TCP-I: Connection Setup and Numbering

7
0

Introduction

TCP, or Transmission Control Protocol, is one of the most important transport layer protocols in computer networks. It is designed for applications that need reliable, ordered, and controlled data delivery between two endpoints.

Unlike UDP, which focuses on low overhead and speed, TCP focuses on correctness. That is why it is used in web communication, file transfer, database access, APIs, email delivery, and many other systems where missing or disordered data is not acceptable.

What Is TCP?

TCP is a connection-oriented transport layer protocol. Before real data transfer begins, the sender and receiver first establish a connection. After that, TCP manages the communication carefully so that data reaches the destination in order and without silent loss.

TCP provides several major features:

  • Reliable delivery: Lost data can be detected and retransmitted.

  • Ordered delivery: Data is reassembled in the correct sequence.

  • Flow control: The sender does not overwhelm the receiver.

  • Congestion control: The sender avoids overloading the network.

  • Full-duplex communication: Both sides can send and receive data in the same connection.

This combination is what makes TCP so widely used.

Why TCP Is Needed

IP can move packets across networks, but IP alone does not guarantee delivery, ordering, or duplication control. Packets may be delayed, dropped, duplicated, or delivered out of order.

TCP solves that problem by adding transport-layer intelligence on top of IP. It turns best-effort packet delivery into a more dependable communication service for applications.

A simple idea to remember is:

  • IP: Tries to deliver packets across networks

  • TCP: Makes application communication reliable and organized

TCP Connection Setup

TCP does not begin by sending application data immediately. It first establishes a connection between the two endpoints. This is done using the three-way handshake.

The handshake works like this:

  • Step 1: The client sends a SYN segment to request a connection.

  • Step 2: The server replies with SYN + ACK.

  • Step 3: The client sends ACK.

A short flow looks like this:

Client SYN => Server SYN-ACK => Client ACK

After these three steps, both sides know that the connection is ready and data transfer can begin.

The three-way handshake is important because it synchronizes sequence numbering and confirms that both sides are prepared to communicate.

TCP Connection Setup

TCP Connection Setup

Sequence Numbers and Acknowledgment Numbers

One of the most important TCP concepts is numbering. TCP keeps track of data using sequence numbers and acknowledgment numbers.

TCP numbers bytes, not packets. That means every byte in the data stream has a logical position.

  • Sequence number: Identifies the first byte carried in a segment

  • Acknowledgment number: Tells the sender which byte is expected next

If a sender transmits bytes 1000 to 1499, the receiver may send an acknowledgment saying 1500. That means all bytes up to 1499 have been received successfully, and the next expected byte is 1500.

This byte-level numbering is the foundation of TCP reliability, ordering, and retransmission.

CS Core

Read Similar Blogs

Comments0