Results 1 to 6 of 6
hey guys,
well I got an strange error while I am programming. In fact, I am doing fast udp communication and testing the communication. In order to do it, I ...
- 09-28-2010 #1Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
UDP error unknow state - C programming
hey guys,
well I got an strange error while I am programming. In fact, I am doing fast udp communication and testing the communication. In order to do it, I have done a program which test how many frame i manage to receive by changing the flow( between 800 Mb/s to 950Mb/s). The flow and number of Frame are defined in an other computer and every thing about that is alright.
While I am testing the number of Frame received 100 time, sometimes, I get 995 receveid et the next 1005 receveid instead of 1000. The delay for receiving frame lasts much more than the real delay.
So how could this error happen and how can I do for this error to not occur anymore?
Thanks, Seb
- 09-28-2010 #2Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
What do you mean by "real" delay?
Don't forget, UDP makes absolutely no guarantees about either delivery or timeliness of delivery of packets - they could arrive out of sequence, late, or not at all. There will naturally be some variation in when you receive sent UDP packets (with the possible exception of using the loopback interface... not sure about that though...) and you should account for this in your program.
If you need guaranteed same-order delivery, use TCP.
- 09-28-2010 #3Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
What do you mean by "real" delay?
Well, it is not really a computer which create UDP frame but a FPGA but it does the same job with a unique difference, it is safer than a computer and I really trust about it. I should have something like 2 or 3 seconds of delay between the theoric end of listening and the real end of listening. About TCP, I wish I could use it but it is impossible unfortunatly because of the rate of message ( around 950 Mb/s in UDP).
So my test is something like that:
- open my UDP communication,
- launch my frame generator
- read frames received ( 1000) with the appropriate delay
- wait for 3-4 seconds
and I do it for 100 times. So I just don't understand why I have something like 5 frames more that I received. I heard about that it could be a problem in the FIFO at the ethernet card level. Do you know maybe how can I flush my FIFO in the ethernet card driver or just try to take frame stuck in?
- 09-28-2010 #4Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
How complicated is the network setup between the FPGA and your computer? Is it going through the internet? A single switch? A single crossover cable?
- 09-29-2010 #5Just Joined!
- Join Date
- Sep 2010
- Posts
- 5
well, it doesn't really matter about it, it is just a FPGA and the communication is with a single crossover cable... But do you have an idea about my error?
- 09-29-2010 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
UDP is not guaranteed delivery or order of delivery. Your framerate is such that it is saturating a GigE connection. You are driving it at 80-95% of theoretical maximum bandwidth. Your CPU and motherboard memory bandwidth limits are probably being overextended trying to process this much data this quickly. Personally, I think you are doing rather well given the circumstances and should not consider this behavior an "error".
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
