Search⌘ K
AI Features

Other TCP Connection Establishment Methods

Understand the various methods TCP uses to establish connections including the standard three-way handshake and simultaneous connection setups. Learn how TCP uses a finite state machine to manage states on both client and server sides, enabling reliable data exchange and connection management.

In the last lesson, we looked at the most common way that TCP connection establishment could occur. Now, let’s look at some other ways it can successfully occur.

A TCP Three-way Handshake FSM

TCP connection establishment can be described with a four-state Finite State Machine (FSM) as shown below. In this FSM, X/YX/Y indicates that segment XX was transmitted and segment YY was received. Init is the initial state

TCP FSM for connection establishment
TCP FSM for connection establishment

Client-Side

Let’s carve out the paths in this FSM. Here’s the three-way handshake path.

  1. A client host starts in the Init state.
  2. It then sends a SYN segment and enters the SYN Sent state where it waits for a SYN+ACK segment.
  3. When a SYN+ACK is recieved in the SYN SENT state, it replies with an ACK segment and enters the Established state where data can be exchanged.

Server-Side

  1. On the other hand, a server host starts in the Init state.

  2. When a server process starts to listen to a destination port, the underlying TCP entity creates a TCP control block and a queue to process incoming SYN segments. Upon reception of a SYN segment, the server’s TCP entity replies with a SYN+ACK and enters the SYN RCVD state.

  3. It remains in this state until it receives an ACK segment that acknowledges its SYN+ACK segment, and with this it then enters the Established state.

Simultaneous Connection Establishment

Apart from these two paths in the TCP connection establishment, shown in the above FSM, there is a third way that a connection can be established: when both the client and the server send a SYN segment to open a TCP connection.

Simultaneous TCP Connection Opening
1 / 2
Simultaneous TCP Connection Opening

Both sides must know the port number for each other in this case. It doesn’t have to be a well-known port number or the same on both sides.

Feel free to ask any questions related to the lesson in the following widget. Our AI will answer them and help you better understand the topic

AI Powered
Saved
3 Attempts Remaining
Reset

Quick Quiz!

Technical Quiz
1.

Simultaneous connection may result in more segments being exchanged than a regular three-way handshake.

A.

True

B.

False


1 / 2

Coming up, we’ll look at a few scenarios in which connection establishment can go wrong and how TCP handles it.