0% found this document useful (0 votes)
3 views57 pages

Transport Layer

The Transport Layer is the fourth layer of the OSI model, responsible for process-to-process communication by breaking data into segments and providing error checking. It utilizes protocols like TCP for connection-oriented services and UDP for connectionless services, facilitating reliable data transmission and flow control. Key functionalities include socket addressing, multiplexing, and the three-way handshake process for establishing connections.

Uploaded by

ch414114
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 (0 votes)
3 views57 pages

Transport Layer

The Transport Layer is the fourth layer of the OSI model, responsible for process-to-process communication by breaking data into segments and providing error checking. It utilizes protocols like TCP for connection-oriented services and UDP for connectionless services, facilitating reliable data transmission and flow control. Key functionalities include socket addressing, multiplexing, and the three-way handshake process for establishing connections.

Uploaded by

ch414114
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/ 57

UNIT-IV

Transport Layer
Transport Layer:

• The Transport layer is the fourth layer in the


OSI model, which provides communication
services between the computers connected
in the network.

• This Layer is the first one which breaks the


information data, supplied by Application
layer into smaller units called segments.
• For example: The transport layer provides an
error checking service during the transmission
of data packets from source computer to
destination computer.
Process-to-Process Delivery
• The data link layer helps to deliver the frames
between two neighboring nodes over a link. This
process is called as node-to-node delivery.

• The network layer helps to deliver the datagrams


between two hosts. This process is called as host-
to-host delivery.
• Several processes are carried out on the
source host and destination host. Some
mechanism is needed to complete the
delivery process between the source host
and destination host.

• The transport layer helps to carry out


the process-to-process delivery i.e. the
delivery of a packet or part of message
from one process to another process.
Transport layer services

1.Socket address

2.Multiplexing and Demultiplexing

3.Connection-oriented Service and


Connection-less Services
1.Socket address: Process to process delivery
(transport layer communication) needs two
identifiers, one is IP address and the other is port
number at each end to make a connection.
• Socket address is the combinations of IP address
and port number
2.Multiplexing and Demultiplexing:

• Multiplexing is the process of combining two or


more data streams into a single physical
connection.
• TCP provides multiplexing facilities by using
source and destination port numbers.
• These port numbers allow TCP to set up a
number of virtual connections over a physical
connection and multiplex the data stream
through that connection.
• The reverse process which is delivering data to
the correct socket by the transport layer is called
demultiplexing.

3.Connection-oriented and Connection-less


Services:

• Communication can be established in two ways


between two or more devices that are
connection-oriented and connection-less.
• Network layers can offer these two different
types of services to its layer for transferring data.
• Connection-oriented services involve the
establishment and termination of the connection.

• connection-less services don’t require any


connection creation and termination processes
for transferring data.

• TCP provides Connection-oriented services.

• It uses handshake process to establish the


connection between the sender and receiver.
3- Way Handshake Process
A handshake process includes some steps which
are:
➢Client requests server to set up a connection for
transfer of data.
➢Server program notifies its TCP that connection
can be accepted.
➢The client transmits a SYN segment to the server.
➢The server sends SYN+ACK to the client.
➢Client transmits 3rd segment i.e. just ACK
segment.
➢Then server terminates the connection.
• Connectionless service means that a node can
send data packets to its destination without
establishing a connection to the destination.

• This works because of error handling protocols,


which allow for error correction like requesting
retransmission.

• User Datagram Protocol (UDP) is a


connectionless protocol.
Internet transport protocols:
TCP & UDP
Transmission Control Protocol(TCP):
• It provides full transport layer services to
applications.
• It is a connection-oriented protocol that
means the connection established between
both the ends of the transmission.
• For creating the connection, TCP generates a
virtual circuit between sender and receiver for
the duration of a transmission.
• TCP is a reliable protocol as it detects the error
and retransmits the damaged frames.
• TCP protocol number is 6 and supports
Acknowledgment.
Features Of TCP protocol:
1.Stream data transfer
2.Reliability
3.Flow Control
4.Multiplexing
5.Logical Connections
6.Full Duplex
Source port address: It is used to define the
address of the application program in a source
computer. It is a 16-bit field.

Destination port address: It is used to define the


address of the application program in a
destination computer. It is a 16-bit field.

Sequence number: A stream of data is divided


into two or more TCP segments. The 32-bit
sequence number field represents the position of
the data in an original data stream.
• Acknowledgement number: A 32-field
acknowledgement number acknowledge the data
from other communicating devices. If ACK field is
set to 1, then it specifies the sequence number
that the receiver is expecting to receive.
• Header Length (HLEN): It specifies the size of the
TCP header in 32-bit words. The minimum size of
the header is 5 words, and the maximum size of
the header is 15 words.
• Therefore, the maximum size of the TCP header is
60 bytes, and the minimum size of the TCP
header is 20 bytes.
• Reserved: It is a six-bit field which is reserved for
future use.

There are total six types of flags in control field:

1.URG: Urgent pointer is valid


2.ACK: Acknowledgement number is valid( used in
case of cumulative acknowledgement)
3.PSH: Request for push
4.RST: Reset the connection
5.SYN: Synchronize sequence numbers
6.FIN: Terminate the connection
• Window Size: The window is a 16-bit field that
defines the size of the window.
• Checksum: The checksum is a 16-bit field used in
error detection
• Urgent pointer: If URG flag is set to 1, then this
16-bit field is an offset from the sequence
number indicating that it is a last urgent data
byte.
• Options and padding: It defines the optional
fields that convey the additional information to
the receiver.
User Datagram Protocol (UDP)
• UDP stands for User Datagram Protocol. It is a
Transport Layer Protocol, which is a part of the
Internet Protocol Suite and an alternative
communication protocol to Transmission
Control Protocol (TCP).
• UDP is the simplest transport layer protocol
designed to send data over the Internet.
• It picks the datagram from the network layer
and attaches the header then forwards it to
the user.
•.
• UDP is considered as connectionless protocol
because it doesn't require a virtual circuit to be
established before any data transfer occurs.
• UDP protocol number is 17. It is used for VoIP,
video streaming, gaming and live broadcasts.
• It is faster and needs fewer resources and
allows missing packets.
• UDP can be used for multicasting as it supports
packet switching.
• It can be used for transaction-based protocols,
such as DNS or Network Time Protocol (NTP).
• It can be used by routing protocols such as RIP
and OSPF.
UDP Header Format
• UDP headers contain a set of parameters called
fields. A UDP header has four fields which are as
follows:
Source Port: It is a 2 Byte field that tells the port
number of a source.
Destination Port: It is also a 2 Byte long filed that
tells the port number of the destination.
Length: It is the total length of the UDP, including
the header and the data. It is a 16-bits field.
Checksum: It is a 2 Byte long field that is used to
check errors, e.g., it is used in IPv6 and sometimes
in IPv4.
COMPUTER NETWORKS

UNIT-IV

TRANSPORT LAYER

PREPARED
BY
P.SANTHOSH KUMAR
K.VINOD KUMAR
Introduction

 Transport layer follows process to process(i,.e port to port).


 It is mainly depending on port numbers.
 In network layer we are using IP Address(combination of n/w ID & HostID)
 In transport layer we are using socket address(combination of IP Address & port numbers) for for
transmitting the data from source to destination.
Socket address example:192.168.10.20:8080
Here 192.168.10.20 is IP Address and 8080 is port number for connecting web page.
 Functionalities
 Reliability
 Flow control(stop and wait,GBN,SR)
 Error control(Checksum,CRC,parity…..)
 Congestion control
Port number

File Transfer Protocol

File Transfer Protocol

Dynamic Host Configuration Protocol

Hypertext Transfer Protocol World Wide Web

HTTP Secure
Introduction cont……….
Transport Layer protocols

 In transport layer mainly we are using two protocols


1.TCP(Transmission Control Protocol)
2.UDP(User Datagram Protocol).

TCP is used for connection oriented purpose, UDP is used for Connection less purpose.
Transmission control protocol(TCP)

 Transmission Control Protocol-


 TCP is short for Transmission Control Protocol.
 It is a transport layer protocol.
 It has been designed to send data packets over the Internet.
 It establishes a reliable end to end connection before sending any data.
Characteristics Of TCP-

 TCP is a reliable protocol.


 TCP is a connection oriented protocol.
 TCP handles both congestion and flow control.
 TCP ensures in-order delivery.
 TCP ensures in-order delivery.
 TCP can use both selective & cumulative acknowledgements.
 TCP provides error checking & recovery mechanism.
TCP Header-

 Transmission Control Protocol is a transport layer protocol.


 It continuously receives data from the application layer.
 It divides the data into chunks where each chunk is a collection of bytes.
 It then creates TCP segments by adding a TCP header to the data chunks.
 TCP segments are encapsulated in the IP datagram.
