0% found this document useful (0 votes)
7 views38 pages

Transport Layer Protocols Overview

Chapter IV discusses the transport layer, its services, and key elements of transport protocols, including reliable data transfer with TCP and connectionless transport using UDP. It covers aspects such as process-to-process communication, flow control, error control, and congestion control mechanisms. The chapter emphasizes the importance of reliability in data transfer and the complexities involved in managing network congestion.

Uploaded by

Roba Shelema
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)
7 views38 pages

Transport Layer Protocols Overview

Chapter IV discusses the transport layer, its services, and key elements of transport protocols, including reliable data transfer with TCP and connectionless transport using UDP. It covers aspects such as process-to-process communication, flow control, error control, and congestion control mechanisms. The chapter emphasizes the importance of reliability in data transfer and the complexities involved in managing network congestion.

Uploaded by

Roba Shelema
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

Chapter IV

Transport Layer
2 Contents

 Transport layer and its service


 Elements of Transport Protocols
 Reliable Data Transfer: TCP
 Connectionless Transport: UDP
 Congestion Control

Ayuyazi 3/26/2023
3

Ayuyazi 3/26/2023
4 Transport Layer and its services
 The transport protocol provides an end-to-end
(process-to-process) data transfer service that
shields upper-layer protocols from the details of the
intervening network or networks.
 A transport protocol can be either connection
oriented or connectionless.
 If the underlying network or internetwork service is
unreliable (i.e. IP), then a reliable connection-
oriented transport protocol becomes quite complex.
 The basic cause of this complexity is the need to
deal with the relatively large and variable delays
Ayuyazi 3/26/2023
5 Transport Layer cont…..

Ayuyazi 3/26/2023
6 Elements of Transport Protocols
Process to Process communication
 The first duty of a transport-layer protocol is to
provide process-to-process communication. A
process is an application-layer entity that uses the
services of the transport layer.
 A transport-layer protocol is responsible for delivery
of the message to the appropriate process.

Ayuyazi 3/26/2023
Elements of Transport Protocols cont….
7
Addressing: Port Numbers
 For the purpose of process to process communication,
we must define the local host, local process, remote
host, and remote process.
 The local host and the remote host are defined using
IP addresses. To define the processes, we need second
identifiers, called port numbers.
 The client program and the server process define their
own port number (mostly temporary and permanent
respectively).

Ayuyazi 3/26/2023
8
Elements of Transport Protocols cont…
Multiplexing/demultiplexing
 With respect to the interface between the transport
protocol and higher-level protocols, the transport
protocol performs a multiplexing/demultiplexing
function.
 The transport layer at the source performs
multiplexing; the transport layer at the destination
performs demultiplexing.
 That is, multiple users employ the same transport
protocol and are distinguished by port numbers or
service access points.
Ayuyazi 3/26/2023

 The transport entity may also perform a


9 Elements of Transport Protocols cont…
Flow Control
 Whenever an entity produces items and another entity
consumes them, there should be a balance between
production and consumption rates.
 If the sender delivers items whenever they are produced
without a prior request from the consumer the delivery is
referred to as pushing. If the producer delivers the items after
the consumer has requested them, the delivery is referred to
as pulling.

Ayuyazi 3/26/2023
10
Elements of Transport Protocols cont…
 In communication at the transport layer, we are
dealing with four entities: sender process, sender
transport layer, receiver transport layer, and
receiver process.
 We need at least two cases of flow control: from the
sending transport layer to the sending application
layer and from the receiving transport layer to the
sending transport layer.

Ayuyazi 3/26/2023
11
Elements of Transport Protocols cont…
Error Control
 In the Internet, since the underlying network layer
(IP) is unreliable, we need to make the transport
layer reliable if the application requires reliability.
 Reliability can be achieved to add error control
