How does TCP ensure reliable transfer of packets?


TCP uses acknowledgement mechanism to check safe and sound arrival of data. TCP uses error control which include mechanisms for detecting corrupted segments, lost segments, out of order segments. TCP achieve this using three tools, check sum, acknowledgement and time out. Each segment includes a checksum field which is used to check for a corrupted segment. If the segment is corrupted it is discarded by the destination TCP and is considered as lost. TCP uses a 16 bit checksum that is mandatory in every packet. Check sum is computed at the source machine and attached with packet. Destination machine recomputes the checksum and if the checksum in packet and recomputed checksum are same then the packet is accepted as a valid packet, otherwise it is discarded. TCP uses acknowledgements to confirm the receipt of packets. When a packet is corrupted or lost or delayed, it is re-transmitted. TCP normally maintains a re-transmission time out time (RTO) for all outstanding packets. When the timer runout, the earliest outstanding segment is re-transmitted. The value of RTO is dynamic in TCP and is updated based on the round trip time of packets. RTT is the time needed for a packet to reach destination and for an acknowledgement to be received.

No comments:

Post a Comment