User Datagram Program (UDP) : TCP/IP Protocol Suite

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 18

Chapter 14

User
Datagram
Program
(UDP)

TCP/IP Protocol Suite 1


Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
OBJECTIVES:
 To introduce UDP and show its relationship to other protocols in
the TCP/IP protocol suite.
 To explain the format of a UDP packet and discuss the use of
each field in the header.
 To discuss the services provided by the UDP such as process-to-
process delivery, multiplexing/demultiplexing, and queuing.
 To discuss how some application programs can benefit from the
simplicity of UDP.
 To briefly discuss the structure of the UDP package.

TCP/IP Protocol Suite 2


Chapter 14.1 Introduction
Outline 14.2 User Datagram

14.3 UDP Services

14.4 UDP Application

14.5 UDP Package

TCP/IP Protocol Suite 3


14-1 INTRODUCTION

Figure 14.1 shows the relationship of the User


Datagram Protocol (UDP) to the other protocols and
layers of the TCP/IP protocol suite: UDP is located
between the application layer and the IP layer, and
serves as the intermediary between the application
programs and the network operations.

TCP/IP Protocol Suite 4


Figure 14.1 Position of UDP in the TCP/IP protocol suite

TCP/IP Protocol Suite 5


14-2 USER DATAGRAM

UDP packets, called user datagrams, have a fixed-size


header of 8 bytes. Figure 14.2 shows the format of a
user datagram.

TCP/IP Protocol Suite 6


Figure 14.2 User datagram format

TCP/IP Protocol Suite 7


Example 14.1
The following is a dump of a UDP header in hexadecimal format.

a. What is the source port number?


b. What is the destination port number?
c. What is the total length of the user datagram?
d. What is the length of the data?
e. Is the packet directed from a client to a server or vice versa?

TCP/IP Protocol Suite 8


Example 14.1 Continued
Solution
a. The source port number is the first four hexadecimal digits
(CB84)16 or 52100.
b. The destination port number is the second four hexadecimal
digits (000D)16 or 13.
c. The third four hexadecimal digits (001C)16 define the length of
the whole UDP packet as 28 bytes.
d. The length of the data is the length of the whole packet
minus the length of the header, or 28 – 8 = 20 bytes.
e. Since the destination port number is 13 (well-known port), the
packet is from the client to the server.

TCP/IP Protocol Suite 9


Topics Discussed in the Section
 Process-to-Process Communication
 Connectionless Service
 Flow Control
 Error Control
 Congestion Control
 Encapsulation and Decapsulation
 Queuing
 Multiplexing and Demultiplexing
 Comparison between UDP and Generic Simple
Protocol
TCP/IP Protocol Suite 10
TCP/IP Protocol Suite 11
Figure 14.5 Encapsulation and decapsulation

TCP/IP Protocol Suite 12


Figure 14.6 Queues in UDP

TCP/IP Protocol Suite 13


Figure 14.7 Multiplexing and demultiplexing

TCP/IP Protocol Suite 14


Note

UDP is an example of the


connectionless simple protocol

TCP/IP Protocol Suite 15


Topics Discussed in the Section
 UDP Features
 Typical Applications

TCP/IP Protocol Suite 16


Example 14.6
Assume we are downloading a very large text file from the
Internet. We definitely need to use a transport layer that provides
reliable service. We don’t want part of the file to be missing or
corrupted when we open the file. The delay created between the
delivery of the parts are not an overriding concern for us; we wait
until the whole file is composed before looking at it. In this case,
UDP is not a suitable transport layer.

TCP/IP Protocol Suite 17


Example 14.7
Assume we are watching a real-time stream video on our
computer. Such a program is considered a long file; it is divided
into many small parts and broadcast in real time. The parts of the
message are sent one after another. If the transport layer is
supposed to resend a corrupted or lost frame, the synchronizing
of the whole transmission may be lost. The viewer suddenly sees a
blank screen and needs to wait until the second transmission
arrives. This is not tolerable. However, if each small part of the
screen is sent using one single user datagram, the receiving UDP
can easily ignore the corrupted or lost packet and deliver the rest
to the application program. That part of the screen is blank for a
very short period of the time, which most viewers do not even
notice. However, video cannot be viewed out of order, so
streaming audio, video, and voice applications that run over UDP
must reorder or drop frames that are out of sequence.

TCP/IP Protocol Suite 18

You might also like