services to the transport layer. Error control at the
transport layer is responsible for
1. Detecting and discarding corrupted packets.
2. Keeping track of lost and discarded packets and
resending them.
3. Recognizing duplicate packets and discarding
Ayuyazi 3/26/2023
12
Elements of Transport Protocols cont…
Congestion Control
 Congestion in a network may occur if the load on
the network, the number of packets sent to the
network, is greater than the capacity of the
network the number of packets a network can
handle. Congestion happens in any system that
involves waiting (on road traffic).
 Congestion control refers to the mechanisms and
techniques that control the congestion and keep the
load below the capacity.
 Congestion in a network occurs because routers and
switches have queues. If a router cannot process the
Ayuyazi 3/26/2023
13 Transport Layer Protocols

Ayuyazi 3/26/2023
Reliable Data Transfer: TCP
14
 TCP is designed to provide reliable communication between
pairs of processes (TCP users) across a variety of reliable
and unreliable networks and internets.
 TCP explicitly defines connection establishment, data
transfer, and connection teardown phases to provide a
connection-oriented service.
 To achieve this goal, TCP uses checksum, retransmission of
lost or corrupted pa c k e t s , c u m u la t i v e a nd s e le c t i v e
acknowledgments, and timers.
 TCP provides two useful facilities for labeling data: push and
urgent:
 Da t a s t r e a m p u s h : O r d i n a r i l y , T C P d e c i d e s w h e n
sufficient data have accumulated to form a segment for
Ayuyazi 3/26/2023

transmission. The TCP user can require TCP to transmit


TCP cont….
15
TCP header

Ayuyazi 3/26/2023
TCP header description
16  Source (destination) port address: this is a 16-bit field that
defines the port number of the application program in the
source (destination) hosts.
 Sequence number: this 32-bits field defines the number assigned
to the first byte of data contained in this segment.
 Acknowledgment number: this 32-bit field defines the byte
number that the receiver of the segment is expecting to receive
from the other party. If the receiver of the segment has
successfully received byte number x from the other party, it
returns x + 1 as the acknowledgment number (sometimes the
acknowledgment and data can be piggybacked together).
 Header length: this 4-bit field indicates the number of 4-byte
