1

I made a short example because I have tried understanding the difference between MSS and window size in tcp header when we consider a sender and a receiver.

So let's say sender and receiver use the same MSS which is 700 Byte and let's say window size (in tcp header) is 28000 Byte for both sender and receiver.

Now my question, can receiver send full 28000 Byte to sender? Or will this be restricted/influenced by the MSS with 700 Byte somehow?

Maybe you can give me a simple example like that if mine was too bad?

4
  • The MSS is the (largest) way to segment the window data. – Zac67 Jan 20 at 20:58
  • @Zac67 I have read that question and its answers before making this one because no I didn't understand it :( That's why I tried to make my own little example here so I can see how they (MSS and window size) relate/work between sender and receiver – eyesima Jan 20 at 21:01
  • 1
    Forget MSS for a moment. The window size tells the sender how much data it can send without receiving ACK. When data is ACKed, the window advances and more data gets sent. End of story. Now, the MSS tells the sender how large each segment may be ie. how to chunk up the data that is sent out. – Zac67 Jan 20 at 21:15
  • @Zac67 Thank you and Ron Maupin now I also understand the topic you linked me too !! (: – eyesima Jan 20 at 21:16
3

The MSS is sent in the handshake, and it is the maximum size of a segment that the side sending it will receive.

The window is sent in all the segments, and the sender of it is telling the other side how much data it will accept from the other side, even in multiple segments. The window size is constantly adjusted, based on what the receiver of the data can handle.

If the MSS is 700, then each segment can have up to 680 bytes of data (assuming no TCP options in the header). with a window of 28000, then the sender of the data can send 41 segments of 680 data bytes (or more segments if some or all of the segments have less than that).

5
  • Thanks this is what I exactly needed to see them both in action! I have one more question: Let's say we have tcp options in header which is 4 bytes long. Then the total tcp header is 20 bytes + 4 bytes = 24 bytes long sooo then for the MSS each segment can carry at most 700 - 24 = 676 bytes of data? Or will this be different then if we have options too? – eyesima Jan 20 at 21:11
  • 1
    If the segment has a maximum size of 700, then you need to subtract any header and options from that to determine how much data can be sent in the segment. The same thing holds true for the MTU and IP packet. If the MTU is 1500, then an IPv4 packet with no header can have a payload of up to 1480, but options will reduce that. – Ron Maupin Jan 20 at 21:15
  • I hope it's okay for you if I ask one more question because it just came to my mind. If the window size of the congestion control window is only 1 MSS at the beginning of the connection, then it will not be possible to use 41 segments of 680 data bytes because we will only be allowed to use 1 segment because MSS is 1 at the beginning? – eyesima Jan 20 at 21:27
  • 1
    The congestion window is different. The receive window is how much data the receiver is willing to accept, but the congestion window is how many segments the sender is willing to send. The sender will try to send more and more, until it runs into a problem, then it backs off. There is no communication of this window between the TCP peers. – Ron Maupin Jan 20 at 21:33
  • You have helped me a lot people, thank you so much^- – eyesima Jan 21 at 0:34

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