0% found this document useful (1 vote)
48 views5 pages

Connection Establishment in TCP

The document discusses the three-way handshake process used to establish a TCP connection between two hosts. It explains that TCP A sends a SYN packet to TCP B, TCP B responds with a SYN-ACK packet, and TCP A acknowledges with an ACK packet, establishing the connection. It provides an example handshake sequence and explains each step, demonstrating how the hosts synchronize sequence numbers and transition between states.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
48 views5 pages

Connection Establishment in TCP

The document discusses the three-way handshake process used to establish a TCP connection between two hosts. It explains that TCP A sends a SYN packet to TCP B, TCP B responds with a SYN-ACK packet, and TCP A acknowledges with an ACK packet, establishing the connection. It provides an example handshake sequence and explains each step, demonstrating how the hosts synchronize sequence numbers and transition between states.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

4.

Understand the working of “Connection


Establishment” in TCP

4.1 Introduction
When two processes wish to communicate, their TCP’s must first establish a connection i.e.
initialize the status information on each side. Since connections must be established between
unreliable hosts and over the unreliable internet communication system, a “three-way
handshake” with clock based sequence numbers is the procedure used to establish a
Connection. This procedure normally is initiated by one TCP and responded by another TCP.
The procedure also works if two TCPs simultaneously initiate the procedure. When
simultaneous attempt occurs, each TCP receives a “SYN” segment which carries no
acknowledgement after it has sent a “SYN”.

The simplest three-way handshake is shown in the following figure.

TCP A TCP B
1. CLOSED LISTEN

2. SYN-SENT  <A: SEQ=100><CTL=SYN> SYN-RECEIVED

3. ESTABLISHED ` <B: SEQ=300><ACK=101><CTL=SYN,


ACK> SYN-RECEIVED

4. ESTABLISHED  <A: SEQ=101><ACK=301><CTL=ACK>


ESTABLISHED

5. ESTABLISHED  <A:
SEQ=101><ACK=30
1><CTL=ACK><DAT
A>
ESTABLISHED

Fig: Basic 3-Way Handshake for Connection Synchronization

Explanation:

The above figure should be interpreted in the following way. Each line is numbered for
reference purposes. Right arrows () indicates the departure of a TCP Segment from TCP A
to TCP B, or arrival of a segment at B from A. Left arrows ( ) indicates the reverse. TCP
states represent the state after the departure or arrival of the segment (whose contents are

Ver 11.1 1
shown in the center of each line). Segment contents are shown in abbreviated form, with
sequence number, control flags, and ACK field. In line2 of the above figure, TCP A begins by
sending a SYN segment indicating that it will use sequence numbers starting with sequence
number 100. In line 3, TCP B sends a SYN and acknowledges the SYN it received from TCP
A.

Note that the acknowledgment field indicates TCP B is now expecting to hear sequence 101,
acknowledging the SYN which occupied sequence 100. At line 4, TCP A responds with an
empty segment containing an ACK for TCP B's SYN; and in line 5, TCP A sends some data.

4.2 Network Setup


Step 1:

Open Examples  Connection-Establishment-in-TCP as shown below:

Step2:

Click & drop Wired Nodes and Router onto the Simulation Environment and link them as
shown below.

Ver 11.1 2
Step3:

To run the simulation, click the Application icon present on ribbon and change the
Application_Type to FTP. The Source_Id is 1 and Destination_Id is 2.

Router Properties: Accept default properties for Router.


Enabling Wireshark Capture on Source Node:
 Right Click on source node and go to properties.
 Under General properties enable Wireshark Capture option as “Online”.
 Click OK. Once the simulation starts, Wireshark capture all the packets.

Ver 11.1 3
Click on run simulation and set Simulation Time as 10 sec. In the Static ARP Configuration
tab set Static ARP as Disable.

4.3 Output
The following results will be obtained. Open Wireshark window and you would see

Fig: 3-way handshake captured in Wireshark

Ver 11.1 4
4.4 Inference
In the above figure we can see that NODE-1 (check the IP address of NODE-1 from the
scenario) sends a control packet of type TCP_SYN requesting the connection with the NODE-
2 (find the IP address from the scenario). NODE-2 responds with the control packet of type
TCP_SYN_ACK to NODE-1. This TCP_SYN_ACK is the ACK packet for the TCP_SYN
packet. NODE-1 then sends the TCP_ACK to NODE-2 via ROUTER-3 making the
CONNECTION_STATE as TCP_ESTABLISHED. Once the connection is established, data
transmission starts and we see that data packet (size 1500 bytes) sent from the NODE-1 to
the NODE-2.

Ver 11.1 5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy