I've been trying to dig into and gain a firm understanding of what it means that TCP lacks message boundaries. I I set up two servers: one UDP and one TCP. The UDP one will only read from the socket when data arrives. Whereas the TCP one reads from it constantly.
I've also confirmed that when UDP packets ate fragmented the largest fragment arrives first. I have not yet figured out, in Perl at least, how to tell if a fragmented packet was received, as well as is more data is coming.
If there is no good way to tell in Perl, or any other language if a UDP packet is fragmented(Wireshark figures it out so maybe C?) then you end up in the same situation as TCP. Though reassembling fragment packets could get interesting in UDP without the additional info. How would you know if one price goes with another? UDP doesn't guarantee the in-order delivery. Even if fragments are received highest byte-offset to lowest what do you do if another packet sneaks in there? Fragments are allowed to find there own route through the network.
It doesn't seem to matter whether you use TCP or UDP. Things are gonna get hairy without some rules being laid down for higher layers to use when reassembling the original message.
No comments:
Post a Comment