Altera_Forum
Honored Contributor
21 years agoMissing UDP packet in NIOS II
I have modified the NIOS II telnet demo, added a UDP socket, and am having trouble with a lost UDP packet. The demo was modified in the following simple manner.
The data transfer TCP socket is used to download configuration data to NIOS II using Winsock 2.2. NIOS then produces a large data set that is transferred in 1024 byte packets via a UDP socket. UDP is used because speed of transfer is of the utmost importance. Things work great with the exception of loosing a UDP packet. It happens randomly in time once every several hundred to several thousand packets. Using a packet sniffer (CommView) on the PC, I can see that the data transfer TCP port is sending a short 60 byte packet back to the PC at a random spot in the UDP transmission stream. This happens on each UDP burst transmission - successful or not. But, every time a UDP packet is missing, I can see that instead of a single TCP packet, 2 of these identical TCP packets are being transmitted consecutively. The packet sniffer then shows that a UDP packet is missing. I am not sure if these TCP packets are interferring with the UDP transmission, or they are just a symptom of the lost packet. I am not an experienced TCP/IP programmer, so maybe there is something obvious here. Are the send buffers for these two sockets independent pieces of memory or are they the same memory buffer? Should I increase the send buffer sizes via setsockopt() thinking that the second TCP packet clobbers the UDP? Are these TCP packets keep-alives, or some other sort of housekeeping with the connect socket on the PC? Is there some simple way to "stop" all TCP transmission during the UDP burst? Suggestions for a cure? Thanks Dan Grolemund