3.3. Closing a Connection

After all data has been transferred, the TCP connection has to be closed. Figure 3.4 shows the segment exchange for the so-called graceful termination of a TCP connection. Each party is closing its part of the TCP connection independently. This means that in Figure 3.4 the FIN segment sent by host A indicates that host A is finished sending data but not that host B is done. In fact host B can still send data to host A even after host B has acknowledged the FIN segment sent by host A. Therefore, the TCP connection is considered closed and all state can be removed only after both hosts have agreed to close the connection. In case either host has to terminate a TCP connection instantly while risking the loss of data, it ...

Get Web Caching and Replication now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.