Transmission Control Protocol

The TCP protocol provides reliable data flow delivery between two Internet hosts.

Like UDP, TCP uses the IP protocol as a lower-level protocol for transmitting datagrams and supports the transmission of a continuous stream of datagrams. But unlike UDP, TCP provides reliable delivery of messages. TCP guarantees that during transmission the data will not be distorted, lost, copied, and their order will not be changed. It allows programmers not to build special mechanisms of protection of transfer of data in the applied programs.

The features of TCP protocol are listed below:

Simple data transmission.

TCP supports bidirectional transfer of continuous data octets between users, dividing data on segments which are transferred through the Internet. The minimum size of a TCP segment is 1024 bytes. In the general case TCP itself decides when to transmit a block of packets.

Reliability

TCP corrects the errors connected with the distortion, loss, duplication of the data, and also change of an order of delivery. To do this, TCP assigns a sequence number to all data octets and waits for an acknowledgement (ACK) on the delivery of each octet from the TCP target module. If the timeout has expired before the ACK is received, the data is retransmitted. The TCP retransmission timeout value for each connection is determined dynamically based on a cyclic time counter. Sequential numbers allow the destination TCP module to restore the order of data received and to remove duplicate packets. Data integrity is checked using a checksum, which is calculated by the sender for each segment transmitted and checked by the recipient, which discards damaged segments.

Flow control

To control the flow in each ACK packet, the TCP module specifies the recipient window size, that is, the allowable interval of message sequence numbers following the last successfully received data segment. The window size specifies the number of octets that the sender can transmit until the next permission is received.

Multiplexing

TCP allows multiple host processes to simultaneously work with TCP functions. Each host is allocated a set of ports for TCP. A unique TCP socket identifier consists of the port number, network address, and host address. Each connection is uniquely identified by a socket pair.

Connections

TCP stores certain state information for each data stream to transmit. This information forms the description of the connection and contains information such as the socket pair, sequence numbers of segments, and window size. A pair of sockets located at different ends of a connection uniquely identifies that connection.

Priority and protection

The TCP user can set the security level and priority of the data being sent. If the user does not specify custom values, default values apply.