0

Let's say a TCP segments has in the field of "window size" = 1400 bytes.
Does that mean that

  1. we can send 1400 bytes counted in tcp segments = TCP headers + data or
  2. it does specify only the max size of unacknowledged payload we can send?

example:
We need to send a file of 1380 bytes.

case 1) let's have a minimum TCP header of 20 bytes : 20 + data = 1400 > data (= 1380) so we need two segments (20 + 1380) + (20 + 10).

case 2) data = 1390 < 1400 we are perfectly fine : we send one segment of size 1410.

2 Answers 2

2

Addendum, to what Zack said.

I think you misunderstand what window size means.

Window size is the free space in the receiver buffer, that is the amount of data that the sender can send without receiving an ACK. Usually, this space would be enough to fit several segments (maximum segment size). It says nothing about the payload size in a single segment.

Since TCP is supposed to use delayed ACKs, i.e., send ACK for every other packet, I would say that this space must be at least two segments.

example: We need to send a file of 1380 bytes.

case 1) let's have a minimum tcp header of 20 bytes : 20 + data = 1400 -> >data = 1380 so we need two segments (20 + 1380) + (20 + 10).

so, if window size was smaller than one segment, you not only need two segments, you would need to send one segment, wait for ACK, and then send another one.

on the other hand, each path has maximum segment size (MSS). If the MSS is 1400 bytes you will need two segments, but you can send two packets one directly after another

case 2) data = 1390 < 1400 we are perfectly fine : we send one segment of size 1410.

yes, if MSS allows it you can. If not, you can still split the file between two segments, and send them one directly after another.

2
  • 1
    I know that , that " is the amount of data that the sender can send without receiving an ACK" . What I wanted to make sure was actually this word : " data " --> so only tcp payload Jan 30 at 19:18
  • @brucebanner then you probably should have accepted Zac's answer :) Your examples are still not how it works.
    – Effie
    Jan 31 at 9:05
3

No, the receive window refers to payload data only. It excludes any TCP headers. Case 2 is correct. Note that segment does include the TCP header.

See RFC 793 for the TCP protocol standard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.