csc/ece 573 internet protocols user datagram protocol

15
CSC/ECE 573 Internet Protocols User Datagram Protocol

Upload: leona-jordan

Post on 05-Jan-2016

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: CSC/ECE 573 Internet Protocols User Datagram Protocol

CSC/ECE 573Internet Protocols

User Datagram Protocol

Page 2: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 2

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

Page 3: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 3

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

Page 4: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 4

Process-level CommunicationIP 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

Page 5: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 5

Protocol PortsPort = 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

unavailableBuffered (finite queue)

Messages carry destination port and source port (for replies)

Page 6: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 6

UDP Ports

Page 7: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 7

UDP Ports (cont'd)

Page 8: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 8

UDP Port Numbers

Page 9: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 9

Some Well-Known Ports

Listed in file /etc/services

PORT # SERVICE

7 ECHO

9 DISCARD

11 SYSTAT

13 DAYTIME

19 CHARGEN

37 TIME

42 NAMESERVER

43 WHOIS

53 DOMAIN

67 BOOTPS

68 BOOTPC

69 TFTP

111 SUNRPC

123 NTP

161 SNMP

162 SNMPTRAP

513 WHO

Page 10: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 10

UDP Multiplexing, Demultiplexing• Enabled by the port abstraction

Page 11: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 11

UDP Input QueueApplication 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

Page 12: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 12

UDP Queues

Page 13: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 13

UDP Datagram FormatSource and destination ports

Length: of UDP header and data

Checksum: across pseudo-header, UDP header, data

Page 14: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 14

UDP Checksum ComputationOne'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?)

Page 15: CSC/ECE 573 Internet Protocols User Datagram Protocol

Copyright Rudra Dutta, NCSU, Spring, 2003 15

When to Use UDPUDP 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