SlideShare a Scribd company logo
1 of 41
Download to read offline
PART V: TRANSPORT LAYER
INTRODUCTION TO TRANSPORT LAYER
Subject: Computer Networks
Tutor: Bilal Munir Mughal
1
Ch-23
Content Outline
 INTRODUCTION
 Transport-Layer Services
 Connectionless and Connection-Oriented Protocols
 TRANSPORT-LAYER PROTOCOLS
 Simple Protocol
 Stop-and-Wait Protocol
 Go-Back-N Protocol (GBN)
 Selective-Repeat Protocol
 Bidirectional Protocols: Piggybacking
2
INTRODUCTION
3
TRANSPORT-LAYER SERVICES
 The transport layer is responsible for providing
services to the application layer; it receives services
from the network layer.
 Process-to-Process Communication
 Addressing: Port Numbers
 Encapsulation and Decapsulation
 Multiplexing and Demultiplexing
 Flow Control
 Error Control
 Congestion Control
 Connectionless and Connection-Oriented Services
4
TRANSPORT-LAYER SERVICES:
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 (running
program) that uses the services of the transport layer.
5
TRANSPORT-LAYER SERVICES:
ADDRESSING: PORT NUMBERS
 For 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.
 In the TCP/IP protocol suite, the port numbers are
integers between 0 and 65,535 (16 bits).
6
TRANSPORT-LAYER SERVICES:
ADDRESSING: PORT NUMBERS
 The client program defines itself with a port number,
called the ephemeral port number. The word
ephemeral means “short-lived”.
 An ephemeral port number is recommended to be
greater than 1023 for some client/server programs
to work properly.
7
TRANSPORT-LAYER SERVICES:
ADDRESSING: PORT NUMBERS
8
TRANSPORT-LAYER SERVICES:
ADDRESSING: PORT NUMBERS
 Well-known ports. The ports ranging from 0 to 1023 are
assigned and controlled by ICANN.
 Registered ports. The ports ranging from 1024 to 49,151
are not assigned or controlled by ICANN. They can only
be registered with ICANN to prevent duplication.
 Dynamic ports. The ports ranging from 49,152 to 65,535
are neither controlled nor registered. They can be used as
temporary or private port numbers.
9
TRANSPORT-LAYER SERVICES:
ADDRESSING: PORT NUMBERS
 Socket Addresses
 A transport-layer protocol in the TCP suite needs both
the 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.
10
TRANSPORT-LAYER SERVICES:
ENCAPSULATION AND DECAPSULATION
 To send a message from one process to another, the
transport-layer protocol encapsulates and
decapsulates messages.
 The packets at the transport layer are called user
datagrams, segments, or packets, depending on what
transport-layer protocol we use.
11
TRANSPORT-LAYER SERVICES:
MULTIPLEXING AND DEMULTIPLEXING
 Whenever an entity
accepts items from more
than one source, this is
referred to as
multiplexing (many to
one); whenever an entity
delivers items to more
than one source, this is
referred to as
demultiplexing (one to
many).
12
TRANSPORT-LAYER SERVICES:
FLOW CONTROL
 Whenever an entity produces items and another
entity consumes them, there should be a balance
between production and consumption rates.
 If the items are produced faster than they can be
consumed, the consumer can be overwhelmed and
may need to discard some items.
Pushing or Pulling
13
TRANSPORT-LAYER SERVICES:
FLOW CONTROL
 Flow Control at Transport Layer
14
TRANSPORT-LAYER SERVICES:
FLOW CONTROL
 Flow Control at Transport Layer…
 Buffers: Although flow control can be implemented in
several ways, one way is to use buffers: one at the
sending and the other at the receiving transport layer.
 A buffer is a set of memory locations that can hold
packets at the sender and receiver.
15
TRANSPORT-LAYER SERVICES:
ERROR CONTROL
 Network layer (IP) is unreliable, we need to make the
transport layer reliable if the application requires
reliability.
 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 them.
4. Buffering out-of-order packets until the missing packets
arrive.
16
TRANSPORT-LAYER SERVICES:
ERROR CONTROL
 Sequence Numbers
 Error control requires that the sending transport layer
knows which packet is to be resent and the receiving
transport layer knows which packet is a duplicate, or
which packet has arrived out of order.
 This can be done if the packets are numbered. We
can add a field to the transport-layer packet to hold
the sequence number of the packet.
 For error control, the sequence numbers are modulo
2m, where m is the size of the sequence number field
in bits.
17
TRANSPORT-LAYER SERVICES:
ERROR CONTROL
 Acknowledgment
 We can use both positive and negative signals as
error control, but we discuss only positive signals,
which are more common at the transport layer.
 When a packet is sent, the sender starts a timer. If an
ACK does not arrive before the timer expires, the sender
resends the packet.
 Duplicate packets can be silently discarded by the
receiver.
 Out-of-order packets can be either discarded (to be
treated as lost packets by the sender), or stored until the
missing one arrives.
18
TRANSPORT-LAYER SERVICES:
COMBINATION OF FLOW AND ERROR CONTROL
 Flow control requires the use of two buffers, one at
the sender site and the other at the receiver site.
 Error control requires the use of sequence and
acknowledgment numbers by both sides.
 These two requirements can be combined if we use
two numbered buffers, one at the sender, one at the
receiver.
19
TRANSPORT-LAYER SERVICES:
COMBINATION OF FLOW AND ERROR CONTROL
 At the sender,
 when a packet is prepared to be sent, we use the number
of the next free location, x, in the buffer as the sequence
number of the packet. When the packet is sent, a copy is
stored at memory location x, awaiting the
acknowledgment from the other end. When an
acknowledgment related to a sent packet arrives, the
packet is purged and the memory location becomes free.
 At the receiver,
 when a packet with sequence number y arrives, it is
stored at the memory location y until the application layer
is ready to receive it. An acknowledgment can be sent to
announce the arrival of packet y.
20
TRANSPORT-LAYER SERVICES:
COMBINATION OF FLOW AND ERROR CONTROL
 Sliding Window
 The buffer is represented as a set of slices, called
the sliding window, that occupies part of the circle
at any time.
21
TRANSPORT-LAYER SERVICES:
CONGESTION CONTROL
 Congestion in a network may occur if the number of
packets sent to the network is greater than the
capacity of the network.
 Congestion control refers to the mechanisms and
techniques that control the congestion and keep the
load below the capacity.
 Congestion at the transport layer is actually the result
of congestion at the network layer.
22
CONNECTIONLESS AND CONNECTION-
ORIENTED PROTOCOLS
 A transport-layer protocol, like a network-layer
protocol, can provide two types of services:
connectionless and connection-oriented.
 At the network layer, a connectionless service may
mean different paths for different datagrams
belonging to the same message.
 Connectionless service at the transport layer means
independency between packets; connection-
oriented means dependency.
23
CONNECTIONLESS AND CONNECTION-
ORIENTED PROTOCOLS
 Connectionless Service
24
CONNECTIONLESS AND CONNECTION-
ORIENTED PROTOCOLS
 Connectionless Service…
 There is no dependency between the packets, they
may arrive out of order at the destination and will be
delivered out of order.
 There is no numbering on the packets.
 The two transport layers do not coordinate with each
other.
 No flow control, error control, or congestion control
can be effectively implemented in a connectionless
service.
25
CONNECTIONLESS AND CONNECTION-
ORIENTED PROTOCOLS
 Connection-Oriented Service
26
CONNECTIONLESS AND CONNECTION-
ORIENTED PROTOCOLS
 Connection-Oriented Service…
 The client and the server first need to establish a
logical connection between themselves. After data
exchange, the connection needs to be torn down.
 Connection-oriented service means a coordination
between the two end hosts and all the routers in
between.
 It involves only the two hosts; the service is end to end.
 We can implement flow control, error control, and
congestion control in a connection-oriented protocol.
27
TRANSPORT-LAYER PROTOCOLS
 We can create a transport-layer protocol by
combining a set of services described in the
previous sections.
 To better understand the behavior of these protocols,
we start with the simplest one and gradually add
more complexity.
 To make discussion simpler, we first discuss all of
these protocols as a unidirectional protocol (i.e.,
simplex). At the end of the chapter, we briefly discuss
how they can be changed to bidirectional protocols
(i.e., full duplex).
28
TRANSPORT-LAYER PROTOCOLS:
SIMPLE PROTOCOL
 Our first protocol is a simple connectionless protocol
with neither flow nor error control.
 We assume, the receiver can never be overwhelmed
with incoming packets.
29
TRANSPORT-LAYER PROTOCOLS:
SIMPLE PROTOCOL
 The sender site should not send a packet until its
application layer has a message to send.
 The receiver site cannot deliver a message to its
application layer until a packet arrives.
 We can show these requirements using two FSMs.
 We see later that the UDP protocol is a slight
modification of this protocol.
30
TRANSPORT-LAYER PROTOCOLS:
SIMPLE PROTOCOL
 Figure 23.19 shows an example of communication using this
protocol. It is very simple. The sender sends packets one after
another without even thinking about the receiver.
31
TRANSPORT-LAYER PROTOCOLS:
STOP-AND-WAIT PROTOCOL
 Stop-and-Wait protocol, uses both flow and error
control.
 Both the sender and the receiver use a sliding
window of size 1.
 The sender sends one packet at a time and waits for
an acknowledgment before sending the next one.
 To detect corrupted packets, we need to add a
checksum to each data packet.
32
TRANSPORT-LAYER PROTOCOLS:
STOP-AND-WAIT PROTOCOL
 The Stop-and-Wait protocol is a connection-oriented
protocol that provides flow and error control.
 To prevent duplicate packets, the protocol uses
sequence numbers and acknowledgment numbers.
33
TRANSPORT-LAYER PROTOCOLS:
STOP-AND-WAIT PROTOCOL
Efficiency
 The Stop-and-Wait protocol is very inefficient if our
channel has a large bandwidth (high data rate); and
the round-trip delay is long. The product of these two
is called the bandwidth-delay product.
 We can think of the channel as a pipe. The bandwidth-
delay product then is the volume of the pipe in bits. The
pipe is always there. It is not efficient if it is not used.
 The bandwidth-delay product is a measure of the
number of bits a sender can transmit through the
system while waiting for an acknowledgment from the
receiver.
34
TRANSPORT-LAYER PROTOCOLS:
GO-BACK-N PROTOCOL (GBN)
 To improve the efficiency of transmission (to fill the
pipe), multiple packets must be in transition while
the sender is waiting for acknowledgment.
 We discuss two protocol that can achieve this goal;
The first is called Go-Back-N (GBN).
 The key to Go-back-N is that we can send several
packets before receiving acknowledgments, but the
receiver can only buffer one packet.
 We keep a copy of the sent packets until the
acknowledgments arrive.
35
TRANSPORT-LAYER PROTOCOLS:
GO-BACK-N PROTOCOL (GBN)
 In the Go-Back-N protocol, the acknowledgment
number is cumulative and defines the sequence
number of the next packet expected to arrive.
36
TRANSPORT-LAYER PROTOCOLS:
GO-BACK-N PROTOCOL (GBN)
 The Go-Back-N protocol is inefficient if the underlying
network protocol loses a lot of packets.
 Each time a single packet is lost or corrupted, the sender
resends all outstanding packets, even though some of
these packets may have been received safe and sound
but out of order.
 If the network layer is losing many packets because of
congestion in the network, the resending of all of these
outstanding packets makes the congestion worse, and
eventually more packets are lost.
 This has an avalanche effect that may result in the total
collapse of the network.
37
TRANSPORT-LAYER PROTOCOLS:
SELECTIVE-REPEAT PROTOCOL
 Another protocol, called the Selective-Repeat (SR)
protocol, has been devised, which, as the name
implies, resends only selective packets, those that are
actually lost.
38
TRANSPORT-LAYER PROTOCOLS:
BIDIRECTIONAL PROTOCOLS: PIGGYBACKING
 The four protocols we discussed earlier in this section
are all unidirectional: data packets flow in only one
direction and acknowledgments travel in the other
direction.
 A technique called piggybacking is used to improve
the efficiency of the bidirectional protocols.
 When a packet is carrying data from A to B, it can
also carry acknowledgment feedback about arrived
packets from B; when a packet is carrying data from
B to A, it can also carry acknowledgment feedback
about the arrived packets from A.
39
TRANSPORT-LAYER PROTOCOLS:
BIDIRECTIONAL PROTOCOLS: PIGGYBACKING
40
41
Questions?

More Related Content

Similar to DCN 5th ed. slides ch23 Introduction to Transport Layer.pdf

Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
Shivakrishnan18
 
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocols
BE Smârt
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
Chandra Meena
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layer
Khánh Ghẻ
 
Lecture20 tcp
Lecture20 tcpLecture20 tcp
Lecture20 tcp
H K
 

Similar to DCN 5th ed. slides ch23 Introduction to Transport Layer.pdf (20)

Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
 
DCN 5th ed. slides ch24 Transport-Layer Protocols.pdf
DCN 5th ed. slides ch24 Transport-Layer Protocols.pdfDCN 5th ed. slides ch24 Transport-Layer Protocols.pdf
DCN 5th ed. slides ch24 Transport-Layer Protocols.pdf
 
Transport layer
Transport layer Transport layer
Transport layer
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
 
Transport_Layer (1).pptx
Transport_Layer (1).pptxTransport_Layer (1).pptx
Transport_Layer (1).pptx
 
COE332-Ch03d.pptx
COE332-Ch03d.pptxCOE332-Ch03d.pptx
COE332-Ch03d.pptx
 
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocols
 
COMPUTER NETWORKS NOTES Unit 4
COMPUTER NETWORKS NOTES  Unit 4 COMPUTER NETWORKS NOTES  Unit 4
COMPUTER NETWORKS NOTES Unit 4
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
 
The Transport Layer
The Transport LayerThe Transport Layer
The Transport Layer
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layer
 
Unit 5 : Transport Layer
Unit 5 : Transport LayerUnit 5 : Transport Layer
Unit 5 : Transport Layer
 
Unit 4 - Transport Layer
Unit 4 - Transport LayerUnit 4 - Transport Layer
Unit 4 - Transport Layer
 
It6601 mobile computing unit2
It6601 mobile computing unit2It6601 mobile computing unit2
It6601 mobile computing unit2
 
Group 3 Presen.pptx
Group 3 Presen.pptxGroup 3 Presen.pptx
Group 3 Presen.pptx
 
Lecture20 tcp
Lecture20 tcpLecture20 tcp
Lecture20 tcp
 
Chap24
Chap24Chap24
Chap24
 
Nigga.pdf
Nigga.pdfNigga.pdf
Nigga.pdf
 

More from Bilal Munir Mughal (8)

DCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.pptDCN Slides ch10 Error Detection and Correction.ppt
DCN Slides ch10 Error Detection and Correction.ppt
 
DCN 5th ed. slides ch22 Next Generation IP.pdf
DCN 5th ed. slides ch22 Next Generation IP.pdfDCN 5th ed. slides ch22 Next Generation IP.pdf
DCN 5th ed. slides ch22 Next Generation IP.pdf
 
DCN 5th ed. slides ch07 Transmission Media.pdf
DCN 5th ed. slides ch07 Transmission Media.pdfDCN 5th ed. slides ch07 Transmission Media.pdf
DCN 5th ed. slides ch07 Transmission Media.pdf
 
DCN 5th ed. slides ch05 Analog Transmission.pdf
DCN 5th ed. slides ch05 Analog Transmission.pdfDCN 5th ed. slides ch05 Analog Transmission.pdf
DCN 5th ed. slides ch05 Analog Transmission.pdf
 
DCN 5th ed. slides ch04 Digital Transmission.pdf
DCN 5th ed. slides ch04 Digital Transmission.pdfDCN 5th ed. slides ch04 Digital Transmission.pdf
DCN 5th ed. slides ch04 Digital Transmission.pdf
 
DCN 5th ed. slides ch03 Introduction to Physical Layer.pdf
DCN 5th ed. slides ch03 Introduction to Physical Layer.pdfDCN 5th ed. slides ch03 Introduction to Physical Layer.pdf
DCN 5th ed. slides ch03 Introduction to Physical Layer.pdf
 
