Chapter 11. User Datagram Protocol (UDP)

Similar documents
Transport Protocols. Internet has broadly two types of transport protocols as shown in figure below:

Unit 2.

Transport Layer. The transport layer is responsible for the delivery of a message from one process to another. RSManiaol

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

Objectives. Chapter 10. Upon completion you will be able to:

User Datagram Protocol UDP

(Refer Slide Time: 1:09)

TSIN02 - Internetworking

TSIN02 - Internetworking

TSIN02 - Internetworking

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

Process-to-Process Delivery:

TSIN02 - Internetworking

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP

ICMP. Outline ICMP. ICMP oicmp is provided within IP which generates error. Internet Control Message Protocol. Ping Traceroute

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

UNIT IV TRANSPORT LAYER

Process-la-Process Delivery: UDp, TCp, and SCTP

Lecture 4: The Transport Layer and UDP

Position of IP and other network-layer protocols in TCP/IP protocol suite

Chapter 7 Transport Layer. 7.0 Introduction 7.1 Transport Layer Protocols 7.2 TCP and UDP 7.3 Summary

Lecture 3: The Transport Layer: UDP and TCP

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

Chapter 24. Transport-Layer Protocols

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer

UDP: Datagram Transport Service

Department of Computer and IT Engineering University of Kurdistan. Transport Layer. By: Dr. Alireza Abdollahpouri

User Datagram Protocol(UDP)

The transport layer is responsible for the delivery ofa message from one process to another.

NT1210 Introduction to Networking. Unit 10

Transport Layer Protocols. Internet Transport Layer. Agenda. TCP Fundamentals

Transport Layer TCP & UDP Week 7. Module : Computer Networks Lecturers : Lucy White Office : 324

4.0.1 CHAPTER INTRODUCTION

CSCE 463/612 Networks and Distributed Processing Spring 2018

CHAPTER-2 IP CONCEPTS

Chapter 10 User Datagram Protocol (UDP)

The Transmission Control Protocol (TCP)

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

CS 4390 Computer Networks. Transport Services and Protocols

Chapter 7 Internet Protocol Version 4 (IPv4) Kyung Hee University

infrared Disadvantage: 1. cannot use for long-range communication or outside a building due to sun s rays.

Interconnecting Networks with TCP/IP

Internetwork Protocols

Problems of IP. Unreliable connectionless service. Cannot acquire status information from routers and other hosts

CSC 401 Data and Computer Communications Networks

Networking Technologies and Applications

ET4254 Communications and Networking 1

CMPE 80N: Introduction to Networking and the Internet

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

ECE4110 Internetwork Programming. Introduction and Overview

UNIT V. Computer Networks [10MCA32] 1

Development of reliable protocol Sliding window protocols. C = channel capacity in bps I = interrupt/service time + propagation delay

Lesson 5 TCP/IP suite, TCP and UDP Protocols. Chapter-4 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

TCP/IP and OSI Model. Lecture 10 TCP. Host-to-Host Transport Layer. TCP/IP and OSI Model (Continued) TCP Basic (Continued) TCP -- Basic

ECE697AA Lecture 3. Today s lecture

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

To make a difference between logical address (IP address), which is used at the network layer, and physical address (MAC address),which is used at

Introduction to TCP/IP networking

a. the physical layer, b. and the data-link layer. a. three physical layers, b. three data-link layers, c. and only one network layer.

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

OSI Transport Layer. objectives

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University

CN1047 INTRODUCTION TO COMPUTER NETWORKING CHAPTER 6 OSI MODEL TRANSPORT LAYER

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. ** Slides are attributed to J. F.

Chapter 5 End-to-End Protocols

Chapter 2 Network Models 2.1

Last time. Wireless link-layer. Introduction. Characteristics of wireless links wireless LANs networking. Cellular Internet access

User Datagram Protocol (UDP):

Introduction to Internetworking

CS-461 Internetworking. Dr. Mohamed Aboutabl

Different Layers Lecture 20

TSIN02 - Internetworking

INTERNET SYSTEM. Internet Protocol. Kent State University Dept. of Computer Science. CS 4/55231 Internet Engineering. Large Scale Networking

THE TRANSPORT LAYER UNIT IV

TCP/IP THE TCP/IP ARCHITECTURE

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

CSCD 330 Network Programming

06/02/ Local & Metropolitan Area Networks 0. INTRODUCTION. 1. History and Future of TCP/IP ACOE322

LESSON 3 PORTS AND PROTOCOLS

Introduction to the Transport Layer

UNIT 2 TRANSPORT LAYER

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Network Programming. Introduction to Sockets. Dr. Thaier Hayajneh. Process Layer. Network Layer. Berkeley API

