In our application, we are using apache tomcat webserver running in 8081.
It receives POST message from Client at 16:42:06.87 IST timeframe. It acknowledges by ACK packet with window size of 62356 bytes after 200ms.
After some seconds (3-5 seconds), it also sends similar ACK packet but as a "TCP Window Update" packet of 65535 bytes (Buffer empty) to client. And then it sends 200 OK which means Successful Processing...
My question:
What are the scenarios which "TCP Window Update" packet would be sent from Server to Client.
Does this means webserver or Application-Layer took around 3-5 seconds to read 65535-62356(~ 3100) bytes which was in its TCP Receiver window and after reading, it has sent "TCP Window Update" packet since it is yet to send response
After some socket Testing,
Interesting Observation: "TCP Window Update" packet only transferred when Application Layer only fully read entire message and not half/part of data!!!
Would like to add I actually reproduced the "TCP Window Update" packet by normal Client-Server Socket Programming in C.
Scenario:
Client sends a big paragraph (about 3000 bytes) Server accepts connection and spawns a child by fork. After fork, server need to wait for a minute or so() before reading on the socket. This generally initiates an ACK with reduced "TCP window size(65535-3000)" to client. I ensured that the read call reads the fully received data and make sure TCP-Receive Queue of that socket as empty. Then again, Server needs to wait for some time and then only writes onto the socket. During the wait time period after reading, I saw from iptraces that a "TCP Window Update" packet was sent from Server to Client with updated window of 65535 bytes.
Also, When I used read call to read part of incoming data, It did NOT send the "TCP Window Update packet" even if the buffer actually increased after reading partially.