Why TCP transmission is reliable

Source: Internet
Author: User
TCP provides a reliable, connection-oriented, byte-throttling service.    Connection-oriented: means that two applications that use TCP (typically a client and a server) must establish a TCP connection before exchanging data with each other. In a TCP connection, only two parties communicate with each other. Broadcast and multicast cannot be used for TCP. 
 TCP provides reliability in the following ways:
1. The application data is segmented into a block of data that TCP considers best for sending. This is completely different from UDP, and the length of the datagram generated by the application will remain unchanged.                                                                  (truncate the data to a reasonable length)
2, when TCP emits a segment, it starts a timer, waiting for the destination to acknowledge receipt of the message segment. If a confirmation is not received in a timely manner, the message segment will be sent back.                        
(Timeout Resend) 3, when TCP receives data from the other end of the TCP connection, it sends a confirmation. This confirmation is not sent immediately, and will usually be postponed for a fraction of a second.(for the request received, give a confirmation response)(The reason for the delay may be to do a full checksum of the package) 4, TCP will keep its first and the data checked and. This is an end-to-end test and is designed to detect any changes in the data during transmission. If a section is received for inspection and error, TCP discards the segment and does not acknowledge receipt of this message segment.(check out the packet error, discard the message segment, do not give a response, TCP send data end, super time will resend data)5, since the TCP message segment as an IP datagram to transmit, and the arrival of IP datagrams may be disorderly, so the arrival of TCP segment can also be disorderly. If necessary, TCP will reorder the data received, handing the received data to the application tier in the correct order.(reordering of the unordered data before being handed to the application tier)6. Since the IP datagram repeats, the receiving end of the TCP must discard duplicate data.(can discard duplicate data for duplicate data)7, TCP can also provide flow control. Each side of the TCP connection has a fixed size buffer space. The receiving end of TCP allows only the other end to send data that is acceptable to the receiving buffer. This will prevent a faster host from causing a buffer overflow on a slower host.(TCP can flow control to prevent faster hosts from causing buffer overflows on slower hosts)The traffic control protocol used by TCP is a sliding window protocol with variable size. BYTE throttling Service:: Two applications exchange a byte stream consisting of 8bit bytes over a TCP connection. TCP does not insert a record identifier in a byte stream.
We will call this the word throttling service (bytestreamservice). TCP does not explain the content of the byte stream: TCP does not explain the contents of the byte stream. TCP does not know whether the transmitted data byte stream is binary data or ASCII, EBCDIC, or other type of data. The interpretation of the byte stream is explained by the application layer of both sides of the TCP connection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.