Outline. Inter-Process Communication. IPC across machines: Problems. CSCI 4061 Introduction to Operating Systems

Internet Control Message Protocol (ICMP)

Input ports, switching fabric, output ports Switching via memory, bus, crossbar Queueing, head-of-line blocking

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Transport Layer. Chapter 3: Transport Layer

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TCP/IP protocol suite

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 11

Business Data Networks and Security 10th Edition by Panko Test Bank

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Transport Layer Overview

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

Chapter 5 OSI Network Layer

Transcription:

Chapter 11 User Datagram Protocol (UDP)

Outline Process-to-process communication User datagram Checksum UDP operation Use of UDP UDP package

Figure 11-1 Position of UDP in the TCP/IP Protocol Suite The McGraw-Hill Companies, Inc., 2000

Introduction A transport layer protocol usually has two responsibilities Create a process-to-process communications Provide control mechanism at the transport layer UDP does this task at a very minimal level It only provides error control to some extent

Introduction (Cont.) Thus, UDP is a connectionless, unreliable transport protocol Only add process-to-process to the IP And perform very limited error checking Advantages UDP is very simple protocol using a minimum of overhead

11.1 PROCESS TO PROCESS COMMUNICATION The McGraw-Hill Companies, Inc., 2000

Process-to-Process Communication Host-to-host communication Network layer protocol: IP Deliver the message only to the destination computer Process-to-process communication Transport layer protocol: UDP and TCP Deliver the message to the appropriate process

Figure 11-2 UDP Versus IP The McGraw-Hill Companies, Inc., 2000

Port Numbers Used to define the process 0~65535 Well-known port numbers Some servers needs to be assign a universal port number However, client s port number can be defined randomly Ephemeral port number

Figure 11-3 Port Numbers The McGraw-Hill Companies, Inc., 2000

Figure 11-4 IP Addresses Versus Port Numbers The McGraw-Hill Companies, Inc., 2000

IANA Ranges The IANA divides the port numbers into three ranges Well-known: assigned and controlled by IANA 0~1,023 Registered: not assigned or controlled by IANA 1,024~49,151 Can only be registered with IANA to prevent duplication Dynamic (or private): neither controlled nor registered 49152~65535 Ephemeral ports and can by used by any process

Figure 11-5 IANA Ranges The McGraw-Hill Companies, Inc., 2000

Well-Known Ports for UDP Port 7 9 11 13 17 19 53 67 68 Protocol Echo Discard Users Daytime Quote Chargen Nameserver Bootps Bootpc Description Echoes a received datagram back to the sender Discards any datagram that is received Active users Return the data and the time Returns a quote of a day Return a string of characters Domain Name Service Server port to download bootstrap information Client port to download bootstrap information

Well-Known Ports for UDP (Cont.) Port 69 111 123 161 162 Protocol TFTP RPC NTP SNMP SNMP Description Trivial File Transfer Protocol Remote Procedure Call Network Time Protocol Simple Network Management Protocol Simple Network Management Protocol (trap)

Socket Addresses UDP needs two identifiers The IP address The port number Socket address The combination of an IP address and a port number

Figure 11-6 Socket Addresses The McGraw-Hill Companies, Inc., 2000

11.2 USER DATAGRAM The McGraw-Hill Companies, Inc., 2000

User Datagram UDP packets: called user datagrams Have a fixed-size header of 8 bytes The fields are Source port number: 16-bits: 0~65535 Usually chosen by the UDP software Destination port number: 16-bits: 0~65535 Length: 16 bits: Total length (header plus data) of the user datagram Minimum length must be 8 bytes (contains only header) Checksum: 16 bits Detect errors over the entire user datagram (header plus data)

Figure 11-7 User Datagram Format The McGraw-Hill Companies, Inc., 2000

User Datagram (Cont.) However, the UDP length can also be derived from the IP header UDP length = IP length IP header s length Thus, theoretically, the length field in a UDP datagram is not necessary However, it is more efficient to derive the length of a UDP packet by the UDP package itself Ask the IP layer is time consuming

UDP length = IP length IP header s s length The McGraw-Hill Companies, Inc., 2000

11.3 CHECKSUM The McGraw-Hill Companies, Inc., 2000

Checksum UDP checksum calculation is different from the one for IP and ICMP The checksum includes three sections The Pseudoheader However, it will not appear in the UDP datagram The UDP header The data coming from the application layer

Pseudoheader Some part of the header of the IP packet with some fields are filled with 0s Fields Source and destination IP address Protocol To prevent that UDP datagram is correct but IP header is corrupted and be delivered to the wrong host To prevent the packet to deliver to the TCP UDP has the value of 17

