Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi all,
what would be the maximum speed to send UDP packets? Right now I've reached 18 Mbit/s, but for some reason when I try to send a string all I receive on the PC's side is some ascii... I think sending data over 80Mbit/s should be possible or am I wrong?! I'm trying to send this: ****************************************************************** /* * * This file is for testing stand-alone (NO_SYS) LWIP * using a RAM-based simple file system * */ # include "system.h" # include "arch/init.h"# include "lwip/ip_addr.h"# include "lwip/tcpip.h"# include "lwip/netif.h"# include "netif/lan91c111if.h" # include "sys/alt_alarm.h"# define get_milliseconds() alt_nticks() /* ---------- IP oriented addresses for ethernet adapter ---------- */# define IPADDR0 169# define IPADDR1 254# define IPADDR2 0# define IPADDR3 2 # define NETMASK0 255# define NETMASK1 255# define NETMASK2 0# define NETMASK3 0 # define GWADDR0 169# define GWADDR1 254# define GWADDR2 0# define GWADDR3 3 int main(void) { //0.6.4 struct netif *netif; struct netif netif; struct ip_addr ipaddr, netmask, gw; struct ip_addr destIpAddr; struct udp_pcb* pcb; struct pbuf* p; unsigned char buffer[100] = "beetje flauw\n"; unsigned char *buffPtr; alt_avalon_lan91c111_if* dev_list_ptr = (alt_avalon_lan91c111_if*)alt_ethernet_device_list.next; buffPtr = mem_malloc(sizeof(buffer)); memcpy(buffPtr, buffer, sizeof(buffer)); //copy's from buffer to buffer /* * Initialize lwip */ lwip_init(); printf ("Setting IP address to: %d.%d.%d.%d\n", IPADDR0, IPADDR1, IPADDR2, IPADDR3); printf ("Setting netmask to: %d.%d.%d.%d\n", NETMASK0, NETMASK1, NETMASK2, NETMASK3); printf ("Setting gateway address to: %d.%d.%d.%d\n", GWADDR0, GWADDR1, GWADDR2, GWADDR3); IP4_ADDR(&ipaddr, IPADDR0, IPADDR1, IPADDR2, IPADDR3); IP4_ADDR(&netmask, NETMASK0, NETMASK1, NETMASK2, NETMASK3); IP4_ADDR(&gw, GWADDR0, GWADDR1, GWADDR2, GWADDR3); //0.6.4 netif = netif_add(&ipaddr, &netmask, &gw, netif_add(&netif, &ipaddr, &netmask, &gw, (void*)dev_list_ptr, lan91c111if_init, ip_input); //0.6.4 netif_set_default(&netif); netif_set_default(&netif); p = pbuf_alloc(PBUF_TRANSPORT,4096,PBUF_RAM); p->payload = (void*)buffPtr; IP4_ADDR(&destIpAddr, 169, 254, 0, 1); pcb = udp_new(); udp_connect(pcb, &destIpAddr, 666); //mem_free(buffPtr); udp_remove(pcb); while(1) { //0.6.4 lan91c111if_service(netif); lan91c111if_service(&netif); udp_send(pcb, p); // printf(buffer); } } ****************************************************************** this is the way I am trying to send it... but it doesn't reach the pc in the right way. I even wonder if am sending this string. Suggestions anyone? Thanx, Danny