The document describes the TCP 3-way handshake process used to establish a connection between a client and server in a TCP/IP network. It involves 3 steps: 1) the client sends a SYN packet to the server with its initial sequence number, 2) the server responds with a SYN-ACK packet containing its own initial sequence number and acknowledging the client's, and 3) the client sends an ACK packet to the server acknowledging its sequence number, completing the handshake and allowing data transfer to begin.
2. Agenda
❏ Introduction to TCP/IP.
❏ Features of TCP/IP.
❏ Merits & Demerits of TCP/IP
❏ Connection Establishment and Termination.
❏ 3-Way Handshake Process.
3. Introduction to TCP/IP.
● The Transmission Control Protocol (TCP) is one of the main protocols of the Internet
protocol suite. It originated in the initial network implementation in which it
complemented the Internet Protocol (IP). Therefore, the entire suite is commonly
referred to as TCP/IP.
● TCP provides reliable, ordered, and error-checked delivery of a stream of octets
(bytes) between applications running on hosts communicating by an IPnetwork.
● Transmission Control Protocol/Internet Protocol (TCP/IP) is the language a computer
uses to access the internet. It consists of a suite of protocols designed to establish a
network of networks to provide a host with access tothe internet.
● TCP/IP is responsible for full-fledged data connectivity and transmitting the data end
to end by providing other functions, including addressing, mapping and
acknowledgment. TCP/IP contains four layers, which differ slightly from theOSI
model.
5. Description of different TCP/IP protocols
❖ Layer 1: Host-to-network Layer
1. Lowest layer of the all.
2. Protocol is used to connect to the host, so that the packets can be sent overit.
3. Varies from host to host and network to network.
❖ Layer 2: Internet layer
1. Selection of a packet switching network whichis based on a connectionless
internetwork layer is called a internet layer.
2. It is the layer which holds the whole architecturetogether.
3. It helps the packet to travel independently to thedestination.
4. Order in which packets are received is different from the way they are sent.
5. IP (Internet Protocol) is used in thislayer.
cont...
6. 6. The various functions performed by the Internet Layer are:
● Delivering IP packets
● Performing routing
● Avoiding congestion
❖ Layer 3: Transport Layer
1. It decides if data transmission should be on parallel path or singlepath.
2. Functions such as multiplexing, segmenting or splitting on the data is done bytransport
layer.
3. The applications can read and write to the transportlayer.
4. Transport layer adds header information to the data.
5. Transport layer breaks the message (data) into small units so that they arehandled
more efficiently by the network layer.
6. Transport layer also arrange the packets to be sent, in sequence.
cont...
7. ❖ Layer 4: Application Layer
➔ The TCP/IP specifications described a lot of applications that were at the top of theprotocol
stack. Some of them were TELNET, FTP, SMTP, DNS etc.
1. TELNET is a two-way communication protocol which allows connecting to aremote
machine and run applications on it.
2. FTP(File Transfer Protocol) is a protocol, that allows File transfer amongst computer users
connected over a network. It is reliable, simple andefficient.
3. SMTP(Simple Mail Transport Protocol) is a protocol, which is used to transportelectronic
mail between a source and destination, directed via aroute.
4. DNS(Domain Name Server) resolves an IP address into a textual address for Hosts
connected over a network.
5. It allows peer entities to carry conversation.
6. It defines two end-to-end protocols: TCP andUDP.
➢ TCP(Transmission Control Protocol): It is a reliable connection-oriented protocol which handles byte-stream
from source to destination without error and flow control.
➢ UDP(User-Datagram Protocol): It is an unreliable connection-less protocol that do not want TCPs,
sequencing and flow control. Eg: One-shot request-reply kind of service.
cont...
8. ➢ Merits of TCP/IP model
1. It operated independently.
2. It is scalable.
3. Client/server architecture.
4. Supports a number of routing protocols.
5. Can be used to establish a connection between twocomputers.
➢ Demerits of TCP/IP
1. In this, the transport layer does not guarantee delivery of packets.
2. The model cannot be used in any other application.
3. Replacing protocol is not easy.
4. It has not clearly separated its services, interfaces andprotocols.
Merits & Demerits of TCP/IP
9. Connection Establishment
❏ Establishes a virtual path between the source and destination.
❏ How TCP is connection-oriented while using IP (connection-less)?
➔ Connection is virtual.
➔ TCP uses the services of IP to deliver individual segments, butit
controls the connection itself.
➔ IP is unaware of retransmission, out-of-ordersegments
cont...
11. ❏ SYN :
➔ It is for synchronization of sequence numbers.
➔ It consumes 1 sequence number.
➔ Carries no real data .
❏ SYN+ACK:
➔ SYN segment for communication in other direction and ACK
for the received SYN .
➔ It consumes 1 sequence number.
❏ ACK:
➔ Just an ACK segment.
➔ Does not consume any sequence number.
13. ➔ It consumes 1 sequence number
➔ May or may not carry real data.
❏ FIN:
❏ FIN+ACK:
➔ FIN segment to announce closing of connection in other
direction and ACK for the received FIN.
➔ It consumes 1 sequence number.
❏ ACK:
➔ Just an ACK segment.
➔ Does not consume any sequence number.
15. ❏ A three-way handshake is a method used in a TCP/IP network to create a
connection between a local host/client and server. It is a three-step method that
requires both the client and server to exchange SYN and ACK (acknowledgment)
packets before actual data communicationbegins.
❏ A three-way handshake is also known as a TCPhandshake.
16. Steps...
❖ Step 1. Device A (Client) sends a TCP segment with SYN = 1,
ACK = 0, ISN (Initial Sequence Number) = 2000.
➔ The Active Open device (Device A) sends a segment with the SYN flag set to 1,
ACK flag set to 0 and an Initial Sequence Number 2000 (For Example), whichmarks
the beginning of the sequence numbers for data that device A will transmit. SYN is
short for SYNchronize. SYN flag announces an attempt to open a connection. The
first byte transmitted to Device B will have the sequence number ISN+1.
cont...
17. ❖ Step 2. Device B (Server) receives Device A’s TCP segment and
returns a TCP segment with SYN = 1, ACK = 1, ISN = 5000 (Device B’s
Initial Sequence Number), Acknowledgment Number = 2001 (2000 +
1, the next sequence number Device B expecting from Device A).
❖ Step 3. Device A sends a TCP segment to Device B that
acknowledges receipt of Device B’s ISN, With flags set as SYN = 0,
ACK = 1, Sequence number = 2001, Acknowledgment number = 5001
(5000 + 1, the next sequence number Device A expecting from Device
B)
This handshaking technique is referred to as the Three-way handshake
or SYN, SYN-ACK, ACK.
cont...
18. Recap
❏ Step 1 (SYN) : In the first step, client wants to establish a connection with server, so
it sends a segment with SYN(Synchronize Sequence Number) which informs server
that client is likely to start communication and with what sequence number it starts
segments with.
❏ Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits
set. Acknowledgement(ACK) signifies the response of segment it received and SYN
signifies withwhat sequence number it is likely to start the segments with
❏ Step 3 (ACK) : In the final part client acknowledges the response of server and they
both establish a reliable connection with which they will start eh actual data transfer
cont...
cont...