Chapter 11 User Datagram Protocol (UDP)

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Transport Layer PART V.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 13 Introduction to the Transport.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
UDP - User Datagram Protocol UDP – User Datagram Protocol Author : Nir Shafrir Reference The TCP/IP Guide - ( Version Version.
1 K. Salah Module 6.0: Transport Layer Protocols UDP & TCP Chapter 23 & 24.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
Chapter 14 User Datagram Program (UDP)
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
Process-to-Process Delivery:
Ch 23 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Ameera Almasoud.
Process-to-Process Delivery:
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
資 管 Lee Lesson 8 User Datagram Protocol (UDP). 資 管 Lee UDP TCP/IP protocol suite specifies two protocols for the transport layer:UDP and TCP ICMP IP TCP.
Hyung-Min Lee©Networking Lab., 2001 Chapter 11 User Datagram Protocol (UDP)
User Datagram Protocol, UDP 指導老師:梁德昭 老師 學生:吳雅真 學號: 日期:
TCP/IP: Basics1 User Datagram Protocol (UDP) Another protocol at transport layer is UDP. It is Connectionless protocol i.e. no need to establish & terminate.
ICE 302 T RANSPORT LAYER Md. Asif Hossain Term # 2 Lecture # 1 1 Thanks to A. B. Forouzan.
User Datagram Protocol (UDP)
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.6 UDP Principles (Chapter 24) (User Datagram Protocol)
1 Kyung Hee University Chapter 13 Introduction to the Transport Layer.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_a Transport Protocols - UDP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
Fundamentals of Computer Networks ECE 478/578 Lecture #19: Transport Layer Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s.
Transport Layer3-1 Chapter 3 Transport Layer These ppt slides are originally from the Kurose and Ross’s book. But some slides are deleted and added for.
23.1 Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CSC/ECE 573 Internet Protocols User Datagram Protocol.
Process-to-Process Delivery:
1 Kyung Hee University Chapter 8 Internet Protocol (IP)
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
Chapter 13 Introduction to the Transport Layer
1 Kyung Hee University PART 5 Transport Layer. 2 Kyung Hee University Role of position of Transport Layer  Overseeing the delivery of data from a process,
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
TCP/IP Illustrated, Volume 1: The Protocols Chapter 6. ICMP: Internet Control Message Protocol ( 월 ) 김 철 환
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 11 User Datagram Protocol (UDP)
1 Kyung Hee University Chapter 11 User Datagram Protocol.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 14 User Datagram Protocol (UDP) Introduction  Responsibilities of Transport Layer to create a process-to-process communication l using.
1 K. Salah Application Layer Module K. Salah Network layer duties.
Process-to-Process Delivery:
TCP/IP Protocol Suite 1 Chapter 10 Upon completion you will be able to: Internet Group Management Protocol Know the purpose of IGMP Know the types of IGMP.
Chapter 11 User Datagram Protocol
The Transport Layer Implementation Services Functions Protocols
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery, TCP and UDP protocols
Chapter 14 User Datagram Program (UDP)
PART 5 Transport Layer Computer Networks.
TCP Transport layer Er. Vikram Dhiman LPU.
User Datagram Protocol (UDP)
Subject Name: Computer Communication Networks Subject Code: 10EC71
Transport Layer Our goals:
Chapter 14 User Datagram Protocol (UDP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery:
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
CPEG514 Advanced Computer Networkst
CSCD 330 Network Programming
PART V Transport Layer.
Chapter 14 User Datagram Program (UDP)
PART 5 Transport Layer.
Process-to-Process Delivery: UDP, TCP
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer 9/22/2019.
Presentation transcript:

Chapter 11 User Datagram Protocol (UDP) Mi-Jung Choi Dept. of Computer Science and Engineering mjchoi@postech.ac.kr

Contents 11.1 PROCESS-TO-PROCESS COMMUNICATION 11.2 USER DATAGRAM 11.3 CHECKSUM 11.4 UDP OPERATION 11.5 USE OF UDP 11.6 UDP PACKAGE

Objectives Be able to explain process-to-process communication Know the format of a UDP user datagram Be able to calculate a UDP checksum Understand the operation of UDP Know when it is appropriate to use UDP Understand the modules in a UDP package

Position of UDP in TCP/IP

UDP protocol duties To create a process-to-process communication: UDP port number Error control to some extent If UDP detects an error in the received packet, it silently drops it No flow control and no acknowledgement for received data Connectionless, unreliable transport protocol A very simple protocol using minimum overhead The disadvantages come some advantages Sending a small messages b/w UDP

11.1 PROCESS-TO-PROCESS COMMUNICATION Before we examine UDP, we must first understand host-to-host communication and process-to-process communication and the difference between them. The topics discussed in this section include: Port Numbers Socket Addresses

11.1 PROCESS-TO-PROCESS COMMUNICATION

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) Prot Number Process-to-process communication: client-server paradigm Both process (client and server) have the same name Daytime client process / daytime server Today OS supports multi-user and multi-processors A remote computer can run several server programs at same time A local computer can run several client programs at same time For communication, we must define the local host local process remote host remote process

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) Port number for process communication Local host and remote host: IP address Process: port number Range of port number : integer b/w 0 ~ 65,535 well-known port number (1 ~ 1023) registered port (1,024 ~ 49,151) ephemeral port number(49,152 ~ 65,535)

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) IP address vs. port number

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) IANA(Internet Assigned Numbers Authority) range Well-known port: 0 ~ 1,023 Registered port: 1,024 ~ 49,151 Ephemeral port number(dynamic port): 49,152 ~ 65,535

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) Well-known port in UDP Port Protocol Description 7 Echo Echoes a received datagram back to the sender 9 Discard Discards any datagram that is received 11 Users Active users 13 Daytime Returns the date and the time 17 Quote Returns a quote of the day 19 Chargen Returns a string of characters 53 Nameserver Domain Name Service 67 Bootps Server port to download bootstrap information 68 Bootpc Client port to download bootstrap information 69 TFTP Trivial File transfer Protocol 111 RPC Remote Procedure Call 123 NTP Network Time Protocol 161 SNMP Simple Network Management Protocol 162 Simple Network Management Protocol (trap)

