TCP (on)

tcp header format:

1563976242(1)

TCP status bits:

  1. SYN indicate a connection,
  2. FIN connecting means closed,
  3. ACK indicates the response,
  4. PSH expressed DATA data transmission,
  5. RST represents a reset connection.

TCP window:

Do TCP flow control, communications, each side declares a window, identify their current ability to deal with, and do not send too fast, do not send too slow.

TCP three-way handshake timing diagram

1563977458(1)

         The client and server are in CLOSED state. First, the server actively listening on a port, in the LISTEN state. The client then initiates the connection SYN, SYN-SENT state after at. Server receives connections initiated return SYN, ACK and the client SYN, SYN-RCVD state in the following. After the client receives the SYN and ACK sent by the server, sending the ACK ACK, then in ESTABLISHED state, because it pitch-catch success. After the server receives the ACK ACK, in the ESTABLISHED state, because it pitch-catch up.



Disconnection state when connection timing chart

1563977417(1)


       2MSL, MSL is the Maximum Segment Lifetime, the maximum age of the message, any message that it is present on the network the longest time, over this time the message will be discarded. Because the TCP packet is an IP based protocol, and the IP header has a TTL field, the maximum number of IP routes the packet can pass, each processed through a router his decrements this value when this value is zero then the data packets will be discarded, and sends ICMP packet notifying the source host. Agreement MSL 2 minutes, commonly used in the practical application of 30 seconds, 1 minute and 2 minutes, etc..

TCP state machine

1563977308(1)

       In this figure, with black bold portions, the main flow of the above mentioned, wherein the number of digits, the order of the connection process , and capitalization Chinese serial numbers, the order of disconnection procedure . Bold solid line A of the status of the client changes, the server bold broken line B of the state transition.




Guess you like

Origin www.cnblogs.com/menkeyi/p/11241262.html