4 ms·
I've seen UDP fail drastically (dropping north of 50% of packet loss) on controlled networks. Once you hit a certain congestion on a network or a network buffe
by mey 12y ago
I've seen UDP fail drastically (dropping north of 50% of packet loss) on controlled networks. Once you hit a certain congestion on a network or a network buffer fills up you suddenly things go a bit sideways. I'm not sure if switches and OS's consider UDP lower priority then TCP or simply that TCP has mechanisms to recover from packet storms, but TCP continues to "function" where UDP starts hitting the floor en masse.
Conversely I've pondered using UDP packets as a "canary in the coal mine" for networks to monitor it's health.
- colanderman 12y agoThis is how congestion works: queues are not infinitely deep, so the only way to deal with congestion is to (at some point) start dropping packets. TCP (that is, most TCP flow control algorithms) specifically uses packet loss as an indicator of network congestion / how much bandwidth is available, and will back off and retry dropped packets at a lower rate; hence why TCP continues to function (albeit at degraded performance). UDP has no such mechanism, hence you see firsthand the dropped packets. A well-written application should back off in such a scenario so as not to flood the network, but of course many won't. (Of course TCP may very well be prioritized over UDP! It's just not necessary to explain your observations.)
- mey 12y agoAlso priority may be a function of the network configuration (QoS etc) not biased against UDP by default.
- tptacek 12y agoIt's often the opposite. In order to prevent the Internet from melting, TCP does an elaborate dance with all the TCP speakers to back off and avoid congesting the network. UDP does no such dance, and so can monopolize traffic at the expense of TCP. Obviously this presumes that the UDP protocol in question has some mechanism for handling lost packets. But, for instance, if you're doing lossy video or forward error correction, end users do not deal directly with lost packets.
- verbatim 12y agoSwitches dropping TCP packets means slower TCP rather than lost information. This is what TCP is designed to do when it loses packets, it's not related to UDP vs. TCP priority. You can use TCP as this canary as well by monitoring a counter of how many retransmissions have been performed.
- bboreham 12y agoVery much this. It's a bad idea to measure UDP reliability on a quiet day and then make decisions based on those results. On a different day, everything will be happening at once - everyone trying to message their Mom, everyone trying to sell stock, everyone trying to cast a spell on the big monster - and that is when the most packets will be dropped.