1
votes

i have observed this in wireshark packet captures that server sent FIN,ACK. The client sends post request at the same time. server is sending keep-alive to check if the client is alive or not. client also acknowledges and re transfer the failed packets. Server is not sending for any of retransmitted packet. at the end server is sending RST singnal. this is resulting in 503 error.

enter image description here

I need help to understand why would client send POST request even after server's FIN packet?

Let's if the connection is still alive at server side after FIN, why would it not respond to client's POST request?

Why server is sending Keep-Alive packet when client has already send POST request and waiting for server to respond?

1

1 Answers

3
votes

I need help to understand why would client send POST request even after server's FIN packet?

I would say that the POST happens at the same time as the FIN, i.e. the client sent the POST because its TCP stack did not process the FIN from the server yet. Note that packet capturing is done before the data are processed by the system.

Why server is sending Keep-Alive packet when client has already send POST request and waiting for server to respond?

The ACK number in the keep-alive points to the position before the POST, that is the servers TCP stack did not process the POST yet.

at the end server is sending RST singnal. this is resulting in 503 error.

That's when the server processed the POST. Since data were received after (the sending part of ) the connection is closed it will send a RST.

This is proper behavior and if this results in a 503 the client is wrong in my opinion. With a persistent HTTP connection the server may close any time after it finished the response and before it received the next request and the client has to handle this situation by retrying the request with a new connection.