TCP protocol works at the transport layer. The TCP protocol is a connection-oriented, reliable, byte stream-based transport layer communication protocol, defined by IETF's RFC 793; the application layer is: transport layer.
Transmission Control Protocol (TCP, Transmission Control Protocol) is the basic protocol in the Internet protocol suite and a network communication protocol; it specifies how to establish and maintain The connection between the two programs can exchange data, how to send information over the Internet.
TCP supplements the Internet Protocol (IP Protocol), which defines IP addresses used to identify systems on the Internet, mainly ensuring end-to-end data transmission between different nodes. Internet Protocol provides instructions for transmitting data, while TCP creates connections and ensures data is delivered to the correct destination. These two protocols usually work together and are called the TCP/IP suite.
TCPTCP works in conjunction with the Internet Protocol, which defines the logical location of remote nodes, while TCP transports and ensures data is delivered to the correct destination.
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.
Main Features
TCP is a communication protocol for wide area networks. The purpose is to provide a link between two communication endpoints when communicating across multiple networks. Communication methods with the following characteristics:
(1) Stream-based method;
(2) Connection-oriented;
(3) Reliable communication method;
(4) When the network condition is not good, try to reduce the bandwidth overhead caused by retransmission of the system;
(5) Communication connection maintenance is oriented to the two endpoints of the communication, regardless of the intermediate network segment and nodes.
In order to meet these characteristics of the TCP protocol, the TCP protocol makes the following provisions:
①Data fragmentation: The user data is fragmented at the sending end and reassembled at the receiving end. TCP determines the size of fragments and controls fragmentation and reassembly;
②Arrival confirmation: When the receiving end receives the fragmented data, it sends a confirmation to the sending end based on the fragmented data sequence number;
③ Timeout retransmission: The sender starts the timeout timer when sending fragments. If no corresponding confirmation is received after the timer times out, the fragment will be resent;
④ Sliding window: Each party of the TCP connection The size of the receiving buffer space is fixed. The receiving end only allows the other end to send the data that the receiving end buffer can accommodate. TCP provides flow control based on the sliding window to prevent the faster host from causing the buffer of the slower host to overflow;
⑤Out-of-sequence processing: TCP fragments transmitted as IP datagrams may arrive out of order. TCP will reorder the received data and deliver the received data to the application layer in the correct order;
⑥Duplication processing: TCP fragments transmitted as IP datagrams will be repeated, and the TCP receiving end must discard the duplicate data;
⑦Data verification: TCP will keep its header and Data checksum, this is an end-to-end checksum, the purpose is to detect any changes in the data during transmission. If the checksum of a received fragment is incorrect, TCP will discard the fragment and not acknowledge receipt of the segment, causing the peer to timeout and resend.
[Related recommendations: TCP/IP video tutorial]
The above is the detailed content of What layer does the TCP protocol work at?. For more information, please follow other related articles on the PHP Chinese website!