User Datagram Protocol (UDP)

Similar documents
Chapter 11. User Datagram Protocol (UDP)

Network Layer: Network Layer and IP Protocol

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

IP - The Internet Protocol

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

8.2 The Internet Protocol

SUPPORT DE COURS. Dr. Omari Mohammed Maître de Conférences Classe A Université d Adrar Courriel : omarinmt@gmail.com

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Auxiliary Protocols

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Network Programming TDC 561

Network Layer: Address Mapping, Error Reporting, and Multicasting

Ethernet. Ethernet. Network Devices

User Datagram Protocol - Wikipedia, the free encyclopedia

Internet Control Protocols Reading: Chapter 3

Internet Protocols. Background CHAPTER

04 Internet Protocol (IP)

Transport Layer Protocols

2. IP Networks, IP Hosts and IP Ports

Internet Protocol version 4 Part I

Protocols and Architecture. Protocol Architecture.

RARP: Reverse Address Resolution Protocol

Chapter 3. Internet Applications and Network Programming

Transport and Network Layer

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Subnetting,Supernetting, VLSM & CIDR

Internet Architecture and Philosophy

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Internet Protocols. Addressing & Services. Updated:

How do I get to

NETWORK LAYER/INTERNET PROTOCOLS

Computer Networks UDP and TCP

Network Models and Protocols

Internetworking. Problem: There is more than one network (heterogeneity & scale)

Chapter 5. Transport layer protocols

TCP/IP and Encryption. CIT304 University of Sunderland Harry R. Erwin, PhD

TCP/IP and the Internet

Lecture Computer Networks

Technical Support Information Belkin internal use only

Configuring Channel Access. Jeff Hill

Network Models OSI vs. TCP/IP

Electronic Mail

Address Resolution Protocol (ARP), Reverse ARP, Internet Protocol (IP)

Note! The problem set consists of two parts: Part I: The problem specifications pages Part II: The answer pages

Objectives of Lecture. Network Architecture. Protocols. Contents

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Computer Networks - Xarxes de Computadors

TCP/IP Programming. Joel Snyder, Opus1 Geoff Bryant, Process Software

Final for ECE374 05/06/13 Solution!!

[Prof. Rupesh G Vaishnav] Page 1

Overview of TCP/IP. TCP/IP and Internet

Interconnection of Heterogeneous Networks. Internetworking. Service model. Addressing Address mapping Automatic host configuration

Lab 1: Packet Sniffing and Wireshark

Overview of Computer Networks

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Operating System Concepts. Operating System 資 訊 工 程 學 系 袁 賢 銘 老 師

Computer Networks. Lecture 3: IP Protocol. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

Introduction to Analyzer and the ARP protocol

SSC - Communication and Networking Java Socket Programming (II)

Internet Concepts. What is a Network?

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Unix System Administration

Transport Layer. Chapter 3.4. Think about

Internetworking and IP Address

La couche transport dans l'internet (la suite TCP/IP)

Network Working Group Request for Comments: 840 April Official Protocols

Unit 4. Introduction to TCP/IP. Overview. Description. Unit Table of Contents

Virtual Server and DDNS. Virtual Server and DDNS. For BIPAC 741/743GE

EXPLORER. TFT Filter CONFIGURATION

Computer Networks/DV2 Lab

Cape Girardeau Career Center CISCO Networking Academy Bill Link, Instructor. 2.,,,, and are key services that ISPs can provide to all customers.

Introduction To Computer Networking

Variable length subnetting

Lecture 28: Internet Protocols

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

Chapter 13 Internet Protocol (IP)

Strategies. Addressing and Routing

TCP/IP Network Essentials. Linux System Administration and IP Services

Introduction to TCP/IP

Introduction to Computer Networks

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Lecture 8. IP Fundamentals

Datacommunication. Internet Infrastructure IPv4 & IPv6

Linux MPS Firewall Supplement

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Introduction to IP networking

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address

The Internet. Internet Technologies and Applications

Networking Test 4 Study Guide

TCP/UDP # General Name Short Description

Dynamic Host Configuration Protocol (DHCP) 02 NAT and DHCP Tópicos Avançados de Redes

Review: Lecture 1 - Internet History

Networking Applications

Transcription:

Content User Datagram Protocol () Linda Wu protocol Process-to-process communication Port number assignment User datagram operation (CMPT 471 2003-3) Reference: chapter 12 Notes-8 CMPT 471 2003-3 2 Protocol Protocol (cont.) User Datagram Protocol Allows multiple application programs executing on a computer to send and receive datagrams independently Uses to transport messages between machines Unreliable, connectionless datagram delivery Application Transport Network Data link physical SMTP FTP DNS SNMP IGMP TCP ICMP Underlying LAN / WAN technology ARP BOOTP RARP Notes-8 CMPT 471 2003-3 3 Notes-8 CMPT 471 2003-3 4

Protocol (cont.) Transport protocol responsibilities Create process-to-process communication : port number Provide control mechanism at transport level : no flow control or acknowledgement for received packets; provide error control to some extent Provide connection mechanism for processes : receive data unit from process, deliver it unreliably to the receiver; the data unit must be small enough to fit in a packet Protocol (cont.) Why use? is a very simple protocol using a minimum of overhead Suitable for a process that wants to send a small message and does not care much about reliability Suitable for a process with internal flow control and error-control mechanism is used in: SNMP, R, multicasting, broadcasting Notes-8 CMPT 471 2003-3 5 Notes-8 CMPT 471 2003-3 6 Process-to-Process Communication Host-to-host communication At computer level Message is delivered to the destination machine protocol Process-to-process communication At process level Message is delivered to the appropriate process Transport protocol such as Process-to-Process Communication (cont.) Client-server paradigm for process-toprocess communication Client: process that needs services; multiple client programs can run on a local computer Server: process that provides services; multiple server programs can run in a remote computer Definitions: Local host address Local process port number Remote host address Remote process port number Notes-8 CMPT 471 2003-3 7 Notes-8 CMPT 471 2003-3 8

Process-to-Process Communication (cont.) address v.s. port number 141.14.26.7 13 141.14.26.7... address: selects the host 13 13 Port #: selects the process Port Number Assignment Port numbers in TCP/ 0 ~ 65,535 IANA ranges Well-known ports (0 ~ 1,023): assigned and controlled by IANA Registered ports (1,024 ~ 49,151): be registered with IANA to prevent duplication Dynamic ports (49,152 ~ 65,535): can be used by any process Server port number Universal port number: well-known port number Client port number Dynamic binding: not globally known, chosen randomly by the software Notes-8 CMPT 471 2003-3 9 Notes-8 CMPT 471 2003-3 10 Port Number Assignment (cont.) Well-known ports used with Port 0 7 11 13 17 19 53 67 68 Unix keyword - Echo User Daytime Quote Chargen Nameserver Bootps Bootpc Description Reserved Echo a received datagram back to the sender Active users Return the date and time Return a quote of the day Return a string of characters Domain name service Server port to download bootstrap information Client port to download bootstrap information Notes-8 CMPT 471 2003-3 11 Port Number Assignment (cont.) Port numbers in Linux File /etc/services Use IANA port assignment Gives network service names, the corresponding protocol names and port numbers Most of the well-known port numbers are assigned to both and TCP Notes-8 CMPT 471 2003-3 12

User Datagram message is called user datagram Source / destination port Message length: # of bytes in both and data area ( 8) length = length length Checksum: applies to entire datagram data area: (65,535 8 20) bytes 0 Source Port (optional) Message Length Destination Port Checksum (optional) Notes-8 CMPT 471 2003-3 13 16 DATA 31 User Datagram (cont.) Checksum calculation Checksum: an optional field All 0s: to indicate the checksum has not been computed All 1s (negative zero): computed checksum is zero pseudo- Source / destination address PROTO: to ensure the packet belongs to, not to TCP; = 17 length: length of datagram, not including pseudo- * Not transmitted with datagram Notes-8 CMPT 471 2003-3 14 User Datagram (cont.) User Datagram (cont.) Pseudo 0 ZERO 8 Source Port Source address PROTO Message Length 16 Destination address length Destination Port Checksum DATA (Add padding to make the data a multiple of 16 bits) 31 Checksum calculation at sender 1. Add pseudo- to datagram 2. Fill in the checksum field with zeros 3. Divide the total bits into 16-bits words 4. If # of bytes is not even, add 1 byte of padding (all 0s) 5. Add all 16-bit sections using one s complement arithmetic 6. Complement the result (0 1, 1 0), which is a 16-bit number, and insert it to the checksum field 7. Drop the pseudo- and any padding 8. Deliver the datagram to the software for encapsulation Notes-8 CMPT 471 2003-3 15 Notes-8 CMPT 471 2003-3 16

