News for hackers. Stuff that matters.
Re:Why do UDP packets get dropped? by lordnacho on Wednesday August 31, 2016 @10:19AM (#12398466)
The the root cause is always buffers? That's it? Nothing ever gets lost for some other reason, maybe some sort of collision?
Re:Why do UDP packets get dropped? by TallGuyShort on Wednesday August 31, 2016 @10:30AM (#12398554)
They explicitly don't go into what happens on the routers between sender and receiver. Congestion control is a huge part of TCP's design. Don't know how common it is these days, but that is another place where packets will just get dropped. TCP packets get dropped too, but detecting that, resending, and then throttling back is built into the protocol. With UDP you either don't care or you handle that differently higher in the stack.
Re:Why do UDP packets get dropped? by kazinator on Wednesday August 31, 2016 @10:42AM (#12398648)
It could also be data corruption. Some bits flip in the header, and either the UDP fails a checksum validation, or gets misrouted.

There are also software reasons. A network stack is configured for some maximum UDP size and a datagram exceeds that size. On Mac OS X, the default maximum is just a little over 9200 bytes; you have to

   sudo sysctl -w net.inet.udp.maxdgram=65535
The buffer space is there; this is an administrative policy reason for packets being tossed.

Datagrams can be dropped due to being unroutable. Some router gets rebooted, and so its peers drop packets. TCP connections keep going after a little pause; UDP sessions lose datagrams.

Lastly, IP datagrams are dropped if their TTL (time to live) decrements to zero as they cross a router, even if they are otherwise routable, not too big for any buffer, and with a correct checksum.

Re:Why do UDP packets get dropped? by jsnell on Wednesday August 31, 2016 @10:41AM (#12398638)
There's all kinds of other reasons:

- Packet gets corrupted. A bit in the right place could cause it to be dropped or delivered to the wrong destination.

- Something goes wrong on the PHY layer, say a dodgy fiber connection between two nodes. It'll then get dropped due to Ethernet CRC mismatches.

- There are network nodes whose primary reason for existing is selectively dropping packets. For example traffic shapers, firewalls.

Re:Why do UDP packets get dropped? by robohamburger on Wednesday August 31, 2016 @10:48AM (#12398699)
I think there are other IP/routing reasons why an IP packet could get dropped for example if it needs fragmenting but has the no fragment bit set. Also if the TTL runs out from the packet being forwarded too many times.

I imagine all the fancy routing protocols people use could end up dropping a packet. Maybe that can be lumped in with traffic shapers and firewalls?

Fun story about randomly dropping UDP: comcast did that when they first started doing traffic shaping and it ruined my team fortress classic games. I assume there must be a better way than dropping packets. Maybe buffers :) ?

Re:Why do UDP packets get dropped? by jsnell on Wednesday August 31, 2016 @10:59AM (#12398794)
Queuing tends not to be a great traffic shaping strategy. The problem is that the sender will almost certainly not react to the extra queuing delay in any way (nobody runs RTT-sensitive congestion control in practice). And if the sender doesn't react to the queuing, it'll fill up the buffer and the same amount of packets will be dropped anyway. So you got increased RTTs and no reduction in packet loss.

There is a better way of doing shaping for TCP traffic, by making the sender reduce the rate of transmission by other means than dropping packets. For example via manipulating the receive window. (And other, more sophisticated variations on that). But these methods aren't applicable to UDP in general, at best to some small subset of UDP-based protocols.

Re:Why do UDP packets get dropped? by AstralStorm on Wednesday August 31, 2016 @12:57PM (#12399745)
Even TCP Reno is sensitive to RTT and if it's ubiquitous. Likewise common Linux BIC and CuBIC.

Plenty of VoIP and video streaming protocols also handle RTT hikes.

Re:Why do UDP packets get dropped? by tcoppi on Wednesday August 31, 2016 @10:42AM (#12398652)
They didn't go into the number of ways packets can be lost inbetween the sender and receiver. In my experience it is generally some small corruption at some point that causes the IP or ethernet checksum/CRC to fail and the packet gets dropped. It is extremely uncommon nowdays and generally due to failing hardware, buffers are by far the most common cause.
Re:Why do UDP packets get dropped? by AstralStorm on Wednesday August 31, 2016 @01:00PM (#12399757)
Except on any kind of wireless network or ADSL (due to unstable high frequency channels over crummy phone cable).
Re:Why do UDP packets get dropped? by Matthias247 on Wednesday August 31, 2016 @11:15AM (#12398908)
Mostly not. But she wrote that she has no idea about how the internet (or probably communications in general) works: Communications channels can be described by certain channel capacity as well as a signal to noise ratio (SNR). The lower the SNR the higher the chance of losing information (packets or parts of them). Encoding and error correction can help to a certain extent, but will lower the throughput. Whatever you do, Theres always a chance > 0℅ to lose something. On wireless connections much higher. If internet on your mobile doesnt work properly it's much more because of this and not because of overloaded buffers. The extreme case would be a cut cable, which leads to a SNR of 0. Depending on the medium and topology other errors can Happen, e.g. routing errors.

Im surprised that nothing like this is mentioned, isnt that undergraduate university stuff?

Re:Why do UDP packets get dropped? by mcguire on Wednesday August 31, 2016 @10:39AM (#12398619)
"lost in transit

"It's possible that you send a UDP packet in the internet, and it gets lost along the way for some reason. I am not an expert on what happens on the seas of the internet, and I am not going to go into this."

Well. Ok.

Re:Why do UDP packets get dropped? by mzs on Wednesday August 31, 2016 @12:16PM (#12399394)
Yes that's the most common. Assuming good hardware and application software the one I see second most often is when a UDP packet which is more than one IP fragment goes-out but an ARP has to happen only one of the IP fragments is then sent so the other end can't combine them. This is an old BSD network stack bug that lives on in hardware and software out in the wild to this day.
Re:Why do UDP packets get dropped? by _pmf_ on Wednesday August 31, 2016 @10:44AM (#12398668)
> The the root cause is always buffers? That's it? Nothing ever gets lost for some other reason, maybe some sort of collision?

Indirectly; lots of collisions put stress on the buffer, so the probability that the buffer will be exhausted will increase.

Of course, if an intermediary router fails after sending the message, a UDP packet will also be silently dropped.

Re:Why do UDP packets get dropped? by monocasa on Wednesday August 31, 2016 @10:27AM (#12398532)
There aren't a lot of true bus topologies out there any more for collisions to occur on. And Wi-Fi retransmits.
Re:Why do UDP packets get dropped? by TallGuyShort on Wednesday August 31, 2016 @12:32PM (#12399537)
Just to be clear, you mean Wi-Fi retransmits in the case of a collision a-la Ethernet, right? Was talking to someone a while ago who was under the impression that a TCP packet that didn't get ack'd within a certain window might be retransmitted by a Wi-Fi router that was closer to the destination. I was pretty certain it was wrong, but since you said, "Wi-Fi retransmits", just checking that's not what you meant.
Re:Why do UDP packets get dropped? by monocasa on Wednesday August 31, 2016 @04:33PM (#12401249)
Yeah he's wrong, routers don't buffer for downstream reasons in any context I've seen.

That being said, Wi-Fi retransmits on more than just collisions. Under the hood, Wi-Fi actually has it's own acknowledgement protocol beneath the Ethernet layer. The idea is that with electrical bus protocols like Thicknet, each tap has a pretty good view of the whole bus. For wireless you might see your own frames just fine, but the destination might not. So you need to retransmit not just when you see collisions, but when the destination hasn't explicitly acknowledged your packets.

Re:Why do UDP packets get dropped? by mcguire on Wednesday August 31, 2016 @10:43AM (#12398658)
So does wired ethernet.
Re:Why do UDP packets get dropped? by monocasa on Wednesday August 31, 2016 @11:00AM (#12398808)
Well, wired Ethernet isn't a bus topology anymore, so there aren't collisions.
Re:Why do UDP packets get dropped? by mcguire on Wednesday August 31, 2016 @12:16PM (#12399393)
So, I'm old. Get away from my thicknet.