TCP Header

Hello Hussein.

First of all the sequence number doesn’t indicate how much data is sent, but the difference between the original sequence number and the acknowledgement number sent back to the reciever indicates the amount of data that has been sent in one window.

Your first two questions have to do with something called windowing which is a flow control mechanism of TCP. Specifically, when a TCP session begins, the sequence number is chosen randomly. For example, let’s say the initial sequence number is 100588. During the initial handshake, the window size is also determined. This value is in bytes. Let’s say the initial window size is 10000 bytes.

With these values, the sender begins to send segments of data until it sends the window size number of bytes. Then it waits for an acknowledgement. When the reciever recieves the 10000 bytes, it sends the acknolwegement which includes the next expected byte. The next expected byte is calculated as the initial sequence number plus the window size plus 1. So the reciever would send 100588 + 10000 + 1 = 110589 as the next expected byte.

When the sender recieves this information, he begins sending the next “window” of data, that is the next 10000 bytes beginning with byte number 110589. (Remember that this value is a relative value and not an absolute value. It is relative to the original random sequence number.)

Once those 10000 bytes are sent, the reciever sends an acknowledgement with the next expected byte which is 110589 + 10000 + 1 = 120590. The sender recives this acknowledgement and begins sending the next section of data beginning at byte number 120590 and so on.

When the value of the sequence number becomes 4294967295, which is the maximum value a 32 bit binary number can have, it then wraps around to 0 and continues counting. The devices know that an original sequence number of 4294967290 with a final sequence number of 5 will have a difference of 10.

As for your third question, the answer is yes. More accurately however, the window size determines the efficiency with which a link is utilized. Take a look at the excellent video found in this lesson which demonstrates how the window size affects the throughput of data.

I hope this has been helpful!

Laz

3 Likes