TCP (Transmission Control Protocol) Explained

The protocol ensures reliable data transmission

IT technician uses a computer among racks of server

  Jetta Productions/Getty Images

TCP (Transmission Control Protocol) is an important network protocol that is used in the transmission of data over networks. A protocol, in the context of networks, is a set of rules and procedures that govern how the transmission of data is carried out so that everyone in the whole world, independent of the location, software or hardware used, does the thing the same way. TCP works together with IP (Internet Protocol) in a well-known duo called TCP/IP. You can see this term in the network settings of your computer, your smartphone or portable device if you play around with the settings. The IP part deals with the addressing and forwarding of data packets from source to destination while TCP manages the reliability of the transmission. In this article, we will see what TCP does and how it works. 

What TCP Does

The function of TCP is to control the transfer of data such that it is reliable. On networks like the Internet, data is transmitted in packets, which are units of data that are sent independently on the network, and are reassembled once they reach the destination to give back the original data. 

Transmission of data on a network is done in layers, each protocol on one layer doing something complementary with what the others are doing. This set of layers is called a protocol stack. TCP and IP work hand in hand in the stack, one above the other. For example, in one stack, you can have HTTP - TCP - IP - WiFi. This means that when, for example, a computer is accessing a web page, it uses the HTTP protocol to get the web page in HTML, TCP controls the transmission, IP the channeling on the network (e.g the Internet), and WiFi the transmission on the local area network. 

TCP is, therefore, responsible for ensuring reliability during transmission. A reliable data transmission is one in which the following requirements are met. Scenarios are given to better understand the concept. 

  • All the packets reach the destination, that is no packet is lost. You don't want letters or sentences missing when you send your email or instant messages.
  • There is no such delay that would affect data quality. You want your conversation during your VoIP call or streaming audio to be consistent, failing which the spoken words would be unrecognizable. 
  • All data packets are reassembled in order. You want your words in a sentence of your email to be in the order you wrote them. Else, the deer may eat the lion instead of the more natural converse.

How TCP Works 

TCP labels its packets such that they are numbered. It also makes sure they have a deadline to reach the destination (which is a duration of several hundred milliseconds called time-out) and some other technical provisions. For each packet received, the sending device is notified through a packet called acknowledgment. The name says it all. If after the time-out, no acknowledgment is received, the source sends another copy of the probably missing or delayed packet. Out-of-order packets are also not acknowledged. This way, all packets are always assembled in order, without holes and within a predetermined and acceptable delay. 

TCP Addressing 

While IP has a complete mechanism for addressing known as IP addresses, TCP has no such elaborate addressing system. It does not need one. It only uses numbers provided by the device it is working on to identify where it is receiving and sending packets for which service. These numbers are called ports. For example, web browsers use the port 80 for TCP. Port 25 is used or email. The port number is often coupled with the IP address for a service, e.g.