Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reliability of UDP on localhost

Tags:

kernel

udp

I know that UDP is inherently unreliable, but when connecting to localhost I would expect the kernel handles the connection differently since everything can be handled internally. So in this special case, is UDP considered a reliable protocol, or will the kernel still potentially junk some packets if buffers are overrun?

like image 511
Bryan Ward Avatar asked Jun 14 '10 02:06

Bryan Ward


People also ask

Is UDP reliable in a local network?

UDP is a transport layer network protocol. The transport layer is responsible for getting data from one point on the network to another specific point on the network. In that context, UDP is described as an "unreliable" protocol because it makes no guarantees about whether the data sent will actually arrive.

How reliability is achieved in UDP?

UDP is a a lossy unreliable protocol which runs on top of the IP protocol. Unlike TCP (which handles all aspects of reliable communication) it is up to the application layer to handle dropped packets and other aspects of a "reliable" transport protocol.

Is the UDP unreliable?

UDP is an unreliable, connectionless, fast transport protocol used for sending short messages or messages that do not require acknowledgement of receipt. An easy way to remember the difference is: TCP is Trustworthy; UDP is Unreliable.

Why do UDP packets get dropped?

The UDP packet loss is especially affected by TCP traffic and its flow control mechanism. This is because TCP flow control continues to increase its window size until packet loss occurs if the advertised window size is large enough.


2 Answers

I have seen UDP to localhost dropping packets. We think we were overloading the kernel queue. All we know for sure is that it was dropping packets.

like image 177
Alan Avatar answered Jan 06 '23 08:01

Alan


I repeat a previous answer to a related question. To remain portable always anticipate your UDP sockets might drop packets or receive out of order data.

like image 25
Thomas M. DuBuisson Avatar answered Jan 06 '23 07:01

Thomas M. DuBuisson