User Datagram (cont.) Checksum calculation at receiver 1. Add pseudo- to datagram 2. Add padding if needed 3. Divide the total bits into 16-bits sections 4. Add all 16-bit sections using one s complement arithmetic 5. Complement the result 6. If the result is all 0s, drop the pseudo and any padding and accept the the datagram; otherwise, discard the datagram User Datagram (cont.) Purpose of pseudo- To verify that the datagram has reached its correct destination ( address, port number) Pseudo- assemble Sender side: the fields values are known Receiver side: exact the corresponding fields from the of datagram that carries the datagram Notes-8 CMPT 471 2003-3 17 Notes-8 CMPT 471 2003-3 18 Operation Connectionless services Each datagram sent by is an independent datagram cannot chop a stream of data into different related user datagrams Each request must be small enough to fit into one user datagram Only processes sending short message should use Operation (cont.) Flow and error control No flow control No error control except for checksum The sender does not know whether the message has been lost When the receiver detects an error through checksum, it discards it silently The process using should provide flow and error control by itself Notes-8 CMPT 471 2003-3 19 Notes-8 CMPT 471 2003-3 20

Frame Operation (cont.) Encapsulation & decapsulation data Frame data Process Message data Frame data Frame data Process Message data Operation (cont.) Queuing Queues are opened for server / client processes 2 queues for each process Incoming queue: receive messages Outgoing queue: send messages The queues function as long as the process is running The queues are destroyed when the process terminates Encapsulation Decapsulation Notes-8 CMPT 471 2003-3 21 Notes-8 CMPT 471 2003-3 22 Operation (cont.) Operation (cont.) Outgoing queue Daytime client Port 52000 Incoming queue Outgoing queue Daytime server Port 13 Incoming queue Queues on the client side The client process requests a port number from the operating system The process opens incoming and outgoing queues with the requested port number Queues on the server side The server asks for incoming and outgoing queues using its well-known port number Notes-8 CMPT 471 2003-3 23 Notes-8 CMPT 471 2003-3 24

Operation (cont.) Outgoing queue overflow The operating system asks the server / client to wait before sending any more messages Incoming queue overflow drops the datagram and asks the ICMP protocol to send port unreachable message to the datagram sender Operation (cont.) Multiplexing & demultiplexing In a host running TCP/, there are: One Possibly several processes that want to use services Processes Processes No incoming queue created for the port number specified in the arrived datagram discards the datagram and asks the ICMP protocol to send port unreachable message to the datagram sender Multiplexer Sender Demultiplexer Receiver Notes-8 CMPT 471 2003-3 25 Notes-8 CMPT 471 2003-3 26 Operation (cont.) Multiplexing Sender side: there may be several processes that need to send user datagrams Many-to-one relationship: multiplexing accepts messages from different processes Differentiates messages by their port numbers Adds to each message Passes user datagram to Operation (cont.) Demultiplexing Receiver side: there may be several processes that can receive user datagrams One-to-many relationship: demultiplexing receives user datagram from Checks errors in user datagram Drops the Delivers the message to the appropriate process based on the port number Notes-8 CMPT 471 2003-3 27 Notes-8 CMPT 471 2003-3 28

Appendix: 1 s Complement Arithmetic All computers use 2 s complement representation 2 s complement integers Binary Dec Hex 0000 0000 0 00 0000 0001 1 01 0000 0010 2 02 0000 0011 3 03 1111 1111-1 FF 1111 1110-2 FE 1111 1101-3 FD 1 s complement integers Binary 0000 0000 0000 0001 0000 0010 0000 0011 1111 1111 1111 1110 1111 1101 1111 1100 Dec Notes-8 CMPT 471 2003-3 29 0 1 2 3-0 -1-2 -3 Hex 00 01 02 03 FF FE FD FC 1 s Complement Arithmetic (cont.) Example: -3 + 5 = 2 Using 2 s complement: FD + 05 = 01 02 Discarding the carry (01) gives the result Using 1 s complement: FC + 05 = 01 01 Adding the carry (01) to the LSB (01) gives the result: 01 + 01 = 02 * 1 s complement sum is done by summing the numbers and adding the carry (carries) to the result in the rightmost position Notes-8 CMPT 471 2003-3 30