The characteristics of the TCP protocol and TCP segment format

Reference: https://www.bilibili.com/video/BV19E411D78Q?p=62

You must establish a connection before transmitting data, to be released after the end of the data transfer connection. It does not provide a broadcast or multicast service. Because TCP to mention
for reliable connection-oriented transport service, thus inevitably it increased the number of overhead: confirmation, flow control, timer and connection
management.
Reliable, connection-oriented, high latency, suitable for large files.

TCP protocol features:

1.TCP oriented transport protocol connection (the virtual connection). Playing Call
2. Each - TCP connections can only have two ends, each TCP connection can only point to point.
3.TCP provide reliable service delivery, error-free, not lost, not repeat, arrive in order. Reliable ordered, do not lose no weight
4.TCP provides full-duplex communication.

Send caching: data & ready to be sent has been sent but not yet received confirmation of data

Receive buffer: arrive in order to be accepted but not yet read application data sequentially arriving data is not &
5.TCP byte stream oriented: TCP post down the application data as a byte string only unstructured flow.

Flow: Process flow into or flowing out from the process sequence of bytes. |
 

TCP segment header format

After adding options, or retention of an integer multiple of four bytes. This time it is used the filling.

Reference : byte stream transmitted in a TCP connection in each byte sequentially numbered, this field indicates the sequence number of the first byte of a newspaper transmitted data segment.
No acknowledgment : receive other desired first data byte sequence number of the next segment. If the acknowledgment number is N, the data demonstrate that all N-1 number have been correctly received so far.
Offset data (header length) : data at the beginning of the TCP segment at the beginning of how close the TCP segment, 4B in units of bits, i.e., a value is 4B.
6 control bits:

  1. Emergency bit URG : URG = 1, indicating in this segment there is an emergency data, is a high-priority data should be transferred as soon as possible, do not line up in the cache, with the urgent pointer field use.
  2. Acknowledge bit ACK : ACK confirmation number is valid = 1, all the segments must be transmitted an ACK is set to 1 after the connection.
  3. The push bit PSH: PSH = 1, the recipient receives the application delivery process as soon as possible, not to wait until the cache fills up and then delivered.
  4. Reset RST: RST = 1 indicates a serious error occurred in the connection TCP, the connection must be released and then re-establish the transmission link.
  5. Bit synchronization the SYN : the SYN = 1, indicating a connection request / connection acceptance message.
  6. Termination the FIN : When the FIN = 1, indicating that this segment has been finished the data sender is required to release the connection.

Window : refers to the transmission of one segment of the newspaper receiving window, i.e., the other party is now allowed amount of data sent.

And test : test header + data, when the test to add dummy header 12B, the fourth field is 6.
Urgent pointer : URG = 1 is meaningful, the number of bytes indicated newspaper article data in the emergency section.
Options: maximum segment size MSS, expand the window, timestamp, select OK .....
 

Published 592 original articles · won praise 1353 · Views 1.15 million +

Guess you like

Origin blog.csdn.net/weixin_42859280/article/details/105218219