TCP Connection Establishment
Last Updated :
21 May, 2025
TCP (Transmission Control Protocol) is a core internet protocol that ensures reliable, ordered, and error-checked delivery of data between computers. It establishes a connection using a three-way handshake before data transfer begins, allowing both devices to synchronize and agree on communication parameters. TCP breaks data into packets, manages their delivery by resending lost packets, and reassembles them in the correct order. This makes TCP ideal for applications like web browsing, email, and file transfers where accuracy and reliability are important.
TCP Connection Establishment
1. Sender starts the process with the following:
- Sequence number (Seq=521): contains the random initial sequence number generated at the sender side.
- Syn flag (Syn=1): request the receiver to synchronize its sequence number with the above-provided sequence number.
- Maximum segment size (MSS=1460 B): sender tells its maximum segment size, so that receiver sends datagram which won't require any fragmentation. MSS field is present inside Option field in TCP header.
- Window size (window=14600 B): sender tells about his buffer capacity in which he has to store messages from the receiver.
2. TCP is a full-duplex protocol so both sender and receiver require a window for receiving messages from one another.
- Sequence number (Seq=2000): contains the random initial sequence number generated at the receiver side.
- Syn flag (Syn=1): request the sender to synchronize its sequence number with the above-provided sequence number.
- Maximum segment size (MSS=500 B): receiver tells its maximum segment size, so that sender sends datagram which won't require any fragmentation. MSS field is present inside Option field in TCP header.
Since MSS receiver < MSS sender , both parties agree for minimum MSS i.e., 500 B to avoid fragmentation of packets at both ends.
Therefore, receiver can send maximum of 14600/500 = 29 packets.
This is the receiver's sending window size.
- Window size (window=10000 B): receiver tells about his buffer capacity in which he has to store messages from the sender.
Therefore, sender can send a maximum of 10000/500 = 20 packets.
This is the sender's sending window size.
- Acknowledgement Number (Ack no.=522): Since sequence number 521 is received by the receiver so, it makes a request for the next sequence number with Ack no.=522 which is the next packet expected by the receiver since Syn flag consumes 1 sequence no.
- ACK flag (ACk=1): tells that the acknowledgement number field contains the next sequence expected by the receiver.
3. Sender makes the final reply for connection establishment in the following way:
- Sequence number (Seq=522): since sequence number = 521 in 1 st step and SYN flag consumes one sequence number hence, the next sequence number will be 522.
- Acknowledgement Number (Ack no.=2001): since the sender is acknowledging SYN=1 packet from the receiver with sequence number 2000 so, the next sequence number expected is 2001.
- ACK flag (ACK=1): tells that the acknowledgement number field contains the next sequence expected by the sender.

Since the connection establishment phase of TCP makes use of 3 packets, it is also known as 3-way Handshaking (SYN, SYN + ACK, ACK).
TCP Flags Used in Connection Establishment
TCP uses special flags to manage connections between devices such as:
- SYN (Synchronize): This flag is used to start a new connection between two devices.
- ACK (Acknowledge): It confirms that a message has been received successfully.
- RST (Reset): This flag is used to abruptly close a connection due to errors or security reasons.
- FIN (Finish): It signals that one device wants to close the connection properly.
Common Issues in TCP Connection Establishment
Sometimes, problems can occur while setting up a connection. Here are some common issues:
- SYN Flood Attacks: Hackers send many SYN requests without completing the connection, overloading the server.
- Connection Timeout: If a device does not respond in time, the connection attempt fails.
- Packet Loss: Some data packets might get lost due to network issues, causing delays or failures in connection.
How to Optimize TCP Connection Establishment?
To make TCP connections faster and more reliable, here are some useful methods:
- Reducing Latency with TCP Fast Open: This allows data to be sent earlier, reducing the delay when starting a connection.
- Using Keep-Alive Mechanism: This keeps connections open longer, avoiding the need to set up new ones repeatedly.
- Load Balancing for Faster Handshakes: Distributing traffic across multiple servers helps in handling many connections efficiently.
Practice GATE IT 2008 | Question 67 based on three-way handshake process.
Also, read about TCP Connection Termination.
What does "established" mean in TCP?
"Established" in TCP means a connection is successfully set up between two devices, allowing data transfer after completing the three-way handshake.
What is the TCP connection limit?
The limit depends on system resources and configurations, but most modern systems support thousands to millions of concurrent connections.
What is the speed limit of a TCP connection?
TCP speed depends on factors like network bandwidth, latency, congestion, and window size, but it has no fixed limit.
Similar Reads
Difference between Distance vector routing and Link State routing Routing is a process in computer networks which is used to find best path to transmit data packets from one node to another. Distance Vector Routing and Link State Routing are two most used dynamic routing algorithms. They both are a part of Intradomain routing which refer to routing of devices with
3 min read
Fixed and Flooding Routing algorithms In most situations, packets require multiple hops to make a journey towards the destination. Routing is one of the most complex and crucial aspects of packet-switched network design. Desirable Properties of Routing Algorithms:- Correctness and SimplicityRobustness: Ability of the network to deliver
5 min read
Distance Vector Routing (DVR) Protocol Distance Vector Routing (DVR) Protocol is a method used by routers to find the best path for data to travel across a network. Each router keeps a table that shows the shortest distance to every other router, based on the number of hops (or steps) needed to reach them. Routers share this information
5 min read
Unicast Routing - Link State Routing Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between the sender and receiver. There are various unicast protocols such as TCP, HTTP, etc. TCP (Transmission Control Protocol) is the most commonly used unicast protocol. It is a connecti
6 min read
Internet Control Message Protocol (ICMP) Internet Control Message Protocol is known as ICMP. The protocol is at the network layer. It is mostly utilized on network equipment like routers and is utilized for error handling at the network layer. Since there are various kinds of network layer faults, ICMP can be utilized to report and trouble
11 min read
Open Shortest Path First (OSPF) Protocol Fundamentals Open Shortest Path First (OSPF) is a link-state routing protocol designed to efficiently route data within an Autonomous System (AS). It operates by using the Shortest Path First (SPF) algorithm to calculate the best path for packet forwarding. Unlike distance-vector protocols, OSPF triggers updates
7 min read
Types of Spanning Tree Protocol (STP) In Ethernet networks, switches use frames to forward data between devices. However, if there are multiple active paths between switches (such as when switches are interconnected), a loop can occur, causing frames to circulate indefinitely. This loop results in broadcast storms, high CPU utilization,
5 min read
Differences Between Virtual Circuits and Datagram Networks Computer networks that provide connection-oriented services are called Virtual Circuits while those providing connection-less services are called Datagram networks. For prior knowledge, the Internet that we use is based on a Datagram network (connection-less) at the network level as all packets from
7 min read
ARP, Reverse ARP(RARP), Inverse ARP (InARP), Proxy ARP and Gratuitous ARP Prerequisite IP Addressing, Introduction of MAC Addresses, Basics of Address Resolution Protocol (ARP) In this article, we will discuss about whole ARP-family, which are ARP, RARP, InARP, Proxy ARP and Gratuitous ARP. Let's try to understand each one by one.1. Address Resolution Protocol (ARP) -Addr
6 min read
Transport Layer responsibilities The transport Layer is the second layer in the TCP/IP model and the fourth layer in the OSI model. It is an end-to-end layer used to deliver messages to a host. It is termed an end-to-end layer because it provides a point-to-point connection rather than hop-to-hop, between the source host and destin
5 min read