The following diagram represents the TCP header format-
Description-1/5

1. Source Port-
 Source Port is a 16 bit field.
 It identifies the port of the sending application.
2. Destination Port-
 Destination Port is a 16 bit field.
 It identifies the port of the receiving application.
3.Sequence Number-
 Sequence number is a 32 bit field.
 TCP assigns a unique sequence number to each byte of data contained in the
TCP segment.
 This field contains the sequence number of the first data byte.
Description-2/5

 4. Acknowledgement Number-
 Acknowledgment number is a 32 bit field.
 It contains sequence number of the data byte that receiver expects to
receive next from the sender.
 It is always sequence number of the last received data byte incremented
by 1.
 5. Header Length-
 Header length is a 4 bit field.
 It contains the length of TCP header.
 It helps in knowing from where the actual data begins.
Description-3/5

 6. Reserved Bits-
 The 6 bits are reserved.
 These bits are not used.
 URG bit is used to treat certain data on an urgent basis.
 ACK bit indicates whether acknowledgement number field is valid or not.
 PSH bit is used to push the entire buffer immediately to the receiving
application.
 RST bit is used to reset the TCP connection.
 SYN bit is used to synchronize the sequence numbers.
 FIN bit is used to terminate the TCP connection.
Description-4/5

 Window Size-
 Window size is a 16 bit field.
 It contains the size of the receiving window of the sender.
 It advertises how much data (in bytes) the sender can receive without
acknowledgement.
 Checksum-
 Checksum is a 16 bit field used for error control.
 It verifies the integrity of data in the TCP payload.
 Sender adds CRC checksum to the checksum field before sending the data.
 Receiver rejects the data that fails the CRC check.
Description5/5

 Urgent Pointer-
 Urgent pointer is a 16 bit field.
 It indicates how much data in the current segment counting from the first data
byte is urgent.
 Urgent pointer added to the sequence number indicates the end of urgent
data byte.
 This field is considered valid and evaluated only if the URG bit is set to 1.
 Options-
 Options field is used for several purposes.
 The size of options field vary from 0 bytes to 40 bytes.
TCP Connection

 For connecting two devices(i.e client and server) we are using three
phases

1.TCP Connection establishment( 3- way handshaking)


2. Data transfer
3.TCP Connection Termination
3 Way Handshake-

 Three Way Handshake is a process used for establishing a TCP connection


 Step-01: SYN-
 For establishing a connection,
 Client sends a request segment to the server.
 Request segment consists only of TCP Header with an empty payload.
 Then, it waits for a reply segment from the server.
Step-1

 Request segment contains the following information in TCP header-


 Initial sequence number-

 SYN bit set to 1

 Maximum segment size

 Receiving window size


Step-02: SYN + ACK-

 Reply segment contains the following information in TCP header-


 Initial sequence number
 SYN bit set to 1
 Maximum segment size
 Receiving window size
 Acknowledgment number
 ACK bit set to 1
Step-03: ACK-

 After receiving the reply segment,


 Client acknowledges the response of server.
 It acknowledges the server by sending a pure acknowledgement.
TCP Retransmission-

 After establishing the connection,


 Sender starts transmitting TCP segments to the receiver.
 A TCP segment sent by the sender may get lost on the way before
reaching the receiver.
 This causes the receiver to send the acknowledgement with same ACK
number to the sender.
 As a result, sender retransmits the same segment to the receiver.
 This is called as TCP retransmission.
Data transmission
TCP Retransmission-

 2. Retransmission After Receiving 3 Duplicate Acknowledgements-


 Consider sender receives three duplicate acknowledgements for a TCP
segment sent by it.
 Then, sender assumes that the corresponding segment is lost.
 So, sender retransmits the same segment without waiting for its time out
timer to expire.
 This is known as Early retransmission or Fast retransmission.
TCP Connection Termination-

 A TCP connection is terminated using FIN segment where FIN bit is set to 1.
 Consider-
 There is a well established TCP connection between the client and server.
 Client wants to terminate the connection.
 The following steps are followed in terminating the connection-
 Step-01:
 For terminating the connection,
 Client sends a FIN segment to the server with FIN bit set to 1.
 Client enters the FIN_WAIT_1 state.
 Client waits for an acknowledgement from the server.
TCP Connection Termination-

Step-1 Step-2
TCP Connection Termination-

Step-3 Step-4

You might also like