6

Sending a FIN is an indication that the end won't send any data. But can it send TCP keepalive?

If it can then it contradicts the statement of "sending stuff after FIN" even though it is keepalive but not data.

If it doesn't send keepalive, it won't detect if the other end is gone.

For ex:

Client send FIN and got ACK back. Server then sent a reset which was lost. Only way the client can detect that server has gone away is by sending keepalive which will be responded with reset and then the client closes.

Does this happen?

1 Answer 1

6

According to RFC-1122:

Keep-alive packets MUST only be sent when no data or acknowledgement packets have been received for the connection within an interval.

Sending FIN is only an indication that no more data will be sent, not that no more data can be received. If the application after sending FIN is still expecting data, the RFC indicates it can send a keep-alive packet to make sure the other end is still there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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