0% found this document useful (0 votes)
5 views62 pages

Chapter No 4-OSI Transport Layer

The OSI Transport Layer is responsible for the end-to-end transfer of data between applications, ensuring reliability, flow control, and segmentation. It utilizes two main protocols, TCP and UDP, where TCP provides reliable, ordered delivery and UDP offers low-overhead, connectionless communication. The transport layer also manages port addressing to identify applications and supports various applications based on their specific data requirements.

Uploaded by

alissher0786
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)
5 views62 pages

Chapter No 4-OSI Transport Layer

The OSI Transport Layer is responsible for the end-to-end transfer of data between applications, ensuring reliability, flow control, and segmentation. It utilizes two main protocols, TCP and UDP, where TCP provides reliable, ordered delivery and UDP offers low-overhead, connectionless communication. The transport layer also manages port addressing to identify applications and supports various applications based on their specific data requirements.

Uploaded by

alissher0786
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/ 62

OSI Transport

Layer
Chapter 4
9/27/2024

• Why is there a need for the transport layer?


• What is the role of the transport layer as it
provides the end-to-end transfer of data
between applications?
• What is the role of two TCP/IP transport layer
protocols: TCP and UDP?
• How do the key functions of the transport layer
protocol, including reliability, port addressing,
and segmentation, work?
• How do TCP and UDP handle the key
functions?
• When is it appropriate to use TCP or UDP, and
what are some examples of applications that
use each protocol? 2
9/27/2024

The processes described in the OSI transport layer


accept data from the application layer and prepare it for
addressing at the network layer.

The transport layer is responsible for the overall end-to-


end transfer of application data

Introduction 3
9/27/2024

Roles of the Transport Layer


The transport layer provides transparent transfer of data between end
users, providing reliable data transfer services to the upper layers. The
transport layer controls the reliability of a given link through flow control,
segmentation/desegmentation, and error control
The following are the primary responsibilities of the transport layer:
1. Tracking the individual communications between applications on the
source and destination hosts
2. Segmenting data and managing each piece
3. Reassembling the segments into streams of application data
4. Identifying the different applications
5. Performing flow control between end users
6. Enabling error recovery
7. Initiating a session
4
8. The transport layer enables applications on devices to communicate
9/27/2024

5
9/27/2024

Tracking Individual
Conversations
Any host can have multiple applications
that are communicating across the
network.
Each of these applications will be
communicating with one or more
applications on remote hosts.
It is the responsibility of the transport
layer to maintain the multiple
communication streams between these
applications. SAMPLE FOOTER TEXT 6
9/27/2024

7
9/27/2024

Segmenting Data
The application layer passes large
amounts of data to the transport
layer.
The transport layer has to break the
data into smaller pieces, better
suited for transmission.
These pieces are called segments.
This process includes the
encapsulation required on each
piece of data.
8
9/27/2024

9
9/27/2024

At the receiving host, each segment of


Reassembling data must be reassembled in the correct
Segments order and then directed to the
appropriate application.
By numbering and sequencing the
segments, the transport layer can
ensure that these segments are
reassembled into the proper order.
The protocols at the transport layer
describe how the transport layer header
information is used to reassemble the
data pieces into in-order data streams
10
9/27/2024

Identifying the Applications


• To pass data streams to the proper applications, the transport layer must identify
the target application. To accomplish this, the transport layer assigns an identifier to
an application. The TCP/IP protocols call this identifier a port number.

Network Transparency:
Applications do not need to know the operational details of the network in use. The
applications generate data that is sent from one application to another, without
regard to the destination host type, the type of media over which the data must
travel, the path taken by the data, the congestion on a link, or the size of the network.

11
9/27/2024

• Flow control can prevent the loss of


Flow Control segments on the network and avoid the
need for retransmission.

• This is done at the transport layer by


regulating the amount of data the source
transmits as a group.

• When the transport layer is aware that


these resources are overtaxed, some
protocols can request that the sending
application reduce the rate of data flow.
12
9/27/2024

Error Recovery
• For many reasons, it is possible for
a piece of data to become
corrupted, or lost, as it is
transmitted over the network.
• The transport layer can ensure
that all pieces reach their
destination by having the source
device retransmit any data that is
lost.
13
9/27/2024

Initiating a
Session
• The transport layer can provide
connection orientation by creating a
session between the applications.
• These connections prepare the
applications to communicate with each
other before any data is transmitted.
• Within these sessions, the data for a
communication between the two
applications can be closely managed.

14
9/27/2024

Data Requirements Vary

Multiple transport layer protocols exist to meet the


requirements of different applications.

In today’s converged networks, where the flow of


voice, video, and data travels over the same
network, applications with very different transport
needs can be communicating on the same network

Different applications have different requirements for


their data, and therefore different transport protocols
have been developed to meet these requirements.
15
Supporting Reliable
9/27/2024

Communication

TCP is a transport layer protocol that can


be implemented to ensure reliable delivery
of the data. In networking terms, reliability
means ensuring that each piece of data that
the source sends arrives at the destination.

At the transport layer, the three basic


operations of reliability are
■ Tracking transmitted data
■ Acknowledging received data
■ Retransmitting any unacknowledged data 16
9/27/2024

• The transport layer of the sending host tracks all the data pieces for
each conversation and retransmits any data that the receiving host did
not acknowledge.

• These reliability processes place additional overhead on the network


resources because of the acknowledgment, tracking, and
retransmission.

• To support these reliability operations, more control data


is exchanged between the sending and receiving hosts. This control
information is contained in the Layer 4 header.
17
9/27/2024

TCP and UDP


The two most common
transport layer protocols of
the TCP/IP protocol suite are
Transmission Control
Protocol (TCP) and User
Datagram Protocol (UDP).

18
9/27/2024

User Datagram Protocol


(UDP)
UDP is a simple, connectionless protocol

It has the advantage of providing low-overhead data delivery.

The segments of communication in UDP are called datagrams. UDP sends


datagrams as “best effort.”

Applications that use UDP include

■ Domain Name System (DNS)

■ Video streaming

■ Voice over IP (VoIP) 19


9/27/2024

UDP Header
20
9/27/2024

Transmission Control Protocol (TCP)


TCP is a connection-oriented protocol
Additional functions specified by TCP are same-
order delivery, reliable delivery, and flow control.

Each TCP segment has 20 bytes of overhead in


the header encapsulating the application layer
data, whereas each UDP segment has only 8
bytes of overhead.

The following applications use TCP:


■ Web browsers
■ E-mail
■ File transfers
21
9/27/2024

Port Addressing
Identifying the Conversations

• The header of each segment or datagram contains a source and destination port.

• Port numbers are assigned in various ways, depending on whether the message is a
request or a response.

• The transport layer keeps track of this port and the application that initiated the
request so that when a response is returned, it can be forwarded to the correct
application.

• The requesting application port number is used as the destination port number in the
response coming back from the server.

22
9/27/2024

Socket
The combination of the transport layer port
number and the network layer IP address
assigned to the host uniquely identifies a
particular process running on a specific host
device. This combination is called a socket.

For example, an HTTP web page request being


sent to a web server (port 80) running on a host
with a Layer 3 IPv4 address of 192.168.1.20
would be destined to socket 192.168.1.20:80.

23
9/27/2024

24
9/27/2024

Port Addressing Types


and Tools
• Port Addressing Types and Tools The Internet
Assigned Numbers Authority (IANA) assigns port
numbers.
• IANA is a standards body that is responsible for
assigning various addressing standards.
The different types of port numbers are
■ Well-known ports (numbers 0 to 1023)
■ Registered ports (numbers 1024 to 49151)
■ Dynamic or private ports (numbers 49152 to
65535)
25
9/27/2024

Well-Known Ports
• Well-known ports (numbers 0
to 1023) are reserved for
services and applications.

• They are commonly used for


applications such as HTTP
(web server), POP3/SMTP (e-
mail server), and Telnet.

26
9/27/2024

Registered Ports
• Registered ports (numbers
1024 to 49151) are
assigned to user processes
or applications.
• These processes are
primarily individual
applications that a user has
chosen to install

27
9/27/2024

Dynamic or Private Ports


• Dynamic or private ports (numbers 49152 to 65535), also
known as ephemeral ports, are usually assigned
dynamically to client applications when initiating a
connection.

• It is not common for a client to connect to a service using


dynamic or private ports (although some peer-to-peer file-
sharing programs do).

28
9/27/2024

Using Both
TCP and UDP

• Some applications can use both TCP and UDP.

For example, the low overhead of UDP enables


DNS to serve many client requests very quickly.
Sometimes, however, sending the requested
information can require the reliability of TCP.
In this case, both protocols use the well-known
port number of 53
29
9/27/2024

30
9/27/2024

