TCP/IP Connection Establishment
This page shows the process for establishing a TCP/IP connection. In this example, we assume a client computer is contacting a server to send it some information.
- Client sends a packet with the SYN bit set and a sequence number of N.
- Server sends a packet with an ACK number of N+1, the SYN bit set and a sequence number of X.
- The client sends a packet with an ACK number of X+1 and the connection is established.
- The client sends the data.
TCP/IP Connection Termination
- One computer sends a FIN packet to the other computer including an ACK for the last data received (N).
- The other computer sends an ACK number of N+1
- It also sends a FIN with the sequence number of X.
- The originating computer sends a packet with an ACK number of N+1. The connection is closed.
Another way to close the connection is for one computer to send a packet with the RST (reset) bit set which will tell the other computer to immediately terminate the connection.