TWiki> INFBase Web>AnswersPage>YearThree (revision 1)EditAttach

Computer Communications and Networks (COM) - UDP Packet Loss?

For the 2nd coursework you've been asked to write a UDP client and server. People might be finding they're getting hideous packet loss, even when the network should be fine. Is it cheap CAT5 the university has installed? Not entirely...

It turns out most operating systems provide a rather small UDP packet buffer,

To find out on your current computer (if you're in linux), type:

$> /sbin/sysctl -a | grep 'rmem_max'

on this dice machine it's:

net.core.rmem_max = 131071

(which is 128kB).

To find out if this is the problem, the number of UDP packets being dropped is indicated by:

$> netstat -s

(find the line "packet receive errors" under "Udp").

What does this mean for your coursework?

The upshot is your server might be sending huge amounts of data, far too quickly for the client to receive. Several solutions exist. The simplest (but not the most efficient) is to slow the rate of sending using (for example) a call to Thread.sleep(100) after each packet's been sent. This clearly isn't the most elegant solution.

For more information about the UDP buffer and more, see:

-- MikeSmith - 23 Nov 2009

Edit | Attach | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 23 Nov 2009 - 17:10:24 - MikeSmith
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies