Detailed explanation of TCP protocol

TCP Protocol
1.TCP provides reliability by:

  • The application is divided into blocks of data that TCP considers the most appropriate to send, and the unit of information passed by TCP to IP is called a segment
  • When TCP sends a segment, it starts a timer and waits for the destination to confirm receipt of the segment. The unit of information passed by TCP to IP is called segment
  • When TCP receives data from the other end of the TCP connection, it sends an acknowledgment. This acknowledgment is not sent immediately, usually with a delay of a fraction of a second.
  • TCP will keep checksums of its headers and data. This is an end-to-end checksum to detect any changes in data during transmission. If the checksum of the received segment is incorrect, TCP will discard the segment and not acknowledge receipt of the segment.
  • Since TCP segments are transmitted as IP data, and IP datagrams may arrive out of sequence, TCP segments may also arrive out of sequence. If necessary, TCP will sort the received data, handing the received data to the application layer in the correct order.
  • Since IP datagrams send duplicates, the TCP connection must discard duplicate data.
  • TCP also provides flow control, where each side of a TCP connection has a fixed size buffer space. The receiving end of TCP only allows the other end to send as much data as the receiving end's buffer can accommodate. This will prevent the faster host from overflowing the buffer of the slower host.
  • Also, TCP does not interpret the contents of the byte stream.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325759752&siteId=291194637