Interview Questions of Computer Network: TCP three-way handshake fourth wave

Reproduced in: https: //www.cnblogs.com/Andya/p/7272462.html

Three-way handshake:

  TCP process ends initially are closed in the CLOSED state, A initiative to open a connection, and the connection B passive open.

  Then B TCP servers to create a Transmission Control Block TCB, ready to accept the connection request of the client process. Then the server process is in LISTEN (Listen) state, waiting for client connection requests. If there is a response.

  1) The first handshake : TCP client process A is created first transmission control block the TCB, and then issues a connection request message segment (the first portion of the synchronization bit SYN = 1, the initial sequence number seq = x), (SYN = 1 to B the segment can not carry data) but to consume a number, then enter the client process TCP SYN-sENT (sent synchronous) state.

  2) The second handshake : B after receiving a connection request message segments, if they agree to establish a connection acknowledgment is sent to A, the confirmation message segment ( the SYN =. 1, the ACK =. 1, the acknowledgment number ack = x + 1 , Y = initial sequence number SEQ ), the server process passes the test TCP SYN-RCVD (received synchronization) state.

  3) third handshake : TCP Client B after confirmation process receives, B To confirm the given segment ( the ACK =. 1, an acknowledgment number ack = y + 1,. 1 + X = number seq ) (initially seq = x, the second segment so to +1), ACK segment may carry data, does not carry data number is not consumed. TCP connection has been established, A to enter the ESTABLISHED (connection has been established).

When B receives the acknowledgment A also enters the ESTABLISHED state.

  

Guess you like

Origin www.cnblogs.com/yichengming/p/11456229.html