Home > Common Problem > body text

What is the transport layer protocol that provides reliable transmission?

青灯夜游
Release: 2023-01-13 00:39:05
Original
23809 people have browsed it

The transport layer protocol that provides reliable transmission is TCP. TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte stream-based transport layer communication protocol; it is specially designed to provide reliable end-to-end byte streams on unreliable Internet networks. Transfer Protocol.

What is the transport layer protocol that provides reliable transmission?

The operating environment of this tutorial: Windows 10 system, Dell G3 computer.

In the TCP/IP protocol suite, there are two different transmission protocols: TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). The TCP protocol is a connection-oriented protocol. It is relatively reliable, secure, and stable, but it is not efficient and takes up a lot of resources. The UDP protocol is a connectionless protocol. It is highly efficient, fast, and takes up few resources. However, its transmission mechanism is unreliable and must rely on auxiliary algorithms to complete transmission control.

Therefore, The transport layer protocol that provides reliable transmission is TCP.

TCP is designed to accommodate a layered protocol hierarchy that supports multiple network applications. TCP is relied upon to provide reliable communication services between pairs of processes in a host computer connected to different but interconnected computer communication networks. TCP assumes that it can obtain simple, possibly unreliable datagram services from lower-level protocols. In principle, TCP should be able to operate on top of a variety of communications systems, from hardwired connections to packet-switched or circuit-switched networks.

TCP Transmission Control Protocol is a transmission protocol specially designed to provide reliable end-to-end byte streams on unreliable Internet networks.

Main functions:

When the application layer sends a data stream represented by 8-bit bytes to the TCP layer for inter-network transmission, TCP Split into segments of appropriate length, the maximum segment size (MSS) is usually limited by the maximum transmission unit (MTU) of the data link layer of the network to which the computer is connected. TCP then passes the data packet to the IP layer, which delivers the packet through the network to the TCP layer of the receiving entity.

In order to ensure the reliability of message transmission, TCP gives each packet a sequence number. At the same time, the sequence number also ensures that the packets transmitted to the receiving end entity are received in order. The receiving entity then sends back a corresponding acknowledgment (ACK) for the successfully received bytes; if the sending entity does not receive the acknowledgment within a reasonable round trip delay (RTT), then the corresponding data (assumed to be lost) will be retransmitted.

  • In terms of data correctness and legality, TCP uses a checksum function to check whether there are errors in the data. The checksum must be calculated when sending and receiving; at the same time, you can use md5 authentication encrypts data.

  • To ensure reliability, timeout retransmission and piggyback confirmation mechanisms are adopted.

  • For flow control, the sliding window protocol is adopted. The protocol stipulates that unconfirmed packets within the window need to be retransmitted.

In terms of congestion control, the widely acclaimed TCP congestion control algorithm (also known as AIMD algorithm) is adopted. The algorithm mainly includes four main parts:

(1) Slow start

Whenever a TCP connection is established or a TCP connection times out and retransmits, the connection enters the slow start phase. . After entering slow start, the TCP entity initializes the size of the congestion window to one segment, that is: cwnd=1. After that, every time an acknowledgment (ACK) of a message segment is received, the cwnd value increases by 1, that is, the congestion window increases exponentially. When the cwnd value exceeds the slow start threshold value (ssthresh) or a segment is lost and retransmitted, the slow start phase ends. The former enters the congestion avoidance phase, and the latter re-enters the slow start phase.

(2) Congestion avoidance

In the slow start phase, when the cwnd value exceeds the slow start interpretation value (ssthresh), the slow start process ends and the TCP connection enters the congestion avoidance phase. In the congestion avoidance phase, the cwnd value is incremented by 1 after each cwnd message segment sent is fully acknowledged. At this stage, the cwnd value increases linearly.

(3) Fast retransmission

Fast retransmission is an improvement on timeout retransmission. When the source receives three duplicate acknowledgments for the same message, it determines that a message segment has been lost, and therefore retransmits the lost message segment immediately without waiting for the retransmission timer (RTO) to expire. This reduces unnecessary waiting time.

(4) Quick recovery

Quick recovery is an improvement on the loss recovery mechanism. After fast retransmission, it directly enters the congestion avoidance phase without going through the slow start process. Each time after fast retransmission, set ssthresh=cwnd/2, ewnd=ssthresh 3. After that, every time a duplicate confirmation is received, the cwnd value is increased by 1 until the cumulative confirmation of the lost message segment and several subsequent message segments is received, and cwnd=ssthresh is set to enter the congestion avoidance phase.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the transport layer protocol that provides reliable transmission?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
tcp
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template