TCP's head

xiaoxiao2021-03-06  92

TCP's head

TCP data is packaged in an IP datagram as shown below:

Package in TCP data in IP datagram

Displays the data format of the T C P header. If you do not choose a field, it is usually 2 0 bytes.

TCP head

Each T C P section contains the port number of the source and destination for finding the origin and closing application process. These two values ​​plus the source I P address in the I P header and the destination I P address uniquely determine a T C P connection. Sometimes, an I P address and a port number are also referred to as a socket (S O C K e t). This term appears at the earliest T c P Specification (R f C 7 9 3) school     魑 魑 硎 硎       喑 喑 喑 硎 喑 喑 硎 硎 硎 喑 喑 喑 喑 喑 喑 喑 喑 喑r) (including the four-component group of the client I P address, the client port number, the server I P address, and the server port number) can uniquely determine both sides of each T C P connection in the Internet. The serial number is used to identify the data byte stream transmitted from the T c P hair transmission to the T c P P P P P P P P P P T, which represents the first data byte in this message segment. If the byte stream is regarded as one-way flow between the two applications, the T C P counts each byte. The serial number is the number of unsigned numbers of 32 bits, and the serial number arrives at 23 2-1 and starts with 0. When a new connection is established, the S Y n mark changes. The serial number field contains the initial number I s n (INITIAL SEQUENCE NUMBER) of the connection selected by this host. The first byte number of the host to send data is this I s N plus 1, because the S Y n mark consumes a serial number (will show a detailed introduction to how to establish and terminate the connection in the next chapter, when we will see the F I n mark It is also necessary to take up a serial number). Since each transmission byte is counted, the confirmation number contains the next serial number desired by one end of the confirmation. Therefore, the confirmation sequence number should be the last successful receipt of the data byte number number plus 1. Only the A c k mark (hereinafter described) is valid for 1 when confirming the serial number field. Sending A c K does not require any cost, because the 32 bit confirmation serial number field is the same as the A c k mark, is always part of the T C P header. Therefore, we see that once a connection is established, this field is always set, and the A c k mark is always set to 1. T c P provides full-duplex services for the application layer. This means that the data can be transmitted independently in both directions. Therefore, each end of the connection must maintain the transmission data sequence number in each direction. T c P can be expressed as a sliding window protocol that does not have a confirmation or denial (the sliding window protocol is used for data transfer will be introduced in 2 0. 3.). We say that T C P lacks option confirmation because the confirmation sequence number in T C P header indicates that the hairper has successfully received bytes, but does not include the byte referred to in the confirmation sequence. Currently confirmed the part selected in the data stream. For example, if 1 to 1 0 2 4 bytes have been successfully received, the next report contains the byte from 2 0 4 9 to 3 0 7 2, and the receiver cannot confirm this new message section. What it can do is to send a confirmation number 1 5 2 5 A c K. It is also unable to deny a message segment. For example, if you receive a message segment containing 1 0 2 5 ~ 2 0 48 bytes, it is the test and the error, the T C P receiving end can send back a confirmation number 1 0 2 5 A c k. The first length gives the number of 32 bits characters in the first part. This value is required because the length of the optional field is variable. This field accounts for 4 bits, so T C P has the first one of 6 0 bytes. However, there is no field, and the normal length is 2 0 bytes. There are 6 markers bits in the T C P header. Multiple of them can be set to 1 simultaneously. We briefly introduce their usage here. U R GET POINTER This effective A c k confirmed that the serial number is valid. The P S h receiver should give this report to the application layer as soon as possible. R s T Reconstruction. The S Y n synchronization serial number is used to initiate a connection. This logo and the next logo will be introduced in Chapter 1 8. F i n hair button completes the send task.

转载请注明原文地址:https://www.9cbs.com/read-95606.html

New Post(0)