Introduction Datagram Forwarding Gail Hopkins Service paradigm IP datagrams Routing Encapsulation Fragmentation Reassembly Internet Service Paradigm IP Datagrams supports both connectionless and connection-oriented services fundamental delivery service is connectionless at the Internet layer (layer 3) optional reliable connection-oriented service is layered on top of this at the transport layer (layer 4) Packets of data are sent across multiple physical networks via routers Internet protocols define a universal virtual packet - the IP datagram IP datagram can be at most 64K octets, including header and data Routers and Routing Tables Example Internet and Conceptual Routing Table Each router forwards a virtual packet by using a local routing table Each entry is: destination address mask next hop IP address of a router or Deliver direct Then does address resolution 1
Example Routing Table Best-Effort Delivery IP attempts best effort delivery and does not guarantee to deal with: datagram duplication delayed or out of order delivery corruption of data datagram loss These issues are dealt with other protocol layers IP Datagram Header Format Encapsulation When an IP datagram is sent across a physical network it is placed in the data area of a frame and the frame type is set to IP Part 34 Internetworking Using MTU and Datagram Size Maximum transmission unit - max of data that a frame can carry on a given network A packet may have to cope with different MTU sizes as is passes over an internet 2
Fragmentation A datagram that is larger than MTU is fragmented into smaller datagrams Reassembly Is done at the final host routers require less state information fragments can take different routes Header fields indicate when the data is a fragment and also where it belongs Each datagram contains a fragment Whole datagram is lost if any fragment lost Summary Service paradigm IP datagrams Routing Encapsulation Fragmentation Reassembly Reading: Chapter 22, Computer Networks and Internets, Comer, 5 th Edition, 2009 Transport Layer Protocols - UDP Gail Hopkins Introduction UDP and TCP UDP communication semantics Broadcast/multicast UDP datagram format Transport Layer Protocols Layer 4 - layer above IP suite contains: User Datagram Protocol (UDP) The only connectionless transport service Best effort delivery Transport Control Protocol (TCP) Connection-based transport service Provides delivery guarantees 3
Transport Protocols and End-to- End Communication IP passes traffic across the Internet BUT, it cannot distinguish between multiple applications running on a network host Fields in the datagram header only identify computers IP addresses don t identify programs running on computers! IP (Layer 3) treats a computer as an endpoint of communication Layer 4 above - UDP/TCP known as end-to-end protocols because they allow an individual application to be an endpoint of communication User Datagram Protocol (UDP) End-to-end Connectionless Message-oriented Best-effort Arbitrary Interaction Operating System Independent The Connectionless Paradigm An application using UDP Doesn t need to establish a connection before sending data Doesn t need to inform the network when finished Can generate and send data any time Can delay an arbitrarily long time between transmission of two messages UDP Does not maintain state Does not use control messages Communication consists only of data messages themselves Extremely low overhead! Message-Oriented Interface When an application requests UDP to transmit a block of data UDP places data in a single message for transmission UDP doesn t divide a message into multiple packets UDP doesn t combine messages for delivery Data therefore has to fit into one message or application has to coordinate sending multiple messages Message-Oriented Interface Consequence for Programmers Applications that use UDP can depend on protocol to preserve data boundaries Each UDP message must fit into a single IP datagram Absolute limit on size UDP message size can lead to inefficient use of the underlying network Very small messages large ratio of header octets to data octets Very large messages if bigger than MTU, will be fragmented UDP Communication Semantics UDP provides applications with exactly the same best-effort delivery semantics as IP Therefore, messages can be: Lost Duplicated Delayed Delivered out-of-order Corrupted An application must either be immune to these problems, or the programmer must take additional steps to detect and correct problems Choice of using UDP depends on type of application! 4
Modes of Interaction and Broadcast Delivery UDP allows four styles of interaction: 1-1 1-many Multicast or broadcast Many-1 Many-many Endpoint Identification with Protocol Port Numbers UDP defines an abstract set of identifiers called protocol port numbers Independent of the underlying Operating System Each computer using UDP must provide a mapping between port number and program identifiers that the Operating System uses All computers running UDP recognise the standard port numbers Therefore, they know which program to pass the message on to based on port number UDP Datagram Format Each UDP message is called a user datagram Datagram consists of: Header Payload UDP Encapsulation Each UDP datagram is encapsulated in an IP datagram for transmission across the Internet: From Comer, 2009 From Comer, 2009 Summary Introduction to Transport Layer Protocols UDP and TCP UDP communication semantics Broadcast/multicast UDP datagram format Reading: Chapter 25, Computer Networks and Internets, Comer, 5 th Edition, 2009 5