Example 1 See Next Slide  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 TFTP. Note TFTP can use port 69 on either UDP or TCP. $ grep tftp /etc/services tftp 69/tcp tftp 69/udp See Next Slide 

Example 1 (cont.) SNMP uses two port numbers (161 and 162), each for a different purpose, as we will see in Chapter 21 $ grep snmp /etc/services snmp 161/tcp #Simple Net Mgmt Proto snmp 161/udp #Simple Net Mgmt Proto snmptrap 162/udp #Traps for SNMP

11.1 PROCESS-TO-PROCESS COMMUNICATION (cont.) Socket Address Combination of IP address and port number

UDP length = IP length − IP header’s length 11.2 USER DATAGRAM UDP packets are called user datagrams and have a fixed-size header of 8 bytes. UDP length = IP length − IP header’s length

11.2 USER DATAGRAM Format source port number destination port number length : header + data (0~65,535) checksum : to detect error for entire user datagram (Pseudoheader + header + data)

11.3 CHECKSUM The topics discussed in this section include: UDP checksum calculation is different from the one for IP and ICMP. Here the checksum includes three sections: a pseudoheader, the UDP header, and the data coming from the application layer. The topics discussed in this section include: Checksum Calculation at Sender Checksum Calculation at Receiver Optional Use of the Checksum

11.3 Checksum (cont.) Pseudoheader added to UDP header

11.3 Checksum (cont.) Checksum calculation at receiver Add the peudoheader to UDP user datagram Fill the checksum field with 0s Divide the total bits into 16-bit (2 bytes) sections If the total number of bytes is not even, add 1 byte of padding (all 0s). The padding is only for the purpose of calculating the checksum and will be discarded afterwards. Add all 16-bit sections using one’s complement arithmetic Complement the result, which is a 16-bit number, and insert in the checksum field Drop the peudoheader and any added padding Deliver the user datagram to the IP layer for encapsulation

