Chapter 23
Process-to-Process Delivery:
UDP, TCP, and SCTP
23.1
23-1 PROCESS-TO-PROCESS DELIVERY
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, as we will
see later.
Topics covered in this chapter:
Client/Server Paradigm
Multiplexing and Demultiplexing
Connectionless Versus Connection-Oriented Service
Reliable Versus Unreliable
Three Protocols
23.2
Note
The transport layer is responsible for
process-to-process delivery.
23.3
Figure 23.1 Types of data deliveries
23.4
Client/Server Paradigm
Although there are several ways to achieve
process-to-process communication, the most
common one is through the client/server
paradigm. A process on the local host, called a
client, needs services from a process usually on
the remote host, called a server.
Both processes (client and server) have the
same name. For example, to get the day and
time from a remote machine, we need a
Daytime client process running on the local
host and a Daytime server process running on
a remote machine.
23.5
Addressing
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.
At the network layer, we need an IP address
to choose one host among millions.
(Read details from pages 704-705)
23.6
Figure 23.2 Port numbers
23.7
Figure 23.3 IP addresses versus port numbers
23.8
lANA Ranges
The lANA (Internet Assigned Number Authority)
has divided the port numbers into three ranges:
well, known, registered, and dynamic (or private),
as shown in Figure 23.4.
Well-known ports: The ports ranging from 0 to 1023 are
assigned and controlled by lANA. These are the well-known
ports.
Registered ports: The ports ranging from 1024 to 49,151
are not assigned or controlled by lANA. They can only be
registered with lANA to prevent duplication.
Dynamic ports. The ports ranging from 49,152 to 65,535
are neither controlled nor registered. They can be used by
any process. These are the ephemeral ports.
23.9
Figure 23.4 IANA ranges
23.10
Socket address
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 (see Figure 23.5).
23.11
Figure 23.5 Socket address
23.12
Figure 23.6 Multiplexing and demultiplexing
23.13
Connectionless Versus
Connection-Oriented
Service
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 either. UDP, is
connectionless.
23.14
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.
We will see shortly that TCP and
SCTP are connection-oriented
protocols.
23.15
Reliable Versus Unreliable
The transport layer service can be reliable or
unreliable. If the application layer program
needs reliability, we use a reliable transport
layer protocol by implementing flow and error
control at the transport layer. This means a
slower and more complex service. 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.
23.16
In the Internet, there are three
common different transport layer
protocols, as we have already
mentioned. UDP is connectionless
and unreliable; TCP and SCTP are
connection oriented and reliable.
23.17
Figure 23.7 Error control
23.18
Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite
23.19
23-2 USER DATAGRAM PROTOCOL (UDP)
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 instead of host-to-
host communication.
Topics discussed in this section:
Well-Known Ports for UDP
User Datagram
Checksum
UDP Operation
Use of UDP
23.20
Table 23.1 Well-known ports used with UDP
23.21
Example 23.1
In UNIX, the well-known ports are stored in a file
called /etc/services. Each line in this file gives the name
of the server and the well-known port number. We can
use the
grep utility to extract the line corresponding to the desired
application. The following shows the port for FTP. Note
that FTP can use port 21 with either UDP or TCP.
23.22
Example 23.1 (continued)
SNMP uses two port numbers (161 and 162), each for a
different purpose, as we will see in Chapter 28.
23.23
Figure 23.9 User datagram format
23.24
Note
UDP length
= IP length – IP header’s length
23.25
Figure 23.10 Pseudoheader for checksum calculation
23.26
Example 23.2
Figure 23.11 shows the checksum calculation for a very
small user datagram with only 7 bytes of data. Because
the number of bytes of data is odd, padding is added for
checksum calculation. The pseudoheader as well as the
padding will be dropped when the user datagram is
delivered to IP.
23.27
Figure 23.11 Checksum calculation of a simple UDP user datagram
23.28
Figure 23.12 Queues in UDP
23.29
Use of UDP
UDP is suitable for a process that requires simple
request-response communication with little concern
for flow and error control.
UDPis 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.
UDP is a suitable transport protocol for multicasting.
Multicasting capability is embedded in the UDP
software but not in the TCP software.
UDP is used for management processes such as
SNMP
UDP is used for some route updating protocols such
as Routing Information Protocol (RIP)
23.30