DCN 5th ed. slides ch02-Network Models.pptx
DCN 5th ed. slides ch02-Network Models.pptxDCN 5th ed. slides ch02-Network Models.pptx
DCN 5th ed. slides ch02-Network Models.pptx
 
DCN 5th ed. slides ch01-Introduction.pdf
DCN 5th ed. slides ch01-Introduction.pdfDCN 5th ed. slides ch01-Introduction.pdf
DCN 5th ed. slides ch01-Introduction.pdf
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

DCN 5th ed. slides ch23 Introduction to Transport Layer.pdf

  • 1. PART V: TRANSPORT LAYER INTRODUCTION TO TRANSPORT LAYER Subject: Computer Networks Tutor: Bilal Munir Mughal 1 Ch-23
  • 2. Content Outline  INTRODUCTION  Transport-Layer Services  Connectionless and Connection-Oriented Protocols  TRANSPORT-LAYER PROTOCOLS  Simple Protocol  Stop-and-Wait Protocol  Go-Back-N Protocol (GBN)  Selective-Repeat Protocol  Bidirectional Protocols: Piggybacking 2
  • 4. TRANSPORT-LAYER SERVICES  The transport layer is responsible for providing services to the application layer; it receives services from the network layer.  Process-to-Process Communication  Addressing: Port Numbers  Encapsulation and Decapsulation  Multiplexing and Demultiplexing  Flow Control  Error Control  Congestion Control  Connectionless and Connection-Oriented Services 4
  • 5. TRANSPORT-LAYER SERVICES: 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 (running program) that uses the services of the transport layer. 5
  • 6. TRANSPORT-LAYER SERVICES: ADDRESSING: PORT NUMBERS  For 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.  In the TCP/IP protocol suite, the port numbers are integers between 0 and 65,535 (16 bits). 6
  • 7. TRANSPORT-LAYER SERVICES: ADDRESSING: PORT NUMBERS  The client program defines itself with a port number, called the ephemeral port number. The word ephemeral means “short-lived”.  An ephemeral port number is recommended to be greater than 1023 for some client/server programs to work properly. 7
  • 9. TRANSPORT-LAYER SERVICES: ADDRESSING: PORT NUMBERS  Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by ICANN.  Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by ICANN. They can only be registered with ICANN to prevent duplication.  Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered. They can be used as temporary or private port numbers. 9
  • 10. TRANSPORT-LAYER SERVICES: ADDRESSING: PORT NUMBERS  Socket Addresses  A transport-layer protocol in the TCP suite needs both the 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. 10
  • 11. TRANSPORT-LAYER SERVICES: ENCAPSULATION AND DECAPSULATION  To send a message from one process to another, the transport-layer protocol encapsulates and decapsulates messages.  The packets at the transport layer are called user datagrams, segments, or packets, depending on what transport-layer protocol we use. 11
  • 12. TRANSPORT-LAYER SERVICES: MULTIPLEXING AND DEMULTIPLEXING  Whenever an entity accepts items from more than one source, this is referred to as multiplexing (many to one); whenever an entity delivers items to more than one source, this is referred to as demultiplexing (one to many). 12
  • 13. TRANSPORT-LAYER SERVICES: FLOW CONTROL  Whenever an entity produces items and another entity consumes them, there should be a balance between production and consumption rates.  If the items are produced faster than they can be consumed, the consumer can be overwhelmed and may need to discard some items. Pushing or Pulling 13
  • 14. TRANSPORT-LAYER SERVICES: FLOW CONTROL  Flow Control at Transport Layer 14
  • 15. TRANSPORT-LAYER SERVICES: FLOW CONTROL  Flow Control at Transport Layer…  Buffers: Although flow control can be implemented in several ways, one way is to use buffers: one at the sending and the other at the receiving transport layer.  A buffer is a set of memory locations that can hold packets at the sender and receiver. 15
  • 16. TRANSPORT-LAYER SERVICES: ERROR CONTROL  Network layer (IP) is unreliable, we need to make the transport layer reliable if the application requires reliability.  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 them. 4. Buffering out-of-order packets until the missing packets arrive. 16
  • 17. TRANSPORT-LAYER SERVICES: ERROR CONTROL  Sequence Numbers  Error control requires that the sending transport layer knows which packet is to be resent and the receiving transport layer knows which packet is a duplicate, or which packet has arrived out of order.  This can be done if the packets are numbered. We can add a field to the transport-layer packet to hold the sequence number of the packet.  For error control, the sequence numbers are modulo 2m, where m is the size of the sequence number field in bits. 17
  • 18. TRANSPORT-LAYER SERVICES: ERROR CONTROL  Acknowledgment  We can use both positive and negative signals as error control, but we discuss only positive signals, which are more common at the transport layer.  When a packet is sent, the sender starts a timer. If an ACK does not arrive before the timer expires, the sender resends the packet.  Duplicate packets can be silently discarded by the receiver.  Out-of-order packets can be either discarded (to be treated as lost packets by the sender), or stored until the missing one arrives. 18
  • 19. TRANSPORT-LAYER SERVICES: COMBINATION OF FLOW AND ERROR CONTROL  Flow control requires the use of two buffers, one at the sender site and the other at the receiver site.  Error control requires the use of sequence and acknowledgment numbers by both sides.  These two requirements can be combined if we use two numbered buffers, one at the sender, one at the receiver. 19
  • 20. TRANSPORT-LAYER SERVICES: COMBINATION OF FLOW AND ERROR CONTROL  At the sender,  when a packet is prepared to be sent, we use the number of the next free location, x, in the buffer as the sequence number of the packet. When the packet is sent, a copy is stored at memory location x, awaiting the acknowledgment from the other end. When an acknowledgment related to a sent packet arrives, the packet is purged and the memory location becomes free.  At the receiver,  when a packet with sequence number y arrives, it is stored at the memory location y until the application layer is ready to receive it. An acknowledgment can be sent to announce the arrival of packet y. 20
  • 21. TRANSPORT-LAYER SERVICES: COMBINATION OF FLOW AND ERROR CONTROL  Sliding Window  The buffer is represented as a set of slices, called the sliding window, that occupies part of the circle at any time. 21
  • 22. TRANSPORT-LAYER SERVICES: CONGESTION CONTROL  Congestion in a network may occur if the number of packets sent to the network is greater than the capacity of the network.  Congestion control refers to the mechanisms and techniques that control the congestion and keep the load below the capacity.  Congestion at the transport layer is actually the result of congestion at the network layer. 22
  • 23. CONNECTIONLESS AND CONNECTION- ORIENTED PROTOCOLS  A transport-layer protocol, like a network-layer protocol, can provide two types of services: connectionless and connection-oriented.  At the network layer, a connectionless service may mean different paths for different datagrams belonging to the same message.  Connectionless service at the transport layer means independency between packets; connection- oriented means dependency. 23
  • 24. CONNECTIONLESS AND CONNECTION- ORIENTED PROTOCOLS  Connectionless Service 24
  • 25. CONNECTIONLESS AND CONNECTION- ORIENTED PROTOCOLS  Connectionless Service…  There is no dependency between the packets, they may arrive out of order at the destination and will be delivered out of order.  There is no numbering on the packets.  The two transport layers do not coordinate with each other.  No flow control, error control, or congestion control can be effectively implemented in a connectionless service. 25
  • 26. CONNECTIONLESS AND CONNECTION- ORIENTED PROTOCOLS  Connection-Oriented Service 26
  • 27. CONNECTIONLESS AND CONNECTION- ORIENTED PROTOCOLS  Connection-Oriented Service…  The client and the server first need to establish a logical connection between themselves. After data exchange, the connection needs to be torn down.  Connection-oriented service means a coordination between the two end hosts and all the routers in between.  It involves only the two hosts; the service is end to end.  We can implement flow control, error control, and congestion control in a connection-oriented protocol. 27
  • 28. TRANSPORT-LAYER PROTOCOLS  We can create a transport-layer protocol by combining a set of services described in the previous sections.  To better understand the behavior of these protocols, we start with the simplest one and gradually add more complexity.  To make discussion simpler, we first discuss all of these protocols as a unidirectional protocol (i.e., simplex). At the end of the chapter, we briefly discuss how they can be changed to bidirectional protocols (i.e., full duplex). 28
  • 29. TRANSPORT-LAYER PROTOCOLS: SIMPLE PROTOCOL  Our first protocol is a simple connectionless protocol with neither flow nor error control.  We assume, the receiver can never be overwhelmed with incoming packets. 29
  • 30. TRANSPORT-LAYER PROTOCOLS: SIMPLE PROTOCOL  The sender site should not send a packet until its application layer has a message to send.  The receiver site cannot deliver a message to its application layer until a packet arrives.  We can show these requirements using two FSMs.  We see later that the UDP protocol is a slight modification of this protocol. 30
  • 31. TRANSPORT-LAYER PROTOCOLS: SIMPLE PROTOCOL  Figure 23.19 shows an example of communication using this protocol. It is very simple. The sender sends packets one after another without even thinking about the receiver. 31
  • 32. TRANSPORT-LAYER PROTOCOLS: STOP-AND-WAIT PROTOCOL  Stop-and-Wait protocol, uses both flow and error control.  Both the sender and the receiver use a sliding window of size 1.  The sender sends one packet at a time and waits for an acknowledgment before sending the next one.  To detect corrupted packets, we need to add a checksum to each data packet. 32
  • 33. TRANSPORT-LAYER PROTOCOLS: STOP-AND-WAIT PROTOCOL  The Stop-and-Wait protocol is a connection-oriented protocol that provides flow and error control.  To prevent duplicate packets, the protocol uses sequence numbers and acknowledgment numbers. 33
  • 34. TRANSPORT-LAYER PROTOCOLS: STOP-AND-WAIT PROTOCOL Efficiency  The Stop-and-Wait protocol is very inefficient if our channel has a large bandwidth (high data rate); and the round-trip delay is long. The product of these two is called the bandwidth-delay product.  We can think of the channel as a pipe. The bandwidth- delay product then is the volume of the pipe in bits. The pipe is always there. It is not efficient if it is not used.  The bandwidth-delay product is a measure of the number of bits a sender can transmit through the system while waiting for an acknowledgment from the receiver. 34
  • 35. TRANSPORT-LAYER PROTOCOLS: GO-BACK-N PROTOCOL (GBN)  To improve the efficiency of transmission (to fill the pipe), multiple packets must be in transition while the sender is waiting for acknowledgment.  We discuss two protocol that can achieve this goal; The first is called Go-Back-N (GBN).  The key to Go-back-N is that we can send several packets before receiving acknowledgments, but the receiver can only buffer one packet.  We keep a copy of the sent packets until the acknowledgments arrive. 35
  • 36. TRANSPORT-LAYER PROTOCOLS: GO-BACK-N PROTOCOL (GBN)  In the Go-Back-N protocol, the acknowledgment number is cumulative and defines the sequence number of the next packet expected to arrive. 36
  • 37. TRANSPORT-LAYER PROTOCOLS: GO-BACK-N PROTOCOL (GBN)  The Go-Back-N protocol is inefficient if the underlying network protocol loses a lot of packets.  Each time a single packet is lost or corrupted, the sender resends all outstanding packets, even though some of these packets may have been received safe and sound but out of order.  If the network layer is losing many packets because of congestion in the network, the resending of all of these outstanding packets makes the congestion worse, and eventually more packets are lost.  This has an avalanche effect that may result in the total collapse of the network. 37
  • 38. TRANSPORT-LAYER PROTOCOLS: SELECTIVE-REPEAT PROTOCOL  Another protocol, called the Selective-Repeat (SR) protocol, has been devised, which, as the name implies, resends only selective packets, those that are actually lost. 38
  • 39. TRANSPORT-LAYER PROTOCOLS: BIDIRECTIONAL PROTOCOLS: PIGGYBACKING  The four protocols we discussed earlier in this section are all unidirectional: data packets flow in only one direction and acknowledgments travel in the other direction.  A technique called piggybacking is used to improve the efficiency of the bidirectional protocols.  When a packet is carrying data from A to B, it can also carry acknowledgment feedback about arrived packets from B; when a packet is carrying data from B to A, it can also carry acknowledgment feedback about the arrived packets from A. 39