0% found this document useful (0 votes)
3 views79 pages

Introduction to Transport Layer Functions

The document provides an overview of the transport layer in computer networks, detailing its role in process-to-process communication and the use of port numbers for addressing. It discusses the differences between connectionless (UDP) and connection-oriented (TCP) protocols, highlighting their respective services, error control mechanisms, and applications. Additionally, it covers concepts such as multiplexing, demultiplexing, flow control, and the structure of transport-layer packets.

Uploaded by

23se02cs079
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)
3 views79 pages

Introduction to Transport Layer Functions

The document provides an overview of the transport layer in computer networks, detailing its role in process-to-process communication and the use of port numbers for addressing. It discusses the differences between connectionless (UDP) and connection-oriented (TCP) protocols, highlighting their respective services, error control mechanisms, and applications. Additionally, it covers concepts such as multiplexing, demultiplexing, flow control, and the structure of transport-layer packets.

Uploaded by

23se02cs079
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

Module 6

Introduction to Transport Layer


By:
Maulika Patel

Maulika Patel SECE3011-


Computer Networks
McGraw-Hill [Link]-Sem5 ©The McGraw-Hill Companies, Inc., 2000
Transport-Layer Services
• Transport layer is located between the
network layer and the application layer.
• The transport layer is responsible for
providing services to the application layer; it
receives services from the network layer

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Process-to-Process Communication

• The transport layer is responsible for process-


to-process delivery—the delivery of a packet,
part of a message, from one process to
another.
• Two processes communicate in a
client/server relationship.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Types of data deliveries

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Addressing: Port Numbers
• A process on the local host, called a client, needs services from a
process usually on the remote host, called a server.
• However, operating systems today support both multiuser and
multiprogramming environments.
• A remote computer can run several server programs at the same
time, just as several local computers can run one or more client
programs at the same time.
• 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 (1Computer
6 b iNetworks
t s).
M itul Pa t el SECE3011-
[Link]-Sem5
Addressing: Port Numbers
• The client program defines itself with a port
number, called the ephemeral port number.
• The word ephemeral means “short-lived” and
is used because the life of a client is normally
short.
• TCP/IP has decided to use universal port
numbers for servers; these are called well-
known port numbers

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Port numbers

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
IP addresses versus port numbers

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
ICANN Ranges

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Socket Address
• 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.
• The client socket address defines the client process
uniquely just as the server socket address defines
the server process uniquely.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Encapsulation and Decapsulation

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
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
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
Multiplexing and Demultiplexing

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Flow Control at Transport Layer

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Buffers
• 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.
• A buffer is a set of memory locations that can
hold packets at the sender and receiver.
• The flow control communication can occur by
sending signals from the consumer to the
producer. Maulika SECE3011-
Computer
Patel Networks [Link]-Sem5
Error Control
• Error control at the transport layer is
responsible for
1. Detecting and discarding corrupted packets.
[Link] track of lost and discarded packets
and resending them.
[Link] duplicate packets and discarding
them.
[Link] out-of-order packets until the
missing packets arrive.
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
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.
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
Sequence Numbers
• However, because we need to include the sequence
number of each packet in the header, we need to
set a limit. If the header of the packet allows m bits
for the sequence number, the sequence numbers
range from 0 to 2m − 1.
• If m is 4, the only sequence numbers are 0 through
15, inclusive. However, we can wrap around the
sequence. So the sequence numbers in this case are

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Sliding Window

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connectionless and Connection-
Oriented Protocols
• A transport-layer protocol, like a network-
layer protocol, can provide two types of
services: connectionless and connection-
oriented
• Connectionless service at the transport layer
means independency between packets;
connection-oriented means dependency

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connectionless Service

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connectionless Service
• We can say that no flow control, error
control, or congestion control can be
effectively implemented in a connectionless
service.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connection-Oriented Service

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connection-oriented service
• We can implement flow control, error
control, and congestion control in a
connection oriented protocol.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Transport-Layer Protocols

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Services
• UDP
• UDP is an unreliable connectionless transport-layer
protocol used for its simplicity and efficiency in
applications where error control can be provided by the
application-layer process.
• TCP
• TCP is a reliable connection-oriented protocol that can be
used in any application where reliability is important.
• SCTP
• SCTP is a new transport-layer protocol that combines the
features of UDP and MTitCul [Link] SECE3011-
Computer Networks [Link]-Sem5
Port Numbers

Maulika SECE3011-
Computer
Patel Networks [Link]-Sem5
USER DATAGRAM PROTOCOL(UDP)

• connectionless, unreliable transport protocol.


• providing process-to-process communication
instead of host-to-host communication
• If UDP is so powerless, why would a process
want to use it?
• “If a process wants to send a small message
and does not care much about reliability, it
can use UDP. Sending a small message using
UDP takes much less interaction between the
Maulika Patel SECE3011-
sender and receiver than using TCP.”
Computer Networks [Link]-Sem5
User datagram packet format

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Example

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Solution

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Exercise

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
UDP Services
1. Process-to-Process Communication
– using socket addresses, a combination of IP addresses and
port numbers.
2. Connectionless Services
– Each user datagram sent by UDP is an independent
datagram.
– There is no relationship between the different user
datagrams even if they are coming from the same source
process and going to the same destination program.
– no connection establishment and no connection
termination
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
UDP Services
3. Flow Control
– no flow control. the process using UDP should provide
for this service, if needed
4. Error Control
– no error control. the process using UDP should provide
for this service, if needed
5. Checksum
– UDP checksum calculation includes three sections: a
pseudoheader, the UDP header, and the data coming
from the application layer. The pseudoheader is the
part of the headeMrituloPaftelthe IP SpECa
E30c
11k
- et
Computer Networks [Link]-Sem5
Pseudoheader for checksum calculation

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
UDP Services
6. Congestion Control
– does not provide congestion control.
7. Encapsulation and Decapsulation
8. Multiplexing and Demultiplexing

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
UDP Applications
• The connectionless service provides less
delay; the connection-oriented service
creates more delay. If delay is an important
issue for the application, the connectionless
service is preferred.
• A client-server application such as DNS uses
the services of UDP because a client needs to
send a short request to a server and to
receive a quick response from it.
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
UDP Applications
• A client-server application such as SMTP,
which is used in electronic mail, cannot use
the services of UDP because a user might
send a long e-mail message, which could
include multimedia (images, audio, or video).

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Examples
1. Downloading a very large text file from the
Internet? – can’t use UDP
2. Real-time interactive application, such as
Skype? – can use UDP
3. route updating protocols such as Routing
Information Protocol(RIP) – can use UDP

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
TRANSMISSION CONTROL PROTOCOL(TCP)
• connection-oriented, reliable protocol.
• TCP explicitly defines connection establishment,
data transfer, and connection teardown phases to
provide a connection-oriented service.
• To achieve this goal, TCP uses checksum (for error
detection), retransmission of lost or corrupted
packets, cumulative and selective
acknowledgments, and timers.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
TCP Services
• Process-to-Process Communication
– As with UDP, TCP provides process-to-process
communication using port numbers
• Stream Delivery Service
– allows the sending process to deliver data as a
stream of bytes and allows the receiving process
to obtain data as a stream of bytes

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
• Sending and Receiving Buffers
– Because the sending and the receiving processes
may not necessarily write or read data at the
same rate, 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 as shown in
Figure

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Sending and receiving buffers

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
TCP Segment
• At the transport layer, 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.
• The segments are encapsulated in an IP
datagram and transmitted.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
TCP segments

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
• Connection-Oriented Service
– TCP, unlike UDP, is a connection-oriented protocol. When
a process at site A wants to send to and receive data
from another process at site B, the following three
phases occur:
1. The two TCP’s establish a logical connection between
them.
2. Data are exchanged in both directions.
3. The connection is terminated.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
• Full-Duplex Communication
– TCP offers full-duplex service, where data can
flow in both directions at the same time.
• Multiplexing and Demultiplexing
– Like UDP, TCP performs multiplexing at the sender
and demultiplexing at the receiver.
• Reliable Service
– TCP is a reliable transport protocol. It uses an
acknowledgment mechanism to check the safe
and sound arrival of data.
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
Numbering System
• Sequence Number
• After the bytes have been numbered, TCP assigns a
sequence number to each segment that is being
sent. The sequence number, in each direction, is
defined as follows:
1. The sequence number of the first segment is the
ISN (initial sequence number),which is a random
number between 0 and 232 − 1.
2. The sequence number of any other segment is the
sequence number of the previous segment plus the
number of bytes (real or imaginary) carried by the
Maulika SECE3011-
previous [Link]
Patel Networks [Link]-Sem5
Example
• Suppose a TCP connection is transferring a
file of 5000 bytes. The first byte is numbered
10001.
• What are the sequence numbers for each
segment if data are sent in five segments,
each carrying 1000 bytes?

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Example

The following shows the sequence number for each


segment:

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

The bytes of data being transferred in each


connection are numbered by TCP.
The numbering starts with a randomly
generated number.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Acknowledgment Number
• 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.
• However, the acknowledgment number
defines the number of the next byte that the
party expects to receive.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
TCP segment format

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

The value in the sequence number field of a


segment defines the
number of the first data byte
contained in that segment.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

The value of the acknowledgment field in a segment


defines
the number of the next byte a party expects to
receive.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Control field

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Description of flags in the control field

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Urgent pointer
• This 16-bit field, which is valid only if the
urgent flag is set, is used when the segment
contains urgent data.
• It defines a value that must be added to the
sequence number to obtain the number of
the last urgent byte in the data section of the
segment.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
A TCP Connection
• In TCP, connection-oriented transmission
requires three phases:
– connection establishment
– data transfer, and
– connection termination.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connection Establishment
• The connection establishment in TCP is called
three-way handshaking. In our example, 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.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connection establishment using three-way handshaking

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

A SYN segment cannot carry data, but it


consumes one sequence number.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

A SYN + ACK segment cannot


carry data, but does consume one
sequence number.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

An ACK segment, if carrying no data,


consumes no sequence number.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Data
Transfer

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Connection termination using three-way handshaking

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

The FIN segment consumes one sequence


number if it does
not carry data.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Note

The FIN + ACK segment consumes


one sequence number if it
does not carry data.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Half-Close
• In TCP, one end can stop sending data while still receiving
data. This is called a halfclose
• It can occur when the server needs all the data before
processing can begin. A good example is sorting.
• The client sends data to the server to be sorted, the server
needs to receive all the data before sorting can start. This
means the client, after sending all data, can close the
connection in the client-to-server direction.
• However, the server-to-client direction must remain open to
return the sorted data. The server, after receiving the data,
still needs time for sorting; its outbound direction must
remain open

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Half-close

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
SCTP
• 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

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
SCTP Services
• Process-to-Process Communication
• SCTP, like UDP or TCP, provides process-to-
process communication.
• Multiple Streams

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
SCTP Services
• Multihoming

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
SCTP Services
• Full-Duplex Communication
• Connection-Oriented Service
• Reliable Service

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Summary
• UDP is an unreliable and connectionless
transport-layer protocol that creates a
process to process communication, which
means it requires little overhead and offers
fast delivery.
• The UDP packet is called a user datagram.
• UDP has no flow- or error-control
mechanism; its only attempt at error control
is the checksum
Maulika Patel SECE3011-
Computer Networks [Link]-Sem5
Summary
• Transmission Control Protocol (TCP) is
another transport-layer protocol in the
TCP/IP protocol suite.
• It provides process-to-process, full-duplex,
and connection oriented service.
• A TCP connection consists of three phases:
connection establishment, data transfer, and
connection termination.

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Summary
• SCTP is a message-oriented, reliable protocol
that combines the good features of UDP and
TCP.
• SCTP provides additional services not
provided by UDP or TCP, such as multiple-
stream and multihoming services

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
Exercise

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5
THANK YOU

Maulika Patel SECE3011-


Computer Networks [Link]-Sem5

You might also like