• No results found

Chapter 11. User Datagram Protocol (UDP)

N/A
N/A
Protected

Academic year: 2021

Share "Chapter 11. User Datagram Protocol (UDP)"

Copied!
27
0
0

Loading.... (view fulltext now)

Full text

(1)

©The McGraw-Hill Companies, Inc., 2000 11 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Chapter 11

User Datagram Protocol

(UDP)

(2)

CONTENTS CONTENTS

• PROCESS-TO-PROCESS COMMUNICATION

• USER DATAGRAM

• CHECKSUM

• UDP OPERATION

• USE OF UDP

• UDP PACKAGE

(3)

©The McGraw-Hill Companies, Inc., 2000 33 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Position of UDP in the TCP/IP protocol suite

(4)

UDP Services

• Process-to-process communication using “Ports.”

Fundamentally, this is the only thing it adds on top of IP.

• Control:

– No flow control or acknowledgment

– Minimal error control: simply detect and drop.

• No Segmentation/Reassembly service. Incoming data must fit in a UDP packet.

• Connectionless & Unreliable transport.

• Minimal overhead, compared to TCP

(5)

©The McGraw-Hill Companies, Inc., 2000 55 © Adapted for use at JMU by Mohamed Aboutabl, 2003

PROCESS TO PROCESS COMMUNICATION 11.1 11.1

UDP versus IP

(6)

Client-Server Paradigm & Ports

• A Client process on a local host sends a request to a Server process on a remote host.

• Client process identification:

– Local host IP

– Ephemeral port number (0-65,535) randomly chosen by UDP

• Server process identification – Remote host IP

– Well-known port number

(7)

©The McGraw-Hill Companies, Inc., 2000 77 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Role of IP addresses vs. Port numbers

(8)

IANA Port Number Ranges

Simple Network Management Protocol SNMP

161

Network Time Protocol NTP

123

Remote procedure call RPC

111

Returns the date and time Daytime

13

Echoes a received datagram back to sender Echo

7

Description Protocol

Port

(9)

©The McGraw-Hill Companies, Inc., 2000 99 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Socket addresses

UDP Header UDP Header IP Header

IP Header

(10)

UDP Packets or User Datagram 11.2 11.2

Max UDP Data length

= 65535 - UDP Header (8) - Smallest IP header(20)

= 65,507

(11)

©The McGraw-Hill Companies, Inc., 2000 1111 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Checksum 11.3 11.3

• Checksum covers three sections:

1. Pseudoheader (which does not physically exist as part of the user datagram)

2. UDP header

3. Data coming from Application Layer whose length must be

an even number of Bytes. Padding may be added to help

compute the checksum, then eliminated be.

(12)

Pseudoheader added to the UDP datagram

(13)

©The McGraw-Hill Companies, Inc., 2000 1313 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Checksum calculation of a

simple UDP user datagram

(14)

UDP Operation 11.4 11.4

• Its Connectionless:

– Independent user datagrams, even if from same source socket to same destination socket. No streaming is

supported.

– Data must be small enough to fit in one user datagram.

• No flow or error control

– If checksum fail, destination silently drops the datagram.

– Source gets no idea whether the user datagram has arrived.

(15)

©The McGraw-Hill Companies, Inc., 2000 1515 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Encapsulation and decapsulation

+ pair of sockets + pair of sockets + data length + data length

Protocol = Protocol =

17

17 + Sender/Receiver IP + Sender/Receiver IP

+ sender’s socket

+ sender’s socket

(16)

Queues in UDP

(17)

©The McGraw-Hill Companies, Inc., 2000 1717 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Multiplexing and demultiplexing

(18)

Use of UDP 11.5 11.5

• Simple request-response communication (no bulk data)

• Processes with Internal flow and error-control mechanisms (e.g. Trivial FTP).

• Multicasting and Broadcasting

• Management processes (e.g. SNMP)

• Routing Information Protocol (RIP) for route updating.

(19)

©The McGraw-Hill Companies, Inc., 2000 1919 © Adapted for use at JMU by Mohamed Aboutabl, 2003

UDP Package

11.6 11.6

(20)

Examples

Control-block table at the beginning State

State Process ID Process ID Port Number Port Number Queue Number Queue Number ---

--- --- --- --- --- --- ---

IN-USE 2,345 52,010 34

IN-USE 3,422 52,011

FREE

IN-USE 4,652 52,012 38

FREE

(21)

©The McGraw-Hill Companies, Inc., 2000 2121 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Example 1 Example 1

The first activity is the arrival of a user

(22)

Example 2 Example 2

After a few seconds, a process starts. It asks

(23)

©The McGraw-Hill Companies, Inc., 2000 2323 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Modified table after Example 2

State

State Process ID Process ID Port Number Port Number Queue Number Queue Number ---

--- --- --- --- --- --- ---

IN-USE 2,345 52,010 34

IN-USE 3,422 52,011

IN-USE 4,978 52,014

IN-USE 4,652 52,012 38

FREE

(24)

Example 3 Example 3

A user datagram now arrives for port 52,011.

(25)

©The McGraw-Hill Companies, Inc., 2000 2525 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Modified table after Example 3

State

State Process ID Process ID Port Number Port Number Queue Number Queue Number ---

--- --- --- --- --- --- ---

IN-USE 2,345 52,010 34

IN-USE 3,422 52,011 43

IN-USE 4,978 52,014

IN-USE 4,652 52,012 38

FREE

(26)

Example 4 Example 4

After a few seconds, a user datagram arrives for port 52,222. The input module checks the table and cannot find the entry for this destination. The user datagram is dropped and a request is made to ICMP to send an

“unreachable port” message to the source.

(27)

©The McGraw-Hill Companies, Inc., 2000 2727 © Adapted for use at JMU by Mohamed Aboutabl, 2003

Example 5 Example 5

After a few seconds, a process needs to send

a user datagram. It delivers the data to the

output module which adds the UDP header

and sends it.

References

Related documents

Complete testing of a wireless service must separately test the components in each of the radio access network, wireless core network and Internet core networks, test each of the

Strong notions of secrecy such as forward and backward se- crecy must also be guaranteed even if adversary A corrupts the whole system by obtaining the session master key and the

In this work we establish such lower bounds for previously studied restricted classes of algebraic circuits, and show these lower bounds are interesting by providing non-trivial

Each level of government and stakeholder group was invited to share experience and information in the areas covered by the impact assessment questionnaire, with a focus on

Furthermore, imino-quinolyl platinum(II) complexes showed slightly superior cytotoxic activities compared to their palladium(II) counterparts across the examined

Since the first demonstration of printed graphene electronics, this field has witnessed four major advances: the functional material set has evolved from graphene alone to a wider

The specific archiving services as offered by the E-depot could be generic services in the reference architecture, similar to document management services (see Figure 7)..

Scene analysis, where a Convolutional Neural Network (CNN) is used for object detection followed by generation of grasping points using ob- ject edge image and an algorithm