netstat
Command
• The netstat command is an important
network utility that you can use to verify
those connections.

• netstat lists the protocol in use, the


local address and port number, the
destination address and port number,
and the state of the connection.
31
9/27/2024

32
9/27/2024

Segmentation and Reassembly: Divide and


Conquer
• Sending all this data in one large piece would be impractical.
• A large piece of data could take minutes or even hours to send, and no other
network traffic could be transmitted at the same time. In addition, if errors
occurred during the transmission, the entire data file would be lost or would
have to be re-sent.
• Dividing application data into segments both ensures that data is transmitted
within the limits of the media and that data from different applications can be
multiplexed onto the media.
• The size of the segment varies depending on the networking technology and
specific physical medium in use. 33
9/27/2024

• TCP and UDP handle segmentation differently.


• In TCP, each segment header contains a sequence number. This sequence
number allows the transport layer functions on the destination host to reassemble
segments in the order in which they were transmitted.
• UDP also track the conversations between applications, they are not concerned
with the order in which the information was transmitted or in maintaining a
connection.
• The UDP header does not include a sequence number.
• UDP is a simpler design and generates less overhead than TCP, resulting in a
faster transfer of data.
• Data might not arrive in the order in which it was sent.

34
9/27/2024

TCP: • TCP is often referred to as a


connection-oriented protocol, a
Communicating protocol that guarantees reliable
with Reliability and in-order delivery of data from
sender to receiver.
35
9/27/2024

Making Conversations Reliable


• TCP is often referred to as a connection-
oriented protocol
• A protocol that guarantees reliable and in-
order delivery of data from sender to
receiver.
• The transport layer initiates a process to
create a connection with the destination.
• This connection enables the tracking of a
session
• A complete TCP conversation requires the
establishment of a session between the
hosts in both directions. 36
9/27/2024

Overhead in TCP
• After a session has been established, the destination
sends acknowledgments to the source for the segments
that it receives.

• Part of the additional overhead of using TCP is the


network traffic generated by acknowledgments and
retransmissions.

• The establishment of the sessions creates overhead in


the form of additional segments being exchanged
37
9/27/2024

TCP Server Processes

• Each application process running on the


server is configured to use a port number
• An individual server cannot have two
services assigned to the same port number
• When an active server application is
assigned to a specific port, that port is
considered to be “open” on the server
• It is common for a server to provide more
than one service, such as a web server and
an FTP server, at the same time.
38
9/27/2024

TCP Connection Establishment


and Termination
39
9/27/2024

TCP Three-Way Handshake


• To establish the connection, the hosts perform a three-way
handshake.
• Control bits in the TCP header indicate the progress and
status of the connection.
The three-way handshake performs the following functions:
• Establishes that the destination device is present on the
network
• Verifies that the destination device has an active service and
is accepting requests on the destination port number that the
initiating client intends to use for the session
• Informs the destination device that the source client intends
to establish a communication session on that port number

40
9/27/2024

In TCP connections, the host serving as a client initiates the session to the server. The
three steps in TCP connection establishment are as follows:
1. The initiating client sends a segment containing an initial sequence value, which
serves as a request to the server to begin a communications session.
2. The server responds with a segment containing an acknowledgment value equal to
the received sequence value plus 1, plus its own synchronizing sequence value.
The acknowledgment value is 1 greater than the sequence number because there
is no data contained to be acknowledged. This acknowledgment value enables the
client to tie the response back to the original segment that it sent to the server.
3. The initiating client responds with an acknowledgment value equal to the sequence
value it received plus 1. This completes the process of establishing the connection.

41
9/27/2024

SAMPLE FOOTER TEXT 42


9/27/2024

Within the TCP segment header, the following six 1-bit fields contain control
information used to manage the TCP processes:
• URG: Urgent pointer field significant
• ACK: Acknowledgment field significant
• PSH: Push function
• RST: Reset the connection
• SYN: Synchronize sequence numbers ■ FIN: No more data from sender
These fields are referred to as flags, because the value of one of these fields
is only 1 bit and, therefore, has only two values: 1 or 0. When a bit value is
set to 1, it indicates what control information is contained in the segment.
43
9/27/2024

TCP Session Termination

• To close a connection, the FIN control flag in the segment header must be
set.
1. When the client has no more data to send in the stream, it sends a
segment with the FIN flag set.
2. The server sends an ACK to acknowledge the receipt of the FIN to
terminate the session from client to server.
3. The server sends a FIN to the client, to terminate the server-to-client
session.
4. The client responds with an ACK to acknowledge the FIN from the server.
44
9/27/2024

