Friday, February 26, 2010

TCP’s Error Detection / Error Reovery Feature

____________________________________________
TCP’s Error Detection / Error Reovery Feature

Before we take a look at how TCP performs both error detection and error recovery, we need to draw a very clear line between those two terms. They are not the same thing!
-    Error detection is finding an error
-    Error recovery is doing something about the error

TCP does both, and it uses both a sequence number and an acknowledgement number (“ack”) in the TCP header to do so. In the following example, one host is sending four segments to another host. Each of the segments has a sequence number. That sequence number tells the recipient in what order to reassemble the segments, and it’s also a fundamental concept in error detection and recovery.  ACK is nothing but the next segment number receiver would like to see.

For simplicity’s sake, we’ll assume the first segment has a sequence number of 100, and we’ll add 100 to the subsequent sequence numbers. (Remember, we’re at the Transport layer – these are segments!)


The recipient will now send a segment back that contains no data, but does have an ack number set. You might think that the ack number would reflect the last sequence number received, but that’s not quite right. The ack number will actually indicate the next sequence number the data recipient expects to see!

Like in our example above the receiver sends a ACK 500 signal back to the sender to let sender know that it got all the frames. In case Seq200 is lost during the transmission the Receiver sends a ACK200 at the end of the transfer. The sender receives ACK200 and sends the SEQ 200 back to the receiver. Receiver then sends a ACK500 to the receiver to notify the sender about receiving all the frames.


What if the acknowledgment itself is lost? The send will wait for life time otherwise.

This entire process revolves around two things:
-    The sender is waiting for a positive message from the recipient that the data was received.
-    If that message isn’t received, the data is retransmitted.
That’s why we call this entire process Positive Acknowledgement with Retransmission (PAR).


____________________________________________

2 comments: