Front-end summary of knowledge (1): TCP three-way handshake fourth wave

Before introducing the TCP three-way handshake fourth wave, let's recall the seven-layer OSI computer network:

  1. Physical layer: in the form of binary data transmitted on the physical media data
  2. The data link layer: how data is combined into data blocks, said data blocks to which frame (abbreviation: transmission frame has the address) in the data link layer; how to control the transmission physical channel frame, including how to handle the transmission error (Jane: error detection function) ... (not to mention more)
  3. Network layer: the transfer function between the data communication between the data frames between the two end points adjacent transport layer and the data link layer, which provides the data link layer, the network management further, the data from the seek source via a plurality of intermediate nodes to the destination terminal, so that the transport layer to provide the basic -end data transmission service. There are said to route packets.
  4. Transport Layer : responsible for the two hosts in the process of providing communication services between.
  5. Session Layer: built on top of the transport layer, the transport layer using a service provided by the application to establish and maintain a session, and the session can obtain synchronization. Session layer uses a checkpoint communication session can continue the communication failure from the checkpoint restore communication. This capability is extremely important for transferring large files .
  6. Presentation Layer: data formatting, code conversion, data encryption
  7. Application layer: file transfer, e-mail, file services, virtual terminals, etc.

Transport Layer

The service transport layer generally through the transport connection establishment phase, the data transfer phase, a transmission connection release phase . 3 stages, in the data transfer phase is divided into general data transmission and speeding up data transfer in two forms. The most common transport layer two protocols are the Transmission Control Protocol TCP and user datagram protocol the UDP .

The transport layer provides end to end service between the host application process, basic functions are as follows:

  1. Segmentation and reassembly of data

  2. By port number addressing

  3. Connection Management

  4. Error control and flow control, error correction function

To transport layer session layer provides a communication service reliability, avoiding packet error, loss, delay time disorder, repeat, and so out of order errors.

TCP

There are three-way handshake tcp FAQ:

Former client and server communication To connect, "three-way handshake" role is 双方都能明确自己和对方的收、发能力是正常的.

  • The first handshake: the client sends a packet network, the server received. So the server can be concluded: the ability to send, receive capability of the client service side is normal.
  • The second handshake: server contract, the client received. So that the client can conclude that: receive, transmit capability, the client receives, the ability to send the server is normal. Note : At this time the server can not determine the ability of both the transceiver is normal, so it has the third handshake
  • Third handshake: the client contract, the server received. So the server can be concluded: send, receive client's ability to receive, transmit capability, the server is normal.

Small sum: Is not that the transport layer transport connection establishment phase Well, of course there are other effects associated with the four waving

Four waving FAQ

First, let's look at reclassification three-way handshake:

  1. The client sends a SYN segment, and indicates the client's initial sequence number, i.e. ISN ©.
  2. The server sends its SYN segment as a response, indicating their same ISN (s). To confirm the client SYN, ISN © + 1 as the ACK value. Thus, each transmit a SYN, the sequence number is increased by 1. If the case is lost, the retransmission will.
  3. In order to check the server SYN, client ISN (s) +1 as ACK returned values.

Obviously, the same token, this is the transmission of the transport layer connection release phase

Assumptions C (Client) to close the connection:

  1. C will send commands to the S (Server), comprising Fin, Ack, Seq

  2. S command is received, the transmission instruction, including Ack, Seq, no attention Fin

    (S simply can not be sent, but may receive a) corresponds to the state as:
    Here Insert Picture Description

  3. All other data is then transmitted over S, S sends instructions, including Fin, Ack, Seq, note that this command can not be immediately returned, after the application layer is given in the application data transmitted over.

  4. C terminal receives transmission command ACK, Seq, let S know know C

As these Fin, Ack, Seq how calculated, there is not a mention. However, to draw a map deepen what impression it:
Here Insert Picture Description
Summary: finally finished (time spent slightly longer, does not refer to the number of words), computer network did not seriously study, review it a bit difficult, or time to learn a little careful of some, not to planted himself so much pit

Published 89 original articles · won praise 17 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_42317011/article/details/104345851