Fall 2010CMSC 1501 Internetworking
Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and in most cases will involve several links and several networks). –Pipe can lose or corrupt data (think postal system analogy – vast majority of time it arrives, but not always). –We transmit data in discrete chunks called “packets” So what info do we need to build a single “logical” network (either reliable or unreliable)?
Fall 2010CMSC 1503 Issues Getting various technologies to work with one another (I.e. creating a single “network” from many heterogeneous systems). –Problem magnified since packet may need to traverse several different networks (and network technologies), each with their own addressing schemes, service models, media access protocols, etc. Scale: It’s the big issue –How can you find an efficient path through a network with millions (and perhaps billions eventually) of nodes? –How do you provide addressing for a network with this many nodes?
Fall 2010CMSC 1504 Internetwork: Arbitrary collection of possibly heterogeneous networks interconnected to provide host-to- host packet delivery service. Network: Directly connected or switched network that uses a single technology (i.e. ATM, 802.5, Ethernet). –Could be many physical networks creating a single logical network. –E.g. several Ethernet networks connected on a university campus
Fall 2010CMSC 1505 Internetwork Internet—THE internetwork. –Runs the Internet Protocol (Kahn-Cerf) –Interesting because it has faced the problems of scale internet—abstract internetwork
Fall 2010CMSC 1506 IP is a big deal Vint Cerf and Bob Kahn with Pres. Bush at 2006 ceremony where they received the Presidential Medal of Freedom for their work on IP. White House News & Policies photophoto
Fall 2010CMSC 1507 IP Internet Concatenation of Networks Note Hn denotes host, Rn denotes router.
Fall 2010CMSC 1508 IP Internet Protocol Stack R1 ETH FDDI IP ETH TCP R2 FDDI PPP IP R3 PPP ETH IP H1 IP ETH TCP H8
Fall 2010CMSC 1509 The Internet Outline Best Effort Service Model Global Addressing Scheme
Fall 2010CMSC Service Model Connectionless (datagram-based) –So each packet must be “self-contained” Best-effort delivery (unreliable service) –packets are lost –packets are delivered out of order –duplicate copies of a packet are delivered (?!) –packets can be delayed for a long time
Fall 2010CMSC Why?! Best Effort service model is as simple a model as you can design, and this is a strong point! –If you provide best effort service over a network technology that provides reliable delivery, you’re fine –If you provide reliable delivery over a network technology that is unreliable, then you’ve got a problem: you need lots of extra functionality in the routers to handle the network deficiencies, and keeping the routers as simple as possible was an IP design goal. (Why?) Note: IP today runs over many technologies that were not in existence when IP was invented!
Fall 2010CMSC IP Datagram Format VersionHLen TOSLength IdentFlagsOffset TTLProtocolChecksum SourceAddr DestinationAddr Options (variable) Pad (variable) Data In 32 bit words In bytes Note: fields aligned on 32 bit boundaries
Fall 2010CMSC Fields Version: note placement at front of packet (why?) Header Length: in 32 bit words (20 bytes when no options) Type of service: later Length: of entire packet in bytes (note max of 65,535 bytes because of 16 bit length field) Ident, flags, offset all deal with fragmentation Time to live: first seconds, but evolved to be hop count
Fall 2010CMSC Fields Protocol: demux key specifying higher level protocol that gets datagram Checksum: take IP header as sequence of 16 bit words, add them using ones complement, take ones complement of result. –Relatively easy to calculate in software –Not as strong error detection as CRC –Bad packets discarded Src, dest address: pretty clear (and these are unique!) Options: rare, but complete IP implementation must handle them all! Presence determined by header length field
Fall 2010CMSC Fragmentation and Reassembly Each network has some MTU (why?) –Why not some uniform standard? –What is a reasonable choice for a given host? Strategy –fragment when necessary (MTU < Datagram length) –try to avoid fragmentation at source host –re-fragmentation is possible –fragments are self-contained datagrams –delay reassembly until destination host –do not recover from lost fragments
Fall 2010CMSC Fragmentation and Reassembly Ident field: chosen by sending host, intended to be unique among all datagrams that might be received at this dest from this source over reasonable time period. –All fragments keep this same ident value Offset: specifies 8 bytes chunk of data (why?) Flags: M is “more” flag
Fall 2010CMSC Example Ident = xOffset = 0 Start of header 0 Rest of header 1400 data bytes Ident = xOffset = 0 Start of header 1 Rest of header 512 data bytes Ident = xOffset = 512 Start of header 1 Rest of header 512 data bytes Ident = xOffset = 1024 Start of header 0 Rest of header 376 data bytes MTU 532 bytes Note: fragmentation can occur at multiple hops!
Fall 2010CMSC Global Addresses Properties –globally unique (don’t want anyone with my phone #) Why not just use Ethernet address?! –hierarchical: network + host (really interface) Dot Notation – – – NetworkHost A: NetworkHost B: NetworkHost C:
Fall 2010CMSC IP Internet Note Hn denotes host, Rn denotes router. Routers need two IP addresses. All hosts on same network have same network part of IP address
Fall 2010CMSC Terminology Routing Mechanism: How a router selects the link over which to forward a packet Routing Protocol: Policies that determine what is placed in the routing tables. These are not the same thing!
Fall 2010CMSC Datagram Forwarding Strategy –every datagram contains destination’s address –if directly connected to destination network, then forward to host –if not directly connected to destination network, then forward to some router –forwarding table maps network number into next hop –each host has a default router –each router maintains a forwarding table Example (R2) Network Number Next Hop 1 R3 2 R1 3 interface 1 4 interface 0
Fall 2010CMSC Recall: R2 R1 H4 H5 H3 H2 H1 Network 2 (Ethernet) Network 1 (Ethernet) H6 Network 3 (FDDI) Network 4 (point-to-point) H7R3H8
Fall 2010CMSC Pseudocode if (networknum dest = networknum my interface) deliver packet over that interface else if (networknum in my routing table) deliver packet to next hop router else deliver packet to default router