Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

TCP FIN with Data causing RST

Hi,

I am working on a problem where we get tcp resets from a a cloud service provider every time the tcp FIN is sent with data. I have done quite a bit of searching and haven't come across anything saying a segment can't be combined with a FIN but at the same time haven't come across any examples of a tcp close where the FIN packet has data.

Here is the tcp close sequence with my comments:

  1. Server: sends FIN with 165 bytes of data // expect client to ack of 165 +1 (data + 1 for the FIN), ACK & PSH flags present
  2. Client: sends ACK ack’ng 166 // client has ack'd data and FIN, nothing outstanding to ack, no data in this packet
  3. Client: sends 149 bytes // expect server to ack this 149 bytes, ACK flag present
  4. Client: sends FIN // no data in this packet, now expecting ack of the above 149 bytes and + 1 for the FIN flag, ACK flag present
  5. Server: send RST // ack of 149 bytes, client FIN not ack'd, ACK flag present

The the data flow is from client to server. The problem is when the client app is notified a RST was received from the server it considers the data wasn't received and needs to resend it. So that RST is causing us quite a bit of grief.

It seems to me the problem is on the server side, it shouldn't be sending a RST.

Thanks,

-Wes