When receiving TCP packets, Socket
will give me reassembled packets, in case they got IP fragmented, as I'm guaranteed to get an ordered, gap-free stream of bytes.
When receiving UDP packets, where I may receive packets in a different order than sent, or duplicates, and other packets might get lost along the way, I would have expected to get every UDP/IP packet "raw", immediately when it arrives. On the other hand, as I don't get the IP header, I could not reassemble packets myself. In other words, I have to rely on Socket
to do the job for me. But that would mean, that for this reassembling alone, (fragmented) packets would have to be buffered, ordered, de-duped, and discarded if a fragment doesn't make it.
How does this work in reality?