Overview of TCP protocol one

1. TCP features and TCP connections
TCP features

The main features of TCP are: connection-oriented, each connection can only have two endpoints, reliable delivery, full-duplex communication [1] , and byte-oriented flow. Details are as follows:

  1. TCP is a connection-oriented transport layer protocol. That is, there are two processes of establishing a connection and releasing a TCP connection. ==TCP treats connections as the most basic abstraction==;
  2. Each TCP connection can only have two endpoints, that is, the connection is point-to-point. The endpoint of the connection is called a socket or socket, which will be described in detail later;
  3. TCP provides the service of reliable delivery, that is, the transmission of data is error-free, not lost, not duplicated and arrives == in order == ;
  4. TCP provides full duplex communication. Both sides of the connection (sockets) can send data at any time; roommates at both ends of the TCP connection == sending cache and receiving cache == to temporarily store data for two-way communication;
  5. TCP is byte stream oriented. A stream in TCP refers to a sequence of bytes flowing into and out of a process. The data interacted by the application (application layer) and TCP (transport layer) is an unstructured byte sequence in the eyes of TCP. TCP does not understand its meaning, but stores it in the send buffer, and sends it when it is not blocked. byte sequence of length;
TCP connection

==Connection is the most basic abstraction of TCP== .
The endpoint of a TCP connection is called a socket or socket: ==The port number is spliced ​​to the IP address to form a socket==:

  • socket socket=(ip address: port number)

Each TCP connection is uniquely identified by the two endpoints at both ends of the communication:

  • TCP connection::={socket 1 ,socket 2 }={(IP 1 :port 1 ),(IP 2 :port 2 )}

Each IP address can have multiple different TCP connections, and the same port number can appear in multiple different TCP connections.

socket

The socket here refers to "IP: port number", which has many meanings in the computer, such as the api of the application accessing the networking protocol, the function name in the socket api, the abbreviation of the socket function return value "socket descriptor", etc. .

Remark

[0] Superscript ^1^, small subscript ~1~;

Guess you like

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