Download presentation
Presentation is loading. Please wait.
Published byLeona Jordan Modified over 9 years ago
1
CSC/ECE 573 Internet Protocols User Datagram Protocol
2
Copyright Rudra Dutta, NCSU, Spring, 20032 User Datagram Protocol (RFC 768) Same service as IP connectionless, no state maintained unreliable, no notification if discarded, no reordering no flow control Application program must assume responsibility for reliable communication by dealing with… message loss duplication excessive delay out of order delivery loss of connectivity
3
Copyright Rudra Dutta, NCSU, Spring, 20033 UDP (cont'd) UDP adds ports differentiation of services within host payload checksum (optional) data integrity User datagram encapsulated within IP datagram overhead: 8 bytes protocol identifier (in IP header): 17 for reply: reverse source and destination port numbers Demultiplexing by port # identifies to what process a message should be delivered each datagram received by one process only
4
Copyright Rudra Dutta, NCSU, Spring, 20034 Process-level Communication IP provides host-to-host communication Support for communication between processes on different machines required how do we identify processes on other machines? communication frequently is same as “request for service” Difficulties processes created and destroyed dynamically (no static ID) a single process may provide multiple services; must be clear which service the requestor needs Binding of “service required” and “process that handles this service” should be determined by the server, not the client
5
Copyright Rudra Dutta, NCSU, Spring, 20035 Protocol Ports Port = abstraction of source or destination point identified by a positive integer OS provides an interface for processes to specify/access ports Synchronous access to ports (usually) process blocks (suspends execution) when port unavailable Buffered (finite queue) Messages carry destination port and source port (for replies)
6
Copyright Rudra Dutta, NCSU, Spring, 20036 UDP Ports
7
Copyright Rudra Dutta, NCSU, Spring, 20037 UDP Ports (cont'd)
8
Copyright Rudra Dutta, NCSU, Spring, 20038 UDP Port Numbers
9
Copyright Rudra Dutta, NCSU, Spring, 20039 Some Well-Known Ports Listed in file /etc/servic es PORT #SERVICE 7ECHO 9DISCARD 11SYSTAT 13DAYTIME 19CHARGEN 37TIME 42NAMESERVER 43WHOIS 53DOMAIN 67BOOTPS 68BOOTPC 69TFTP 111SUNRPC 123NTP 161SNMP 162SNMPTRAP 513WHO
10
Copyright Rudra Dutta, NCSU, Spring, 200310 UDP Multiplexing, Demultiplexing Enabled by the port abstraction
11
Copyright Rudra Dutta, NCSU, Spring, 200311 UDP Input Queue Application programs negotiate with OS to use a given port OS creates internal queue to hold arriving messages for the port application may specify/change queue size Upon receipt of a datagram, UDP checks destination port against ports currently in use if no match, sends ICMP “port unreachable” error and discards datagram if match is found, enqueues datagram to corresponding port if port queue is full, discards datagram, no error message
12
Copyright Rudra Dutta, NCSU, Spring, 200312 UDP Queues
13
Copyright Rudra Dutta, NCSU, Spring, 200313 UDP Datagram Format Source and destination ports Length: of UDP header and data Checksum: across pseudo-header, UDP header, data
14
Copyright Rudra Dutta, NCSU, Spring, 200314 UDP Checksum Computation One's complement of one's complement sum of 16-bit words may need to pad with 1 byte (all 0) at end if an odd number of bytes If received checksum is incorrect, datagram is silently discarded Checksum may be turned off for performance at your peril Set to zero (all 0’s) Violates layering principle (why?)
15
Copyright Rudra Dutta, NCSU, Spring, 200315 When to Use UDP UDP is a suitable transport protocol for simple request-response communication with little concern for error/flow control (non-critical application) e.g., time of day service a process with application-level flow/error control mechanisms (e.g., TFTP) multicast and broadcast communication (why preferred over reliable transport protocol?) Barebones meta-protcols (SNMP, RIP) Also handy for use with ICMP-based and other probes Route determination (traceroute) Path MTU discovery Investigate ARP Source Quench
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.