350 likes | 354 Views
This chapter explores the different types of networks, such as point-to-point links and shared media, and the methods for connecting them together. It also covers the concepts of heterogeneity, scale, routing, and addressing. The Internet Protocol (IP) is introduced as the protocol used for internetworking. The chapter discusses the services provided by IP, including datagram-based data delivery with best-effort and unreliable service. It also explains the format of IP datagrams, fragmentation and reassembly, and global addressing. The concepts of datagram forwarding, host interfaces, and router forwarding tables are discussed, along with the role of bridges, switches, and routers in internetworking. The chapter also covers IP mapping, Address Resolution Protocol (ARP), Dynamic Host Control Protocol (DHCP), Internet Control Message Protocol (ICMP), and routing and forwarding.
E N D
Chapter 4 • “There is more than one network” • Point-to-point links • Shared media • Switches • Goal – connect these things together • Heterogeneity • Scale • Routing(connection of nodes) • Addressing • Introduce the Internet Protocol(IP) Internetworking
Network 1 (Ethernet) H7 R3 H8 H1 H8 H2 H1 H3 TCP TCP Network 4 R1 R2 R3 (point-to-point) Network 2 (Ethernet) R1 IP IP IP IP IP R2 FDDI PPP ETH ETH ETH FDDI PPP ETH H4 Network 3 (FDDI) H5 H6 Internet, internet or internetwork • Concatenation of Networks • Protocol Stack Routers/Gateways Internetworking
Service Model • the services that are to be provided from host-to-host • IP provides Datagram data delivery service • Connectionless (datagram-based) / full dest • 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 Internetworking
0 4 8 16 19 31 TOS Length V ersion HLen Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Pad Options (variable) (variable) Data Datagram Version-IP e.g. IPv4, IPv6 Hlen-Header length TOS-Type Of Service(ch6) TTL-Time To Live Protocol-UDP/TCP • Datagram format Assigned at 32-bit Boundary Internetworking
Fragmentation and Reassembly • Each network has some Maximum Transmission Unit(MTU) – largest IP datagram that it can carry in a frame. • Strategy • fragment when necessary (MTU < Datagram) • try to avoid fragmentation at source host • re-fragmentation is possible when travel to a different network • fragments are self-contained datagrams • delay reassembly until destination host • do not recover from lost fragments Internetworking
Network 1 (Ethernet) H7 R3 H8 H2 H1 H3 Network 4 (point-to-point) Network 2 (Ethernet) R1 R2 H4 Network 3 (FDDI) H5 H6 Global Addresses • All hosts attached to the same network have the same network field • The host field unique • Routers have two interfaces Internetworking
Datagram Forwarding • How do IP routers forward datagrams? • Strategy (main points) • every datagram contains destination’s address • if directly connected to destination network, then forward to host(i.e. same network number) • if not directly connected to destination network, then forward to some router(next hop router-host selected) • Hosts = 1 interface, routers >= 2 interfaces • forwarding table maps network number into next hop • each host has a default router • each router maintains a forwarding table Internetworking
Network 1 (Ethernet) H7 R3 H8 H2 H1 H3 Network 4 (point-to-point) Network 2 (Ethernet) R1 R2 H4 Network 3 (FDDI) H5 H6 Datagram Forwarding • Example (R2) Network Number Next Hop 1 R3 2 R1 3 interface 1 4 interface 0 0 1 Routers/Gateways Internetworking
Bridges, Switches, and Routers • Confusion? • Bridges • Link-level to forward frames from one link to another to create extended LANs • Switches • Network-level to forward packets from one link to another to create packet-switched networks • Routers • Internet-level to forward datagrams from network to another • Bridges/Switches (above the physical below the internet) Internetworking
IP Mapping • IP datagrams contain IP addresses • Physical interface only understands the addressing specific to its link-level(i.e. Ethernet, Token-Ring, etc) • Problem – how to put the two together? • Solution – have each host maintain a table of address pairs. Internetworking
ARP - Address Translation • Map IP addresses into physical addresses • destination host • next hop router • ARP cache or ARP table • ARP (Address Resolution Protocol) • table of IP to physical address bindings dynamically created • broadcast request if IP address not in table • target machine responds with its link-level and physical address • table entries are discarded if not refreshed Internetworking
DHCP • Why Dynamic Host Control Protocol (DHCP) ? • Manual configuration is problematic • incorrect network# and IP address • DHCP Server • Contains list of IP addresses in a range(same network number) • IP addresses are leased • Use DHCPDISCOVER(255.255.255.255) broadcast • Server responds by filling in corresponding IP field of packet sent back to client Internetworking
ICMP - Error Reporting • Internet Control Message Protocol(ICMP) reports • Link failure • Reassembly failure • TTL = 0 • CRC failed • IP & ICMP always configured together Internetworking
Routing • For VC’s (one-off setup) • For datagrams, every packet must be routed • Regardless, switches and routers must • Look at destination port • Determine the output port best suited transmission Internetworking
Routing & Forwarding • Routing tables are constructed as precursors to forwarding table construction • Routing algorithms • Map Ntwk #s to NHs • Optimized for changes in topology • Forwarding tables • Ntwk #s, Output interfaces, MAC address of NH • Optimized to look up Ntwk #s Internetworking
Routing & Forwarding • Routing Table NetworkNH (NextHop) 10 171.29.222.38 • Forwarding table NetworkIntMAC Address 10 if0 8:0:2 B:E 4:B:1:2 Internetworking
Routing Domain • What is a routing domain? it is a matter of graph theory hosts, switches, routers, or networks network links w/associated costs Internetworking
Routing Protocol • How to store the shortest paths? calculate and store in non-volatile memory? • Nope! • Node/link failures not handled • Node/link additions not handled • Edge costs do not change • Run routing protocols among nodes instead • Distance vector and link state Internetworking
Distance Vector(Bellman-Ford) • Each node maintains a set of triples • (Destination, Cost, NextHop) • Exchange updates directly connected neighbors • periodically (on the order of several seconds) • whenever table changes (called triggered update) • Each update is a list of pairs: • (Destination, Cost) • Update local table if receive a “better” route • smaller cost • came from next-hop • Refresh existing routes; delete if they time out Internetworking
Distance Vector Destination Cost NextHop B 1 B C 1 C D E 1 E F 1 F G • Destination Cost NextHop • B 1 B • C 1 C • D 2 C • E 1 E • F 1 F • G 2 F • With no topological changes • Only a few exchanges for completion • Realization of routing tables at nodes is called convergence • The beauty - no one node is responsible for being the central authority Internetworking
Routing Updates • Two circumstances under which a node sends an update • Periodic updates (I’m alive!) • Triggered updates (recipient) Internetworking
Routing Failure • Example 1: IF LINK from F to G WENT DOWN • F detects that link to G has failed • F sets distance to G to infinity and sends update t o A • A sets distance to G to infinity since it uses F to reach G • A receives periodic update from C with 2-hop path to G • A sets distance to G to 3 and sends update to F • F decides it can reach G in 4 hops via A • Example 2: PROBLEM of count to infinity • link from A to E fails • A advertises distance of infinity to E • B and C advertise a distance of 2 to E • B decides it can reach E in 3 hops; advertises this to A • A decides it can read E in 4 hops; advertises this to C • C decides that it can reach E in 5 hops… Internetworking
Count to Infinity • Solutions • Set max at 16 • What if the network grows • Stabilization (two nodes) • Split Horizon (don’t send routes learned from neighbors) • Split Horizon with Poison Reverse • Problem – speed of convergence • Link-state routing Internetworking
Routing Protocols • Interior Gateway Protocols(IGP) • Distance Vector • Updates based upon directly connected neighbors • Destination, cost, and NH (NextHop) • Count-to-Infinity • RIP • Link State • Updates communicated through network Internetworking
Routing Information Protocol(RIP) • Probably the most used routing protocol today • Example distance vector protocol • RIP send advertisements every 30 seconds • Routers also send updates when it receives an update from another router • All link costs = 1 • Minimum hop route • Valid distance = 1 16() Internetworking
Link State Routing • Strategy • send to all nodes (not just neighbors) information about directly connected links (but not entire routing table) • Reliable flooding of Link State Packet (LSP) • Each node then has complete topology of network • Apply any shortest path algorithm (e.g. Dijkstra) to find the shortest route • Link State Packet (LSP) • id of the node that created the LSP • cost of link to each directly connected neighbor • sequence number (SEQNO) • time-to-live (TTL) for this packet Internetworking
OSPF • Open Shortest Path First (OSPF) • Most commonly used type of LSP Internetworking
Distance Vector vs. Link State Internetworking
Tree Structured Internet(c. 1990) NSFNET backbone Stanford ISU BARRNET MidNet … regional regional W estnet regional Berkeley P ARC UNL KU UNM NCAR UA Autonomous Systems Internetworking
The Global Internet • We know • How to internetwork(heterogenous) • IP scalability • Routers don’t need to know about every host • Need to know about all the networks • Ten of thousands of networks • What about scalability? • Routing tables don’t scale • IGP don’t scale Internetworking
Scaling • Two related scaling issues • Scalability of routing • Minimize # of network numbers in routing protocols • Minimize # of entries in the routing tables • Classless routing • Hierarchy • Address utilization • Minimize the usage rate if IP addresses • Classless routing Internetworking
Making Routing Scale • Need efficient Hierarchical Addressing • Reduce the # of network numbers assigned • Inefficient use of Hierarchical Address Space • class C with 2 hosts (2/255 = 0.78% efficient) • class B with 256 hosts (256/65535 = 0.39% efficient) 7 24 (a) 0 Network Host 14 16 Any network with > 255 hosts (b) 1 0 Network Host 21 8 (c) 1 1 0 Network Host Internetworking
Network number Host number Class B address 111111111111111111111111 00000000 Subnet mask (255.255.255.0) Network number Subnet ID Host ID Subnetted address Subnetting • Split a single IP network number into several subnets • Add another level to address/routing hierarchy: subnet • Subnet masksenable physical networks to share the samesubnet number • Subnets visible only within site, world sees single network Configure each node with a subnet mask Hosts now configured with IP address and subnet address Internetworking
Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 128.96.34.1 H1 R1 Subnet mask: 255.255.255.128 128.96.34.130 Subnet number: 128.96.34.128 128.96.34.139 128.96.34.129 H2 R2 H3 128.96.33.1 128.96.33.14 Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0 Subnet Example Forwarding table at router R1 Subnet Number Subnet Mask Next Hop 128.96.34.0 255.255.255.128 interface 0 128.96.34.128 255.255.255.128 interface 1 128.96.33.0 255.255.255.0 R2 Internetworking
Datagram Forwarding Algorithm D = destination IP address for each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop • Use a default router if nothing matches • Not necessary for all 1s in subnet mask to be contiguous • Can put multiple subnets on one physical network • Subnets not visible from the rest of the Internet Internetworking