11.3 Checksum (cont.) Checksum calculation of a UDP user datagram

11.3 Checksum (cont.) Checksum calculation at receiver Add the peudoheader to UDP user datagram Add padding if needed Divide the total bits into 16-bit (2 bytes) sections Add all 16-bit sections using one’s complement arithmetic Complement the result If the result is all 0s, drop the peudoheader and any added padding and accept the user datagram. If the result anything else, discard the user datagram

11.4 UDP OPERATION The topics discussed in this section include: UDP uses concepts common to the transport layer. These concepts will be discussed here briefly, and then expanded in the next chapter on the TCP protocol. The topics discussed in this section include: Connectionless Services Flow and Error Control Encapsulation and Decapsulation Queuing Multiplexing and Demultiplexing

11.4 UDP OPERATION Connectionless services No flow control and a simple error check Encapsulation and Decapsulation

11.4 UDP OPERATION (cont.) Queuing of UDP A client site, when a process starts, some implements create both an incoming and outgoing queue associated with each process identified by ephemeral port number. When process terminates, the queues are destroyed. If an outgoing queue is overflow, the OS ask the client process to wait before sending any more messages. When message arrived for a client, UDP checks to have been created an incoming queue for the port number of arrived user datagram. If there is no such incoming queue, UDP discard the user datagram, ask the ICMP to send a port unreachable message to the server.

11.4 UDP OPERATION (cont.) Queues in UDP

UDP vs. TCP communication 응용 UDP 역다중화 datagram dtatgram 다중화

11.4 UDP OPERATION (cont.) Multiplexing and Demultiplexing

11.5 USE OF UDP A simple request-response communication with little concern for flow and error control (not to send bulk data: ftp…) A process with internal flow and error control mechanism. Transport protocol for multicasting and broadcasting. For management process such as SNMP For some route updating protocols such as RIP (Routing Information Protocol)

11.6 UDP PACKAGE To show how UDP handles the sending and receiving of UDP packets, we present a simple version of the UDP package. The UDP package involves five components: a control-block table, input queues, a control-block module, an input module, and an output module. The topics discussed in this section include: Control-Block Table Input queue Control-block module Input module Output module

11.6 UDP PACKAGE (cont.) UDP design

11.6 UDP PACKAGE (cont.) Control Block Table Input Queue Table to keep track of open ports Table entries (state, process ID, port number, queue number) Input Queue One for each process 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

11.6 UDP PACKAGE (cont.) Control-Block Module Algorithm Management of the control block table When process starts, it asks for a port number from the OS OS assigns well-know port numbers to server and ephemeral port numbers to client The process passes the process ID and port number to the control block module to create an entry in the table for the process Algorithm Receive: a process ID and a port number. 1. Search the control block table for a FREE entry. 1. If (not found) 1. Delete an entry using a predefined strategy. 2. Create a new entry with the state IN-USE. 3. Enter the process ID and the port number. 2. Return

11.6 UDP PACKAGE (cont.) Input Module Algorithm It receives a user datagram from IP layer It searches the control block table to find same port number as this user datagram If the entry is found, the module uses the information in the entry to enqueue the data in the corresponding queue If the entry is not found, it generates an ICMP message Algorithm Receive: a user datagram from IP 1. Look for the corresponding entry in the control-block table. 1. If (found) 1. Check the queue field to see if a queue is allocated. 1. If (no) 1. Allocate a queue. 2. Enqueue the data in the corresponding queue. 2. If (not found) 1. Ask the ICMP module to send an “unreachable port” message. 2. Discard the user datagram. 2. Return

11.6 UDP PACKAGE (cont.) Output module Algorithm Responsible for creating and sending user datagram Algorithm Receive: data and information from a process Create a UDP user datagram. Send the user datagram. Return.

Example 2 Control-block table at the beginning Example 2 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, which means that the port has been previously used. The input module sends the data to queue 38. The control-block table does not change. 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

Example 3 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 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 4 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 since this is the first time a user datagram has arrived for this destination. The module creates a queue and gives it a number (43). 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

Examples 5 & 6 Example 5: 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. Example 6: 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.