Ethical Hacking Tutorial

What is TCP? Transmission Control Protocol in Computer Networks


Transmission Control Protocol (TCP) is amongst the most important protocols of the Internet Protocols suite. It is a comprehensively used protocol for the transmission of data in communication networks such as the Internet. Over a network, TCP is the default method of communication of data between different devices. 

During data transfer, it establishes and maintains a connection between the sender and receiver. With its mechanisms, TCP makes sure all packets of data arrive undamaged. It is used for e-mail services and peer-to-peer sharing methods such as- Secure Shell (SSH) and File Transfer Protocol (FTP).

What is TCP in Computer Networks?

TCP stands for Transmission Control Protocol in computer networks

It is a transport layer protocol facilitating the transmission of packets from source to destination. As a connection-oriented protocol, it establishes the connection before the communication between the computing devices in a network. This protocol is used with an IP protocol called the TCP IP model.

The TCP's primary role is to accept the data from the application layer, divide it into several packets, number them, and transmit them to the destination. 

Conversely, the TCP reassemble the packets and transfer them to the application layer. Because TCP is a connection-oriented protocol, the connection remains established until the communication between the sender and receiver is not completed.

Related Concepts:

How does TCP Work?

To ensure that each message reaches its destination intact, the TCP/IP model breaks down the data into small bundles and reassembles the piles into the original message on the other end. Sending the information in little bundles is simpler to maintain efficiency than sending everything in its entirety.

After a specific message breaks down into bundles, these bundles travel along multiple routes if any one of the routes is jammed, but the destination still remains the same. 

Consider an example, suppose a user requests a web page on the Internet; the server processes that user's request and sends back an HTML page to the user. The server uses a protocol called the HTTP Protocol. The HTTP then requests the TCP layer to establish the required connection and send the HTML file. 

The TCP breaks the data or information into small packets and forwards it to the IP (Internet Protocol)  layer. The packets are then sent to the target location through different routes. The TCP layer in the user's system awaits for the transmission to complete and acknowledges once all packets are received.

Related Concepts:

TCP 3-Way Handshake

Handshake refers to establishing the connection between the client and server and is the process of establishing a communication link. In order to transmit a packet, TCP needs a three-way handshake before sending data. 

PAR (Positive Acknowledgement Re-transmission) is reliable communication in TCP. Whenever a sender transfers the data to the receiver, it awaits a positive acknowledgment from the receiver's end confirming the arrival of data. 

If the acknowledgment doesn't reach the sender, it must resend that data. The positive acknowledgment from the receiver establishes a successful connection.

The server is none other than the server itself, and the client is the receiver. A TCP 3 handshake needs both client and server response to exchange data. Here, SYN means synchronized Sequence Number, and ACK indicates acknowledgment. Each step is a handshake between the sender and receiver.

The TCP  three way handshake process is discussed below-

1. SYN

SYN is a segment sent by the client to the server, which acts as a request connection between the client and the server. It notifies the server that the client is willing to establish a connection. 

Synchronising sequence numbers also helps synchronise sequence numbers that are sent between any two devices, where the same SYN segment asks for the sequence number with the connection request.


SYN-ACK segment or SYN + ACK is a segment sent by the server. The ACK segment updates the client about the server receiving the connection request and is ready to build the connection. The SYN segment reports the sequence number with which the server is prepared to start with the segments.

3. ACK

ACK (Acknowledgment) is the final step before the establishment of a successful TCP connection between the client and server. The client sends the ACK segment as the response to the received ACK and SN from the server, establishing a reliable data connection.

After the above three steps, the client and server are ready for the data communication. TCP connection and termination are full-duplex, meaning the data can travel in both directions simultaneously.

Related Concepts:

TCP Congestion Control in Computer Networks

Congestion occurs when the amount of data transmission over a network exceeds capacity, interrupting data transmission. Congestion control is a must to ensure that data is transmitted efficiently and effectively over a network, even when the network is under heavy load. 

Effective congestion control prevents network outages, minimises delays, and reduces data loss risk. With congestion control, network performance can improve significantly and therefore improves user experience.

A congestion control protocol contains the following features:

  • It must avoid congestion and ensure that the bandwidth allocated to a specific host doesn’t exceed the bandwidth of the bottleneck link, which may be responsible for congestion on the network. 

  • It should be fair. The network resources between different hosts must be fairly allocated.

  • The scheme must be efficient and ensure the sender efficiently utilises the bandwidth. It should be within the bandwidth of the bottleneck link and entirely consume it. 

TCP uses three algorithms for congestion control in computer networks:

  • Additive increase, Multiplicative Decrease

  • Slow Start

  • Timeout React

TCP Connection Establishment

TCP hosts should establish a connection-oriented session with each other to make the transport services reliable. Connection establishment uses the three-way handshake mechanism, which synchronises both ends of a network by enabling both sides to agree upon original sequence numbers.

