Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide


NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Searchable, convenient, complete TCP/IP information.
The TCP/IP Guide

Custom Search







Table Of Contents  The TCP/IP Guide
 9  TCP/IP Lower-Layer (Interface, Internet and Transport) Protocols (OSI Layers 2, 3 and 4)
      9  TCP/IP Transport Layer Protocols
           9  Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
                9  TCP/IP Transmission Control Protocol (TCP)
                     9  TCP Message Formatting and Data Transfer

Previous Topic/Section
TCP Maximum Segment Size (MSS) and Relationship to IP Datagram Size
Previous Page
Pages in Current Topic/Section
1
2
3456
Next Page
TCP Immediate Data Transfer: "Push" Function
Next Topic/Section

TCP Sliding Window Data Transfer and Acknowledgement Mechanics
(Page 2 of 6)

Send (SND) Pointers

Both the client and server in the connection must keep track of the stream it is transmitting and the one it is receiving from the other device. This is done using a set of special variables called pointers, that carve the byte stream into the categories above. The four transmit categories are divided using three pointers. Two of the pointers are absolute (refer to a specific sequence number) while one is an offset that is added to one of the absolute pointers, as follows (refer to Figure 219):

  • Send Unacknowledged (SND.UNA): The sequence number of the first byte of data that has been sent but not yet acknowledged. This marks the first byte of Transmit Category #2; all previous sequence numbers refer to bytes in Transmit Category #1.

  • Send Next (SND.NXT): The sequence number of the next byte of data to be sent to the other device (the server in this case). This marks the first byte of Transmit Category #3.

  • Send Window (SND.WND): The size of the send window. Recall that the window specifies the total number of bytes that any device may have “outstanding” (unacknowledged) at any one time. Thus, adding the sequence number of the first unacknowledged byte (SND.UNA) and the send window (SND.WND) marks the first byte of Transmit Category #4.

    Figure 219: TCP Transmission Categories, Send Window and Pointers

    This diagram is the same as Figure 207, but shows the TCP send pointers. SND.UNA points to the start of Transmit Category #2, SND.NXT points to the start of Transmit Category #3, and SND.WND is the size of the send window. The size of the usable window can be calculated as shown from those three pointers.

     


Another way of looking at these pointers is how they indicate the number of bytes a transmitting device can send at any point in time; that is, the number of bytes in Transmit Category #3. The start of Transmit Category #3 is marked by SND.NXT. The end is marked by the first byte of Transmit Category #4, given by SND.UNA+SND.WND. Thus, the number of bytes in Transmit Category #3 is given by the following formula:

SND.UNA + SND.WND - SND.NXT

This is called the usable window, since it indicates how many bytes the transmitter can use at any point in time. When data is acknowledged, this causes bytes to move from Transmit Category #2 to Category #1, by increasing the value of SND.UNA. Assuming that the send window size doesn't change, this causes the window to slide to the right, permitting more data to be sent.

Key Concept: The TCP sliding windows scheme uses three pointers that keep track of which bytes are in each of the four transmit categories. SND.UNA points to the first unacknowledged byte and indicates the start of Transmit Category #2; SND.NXT points to the next byte of data to be sent and marks the start of Transmit Category #3. SND.WND contains the size of the send window; it is added to SND.NXT to mark the start of Transmit Category #4. Adding SND.WND to SND.UNA and then subtracting SND.NXT yields the current size of the usable transmit window.



Previous Topic/Section
TCP Maximum Segment Size (MSS) and Relationship to IP Datagram Size
Previous Page
Pages in Current Topic/Section
1
2
3456
Next Page
TCP Immediate Data Transfer: "Push" Function
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005

© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.