Learn how to do Error Recovery and Reliability

Learn how to do Error Recovery and Reliability in this TCP provides for reliable data transfer, which is additionally called reliability or error recovery, counting on what document you read. To accomplish reliability, TCP numbers data bytes using the Sequence and Acknowledgment fields within the TCP header. TCP achieves reliability in both directions, using the Sequence Number field of 1 direction combined with the Acknowledgment field within the opposite direction. Figure 5-7 shows an example of how the TCP sequence and acknowledgment fields allow the PC to send 3000 bytes of data to the server, with the server acknowledging receipt of the info .

The TCP segments within the figure occur so as , from top to bottom. For simplicity’s sake, all messages happen to have 1000 bytes of data within the data portion of the TCP segment. the primary Sequence number may be a nice round number (1000), again for simplicity’s sake. the highest of the figure shows three segments, with each sequence number being 1000 more than the previous, identifying the primary of the 1000 bytes within the message. (That is, during this example, the primary segment holds bytes 1000–1999; the second holds bytes 2000–2999; and therefore the third holds bytes 3000–3999.)

The fourth TCP segment within the figure—the just one flowing back from the server to the web browser—acknowledges the receipt of all three segments. How? The acknowledgment value of 4000 means “I received all data with sequence numbers up through one less than 4000, so i’m able to receive your byte 4000 next.” (Note that this convention of acknowledging by listing the next expected byte, instead of the number of the last byte received, is named forward acknowledgment.)

Also Read : Overview of TCP/IP Applications

This first example doesn’t recover from any errors, however; it simply shows the basics of how the sending host uses the sequence number field to spot the data, with the receiving host using forward acknowledgments to acknowledge the data. The more interesting discussion revolves around the way to use these same tools to do error recovery. TCP uses the sequence and acknowledgment fields in order that the receiving host can notice lost data, ask the sending host to resend, then acknowledge that the re-sent data arrived.

Many variations exist for how TCP does error recovery. Figure 5-8 shows only one such example, with similar details compared to the previous figure. the online browser again sends three TCP segments, again 1000 bytes each, again with easy-to remember sequence numbers. However, during this example, the second TCP segment fails to cross the network.

The figure points out three sets of ideas behind how the 2 hosts think. First, on the proper , the server realizes that it didn’t receive all the data. the 2 received TCP segments contain bytes numbered 1000–1999 and 3000–3999. Clearly, the server didn’t receive the bytes numbered in between. The server then decides to acknowledge all the info up to the lost data—that is, to remit a segment with the acknowledgment field equal to 2000. The receipt of an acknowledgment that doesn’t acknowledge all the data sent thus far tells the sending host to resend the info . The PC on the left may wait a couple of moments to form sure no other acknowledgments arrive (using a timer called the retransmission timer), but will soon decide that the server means “I really do need 2000 next—resend it.” The PC on the left does so, as shown within the fifth of the six TCP segments within the figure. Finally, note that the server can acknowledge not only the re-sent data, but any earlier data that had been received correctly. during this case, the server received the re-sent second TCP segment (the data with sequence numbers 2000–2999), but the server had already received the third TCP segment (the data numbered 3000–3999). The server’s next acknowledgment field acknowledges the data in both those segments, with an acknowledgment field of 4000.

Flow Control Using Windowing

TCP implements flow control by using a window concept that’s applied to the amount of data which will be outstanding and awaiting acknowledgment at anybody point in time. The window concept lets the receiving host tell the sender how much data it can receive immediately , giving the receiving host a way to make the sending host slow down or speed up. The receiver can slide the window size up and down—called a window or dynamic window— to vary how much data the sending host can send. The sliding window mechanism makes far more sense with an example. the instance , shown in Figure 5-9, uses the same basic rules because the examples within the last few figures.

In this case, none of the TCP segments have errors, and therefore the discussion begins one TCP segment before within the previous two figures.

Begin with the primary segment, sent by the server to the PC. The Acknowledgment field should be familiar by now: it tells the PC that the server expects a segment with sequence number 1000 next. The new field, the window field, is about to 3000. Because the segment flows to the PC, this value tells the PC that the PC can send no more than 3000 bytes over this connection before receiving an acknowledgment. So, as shown on the left, the PC realizes it can send only 3000 bytes, and it stops sending, waiting on an acknowledgment, after sending three 1000-byte TCP segments. Continuing the instance , the server not only acknowledges receiving the data (without any loss), but the server decides to slip the window size a little higher. Note that second message flowing right-to-left within the figure, this point with a window of 4000. Once the PC receives this TCP segment, the PC realizes it can send another 4000 bytes (a slightly larger window than the previous value). Note that while the previous couple of figures show examples for the aim of explaining how the mechanisms work, the examples might offer you the impression that TCP makes the hosts sit there and await acknowledgments a lot. TCP doesn’t want to form the sending host need to wait to send data. as an example , if an acknowledgment is received before the window is exhausted, a new window begins, and therefore the sender continues sending data until the present window is exhausted. Often times, during a network that has few problems, few lost segments, and tiny congestion, the TCP windows stay relatively large with hosts seldom waiting to send.

Questions related to this topic
  1. How much data is in the first segment?
  2. Are TCP segments of same size?
  3. What is the purpose of the 4 byte Acknowledgement number in a TCP header?
  4. What is segment in TCP?

This Blog Article is posted by

Infosavvy, 2nd Floor, Sai Niketan, Chandavalkar Road Opp. Gora Gandhi Hotel, Above Jumbo King, beside Speakwell Institute, Borivali West, Mumbai, Maharashtra 400092

Contact us – www.info-savvy.com

https://g.co/kgs/ttqPpZ

Leave a Comment