0% found this document useful (0 votes)
2 views

data com ch4.3 (1)

Chapter 4 Part 3 of the ECEG-4191 course focuses on the Transport Layer, detailing its functions such as process-to-process delivery, error control, flow control, and connection management. It compares connection-oriented protocols like TCP, which ensures reliable delivery, with connectionless protocols like UDP, which is simpler but less reliable. The chapter also discusses transport layer addressing, including the use of port numbers for service-point addressing, and highlights the applications of both TCP and UDP in data communication.

Uploaded by

gedionworku32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

data com ch4.3 (1)

Chapter 4 Part 3 of the ECEG-4191 course focuses on the Transport Layer, detailing its functions such as process-to-process delivery, error control, flow control, and connection management. It compares connection-oriented protocols like TCP, which ensures reliable delivery, with connectionless protocols like UDP, which is simpler but less reliable. The chapter also discusses transport layer addressing, including the use of port numbers for service-point addressing, and highlights the applications of both TCP and UDP in data communication.

Uploaded by

gedionworku32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

College of Engineering

Electrical and Computer Engineering Department


Data Communication and Computer Networks
(ECEG-4191)
Chapter 4 Part 3
Transport Layer

15 maggio 2025
Outline
Overview of the Transport Layer
protocols
 Introduction
 Sequencing,
 multiplexing,
 reliable delivery,
 congestion control,
 TCP & UDP

15 maggio 2025 Data com by Eng. Matios


Z.
Introduction……..………………………………………..1
Transport layer is responsible for process-to-
process delivery of the entire message.
A process is an application program running on
a host.
Whereas the network layer oversees source-to-
destination delivery of individual packets, it
does not recognize any relationship between
those packets.
The network layer treats each packet
independently, as though each piece belonged
to a separate message, whether it does.
The transport layer, on the other hand, ensures
3
that the whole message arrives intact and in
order,
15 maggio 2025 overseeing both error control and
Data com flow
by Eng. Matios Z.
Introduction……..………………………………………..2

Major function of the transport layer


The Transport layer encompasses these
functions:
1. Enables multiple applications to
communicate over the network at the
same time on a single device.
2. Ensures that, all the data is received
reliably and in order by the correct
application.
3. Employs error handling mechanisms
4

15 maggio 2025 Data com by Eng. Matios Z.


Introduction……..………………………………………..3

15 maggio 2025 Data com by Eng. Matios Z.


Introduction……..………………………………………..4
Responsibilities of the transport layer
• Service-point addressing:- Computers often
run several programs at the same time. For
this reason, source-to-destination delivery
means delivery not only from one computer to
the next but also from a specific process
(running program) on one computer to a
specific process on the other.
 The transport layer header must therefore
include a type of address called a service-
point address (or port address).
 The network layer gets each packet to the
6 correct computer; the transport layer gets
the entire message to the correct
15 maggio 2025 process
Data com by Eng. Matios Z.
on that computer.
Introduction……..………………………………………..5
Segmentation and reassembly
A message is divided into transmittable
segments, with each segment containing a
sequence number.
 These numbers enable the transport layer
to reassemble the message correctly
upon arriving at the destination and to
identify and replace packets that were
lost in transmission.
Flow control
Like the data link layer, the transport layer is
responsible for flow control.
7
 However, flow control at this layer is Z.
15 maggio 2025 Data com by Eng. Matios
performed end to end rather than across a
Introduction……..………………………………………..6
Error control
Like the data link layer, the transport layer is
responsible for error control.
 However, error control at this layer is
performed process-to-process rather than
across a single link.
 The sending transport layer makes sure
that the entire message arrives at the
receiving transport layer without error
(damage, loss, or duplication).
 Error correction is usually achieved
through retransmission.
8

15 maggio 2025 Data com by Eng. Matios Z.


Introduction……..………………………………………..7
Connection control
The transport layer can be either
connectionless or connection-oriented.
 Connectionless transport layer treats each
segment as an independent packet and
delivers it to the transport layer at the
destination machine.
 Connection-oriented transport layer makes
a connection with the transport layer at
the destination machine first before
delivering the packets. After all the data
are transferred, the connection is
9 terminated.
15 maggio 2025 Data com by Eng. Matios Z.
Introduction……..………………………………………..8
Process to process delivery
As a revision, the data link layer is responsible
for delivery of frames between two
neighboring nodes over a link. This is called
node-to-node delivery.
The network layer is responsible for delivery of
datagrams between two hosts. This is called
host-to-host delivery.
Communication on the Internet is not defined
as the exchange of data between two nodes or
between two hosts.
Real communication takes place between two
1
0 processes or application programs. We
need
15 maggio 2025 process-to-process delivery.
Data com by Eng. Matios Z.
Introduction……..………………………………………..9
However, at any moment, several processes
may be running on the source host and several
on the destination host.
To complete the delivery, we need a
mechanism to deliver data from one of these
processes running on the source host to the
corresponding process running on the
destination host.
The transport layer is responsible for process-
to-process delivery; the delivery of a packet,
part of a message, from one process to
another.
1  Two processes communicate in a
1
client/server
15 maggio 2025 relationship. Data com by Eng. Matios Z.
Transport Layer Addressing ..…………………………..1
Whenever we need to deliver something to one
specific destination among many, we need an
address.
At the data link layer, we need a MAC address
to choose one node among several nodes if the
connection is not point-to-point.
 A frame in the data link layer needs a
destination MAC address for delivery and a
source address for the next node's reply.
At the network layer, we need an IP address to
choose one host among millions.
 A datagram in the network layer needs a
1
2 destination IP address for delivery and a
source IP address for the destination's
15 maggio 2025 reply.
Data com by Eng. Matios Z.
Transport Layer Addressing ..…………………………..2
At the transport layer, we need a transport
layer address, called a port number, to
choose among multiple processes running on
the destination host.
 The destination port number is needed for
delivery; the source port number is
needed for the reply.
 In the Internet model, the port numbers
are 16-bit integers between 0 and 65,535.
 The client program defines itself with a
port number, chosen randomly by the
transport layer software running on the
13 client host. This is the ephemeral
(temporal) port number.
15 maggio 2025 Data com by Eng. Matios Z.
Transport Layer Addressing ..…………………………..3
The server process must also define itself
with a port number.
 This number, however, can’t be
port
chosen randomly.
 If the computer at the server site runs a
server process and assigns a random number
as the port number, the process at the client
site that wants to access that server and use
its services will not know the port
number.
 Of course, one solution would be to send a
special packet and request the port number
of a specific server, but this requires more
overhead.
1
4  The Internet has decided to use universal
15 maggio 2025
port numbers for servers; theseData com by Eng. Matios Z.
are called
Transport Layer Addressing ..…………………………..4
Internet Assigned Number Authority (IANA)
Ranges
 There are some exceptions to this rule; for
example, there are clients that are assigned well-
known port numbers. Every client process knows
the well-known port number of the corresponding
server process.
 Well-known ports: the ports ranging from 0 to
1023 are assigned and controlled by IANA. These
are the well-known ports.
 Registered ports: the ports ranging from 1024 to
49,151 are not assigned or controlled by IANA.
They can only be registered with IANA to prevent
1 duplication.
5
 Dynamic
15 maggio 2025 ports: the ports ranging from
Data49,152
com by Eng.to
Matios Z.
Transport Layer Addressing ..…………………………..5
Socket Addresses
 Process-to-process delivery needs two identifiers,
IP address and the port number, at each end to
make a connection. The combination of an IP
address and a port number is called a socket
address.
 The client socket address defines the client
process uniquely just as the server socket
address defines the server process uniquely.
 A transport layer protocol needs a pair of socket
addresses: the client socket address and the
server socket address.
 These four pieces of information are part of the IP
1
6 header and the transport layer protocol header.
The
15 maggio 2025IP header contains the IP addresses; the
Data com UDP
by Eng. Matios Z.
Transport Layer connection .……………………………..1
Connectionless Versus Connection-
Oriented Service
A transport layer protocol can either be
connectionless or connection-oriented.
Connectionless Service
In a connectionless service, the packets are
sent from one party to another with no need
for connection establishment or connection
release.
The packets are not numbered; they may be
delayed or lost or may arrive out of
sequence. There is no acknowledgment
1
7 either.
15 maggio 2025 Data com by Eng. Matios Z.
UDP is connectionless.
Transport Layer connection .……………………………..2
Connection Oriented Service
 In a connection-oriented service, a
connection is first established between the
sender and the receiver.
 Data are transferred. At the end, the
connection is released.
 TCP and SCTP are connection-oriented
protocols.
Reliable versus unreliable
The transport layer service can be reliable or
unreliable.
1 If the application layer program needs
8
reliability,
15 maggio 2025 we use a reliable transport layer
Data com by Eng. Matios Z.
Transport Layer connection .……………………………..3
On the other hand, if the application program
does not need reliability because it uses its
own flow and error control mechanism or it
needs fast service or the nature of the service
does not demand flow and error control (real-
time applications), then an unreliable protocol
can be used.
On the Internet, there are two common
different transport layer protocols, as we have
already mentioned. UDP is connectionless and
unreliable; TCP and SCTP are connection-
oriented and reliable protocols.
These three can respond to the demands of the
19
application layer programs.
15 maggio 2025 Data com by Eng. Matios Z.
User Datagram protocol (UDP) ...………………………..1
The User Datagram Protocol (UDP) is called a
connectionless, unreliable transport protocol.
 It does not add anything to the services of
IP except to provide process-to-process
communication.
Also, it performs very limited error checking. If
UDP is so powerless, why would a process want
to use it?
With the disadvantages come some
advantages. 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
2 can use UDP.
0
 Sending a small message by using UDP
15 maggio 2025 Data com by Eng. Matios Z.
takes much less interaction between the
User Datagram protocol (UDP) ...………………………..2
UDP packets, called user datagrams, have a
fixed-size header of 8 bytes.
Source port number: This is the port number
used by the process running on the source
host.
Destination port number: This is the port
number used by the process running on the
destination host.
Length: This is a 16-bit field that defines the
total length of the user datagram, header plus
data.

2
1
15 maggio 2025 Data com by Eng. Matios Z.
User Datagram protocol (UDP) ...………………………..3
UDP does not perform:
 Flow control
 Error control
 Connection control
 UDP is not capable of segmenting and
reassembling frames and does not
implement sequence numbers
All these functions are done by the
processes (application layer programs)
using TCP. But UDP, like TCP, performs:
Service point addressing
UDP can transmit only small portions of
2 data at a time because it is not capable of
2
segmenting and reassembling frames
15 maggio 2025
and
Data com by Eng. Matios Z.
does not implement sequence numbers
User Datagram protocol (UDP) ...………………………..4
Application of UDP
1. UDP is suitable for a process that requires simple
request-response communication with little
concern for flow and error control. It is not usually
used for a process such as FTP that needs to send
bulk data.
2. 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. It can easily use
UDP.
3. UDP is a suitable transport protocol for
multicasting. Multicasting capability is embedded
2
in the UDP software but not in the TCP software.
3
4. UDP
15 maggio is used for management processes
2025 Data comsuch as Z.
by Eng. Matios
SNMP and used for some route updating protocols
Transmission Control protocol (TCP) ...……..…………..1
Transmission Control Protocol
TCP is a process-to-process transmission
protocol.
TCP, uses port numbers and unlike UDP, TCP is
a connection-oriented protocol; it creates a
virtual connection between two TCPs to send
data.
In addition, TCP uses flow and error control
mechanisms at the transport level.
In brief, TCP is called a connection-oriented,
reliable transport protocol.
2
It adds connection oriented, and reliability
4
features to the services of IP.
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..2
TCP Services
1. Process-to-Process
2. Stream Delivery Service
3. Full-Duplex Communication
4. Connection-Oriented Service
5. Reliable Service
Stream delivery service
TCP, unlike UDP, is a stream-oriented
protocol.
In UDP, a process (an application program)
sends messages, with predefined boundaries,
2 to UDP for delivery.
5
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..3
UDP adds its own header to each of these
messages and delivers them to IP for
transmission.
Each message from the process is called a
user datagram and becomes, eventually, one
IP datagram.
Neither IP nor UDP recognizes any relationship
between the datagrams.
Each application using UDP must send small
data to fit into one user datagram as it is. (UDP
does not segment/reassemble)
TCP, on the other hand, allows the sending
2
6 process to deliver data as a stream of bytes
and
15 maggio 2025allows the receiving process to Data
obtain data
com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..4
TCP creates an environment in which the two
processes seem to be connected by an
imaginary "tube” that carries their data across
the Internet.
The sending process produces (writes to) the
stream of bytes, and the receiving process
consumes (reads from) them.

2
7
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..5
Sending and Receiving Buffers
Because the sending and the receiving
processes may not write or read data at the
same speed, TCP needs buffers for storage.
There are two buffers, the sending buffer and
the receiving buffer, one for each direction.
One way to implement a buffer is to use a
circular array of 1-byte locations. For simplicity,
we have shown two buffers of 20 bytes each in
example next slide; normally the buffers are
hundreds or thousands of bytes, depending on
the implementation.
2 We also show the buffers as the same size,
8
which
15 maggio 2025 is not always the case. Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..6
Sending and receiving buffers

2
9
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………..7
Segment
 TCP, Although buffering handles the disparity
between the speed of the processes, we need one
more step before we can send data.
 The IP layer, as a service provider for TCP, needs
to send data in packets, not as the transport layer,
TCP groups several bytes together into segment.
 TCP adds a header to each segment (for control
purposes) and delivers the segment to the IP layer
for transmission. The segments are encapsulated
in IP datagrams and transmitted.
 This entire operation is transparent to the
receiving process. Later we will see that segments
may be received out of order, lost, or corrupted
3 and resent.
0
 All these are handled by TCP with the receiving
15 maggio 2025 Data com by Eng. Matios Z.
process unaware of any activities.
Transmission Control protocol (TCP) ...……..…………..8
Full-Duplex communication
TCP offers full-duplex service, in which data can
flow in both directions at the same time.
Each TCP then has a sending and receiving
buffer, and segments move in both directions.
Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented
protocol.
When a process at site A wants to send and
receive data from another process at site B, the
following occurs:
1. The two TCPs establish a connection

3
between them.
1
2. Data are exchanged in bothData com by Eng. Matios Z.
15 maggio 2025
Transmission Control protocol (TCP) ...……..…………..9
Note that this is a virtual connection, not a
physical connection.
The TCP segment is encapsulated in an IP
datagram and can be sent out of order, or
lost, or corrupted, and then resent.
Each may use a different path to reach the
destination. There is no physical
connection.
TCP creates a stream-oriented environment
in which it accepts the responsibility of
delivering the bytes in order to the other
3 site.
2
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………10
TCP Segment Numbering System
Byte Number. TCP numbers all data bytes that
are transmitted in a connection.
 Numbering is independent in each direction.
When TCP receives bytes of data from a
process, it stores them in the sending buffer
and numbers them.
 The numbering does not necessarily start from
0. Instead, TCP generates a random number
between 0 and 232 - 1 for the number of the
first byte.
 For example, if the random number happens
to be 1057 and the total data to be sent are
3
6000 bytes, the bytes are numbered from
3 1057 to 7056.
15 maggio2025 Data com by Eng. Matios Z.
Byte numbering is used for flow and error
Transmission Control protocol (TCP) ...……..…………11
Sequence Number. After the bytes have been
numbered, TCP assigns a sequence number to
each segment that is being sent.
 The sequence number for each segment is
the number of the first byte carried in
that segment.
Example: Suppose a TCP connection is
transferring a file of 8000 bytes. The first byte
is numbered 10,001. What are the sequence
numbers for each segment if data are sent in
four segments, each carrying 2000 bytes?
 Solution: The following shows the sequence number for
