Method to establish a tcp connection: first create a transmission control block TCB; then create a transmission control block TCB and send a connection request segment to the server; then reply with a confirmation segment and enter the established connection state; When the confirmation message segment is finally received, the connection can be entered into the established connection state.
Three message handshake to establish TCP connection
The server process is created first Transmission control block TCB and is in the listening state, waiting for the client's connection request
The client creates the transmission control block TCB and sends a connection request segment to the server
After the server receives the connection request segment, if it agrees to establish the connection, it sends a confirmation segment
The client process receives the confirmation segment from the server After receiving the confirmation message segment, it immediately replies with a confirmation message segment and enters the established connection state
After the server receives the confirmation message segment, it also enters the established connection state
Transmission Control Block TCB (Transmission Control Block) stores some important information in each connection
The above is the detailed content of How tcp establishes a connection. For more information, please follow other related articles on the PHP Chinese website!