0% found this document useful (0 votes)
56 views47 pages

Lecture 12-13. Transport Layer

The document discusses the transport layer in computer networks. The transport layer provides process-to-process communication between application layers on different hosts by using logical connections identified by IP addresses and port numbers. It is responsible for functions like multiplexing/demultiplexing data, error control, flow control, and congestion control. Well-known transport layer protocols are TCP and UDP, with TCP providing reliable, connection-oriented delivery and UDP providing simpler, connectionless delivery.

Uploaded by

Andrei Postaru
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)
56 views47 pages

Lecture 12-13. Transport Layer

The document discusses the transport layer in computer networks. The transport layer provides process-to-process communication between application layers on different hosts by using logical connections identified by IP addresses and port numbers. It is responsible for functions like multiplexing/demultiplexing data, error control, flow control, and congestion control. Well-known transport layer protocols are TCP and UDP, with TCP providing reliable, connection-oriented delivery and UDP providing simpler, connectionless delivery.

Uploaded by

Andrei Postaru
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/ 47

Computer networks

Transport layer
Introduction to
Transport Layer
• The transport layer is located
between the network layer
and the application layer
• The transport layer provides
a process to process
communication between two
application layers
• Communication is provided
using a logical connection
• The transport layer is
responsible for providing
services to the application
layer
Process to Process
Communication (1#3)
• A network-layer protocol can deliver the message
only to the destination computer
• A transport-layer protocol is responsible for
delivery of the message to the appropriate
process
Process to Process
Communication (2#3)
• 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)
Process to Process
Communication (3#3)
• The destination IP address defines the host among the different hosts
in the world
• The port number defines one of the processes on this particular host
ICANN Port Ranges
(1#2)
• Well-known ports. The ports ranging from 0 to 1023 are assigned
and controlled by ICANN. These are the well-known ports.
• 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
ICANN Port Ranges
(2#2)
• 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
• To use the services of the transport layer in the Internet, we need a
pair of socket addresses: the client socket address and the server
socket address

Encapsulation and
Decapsulation
• To send a message from one process to another, the transport layer
protocol encapsulates and decapsulates messages
• The transport layer receives the data and adds the transport-layer
header
• The packets at the transport layer in the Internet are called user
datagrams, segments, or packets, depending on what transport-layer
protocol we use
• Decapsulation happens at the receiver site
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)
• The transport layer at the
source performs multiplexing
• the transport layer at the
destination performs
demultiplexing
Flow Control
• Delivery of items from a producer to a consumer can
occur in one of two ways: pushing or pulling
Flow Control at
Transport Layer
• In communication at the transport layer, we are dealing with four
entities: sender process, sender transport layer, receiver transport
layer, and receiver process
• Although flow control can be implemented in several ways, one of the
solutions is normally to use two buffers: one at the sending transport
layer and the other at the receiving transport layer
Error Control (1#2)
• Reliability can be achieved to add error control services to
the transport layer
• Error control at the transport layer is responsible for
– Detecting and discarding corrupted packets
– Keeping track of lost and discarded packets and resending them
– Recognizing duplicate packets and discarding them
– Buffering out of order packets until the missing packets arrive
Error Control (2#2)
• 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
• We can add a field to the transport-layer packet
to hold the sequence number of the packet
• Packets are numbered sequentially
• The out-of-order packets can be recognized by
observing gaps in the sequence numbers
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
• The buffer is represented as a set of slices, called the
sliding window, that occupies part of the circle at any
time
Congestion Control
• An important issue in a packet-switched network,
such as the Internet, is congestion
• Congestion control refers to the mechanisms
and techniques that control the congestion and
keep the load below the capacity
• Congestion in a network or internetwork occurs
because routers and switches have queues —
buffers that hold the packets before and after
processing
Connectionless and Connection
Oriented Protocols (1#2)
• A transport-layer protocol, like a network-layer protocol,
can provide two types of services:
– Connectionless
– Connection oriented
Connectionless and Connection
Oriented Protocols (2#2)

• Connection Oriented Service


Transport layer
protocols (1#10)
• Simple Protocol
– Have no flow nor error control
– The receiver can never be overwhelmed with incoming
packets
Transport layer
protocols (2#10)
• Stop and Wait Protocol
– Uses both flow and error control
– Both the sender and the receiver use a sliding window
of size 1
– It is a connection oriented protocol that provides flow
and error control
Transport layer
protocols (3#10)
• Stop and Wait Protocol
Transport layer
protocols (4#10)
• Go Back N Protocol (GBN)
– Can be send several packets before receiving
acknowledgments
– An acknowledgment number in this protocol is
cumulative
Transport layer
protocols (5#10)
• Go Back N Protocol (GBN)
– The send window is an imaginary box covering the sequence
numbers of the data packets that can be in transit or can be sent
– The receive window makes sure that the correct data packets are
received and that the correct acknowledgments are sent
Transport layer
protocols (6#10)
• Go Back N Protocol (GBN)
– The size of the receive window is always 1
– Any packet arriving out of order is discarded and needs to be
resent
– When a correct packet is received, the window slides
Transport layer
protocols (7#10)
• Go Back N Protocol (GBN)
Transport layer
protocols (8#10)
• Selective Repeat Protocol
– Resends only selective packets, those that are actually
lost
Transport layer
protocols (9#10)
• Selective Repeat Protocol
– Send and receive windows
Transport layer
protocols (10#10)
• Bidirectional Protocols: Piggybacking
Services
• UDP, TCP, SCTP
Well known ports used
with UDP and TCP
User Datagram
Protocol (1#3)
• The User Datagram Protocol (UDP) is a
connectionless, unreliable transport protocol
• UDP packets, called user datagrams, have a
fixed-size header of 8 bytes made of four fields,
each of 2 bytes (16 bits)
User Datagram
Protocol (2#3)
• Connectionless services
– No relationship between the different user datagrams
– No connection establishment and no connection
termination
• No flow control
• No error control, except for the checksum
– If the receiver detects an error through the checksum,
the user datagram is silently discarded
• Does not provide congestion control
User Datagram
Protocol (3#3)
• Queues are associated with ports
• UDP multiplexes and demultiplexes
• Typical Applications
– Suitable for a process that requires simple request response
communication with little concern for flow and error control
– Suitable for a process with internal flow and error control
mechanisms (TFTP)
– Suitable for multicasting
– Used for management processes (SNMP)
– Used for some route updating protocols (RIP)
– Normally used for interactive real time applications that cannot
tolerate uneven delay between sections of a received message
Transmission Control
Protocol (1#13)
• Transmission Control Protocol (TCP) is a connection-
oriented, reliable protocol
• Explicitly defines connection establishment, data transfer,
and connection teardown phases to provide a connection
oriented service
• The most common transport-layer protocol in the Internet
• Provides process to process communication
• Stream-oriented protocol
Transmission Control
Protocol (2#13)
• Sending and Receiving Buffers
• Buffers are also necessary for flow and error
control mechanisms used by TCP
Transmission Control
Protocol (3#13)
• TCP groups a number of bytes together into a packet
called a segment
• TCP adds a header to each segment (for control
purposes) and delivers the segment to the network layer
for transmission
Transmission Control
Protocol (4#13)
• TCP offers full duplex service
• TCP performs multiplexing at the sender and
demultiplexing at the receiver
• TCP is a connection oriented protocol
• Three phases occur to establish communication:
– The two TCP’s establish a logical connection between them
– Data are exchanged in both directions
– The connection is terminated
• TCP is a reliable transport protocol
Transmission Control
Protocol (5#13)
• TCP Numbering System
– There is no field for a segment number value in the segment
header. Instead, there are two fields, called the sequence number
and the acknowledgment number
– TCP numbers all data bytes (octets) that are transmitted in a
connection
– After the bytes have been numbered, TCP assigns a sequence
number to each segment that is being sent
– Each party also uses an acknowledgment number to confirm the
bytes it has received
– The acknowledgment number defines the number of the next byte
that the party expects to receive
Transmission Control
Protocol (6#13)
• TCP Segment format
Transmission Control
Protocol (7#13)
• TCP connection is logical, not physical
• The connection establishment in TCP is called three-way
handshaking
Transmission Control
Protocol (8#13)
• Data transfer
Transmission Control
Protocol (9#13)
• Connection termination: three-way handshaking
Transmission Control
Protocol (10#13)
• Connection termination: four-way handshaking with a half-close
option
Transmission Control
Protocol (11#13)
• Send window
Transmission Control
Protocol (12#13)
• Receive window
Transmission Control
Protocol (13#13)
• Flow control balances the rate a producer creates data with the rate a
consumer can use the data
• TCP separates flow control from error control
Stream Control
Transmission Protocol
• Stream Control Transmission Protocol (SCTP)
is a new transport-layer protocol designed to
combine some features of UDP and TCP in an
effort to create a better protocol for multimedia
communication

Literature
• B. A. Forouzan. Data Communications and
Networking (5th edition). Mc Graw Hill, 2013.
689–814 p.

You might also like