How does TCP handle the duplicate segments and out of order segments?

By using sliding window protocol.

There are two computers A and B. Initial window size=4 packets. After every 4 packets B will send acknowledgment to A and will ask for 5th packet after 4 more packets same thing will happen so on. While sending 11th packet suppose that packet gets dropped then B will wait and won't give any acknowledgment to A. A will wait for some stipulated time then it'll retransmit packet 8-12 as B already have 8-10 it'll override those packets. Hence there'll be no duplication of packet (i.e Segment on Layer 4).

Suppose there's increase in drop rates say after every 3 packets. Then window size will reduce to 2. If dropping is continue then window size will become 1. So after every packet B will ACK. Then after some times drop rates are low. Drops are happening after every 20-30 packets then window size will increase.

This way TCP handles duplication and segmentation.

results matching ""

    No results matching ""