The Transport layer protocol of the TCP/IP protocol family mainly includes TCP and UDP. TCP is a reliable, connection-oriented transport protocol. It enables reliable, connection-oriented data transfer on unreliable networks. UDP is a non-connected transport protocol that is primarily used to support data transfer on a reliable link in a school, or for applications that are sensitive to latency.
The role of the TCP/IP transport layer
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/77/A6/wKioL1ZqjBvDq5JDAAEp8hPswHw000.jpg "title=" 2.jpg " alt= "Wkiol1zqjbvdq5jdaaep8hpswhw000.jpg"/>
The transport layer of TCP/IP is located between the application layer and the network layer, providing an end-to-end connection to the terminal host. The transport layer of TCP/IP has TCP and UDP two major protocols. Both TCP and UDP are based on the same network layer protocol IP. The main functions of the Transport layer protocol are:
Provides a connection-oriented or no-connect service: The Transport Layer protocol defines whether a reliable connection relationship needs to be established between the two endpoints of the communication.
Maintain connection state: If the connection relationship must be established before communication, the Transport layer protocol must record the connection relationship in its database and maintain the connection relationship through some mechanism, and find the connection fault light in time.
Segmentation and encapsulation of Application layer data: Application layer data is often large or continuous data flow, and the network can only send packets of limited length, the Transport layer protocol must be applied to the ship before the application layer data into the appropriate size of the segment (segment), and then to the IP protocol sent.
Implement multiplexing (multiplexing): An IP address can identify a host, a pair of "source-destination" IP addresses can identify a pair of host communication relationships, while a host may have multiple programs accessing the network, so the Transport layer protocol uses the port number (port Number) to identify these upper-level applications, enabling these programs to reuse network channels.
Reliable transfer of data: Data in the trans-network transmission process may be errors, loss, chaos and other problems, Transport layer protocol must be able to detect and correct these problems.
Flow control: When the sending rate of the sender exceeds the receiver's receiving rate, or when the resource is insufficient to support the processing of the data, the transport layer is responsible for controlling the traffic at a reasonable level, whereas the transport layer can release the traffic to the appropriate level when the resource is allowed.
Fundamentals of the TCP protocol
Features of the TCP protocol
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/77/A7/wKiom1Zqj6TDLOEjAAE0KmJyyAs987.jpg "title=" 3.jpg " alt= "Wkiom1zqj6tdloejaae0kmjyyas987.jpg"/>
The TCP defined by RFC793 is a connection-oriented, end-to-end, reliable transport protocol. The main features of TCP include:
Three-time handshake (three-way handshake) establishes the connection: ensures the reliability of the connection establishment.
Port number: The port number identifies the upper layer protocol and the service, realizes the multiplex of the network channel.
Integrity check: By calculating the checksum (Checksum) of the protocol and load data, the receiver can detect the errors that may occur in the transmission process.
Confirmation mechanism: For the data received correctly, the receiver should advertise the sender by explicit means, after a certain period of time, the sender will retransmit the segment that is not confirmed, ensuring the reliability of the transmission.
Serial number: All data sent has a unique serial number, which not only uniquely identifies each segment (segment), but also clarifies the location of each segment throughout the data stream, which the receiver can use to implement functions such as validation, loss detection, and disorderly rearrangement.
Window mechanism: With an adjustable window, the TCP receiver can advertise the desired sending speed, thus controlling the data traffic.
Sixth. TCP and UDP Fundamentals