Basic facts that you should know about TCP servers
TCP stands for Transmission Control Protocol. It is one of the significant data transfer protocols of the Internet, designed to control the transfer of data. The framework of the TCP makes a pre-established data stream, re-requests data, if it has been lost, and deletes duplications if two copies of one packet were created. As opposite to UDP, TCP secures the integrity of the transmitted data and notifies the sender of the results of the transfer.
This protocol was created in 1978 by Robert Kahn and Vinton Cerf, the inventors of the IP protocol. TCP is the main component of the TCP / IP protocol, which determines how information is transmitted over the Internet.
How does it work?
The TCP task is to split messages or files into smaller parts (called data packets), which are then sent over the Internet. After, these packets are processed by another TCP level, which collects data into a complete file.
TCP operation consists of three stages:
TCP aims to work at higher levels. It provides data transfer via the Internet from system to system. The standard example is when it happens from the browser and to web service and likewise. TCP reliably transmits a byte stream between processes. TCP implements flow control, congestion control, handshake, reliable transmission.
Besides, TCP provides:
Reliable delivery of segments
Ordering segments upon receipt
Work with sessions
Control the transmission rate.
A little clarification of TCP structure
The TCP segment header has the following structure:
Source port and Destination port – recipient and sender port numbers, respectively, identifying applications on the sending and receiving nodes.
The Sequence number and Acknowledgment number is the sequence number and acknowledgment number used for reliable delivery.
Header length – This is a four-bit field containing the length of the TCP segment header.
Reserved – 6 bits reserved just in case.
Control – a field with flags that are used in the process of exchanging information and describe the additional purpose of the segment.
Window – contains the size of the window, as mentioned above.
Checksum – checksum header and data.
Urgent – a sign of the importance (urgency) of this segment.
Options – an additional optional field that can be used, for example, to test the protocol.
The TCP service is also called: reliable byte stream. This protocol is responsible for delivering the data and maintaining the order of the transmitted messages.
The flow can be significant. How does the protocol work in this case? Suppose you are downloading a file that weighs several GB. In the protocol, the stream will be divided into segments, and each of these segments will be sent to the receiver. On the recipient side, all parts are assembled again.
Thus, it is a well-thought-out system for reliable data exchange without losing it.