Computer network summary-TCP

A network layered model

OSI seven-layer model and four-layer model in actual development
Insert picture description here

Two TCP/IP protocol suite

Insert picture description here

Three TCP packet format

Insert picture description here

Four TCP three-way handshake

Insert picture description here

  1. First, the client side sends a connection request message

  2. The Server section responds with an ACK message after accepting the connection, and allocates resources for this connection.

  3. After the Client receives the ACK message, it also sends an ACK message to the Server segment and allocates resources, so that the TCP connection is established.

Why is it three times?
It is full-duplex, and both sides are connected at the same time, so the server's request and the reply to the client are realized once.

Four waves of five TCP

Insert picture description here

  1. The server applies for disconnection, namely FIN, and sends Seq+Ack
  2. The client receives the information back, indicating that I have received it
  3. The client sends a message indicating that the connection can be disconnected
  4. The server accepts the information, and the return data indicates that the information has been accepted
    four times?
    Because the two parties are not disconnected at the same time, they need to be confirmed separately, that is, in a semi-closed state, the party sending the closed will not send any more messages, but he can accept the message, that is, the semi-closed, until the other end is also closed, then it is completely closed.

Six why TCP is reliable

1 The sliding window
Insert picture description here
will confirm the data, and if the data is incorrect, retransmission will be requested. There are two types of retransmission: timeout retransmission and fast retransmission.
Retransmission over time (RTO)
When a packet is sent, a timer is started. If the time expires and a response packet that can confirm the sending of the packet has not been received, a copy of the data is retransmitted. Note that the received response packet may be the packet or the post-bread, but as long as it can be confirmed that the packet is received. In addition, if the retransmission is caused by the network delay, the receiving end discards the packet after receiving the duplicate data packet.
Fast retransmission
If the sender receives three response packets of a packet, it will retransmit immediately, which is more efficient than retransmission over time.

2 Congestion control There
are four types in total: slow start, congestion avoidance, fast retransmission, fast connection recovery

Seven this is just a review

Guess you like

Origin blog.csdn.net/GreedySnaker/article/details/114821999
Recommended