45
9/27/2024

TCP Acknowledgment with Windowing


• One of TCP’s functions is to make sure that each segment reaches
its destination
• The segment header sequence number and acknowledgment
number are used together to confirm receipt of the bytes
• The sequence number indicates the relative number of bytes that
have been transmitted in this session
• TCP uses the acknowledgment number in segments sent back to the
source to indicate the next byte in this session that the receiver
expects to receive. This is called expectational acknowledgment.
46
9/27/2024

47
9/27/2024

• The amount of data that a source can transmit before an


acknowledgment must be received is called the window size.
• Window size is a field in the TCP header that enables the
management of lost data and flow control.

48
9/27/2024

TCP Retransmission
• TCP provides methods of managing segment losses, including a
mechanism to retransmit segments with unacknowledged data.

• If one or more segments are missing, only the data in the segments that
complete the stream is acknowledged.

• Hosts today can also employ an optional feature called selective


acknowledgments.
• If both hosts support selective acknowledgments, it is possible for the destination
to acknowledge bytes in noncontiguous segments, and the host would only need
to retransmit the missing data.
49
9/27/2024

TCP Congestion Control: Minimizing


Segment Loss

TCP provides congestion control through


• Flow control
• Dynamic window sizes.

50
9/27/2024

Flow Control
• Flow control assists the reliability of TCP transmission by adjusting
the rate of data flow between the two services in the session.
• The TCP feedback mechanism adjusts the effective rate of data
transmission to the maximum flow that the network and destination
device can support without loss.
• TCP attempts to manage the rate of transmission so that all data will
be received, and retransmissions will be minimized.
• During the delay in receiving the acknowledgment, the sender will not
send additional segments for this session.
51
9/27/2024

52
9/27/2024

Dynamic Window Sizes


• The window size field in the TCP header specifies the amount of
data that can be transmitted before an acknowledgment must be
received.

• Another way to control the data flow is to use dynamic window


sizes.

• When network resources are constrained, TCP can reduce the


window size to require that received segments be acknowledged
more frequently.

• The TCP receiving host sends the window size value to the
sending TCP to indicate the number of bytes that it is prepared to
receive

• If the destination needs to slow the rate of communication, it can


send a smaller window size value to the source as part of an
acknowledgment.
53
9/27/2024

54
9/27/2024

• After periods of transmission with no data losses or constrained


resources, the receiver will begin to increase the window size field.
• This reduces the overhead on the network because fewer
acknowledgments need to be sent.
• Window size will continue to increase until data loss occurs, which will
cause the window size to be decreased.
• This dynamic increasing and decreasing of window size is a continuous
process in TCP, which determines the optimum window size for each
TCP session.
• In highly efficient networks, window sizes can become very large
because data is not being lost.
55
9/27/2024

UDP:
Communicating with
Low Overhead
UDP is a simple protocol that
provides the basic transport
layer functions.
It has much lower overhead
than TCP, because it is not
connection oriented and does
not provide retransmission,
sequencing, and flow control
mechanisms.

56
9/27/2024

UDP: Low
Overhead Versus
Reliability
• Applications that use UDP are not
always unreliable.
• Using UDP simply means that
reliability is not provided by the
transport layer protocol
• Some applications, such as online
games or VoIP, can tolerate loss of
some data.
57
9/27/2024

UDP Datagram Reassembly

• Many applications that use UDP send small


amounts of data that can fit in one segment.
• When multiple datagrams are sent to a
destination, they can take different paths
and arrive in the wrong order
• UDP has no way to reorder the datagrams
into their transmission order.
• UDP simply reassembles the data in the
order that it was received and forwards it to
the application
58
9/27/2024

UDP Server Processes and Requests


• UDP-based server applications are assigned well-known or
registered port numbers.
• When these applications or processes are running, they will
accept the data matched with the assigned port number.
• When UDP receives a datagram destined for one of these
ports, it forwards the application data to the appropriate
application based on its port number.

59
9/27/2024

UDP Client Processes


• The UDP client process randomly selects
a port number from the dynamic range of
port numbers.

• The destination port will usually be the


well-known or registered port number

• Because UDP does not create a session,


as soon as the data is ready to be sent
and the ports are identified, UDP can form
the datagram and pass it to the network
layer to be addressed and sent on the
network. 60
9/27/2024

61
9/27/2024

62

You might also like