Pseudoheader (Cont.) At the time TCP was created (1976), There was significant concern that there might not be proper end-to-end checking of the delivery of datagrams at the IP level Guarantee end-to-end encrypted TCP semantics Consider SA, DA should be shared between IP/TCP, UDP However, in the context of today's high-speed, highly-reliable networks The use of the pseudo header sometimes seems unnecessary

PseudoheaderAdded to the UDP Datagram

Checksum Calculation at Sender Add the pseudoheaderto the UDP datagram Fill the checksum field with zeros Divide the total bits into 16-bits words If the total number of bytes is not even Add 1 byte of padding (all 0s) Add all 16-bit section using one s complement arithmetic Complement the result and insert it in the checksum field Drop the pesudoheaderand any added padding Deliver the UDP datagram to the IP software

Checksum Calculation at Receiver Add the pseudoheaderto the UDP user datagram Add padding if needed Divide the total bits into 16-bit sections Add all 16-bit sections using one s complement arithmetic Complement the result If the result is all 0s Drop the pseudoheaderand any added padding Accept the user datagram Otherwise Discard the user datagram

Figure 11-9 Checksum Calculation of a Simple UDP User Datagram The McGraw-Hill Companies, Inc., 2000

Optional Use of the Checksum The calculation of the checksum in UDP is optional If the checksum is not calculated The field is filled with 0s

11.4 UDP OPERATION The McGraw-Hill Companies, Inc., 2000

UDP Operation Connectionless Services Flow and Error Control Encapsulation and Decapsulation Queuing

Connectionless Services Each user datagram is an independent datagram Even coming from the same source process The user datagram is not numbered No connection establishment and no connection termination

Flow and Error Control No flow control The receiver may overflow with incoming messages No error control except for the checksum The sender does not know if a message has been lost or duplicated

Figure 11-10 Encapsulation and Decapsulation The McGraw-Hill Companies, Inc., 2000

Figure 11-11 Queues in UDP The McGraw-Hill Companies, Inc., 2000

Figure 11-12 Multiplexing and Demultiplexing The McGraw-Hill Companies, Inc., 2000

11.5 USE OF UDP The McGraw-Hill Companies, Inc., 2000

Uses of UDP For a process that require simple request-response communication with little concern for flow and error control For a process with internal flow and error-control TFTP (Trivial File Transfer Protocol) For muticasting and broadcasting Embedded in UDP but not in the TCP software For some management processes For some route updating protocol RIP (Routing Information Protocol)

11.6 UDP PACKAGE The McGraw-Hill Companies, Inc., 2000

UDP Package Five components A control-block table Input queues A control-block module An input module An output module

Figure 11-13 UDP Package The McGraw-Hill Companies, Inc., 2000

Control-Block Table Keep track of the open ports Each entry has a minimum of four fields State: FREE or IN-USE Process ID Port number Corresponding queue number

Input Queues A set of input queues One for each process In the book s design They do not use output queues

Control-Block Module Manage the control-block table Pseudo code Receive: a process ID and a port number Search the control block table for a FREE entry Return If (not found) Delete an entry using a predefined strategy Create a new entry with the state IN-USE Enter the process ID and the port number

Input Module Receive: a user datagram from IP Look for the corresponding entry in the controlblock table If (found) Check the queue field to see if a queue is allocated If (no) Allocate a queue Enqueue the data in the corresponding queue If (not found) Return Ask the ICMP module to send an unreachable port message Discard the user datagram

Output Module Receive: data and information from a process Create a UDP data datagram Send the user datagram Return

Example: Control-Block Table at the Beginning State Process ID Port 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

Example 1 The first activity is the arrival of a user datagram with destination port number 52,012 The input module searches for this port number and finds it Queue number 38 has been assigned to this port The port has been previously used The input module sends the data to queue 38 The control-block table does not change

Example 2 After a few seconds, a process starts It asks the operating system for a port number and is granted port number 52,014 Now the process sends its ID (4,978) and the port number to the control-block module to create an entry in the table The module does not allocate a queue at this moment because no user datagrams have arrived for this destination

Modified Table After Example 2 State Process ID Port 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

Example 3 A user datagram now arrives for port 52,011 The input module checks the table and finds that no queue has been allocated for this destination This is the first time a user datagram has arrived for this destination The module creates a queue and gives it a number (43)

Modified Table After Example 3 State Process ID Port 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

Example 4 After a few seconds, a user datagram arrives for port 52,222 The input module checks the table Cannot find the entry for this destination The user datagram is dropped A request is made to ICMP to send an unreachable port message to the source

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