hapter 4: Network Layer TDTS06 omputer s Lecture 6: Network layer III Routing in the Internet Jose M. Peña, jospe@ida.liu.se ID/DIT, LiU 2009-09-16 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a 4.4 IP: Internet Protocol Datagram format IPv4 addressing IMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF GP 4.7 roadcast and multicast routing * Slides are modified from J. F. Kurose and K. W. Ross. Network Layer 4-1 Network Layer 4-2 IP ddressing: introduction IP address: 32-bit identifier for host, interface interface: connection between host/ and physical link s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.1.1 223.1.2.1 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.1 223.1.3.27 223.1.2.2 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 IP address: subnet part (high order bits) host part (low order bits) What s a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening 223.1.1.1 223.1.2.1 223.1.1.4 223.1.2.9 223.1.2.2 223.1.1.3 223.1.3.27 subnet 223.1.3.1 223.1.3.2 consisting of 3 subnets Network Layer 4-3 Network Layer 4-4 223.1.1.0/24 223.1.2.0/24 Recipe To determine the subnets, detach each interface from its host or, creating islands of isolated s. Each isolated is called a subnet. 223.1.3.0/24 Subnet mask: /24 How many? 223.1.1.1 223.1.1.4 223.1.1.3 223.1.9.2 223.1.7.0 223.1.9.1 223.1.7.1 223.1.8.1 223.1.8.0 223.1.2.6 223.1.3.27 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 Network Layer 4-5 Network Layer 4-6 1
IP addressing: IDR IDR: lassless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet host part part 11001000 00010111 00010000 00000000 200.23.16.0/23 Network Layer 4-7 IP addresses: how to get one? Q: How does a host get IP address? hard-coded by system admin in a file Windows: control-panel->->configuration- >tcp/ip->properties UNIX: /etc/rc.config DHP: Dynamic Host onfiguration Protocol: dynamically get address from as server plug-and-play Network Layer 4-8 hapter 4: Network Layer RIP ( Routing Information Protocol) 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a 4.4 IP: Internet Protocol Datagram format IPv4 addressing IMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF GP 4.7 roadcast and multicast routing distance vector algorithm included in SD-UNIX Distribution in 1982 distance metric: # of hops (max = 15 hops), where a hop is a sub traversed including the destination u D v y w x From to subnets: destination hops u 1 v 2 w 2 x 3 y 3 2 Network Layer 4-9 Network Layer 4-10 RIP advertisements distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) each advertisement: list of up to 25 destination subnets within S Network Layer 4-11 RIP: Example w x y D Destination Network Next Router Num. of hops to dest. w 2 y 2 7 x -- 1..... Routing/Forwarding table in D Network Layer 4-12 2
RIP: Example Dest Next hops w - 1 x - 1 4.... dvertisement from to D w x y D Destination Network Next Router Num. of hops to dest. w 2 y 2 7 5 x -- 1..... Routing/Forwarding table in D Network Layer 4-13 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) link failure info quickly (?) propagates to entire net poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) Network Layer 4-14 RIP Table processing Weird!! Hence, some people may even say that it belongs to the application layer!! OSPF (Open Shortest Path First) RIP routing tables managed by application-level process called route-d (daemon) advertisements sent in UDP packets, periodically repeated Transprt (UDP) (IP) link physical routed forwarding table forwarding table routed Transprt (UDP) (IP) link physical Network Layer 4-15 open : publicly available uses Link State algorithm LS packet dissemination topology map at each node (destinations aren t s but subnets) route computation using Dijkstra s algorithm OSPF advertisement carries one entry per neighbor disseminated to entire S (via flooding) done if some cost changes (or every 30 min otherwise) carried directly over IP (rather than TP or UDP) OSPF must itself implement reliable data transfer mechanisms Network Layer 4-16 OSPF advanced features (not in RIP) Hierarchical OSPF security: all OSPF messages authenticated (to prevent malicious intrusion) multiple same-cost paths allowed (only one path in RIP) For each link, multiple cost metrics for different TOS (e.g., satellite link cost set low for best effort; high for real time) integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF hierarchical OSPF in large domains. Network Layer 4-17 Network Layer 4-18 3
Hierarchical OSPF two-level hierarchy: local area, backbone. Link-state advertisements only in area each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. area border s: summarie distances to nets in own area, advertise to other rea order s. backbone s: run OSPF routing limited to backbone. boundary s: connect to other S s. Internet inter-s routing: GP GP (order Gateway Protocol): the de facto standard GP provides each S a means to: 1. Obtain subnet reachability information from neighboring Ss. 2. Propagate reachability information to all Sinternal s. 3. Determine good routes to subnets based on reachability information and policy. allows subnet to advertise its existence to rest of Internet: I am here Network Layer 4-19 Network Layer 4-20 GP basics pairs of s (GP peers) exchange routing info over semi-permanent TP connections: GP sessions GP sessions need not correspond to physical links. when S2 advertises a prefix to S1: S2 promises it will forward datagrams towards that prefix. S2 can aggregate prefixes in its advertisement Distributing reachability info using egp session between 3a and 1c, S3 sends prefix reachability info to S1. 1c can then use igp do distribute new prefix info to all s in S1 1b can then re-advertise new reachability info to S2 over 1b-to-2a egp session when learns of new prefix, it creates entry for prefix in its forwarding table. 3c 3a 3b S3 1a S1 1c 1d egp session igp session 1b 2c 2a 2b S2 Network Layer 4-21 3c 3a 3b S3 1a S1 1c 1d egp session igp session 1b 2c 2a 2b S2 Network Layer 4-22 Path attributes & GP routes advertised prefix includes GP attributes. prefix + attributes = route two important attributes: S-PTH: contains Ss through which prefix advertisement has passed: e.g, S 67, S 17. This helps to avoid looping advertisements. NEXT-HOP: IP address of the interface through which prefix advertisement has reached the current S. This helps to route datagrams/configure forward tables. If several prefix advertisements arrive to a, then apply route selection rules. when gateway receives route advertisement, uses import policy to accept/decline (e.g. better route known or other reasons). Network Layer 4-23 GP route selection may learn about more than 1 route to some prefix. Router must select route. elimination rules: 1. local preference value attribute: administrator policy decision 2. shortest S-PTH 3. cheapest NEXT-HOP (according to intra-s protocol): hot potato routing 4. additional criteria Network Layer 4-24 4
GP routing policy GP routing policy (2) W X legend: provider customer : W X legend: provider customer :,, are provider s X,W,Y are customer (of provider s) X is dual-homed: attached to two s X does not want to route from via X to.. so X will not advertise to a route to Y Network Layer 4-25 advertises path W to advertises path W to X Should advertise path W to? Y No way! gets no revenue for routing W since neither W nor are s customers wants to force to route to w via wants to route only to/from its customers! Network Layer 4-26 Why different Intra- and Inter-S routing? Policy: Inter-S: admin wants control over how its traffic routed, who routes through its net. Intra-S: single admin, so no policy decisions needed Scale: hierarchical routing saves table sie, reduced update traffic Performance: Intra-S: can focus on performance Inter-S: policy may dominate over performance Network Layer 4-27 5