words in the TCP header (the value of this field is always
between 5 (5 × 4 = 20) and 15 (15 × 4 = 60)).
Ayuyazi 3/26/2023

 Control: this field defines 6 different control bits or flags. These bits (URG:
TCP cont….
17

Ayuyazi 3/26/2023
Description of Abbreviation on State-chart Diagram
18
State Description
CLOSED No connection exists
LISTEN Passive open received; waiting for
SYN
SYN-SENT SYN sent; waiting for ACK
SYN-RCVD SYN + ACK sent; waiting for ACK
ESTABLISHE Connection established; data
D transfer in progress
FIN-WAIT-1 First FIN sent; waiting for ACK
FIN-WAIT-2 ACK to first FIN received; waiting
for second FIN
C L O S E - First FIN received, ACK sent; waiting
WAIT
Ayuyazi
for application to close 3/26/2023
TCP cont…..
19 TCP Mechanisms
 We can group TCP mechanisms into the categories
of connection establishment, data transfer, and
connection termination.
 Connection Establishment in TCP always uses a
three-way handshake. When the SYN flag is set, the
segment is essentially a request for connection and
functions.
 To initiate a connection, an entity sends a SYN, SN
=X where X is the initial sequence number. The
receiver responds with SYN, SN= Y, AN=X+1 by
setting both the SYN and ACK flags. 3/26/2023
Ayuyazi

 The acknowledgment indicates that the receiver is


20 TCP cont…..
Data Transfer
 Although data are transferred in segments over
a transport connection, data transfer is viewed
logically as consisting of a stream of octets. Hence
every octet is numbered, modulo 232.
 Data are buffered by the transport entity on
both transmission and reception.
Connection Termination
 The normal means of terminating a connection is
a graceful close. Each TCP user must issue a
CLOSE primitive. The transport entity sets the
Ayuyazi 3/26/2023

FIN bit on the last segment that it sends out,


21 TCP cont…..
TCP Implementation Policy Options
 The TCP standard provides a precise specification of the
protocol to be used between TCP entities. The design
areas for which options are specified are the following:
 Send policy: in the absence of both pushed data and
a closed transmission window, a sending TCP entity
is free to transmit data at its own convenience.
 Deliver policy: in the absence of a Push, a receiving
TCP entity is free to deliver data at its own
convenience
 Accept policy: in order or in window
Ayuyazi 3/26/2023
22 TCP cont…..
 Send Policy: in the absence of both pushed data
and a closed transmission window, a sending
TCP entity is free to transmit data at its own
convenience, within its current credit allocation.
 As data are issued by the user, they are buffered
in the transmit buffer.
 TCP may construct a segment for each batch of
data provided by its user or it may wait until a
certain amount of data accumulates before
constructing and sending a segment.

Ayuyazi 3/26/2023
23 TCP cont…..

 Deliver Policy: in the absence of a Push, a


receiving TCP entity is free to deliver data to
the user at its own convenience.
 It may deliver data as each in-order segment
is received, or it may buffer data from a
number of segments in the receive buffer
before delivery.

Ayuyazi 3/26/2023
24
TCP cont…..
 Accept Policy When all data segments arrive in order
over a TCP connection, TCP places the data in a
receive buffer for delivery to the user.
 It is possible, however, for segments to arrive out of
order. In this case, the receiving TCP entity has two
options:
 In-order: Accept only segments that arrive in order;
otherwise discarded it.
 In-window: Accept all segments that are within the
receive window.
 The in-order policy makes for a simple
Ayuyazi 3/26/2023

implementation but places a burden on the networking


TCP cont…..
25  Retransmit Policy: the TCP specification states
that TCP will retransmit a segment if it fails to
receive an acknowledgment within a given time. A
TCP employ one of three retransmission
strategies:
 First-only: Maintain one retransmission timer
for the entire queue. If an acknowledgment is
received and reset the timer. If the timer
expires, retransmit the segment at the front of
the queue and reset the timer.
 Batch: Maintain one retransmission timer for
the entire queue. If an acknowledgment is
received and reset the timer. If the timer
Ayuyazi 3/26/2023
26 TCP cont…..
 Acknowledge Policy: when a data segment
arrives that is in sequence, the receiving TCP
entity has two options concerning the timing of
acknowledgment:
 Immediate: When data are accepted,
immediately transmit an empty (no data)
segment containing the appropriate
acknowledgment number.
 Cumulative: When data are accepted, record
the need for acknowledgment, but wait for
an outbound segment with data on which to
piggyback the acknowledgment. To avoid long
Ayuyazi 3/26/2023
27 Congestion Control
 If the transport entities on many machines send too
many packets into the network too quickly, the
network will become congested, with performance
degraded as packets are delayed and lost.
 Controlling congestion to avoid this problem is the
combined responsibility of the network and
transport layers.
 Congestion occurs at routers, so it is detected at the
network layer. However, congestion is ultimately
caused by traffic sent into the network by the
transport layer.
Ayuyazi 3/26/2023
28
Congestion Control cont…..
 Congestion has two main effects.
 First, as congestion begins to occur, the transit
time across a network or internetwork
increases.
 Second, as congestion becomes severe, network
or internet nodes drop packets.
 The TCP flow control mechanism can be used to
recognize the onset of congestion (by recognizing
increased delay times and dropped segments) and
to react by reducing the flow of data.
 If many of the TCP entities operating across a
network exercise this sort of restraint, internet
Ayuyazi 3/26/2023
29 Congestion Control cont…..
Desirable Bandwidth Allocation
Efficiency and Power:
 An efficient allocation of bandwidth across
transport entities will use all of the network
capacity that is available.
power = load/delay
 Power will initially rise with offered load, as
delay remains small and roughly constant, but
will reach a maximum and fall as delay grows
rapidly.
 The load with the highest power represents an
Ayuyazi 3/26/2023
30 Congestion Control cont…..
Max-Min Fairness
 An allocation is max-min fair if the bandwidth
given to one flow cannot be increased without
decreasing the bandwidth given to another flow
with an allocation that is no larger. That is,
increasing the bandwidth of a flow will only
make the situation worse for flows that are less
well off.
 Example:

Ayuyazi 3/26/2023
Congestion Control cont…..
31
Convergence
 A final criterion is that the congestion control algorithm
converge quickly to a fair and efficient allocation of
bandwidth.
 If the convergence is too slow, the algorithm will never
be close to the changing operating point.
 If the algorithm is not stable, it may fail to converge to
the right point in some cases, or even oscillate around
the right point.

Ayuyazi 3/26/2023
Congestion Control cont…..
32 Regulating the Sending Rate
 The sending rate may be limited by two factors.
The first is flow control, in the case that there is
insufficient buffering at the receiver.
 The second is congestion, in the case that there is
insufficient capacity in the network.

Ayuyazi 3/26/2023
Congestion Control cont…..
33
 The way that a transport protocol should regulate
the sending rate depends on the form of the
feedback returned by the network.
 Different network layers may return different kinds
of feedback. The feedback may be explicit or implicit,
and it may be precise or imprecise.
 An example of an explicit, precise design is when
routers tell the sources the rate at which they may
send.
 An explicit, imprecise design is the use of ECN
(Explicit Congestion Notification) with TCP. In this
design, routers set bits on packets that experience
congestion to warn the senders to slow down, but
Ayuyazi 3/26/2023
34 Congestion Control cont…..
Wireless Issues
 Transport protocols such as TCP that implement
congestion control should be independent of the
underlying network and link layer technologies.
 That is a good theory, but in practice there are
issues with wireless networks.
 The main issue is that packet loss is often used as
a congestion signal, including by TCP as we have
just discussed. Wireless networks lose packets all
the time due to transmission errors.
 One solution to this problem is to mask the
wireless losses by using retransmissions over the
Ayuyazi 3/26/2023

wireless link. For example, 802.11 uses a stop-


35 Congestion Control cont…..

Ayuyazi 3/26/2023
Connectionless Transport: UDP
36
 The User Datagram Protocol (UDP) is a
connectionless, unreliable transport protocol. It does
not add anything to the services of IP except for
providing process-to-process communication instead
of host-to-host communication.
 Process-to-process communication service can be
provided by UDP using socket addresses, a
combination of IP addresses and port numbers.
 UDP is a very simple protocol using a minimum of
overhead. If a process wants to send a small message
and does not care much about reliability, it can use
UDP. Ayuyazi 3/26/2023
37 UDP cont…..

 Essentially, it adds a port addressing capability to IP.


The header includes a source port and destination port.
The Length field contains the length of the entire UDP
segment, including header and data.
 The checksum is the same algorithm used for TCP and
IP. For UDP, the checksum applies to the entire UDP
segment plus a pseudo-header prefixed to the UDP
header at the time of calculation and which is the same
pseudo-header used for TCP.
Ayuyazi 3/26/2023
UDP application areas
38  The following shows some typical applications that
can benefit more from the services of UDP than
from those of TCP:
 UDP is suitable for a process that requires simple request-
response communication with little concern for flow and
error control. Example: DNS, and DHCP
 UDP is suitable for a process with internal flow and error
control mechanisms. For example, the Trivial File Transfer
Protocol (TFTP) process includes flow and error control.
 UDP is a suitable for multicasting. Multicasting capability is
embedded in the UDP software.
 UDP is used for management processes such as SNMP.
 UDP is used for some route updating protocols such as
Ayuyazi 3/26/2023

Routing Information Protocol (RIP).

You might also like