1) TCP window size can be different on client and server. In the 3-way-handshake client and server inform each other about their starting values. The maximum value for the TCP window is determined by the OS. For MS Windows this is done in the registry.
2) The TCP window size always belongs to the receiving process, not to the sending process.
– Lets assume the the client shows window size of 65000, this is the size of the client’s receive buffer for this TCP session.
– The server sends 1000 Bytes with SEQ number = X
– The client receives the 1000 Bytes and responds with an ACK, ACK number = X+1000.
The remaining window size of the client is sent along with this ACK.
– If the client has got the 1000 Bytes still in the TCP Receive Buffer, the client’s window size is reduced and shown as 64000 Bytes.
– If the client has already moved the 1000 bytes up to the application, the receive buffer is freed up again and shown as 65000 Bytes.
Additional note:
The window size shows, how many bytes a station CAN receive, before an ACK must be sent. However, a station does usually not wait, until the receive window is full.
Very often you will see a station ACKing every second packet.
The window size of a station is good for flow control for the other side. When a server is notified about the client’s window of 65000 bytes, it may send 65000 Bytes in several packet without any hesitations – but no more – until the sent data is ACKed and the window is freed up again.
Leave a Reply