FreeRTOS+TCP may not be following the TCP standard for connection termination

Describe the bug
I used FreeRTOS to create a server that I connected to a client application.
When I want to terminate the connection, I call close() on my client application. This sends the FIN+ACK frame to FreeRTOS.

According to the TCP RFC, FreeRTOS is supposed to first acknowledge the FIN+ACK by sending an ACK before sending its own FIN+ACK to close its side of the connection.

But FreeRTOS only sends a FIN+ACK in response to the client’s FIN+ACK. It doesn’t first acknowledge the peer’s FIN+ACK.

I am not sure if this is allowed by the TCP standard. I have added a screenshot from Tshark and a sample C TCP client. I have also written steps that can be used to reproduce this issue.


  • Development board: Linux port


  • Host OS: Linux
  • Version: Ubuntu 20.04

To Reproduce

  • Clone the FreeRTOS+TCP demo application and modify it to run as a TCP server.
  • Use Wireshark or Tshark to monitor the packets to and from FreeRTOS.
  • Connect to the FreeRTOS+TCP demo application using a client application.
  • Let the client application call the close function after concluding its transactions.
  • Monitor the tshark or Wireshark logs.


could you point out the place in rfc793 that stipulates the termination sequence? Thanks!

I guess that is an incorrect interpretation - it DOES acknowledge but in the same packet and that is why FIN+ACK.

Hi, Here’s the rfc793 link

Section 3.5 on page 37 discusses the TCP termination steps. Figure 13 on page 38 also presents the 4-way termination handshake.

Okay, thank you for the explanation.