each segment:
3
4  Segment 1 Sequence Number: 10,001 (range: 10,001
15 maggio 2025
to 12,000) Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………12
Acknowledgment Number: communication in
TCP is full duplex; when a connection is
established, both parties can send and receive
data at the same time.
Each party numbers the bytes, usually with a
different starting byte number since it is
randomly selected.
The sequence number in each direction shows
the number of the first byte carried by the
segment.
Each party also uses an acknowledgment
number to confirm the bytes it has received.
3
5
However, the acknowledgment number defines
the
15 maggio 2025number of the next byte that theby Eng.
Data com partyMatios Z.
Transmission Control protocol (TCP) ...……..…………13
In addition, the acknowledgment number is
cumulative, which means that the party takes
the number of the last byte that it has
received, safe and sound, adds 1 to it,
and announces this sum as the
acknowledgment number.
The term cumulative here means that if a party
uses 5643 as an acknowledgment number, it
has received all bytes from the beginning up to
5642.
 Note that this does not mean that the
party has received 5642 bytes because the
3
first byte number might not have to start
6 from 0.
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………14
Three-way handshaking in connection
establishment
 The connection establishment in TCP is called
three-way handshaking. An application program,
called the client, wants to make a connection with
another application program, called the server,
using TCP as the transport layer protocol.
 The process starts with the server. The server
program tells its TCP that it is ready to accept a
connection. This is called a request for a passive
open. Although the server TCP is ready to accept
any connection from any machine in the world, it
cannot make the connection itself.
 The client program issues a request for an active
3
7 open. A client that wishes to connect to an open
15 maggio 2025 Data com by Eng. Matios Z.
server tells its TCP that it needs to be connected to
Transmission Control protocol (TCP) ...……..…………15
 To show the process, we use two timelines: Each
segment has values for all its header fields and
perhaps for some of its option fields, to. However,
we show only the few fields necessary to
understand each phase.

3
8
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………16
 The three steps in this phase are as follows
1. The client sends the first segment, a SYN segment, in
which only the SYN flag is set. This segment is for
synchronization of sequence numbers. It consumes one
sequence number. When the data transfer starts, the
sequence number is incremented by 1. We can say that
the SYN segment carries no real data, but we can think
of it as containing 1 imaginary byte.
2. The server sends the second segment, a SYN +ACK
segment, with 2 flag bits set: SYN and ACK. This
segment has a dual purpose. It is a SYN segment for
communication in the other direction and serves as the
acknowledgment for the SYN segment. It consumes one
sequence number.
3. The client sends the third segment. This is just an ACK
3
9 segment. It acknowledges the receipt of the second
15 maggiosegment
2025 with the ACK flag and acknowledgment
Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………17
Data transfer
 After connection is established, bidirectional data
transfer can take place. Both send data and
acknowledgments. Data and acknowledgment
traveling in the same direction are carried on the
same segment.
 The acknowledgment is piggybacked with the
data. In the example next slide, after connection is
established (not shown in the figure), the client
sends 2000 bytes of data in two segments. The
server then sends 2000 bytes in one segment. The
client sends one more segment. The first three
segments carry both data and acknowledgment,
but the last segment carries only an
4
0 acknowledgment because there are no more data
to 2025
15 maggio be sent. Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………18
 Any of the two parties involved in exchanging data
(client or server) can close the connection, although
it is usually initiated by the client.

4
1
15 maggio 2025 Data com by Eng. Matios Z.
Transmission Control protocol (TCP) ...……..…………19
 Three-way handshaking in connection termination

1.In a normal situation, the client TCP, after receiving a close


command from the client process, sends the first segment, a
FIN segment in which the FIN flag is set. Note that a FIN
segment can include the last chunk of data sent by the
client, or it can be just a control segment. If it is only a
control segment, it consumes only one sequence number.
2.The server TCP, after receiving the FIN segment, informs its
process of the situation and sends the second segment, a FIN
+ACK segment, to confirm the receipt of the FIN segment
from the client and at the same time to announce the closing
of the connection in the other direction. This segment can
also contain the last chunk of data from the server. If it does
not carry data, it consumes only one sequence number.
3.The client TCP sends the last segment, an ACK segment, to
4 confirm the receipt of the FIN segment from the TCP server.
2
This segment contains the acknowledgment number, which is
15 maggio 2025 Data com by Eng. Matios Z.
1 plus the sequence number received in the FIN segment
Transmission Control protocol (TCP) ...……..…………20
 Three-way handshaking for conation termination

4
3
15 maggio 2025 Data com by Eng. Matios Z.
44 28-Mar-22

You might also like