UDP: User Datagram Protocol Brian Jorgage CSC /24/2004
Resource Description net.cs.umass.edu/kurose/transport/UDP.htmlhttp://www- net.cs.umass.edu/kurose/transport/UDP.html Part of a networking tutorial from University of Massachusetts Tie in to class in Chapter 11: Transport Layer Summary: Overview of UDP Good high-level introduction Resource applicable for instruction on operation of various network protocols
Introduction Defined in RFC 768 One of two transport layer protocols – the other is TCP Provides bare-bones functionality Useful is situations requiring minimal overhead
TCP vs UDP TCP uses 3-way handshake UDP has no connection initiation Therefore less overhead – (e.g. DNS needs to be fast so it runs over UDP) TCP maintains connection state information vs UDP no connection state Advantage when many instances of an application need to be run from a server – connections are easier to maintain
TCP vs UDP (cont) TCP has 20 byte header vs UDP 4 byte header TCP has a congestion control mechanism vs UDP’s unregulated send rate Disadvantage to UDP: if network is congested, possible data loss due to buffer overflow in routers
Applications using TCP/UDP , telnet, web, ftp all run over TCP – they need the reliability of TCP DNS, network mgt (SNMP), VoIP, Routing table updates (RIP), NFS, multcasting - all run over UDP since they need the low overhead Note that reliability mechanisms can be built into the application layer if necessary
UDP Segment Structure {Header = 4 bytes} {Data…} Header fields: Source port, Destination port, Length, Checksum
UDP Checksum Used for error detection Compute the sum of all 16 bit words in UDP segment Calculate the one’s complement of the sum – this is now the checksum Example - one’s complement of = The sum of all words + checksum = If the receiver does not compute the same value then an error occurred somewhere UDP does not attempt to recover from error – it may discard the segment or pass a warning along to application