Error Recovery Reliability

TCP provides for reliable data transfer, which is also called reliability or error recovery, depending on what document you read. To accomplish reliability, TCP numbers data bytes using the Sequence and Acknowledgment fields in the TCP header. TCP achieves reliability in both directions, using the Sequence Number field of one direction combined with the Acknowledgment field in the opposite direction. Figure 6-5 shows the basic operation.

In Figure 6-5, the Acknowledgment field in the TCP header sent by the web client (4000) implies the next byte to be received; this is called forward acknowledgment. The sequence number reflects the number of the first byte in the segment. In this case, each TCP segment is 1000 bytes in length; the Sequence and Acknowledgment fields count the number of bytes

Figure 6-5 TCP Acknowledgment Without Errors

Web Server

1000 Bytes of Data, Sequence = 1000

1000 Bytes of Data, Sequence = 2000 1000 Bytes of Data, Sequence = 3000 No Data, Acknowledgment = 4000

Web Browser

Web Browser

I Got All 3000 BytesS^ Send ACK! J

Figure 6-6 depicts the same scenario, but the second TCP segment was lost or was in error. The web client's reply has an ACK field equal to 2000, implying that the web client is expecting byte number 2000 next. The TCP function at the web server then could recover lost data by resending the second TCP segment. The TCP protocol allows for resending just that segment and then waiting, hoping that the web client will reply with an acknowledgment that equals 4000.

Figure 6-6 TCP Acknowledgment with Errors

Web Server

Web Server

with Sequence = 2000. Resend It!

1000 Bytes of Data, Sequence

= 1000

1000 Bytes of Data, Sequence

= 2000

J1000 Bytes of Data, Sequence

= 3000 >

No Data, Acknowledgment

= 2000

1000 Bytes of Data, Sequence

= 2000

No Data, Acknowledgment

= 4000

I Probably Lost One ACK What I Got in Order!

Web Browser

I Probably Lost One ACK What I Got in Order!

jl Just Got 2000-2999X and I Already Had 3000-3999. Ask for I V 4000 Next. y

(Although not shown, the sender also sets a re-transmission timer, awaiting acknowledgment, just in case the acknowledgment is lost, or in case all transmitted segments are lost. If that timer expires, the TCP sender sends all segments again.)

0 0

Post a comment