This procedure also issues that both sides are ready to pass on data and learn that the other side is available to communicate. This is crucial so that packets are not shared or retransmitted during the time of session establishment or after session termination. Each host randomly selects a sequence number to track bytes within the stream it sends and receives.

Host A (requesting end) sends an SYN segment determining the server's port number, which the client wants to connect to, and its initial sequence number, x.

Host B (server) acknowledges its own SYN segment and the server's initial sequence number, y. The server also responds to the client SYN by accepting the sender's SYN plus one (x + 1).

An SYN consumes one sequence number. The client should acknowledge this SYN from the server by accepting the server's SEQ plus one (SEQ = x + 1, ACK = y + 1). This is how a TCP connection is established.

TCP Connection Termination

TCP creates three segments for establishing a connection but takes four segments to terminate. When a TCP connection is full-duplex, i.e. data moves in each direction independent of the other, each direction must be shut down alone. The rule is that either end can share a FIN after sending data.

When a TCP receives a FIN, it should inform the application that the other end has terminated that data flow direction. The sending of a FIN usually results from the application issuing a close.

The receipt of a FIN means there will be no more data flowing in that direction. A TCP can send data after receiving a FIN. The end that first issues the close (for example, send the first FIN) execute the active close. The other end (that receives this FIN) manages the passive close.

What Are TCP Flags?

In TCP connection, flags indicate a particular connection state, provide additional helpful information for troubleshooting purposes, or handle control of a specific connection. Flags are also called control bits.

The most commonly used flags are SYN, ACK, and FIN. Each flag corresponds to 1-bit information.

List of TCP Flags

The table below explains the 6 TCP flags available-






Used to create TCP connection



Used to acknowledge the reception of data or synchronisation packets



Instruct the network stacks to bypass buffering



Indicates out-of-band data that the network stacks must process before standard data



Gracefully terminate the TCP connection



Immediately close the connection and drop any in-transit data


Transmission Control Protocol FAQs

Below are some frequently asked questions related to TCP protocol in networking:

1. What is TCP full form in the computer?

The full form of TCP is Transmission Control Protocol. 

2. What is a TCP connection?

A transmission Control Protocol connection is a communication standard in a computer network that enables application programs and computing devices to share messages over the Internet. It is designed to transfer packets across the web and ensure the successful delivery of data over networks.

3. How many TCP connections can a server handle?

For all the requests TCP gets, it establishes a new socket. Since there are only 65535 TCP ports, a server cannot have more amount of concurrent connections.

4. How long can a TCP connection stay open? 

TCP connections last about two hours without any traffic. Either end can send keep-alive packets, just an ACK on the last received packet. This can be set per socket or by default on every TCP connection.

5. How is a TCP connection established and terminated?

TCP uses a 3-way handshake process to establish a reliable connection. The connection is a full duplex; both sides synchronise (SYN) and acknowledge (ACK). These four flags are exchanged in three steps—SYN, SYN-ACK, and ACK.

To terminate a TCP connection, either device can send a FIN (finish) packet to the other device, indicating it no longer wants to communicate. The other device responds with an ACK packet and then sends its FIN packet to confirm the termination.

6. How many TCP connections are there per port?

Ports are 16-bit numbers. Hence, the maximum number of connections to any given host port is 64K.

7. What is TCP connection rejection?

TCP connection rejection means during a connected system call, connection refused errors are generated when an application attempts to connect using TCP to a server port which is not open.

8. Which type of protocol is TCP?

TCP is a connection-oriented protocol. This means a connection is established and also maintained until and unless the applications at each end have finished exchanging messages.

9. What is TCP congenital control?

TCP congestion control is the mechanism of preventing congestion from happening or removing it after congestion takes place. The congestion window state of TCP limits the quantity of data to be sent by the sender into the network even before receiving the acknowledgement.

10. What is a TCP handshake?

TCP handshake is a process in TCP/IP networks of establishing a working connection between a server and a computer. The method includes three steps and requires the server and client to synchronise and negotiate communication conditions.

11. What is the TCP protocol number?

The TCP protocol number indicates a single byte in the 3rd word of the datagram header. The value recognises the protocol in the above IP layer to which the data should be passed.  

12. What is TCP used for?

TCP is a communication standard enabling application programs and computing devices to exchange information over a network. It sends packets across the internet and ensures the successful delivery of information and messages over networks.

13. What is a TCP 3-way handshake?

A three-way handshake creates a TCP socket connection to transmit data between devices reliably. It allows communication between a web browser on the client side and a server whenever a user navigates the Internet.

14. What is the TCP model?

The TCP model is a four-layer model dividing network communications into four definite layers. The four essential layers are the application, transport, network, and link layers.

15. What are TCP states?

The TCP states are the different stages of a TCP connection. Each state has a specific purpose and is used to ensure that the connection is established and maintained correctly. The states are: Closed, Listen, Synchronize, Established, Close Wait, Last Ack, and Time Wait.

Relevant Tutorials

Prepare With Interview Questions

Deep Concepts:

Did you find this article helpful?