Does TCP always deliver packets in order

TCP is a byte-stream protocol. Bytes are delivered in the order transmitted, guaranteed, if it's possible to deliver the bytes at all.

To do this, bytes are sent in packets.The packets themselves are NOT guaranteed to be delivered to the receiving host in order.

The reason this happens is that the TCP implementation is checking sequence numbers, rearranging the packets as they arrive, and requesting anything that seems to have gotten lost along the way.

Those packets are carried over IP (hence TCP/IP), and IP has no interest in ordering or delivery. So, no, the packets aren't necessarily in order, but TCP figures out the discrepancies and forces it to appear that way before you see the message.

TCP will sometimes fail to deliver any data at all, if the link is sufficiently slow and lossy that the retransmit timers get all out of whack. But if TCP does deliver data, it will be in order

results matching ""

    No results matching ""