TCP connection establishment process and TCP connection termination process 1. TCP connection establishment process-"three handshakes" (1) when the client wants to communicate with the server over TCP, the system first sends a SYN synchronization packet (the SYN bit of the TCP packet header is set) and specifies the server port number to be connected. (2) If the server agrees to the connection, an ACK confirmation packet (The ACK of the TCP packet header is set) will be sent to the client, indicating that the request of the client is accepted, at the same time, the SYN location of the package indicates that the server also wants to communicate with the client. (3) After receiving the package, the client sends an ACK confirmation package to the server to agree. Ii. TCP connection termination process-"4-segment termination sequence" (1) After the Server communicates with the client, the server sends the FIN termination request packet (the FIN bit of the TCP packet header is set), indicating that the communication is ended. (2) the client sends an ACK confirmation packet. (3) the client sends the FIN termination request package to the server. (4) The server returns the ACK confirmation package.