Connection Establishment in TCP
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”.
TCP A TCP B
1. CLOSED LISTEN
5. ESTABLISHED <A:
SEQ=101><ACK=30
1><CTL=ACK><DAT
A>
ESTABLISHED
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.
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.
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
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