So TCP is quite a robust protocol.
TCP is also able to handle out-of-order delivery of the packets at the receiving end.
So you can see in this diagram we have an application which is running on the sending machine as and
we have an application which is running on the receiving machine are suppose the application generates
two packets, the packet two and the packet one.
Now you can see that the TCP on the sending machine as has injected two packets in the network.
The first packet that was injected is the packet number one, followed by the packet number two.
Now this is an open internet.
An open internet is an uncontrolled entity.
Anything can happen anytime.
The packet one and two can actually take different paths to actually reach a recipient TCP.
So you can see on the receiving end, we have assumed that the packet one and two actually arrives in
the opposite order.
Let's say that the packet two arrives first, followed by packet one.
So TCP protocol which is running on the receiving end, will actually accumulate the packets which arrives
out of order and until it ensures that all the packets have arrived.
Then the TCP on the receiving end again rearranges and reorders the packet and then it delivers all
those packets to the application in the correct order.
So TCP protocol on the receiving side implements the procedure to handle out of order delivery of packets
from the sending TCP.
TCP protocol on the receiving side ensures that data is consumed by the receiving application in the
correct order.
You.