Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
SIP extensions for the IP Multimedia Subsystem wikipedia , lookup
Deep packet inspection wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Real-Time Messaging Protocol wikipedia , lookup
UniPro protocol stack wikipedia , lookup
Computer Networks and Internets with Internet Applications, 4e By Douglas E. Comer Lecture PowerPoints By Lami Kaya, [email protected] © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 1 Chapter 24 User Datagram Protocol (UDP) Datagram Transport Service © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 2 Topics Covered • • • • • • • • • • • • 24.1 Introduction 24.2 The Need For End-To-End Transport Protocols 24.3 The User Datagram Protocol 24.4 The Connectionless Paradigm 24.5 Message-Oriented Interface 24.6 UDP Communication Semantics 24.7 Arbitrary Interaction 24.8 Support For Unicast, Multicast, And Broadcast 24.9 Endpoint Identification With Protocol Port Numbers 24.10 UDP Datagram Format 24.11 The UDP Checksum And The Pseudo Header 24.12 UDP Encapsulation © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 3 24.1 Introduction This chapter • considers UDP, a protocol that allows applications to send and receive datagrams • discusses the UDP packet format • explain the ways UDP can be used • shows that although UDP is efficient and flexible, – it has the undesirable property of using best-effort delivery • covers the important concept of protocol port numbers © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 4 24.2 The Need For End-To-End Transport Protocols • IP cannot distinguish among multiple application programs running on the same computer • Why IP is incapable of supporting multiple applications? – The source/destination addresses identify a host computer • The endpoint of a communication is – known as an “end-to-end protocol” or a “transport protocol” • TCP / IP protocols chose to place end-to-end protocols in a separate layer, Layer 4, transport layer © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 5 24.3 The User Datagram Protocol UDP can be characterized as: • End-to-end • Connectionless • Message-oriented – An application that uses UDP sends and receives individual messages • Best-effort – offers applications the same best-effort delivery semantics as IP • Arbitrary interaction – an application can interact with many other applications • Operating system (OS) independent – does not depend on identifiers used by the local OS © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 6 24.4 The Connectionless Paradigm • An application using UDP does not need to pre-establish a connection before sending data • UDP allows an application to delay an arbitrarily long time between the transmissions • If two applications stop sending data – no other packets are exchanged • UDP does not need/use any control messages • UDP has extremely low overhead © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 7 24.5 Message-Oriented Interface • UDP offers a message-oriented interface (MOI) • UDP does not divide or combine messages • The MOI has several important consequences: – UDP can depend on the protocol to preserve data boundaries – each UDP message must fit into a single IP datagram – datagram size forms an absolute limit on the size of a UDP • Message size can cause inefficient use of the network – For small messages • datagrams will have a large ratio of header/data – For large messages • datagrams will be larger than the network MTU, and will be fragmented © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 8 24.6 UDP Communication Semantics • UDP provides best-effort delivery like IP, a message can be – – – – lost duplicated delivered out of order corrupted • UDP does not detect or correct delivery problems. • An application must either be immune to the problems – or take additional steps to detect and correct problems. • UDP suitable for applications such as voice or video – applications that can tolerate delivery errors – but no delays © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 9 24.7 Arbitrary Interaction UDP allows four styles of interaction: • 1-to-1 – application exchanges messages with exactly one other apps. • 1-to-many – application sends a message to multiple recipients • many-to-1 – application receives messages from multiple senders • many-to-many – a set of applications exchange messages with one another © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 10 24.8 Support For Unicast, Multicast, And Broadcast • Transmit the message via IP multicast or broadcast. – Assuming the underlying network supports broadcast • IP will send the datagram in a broadcast frame – UDP allows an application to multicast messages • Delivery via broadcast or multicast is especially useful for Ethernet networks – HW supports both types efficiently © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 11 24.9 Endpoint Identification With Protocol Port Numbers • How should UDP identify an application program as an endpoint? UDP • Defines an abstract set of identifiers called protocol port number – independent of the underlying OS • Provides a mapping between protocol port numbers and the program identifiers that the OS uses • Allows only one application to specify a given pair of endpoints at any time © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 12 24.10 UDP Datagram Format • Each message is called a user datagram, has two parts: – a short header that specifies the sending/receiving applications – a payload that carries the data being sent • Figure 24.1 illustrates the user datagram format. – – – – SOURCE PORT DESTINATION PORT MESSAGE LENGTH CHECKSUM © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 13 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 14 24.11 The UDP Checksum And The Pseudo Header • CHECKSUM field is optional – A sender can either choose to compute a checksum – or make all bits of the checksum field zero • Destination examines the checksum – verifies the checksum if the value is nonzero • UDP extends the checksum – UDP software includes a pseudo header that contains • source • destination • and type fields © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 15 24.12 UDP Encapsulation • UDP uses IP for delivery • Like ICMP, UDP is encapsulated – in IP datagram and then in a LAN HW frame • Figure 24.2 illustrates the concept © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 16 © 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. 17