TCP (Transmission Control Protocol) Transmission Control Protocol
The TCP protocol master implements high reliability package exchange transfer protocols between the host. This article will describe some methods of protocol standards and implementation. Because computer networks are indispensable in modern society, TCP protocols are mainly used when the network is unreliable, and the military may be particularly useful, but it is also applicable to the government and commercial departments. TCP is a reliable protocol that is connected to end-to-end. It supports a variety of web applications. TCP does not require much requirements for the underlying service, it assumes that the lower layer can only provide unreliable datagram services, which can run on a network composed of a variety of hardware. The following figure is the location of the TCP in the hierarchical structure. Its underlying is the IP protocol, and the TCP can segment, reorganize the data according to the data transmitted in the IP protocol, and the IP protocol is responsible for segmentation, reorganizing the data, in a variety of networks Transfer.
The top of the TCP is the application. The following is the IP protocol, the upper interface includes a series of calls similar to the operating system interrupt. For the upper application, TCP should be able to transfer data asynchronously. The underlying interface We assume an IP protocol interface. In order to implement a connection-oriented reliable transmission data on a unreliable network, TCP must resolve reliability, traffic control, must be able to provide multiple interfaces for the upper application, and provide data for multiple applications while TCP The connection problem must be resolved, so that TCP can be called up-oriented, and finally, TCP must also be able to solve communication security issues.
The network environment includes a network connected by a gateway (or other device), the network can be a local area network or some metro network or a wide area network, but no matter what they are, they must be based on packet exchange. Different protocols on the host have different port numbers, and a pair process communicates through this port number. This communication does not include IO operations within the computer, including operations performed on the network. Computers on the network are viewed as the source and destination of the package. It should be noted that different processes in the computer may communicate simultaneously, when they use port numbers that do not receive the data of the forward A process by the B process.
In order to transfer data, the process will call the TCP, transfer the data and the corresponding parameters to the TCP, so TCP will transfer the data to the destination TCP, of course, by transmitting the TCP package in the IP package to the network. The receiver TCP communicates the upper application after receiving the data, and the TCP guarantees the correctness of the receiving data order. Although the underlying protocol may not guarantee the order is correct. What needs to be explained here is that after receiving this package, it will be packed, see if it has already arrived, if not, what is the route to achieve the destination, after the decision, the gateway will be based on the next one The protocol in the network is once again transmitted the TCP package. If necessary, you have to divide this package into several segments. The process of this landing check is a time consuming process. From above, we can see the basic procedure of TCP transmission, of course, the specific process may be much more complicated.
On the host of TCP, TCP can be seen as a module, and the file system is not very different. TCP can also call some operating system functions, TCP does not directly and network, control the network task by dedicated device drive module carry out. TCP only calls the IP interface, and the IP provides services that all TCPs needed to TCP.
It has been said that the TCP connection is reliable, and ensures the order in which the packet is transmitted, and the guarantee order is guaranteed by a serial number. A serial number is also included in the response package, indicating that the recipient is ready for the package. When the TCP transmits a packet, it places this packet into the retransalence queue while starting the numeric, if you receive the confirmation information about this package, remove this package from the queue, if the timing timeout Re-send this package. Note that the confirmation information returned from TCP does not guarantee that the final recipient receives the data, which is the responsibility of the recipient. Each channel for transmitting TCP has a port mark because this tag is determined by each TCP terminal, so TCP may not be unique, in order to ensure the unique value of this value, to use the network address and port number to achieve unique The purpose of the identification, we call this for sockets, a connection is identified by a socket on both ends, local sockets may communicate with different external sockets, which is a full-duplex.
The TCP returns a name that tag this connection by sending an Open command and an external socket parameter to the local port. In order to save this connection, we assume that there is something called Transmission Control Block, TCB to save. The OPEN command also specifies that the establishment of this connection is a proactive request or passive waiting request.
Here is a brief introduction to TCP. The TCPIP protocol is a widely used protocol, understanding it is very beneficial to understanding network operations.