Routing Unicast routing protocols Jens A Andersson Electrical and Information Technology R1 Choosing an Optimal Path R4 5 R7 5 10 40 R6 6 5 B R2 15 A 20 4 10 10 R8 R3 5 10 R5 1
Router A router is a type of internetworking device that passes data packets between networks, based on Layer 3 or Network Layer addresses. A router has the ability to make intelligent decisions regarding the best path for delivery of data on the network. Figure 21.1 Unicasting Packet Switched Routing 2
VPN, VPC Virtual Private Network Virtual Path Connection Build a virtual and private network overlaying a public network Often by tunnelling (encapsulation of packets inside packets) Often encrypted Figure 8.1 Circuit-switched network Circuit-switched routing 3
Local Routing.105.10.1 Netid: 192.168.1.0/24 router ARP (1) 8 4
ARP (2) 9 Reminder Routing performed on net ids One net id per link/subnet! (at least) (What if links/subnets without net ids?) 5
Technology of Distributed Routing Distance Vector Each router knows little about network topology Only best next-hops are chosen by each router for each destination network. Best end-to-end paths result from composition of all nexthop choices Does not require any notion of distance Does not require uniform policies at all routers Examples: RIP, BGP Link State Topology information is flooded within the routing domain Best end-to-end paths are computed locally at each router. Best end-to-end paths determine next-hops. Based on minimizing some notion of distance Works only if policy is shared and uniform Examples: OSPF, IS-IS Routing Tables and Forwarding Table RIP Process BGP Process RIP Routing tables BGP Routing tables BGP OSPF Process OSPF Routing tables Static routing table RIP Domain OSPF Domain Forwarding Table Manager OS kernel Forwarding Table 6
The Link Metric Possible metrics hop count inverse of the link bandwidth delay dynamically calculated administratively assigned combination Traffic should be monitored and metrics adjusted Figure 21.2 Popular routing protocols Routing Protocols 7
Figure 21-18 The Concept of Distance Vector Routing Table 21.1 A distance vector routing table Distance Vector Routing Table Destination Hop Count Next Router Other information 163.5.0.0 7 172.6.23.4 197.5.13.0 5 176.3.6.17 189.45.0.0 4 200.5.1.6 115.0.0.0 6 131.4.7.19 Network id Metric Host id of interface 8
RIP ( Routing Information Protocol) Distance vector algorithm Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops) Can you guess why there is a max? Distance vectors: exchanged among neighbours every 30 sec via Response Message (also called advertisement) Each advertisement: list of up to 25 destination nets within AS RIP Updating Algorithm (1) if (advertised destination not in table) then update table (2) else (2.a) if (advertised next-hop = next-hop in table) then replace entry (2.b) else (2.b.i) if (advertised hop count < hop count in table) then replace entry (2.b.ii) else do nothing 9
Figure 21-23 Example 21.1 RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbour/link declared dead routes via neighbour invalidated new advertisements sent to neighbours neighbours in turn send out new advertisements (if tables changed) link failure info quickly propagates to entire net split horizon and poison reverse used to prevent ping-pong loops (infinite distance = 16 hops) 10
The Count to Infinity Problem A A at cost 1 A at cost 2 A at cost 3 A I don t know A, so I will not tell A at cost 2 A at cost 3 A A at cost 3 A at cost 4 A at cost 5 The Count to Infinity Problem (cont) A A at cost 5 A at cost 6 A at cost 7 A A at cost 7 A at cost 8 A at cost 9 11
Split Horizon A A at cost 1 A at cost 2 but I won t tell 1 1 2 3 A I can t reach A A at cost 2 but I won t tell 1 1 2 3 A I can t reach A I can t reach A 1 2 3 Split Horizon with Poison Reverse A A at cost 1 A at cost 2 but I tell 1 I can t. Tells 1 that info about A came from 1. 1 2 3 12
Unsolved routing-loop C at cost 1 C B A I tell D I can reach C at cost 2, But I ll tell B that I can t! D I tell A I can reach C at cost 2, But I ll tell B that I can t! Figure 21-24 Concept of Link State Routing 13
Figure 21-28 Link State Database The Dijkstra Algorithm 1. Identify the root (the node itself) 2. Attach all neighbour nodes temporarily 3. Make arc and node with least cumulative cost permanent 4. Choose this node 5. Repeat 2 and 3 until all nodes are permanent 14
Table 21.2 Link state routing table for router A Link State Routing Table Network Cost Next Router Other Information N1 5 C N2 7 D N3 10 B N4 11 D N5 15 C Network id Metric Host id of interface Figure 21.7 Areas in an autonomous system OSPF hierarchy 15
Figure 21.8 Types of links Types of Links Figure 21.9 Point-to-point link Point-to-Point Link 16
Figure 21.10 Transient link Transient Link Figure 21.11 Stub link Stub Link 17
Figure 21.14 Types of LSAs Types of LSAs Figure 21.15 Router link Router Link 18
Figure 21.16 Network link Network Links Figure 21.17 Summary link to network Summary Link to Network 19
Figure 21.18 Summary link to AS boundary router Summary link to AS boundary router Figure 21.19 External link External Link 20
Comparison of LS and DV algorithms Message complexity LS:with n nodes, E links, O(nE) msgs for full knowledge, changes sent to all nodes DV: exchange - periodically or triggered - between neighbours only Speed of Convergence LS:O(n 2 ) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost for its own links node can break broadcast path or change broadcasted info each node computes only its own table DV: DV node can advertise incorrect path cost to any path each node s table used by others error propagate thru network Flooding Routing without routing information Forward each packet to all ports except incoming port Detect and remove looping packets Very robust This is not broadcast 21
Source Address routing Route according to source address?! Example: Customers share subnet (different ISPs; unlikely) Customers have different traffic policies Internet AS Hierarchy Intra-AS border (exterior gateway) routers Inter-AS interior (gateway) routers 22
Hierarchical Routing aggregate routers into regions, autonomous systems (AS) routers in same AS run same routing protocol intra-as routing protocol routers in different AS can run different intra- AS routing protocol gateway routers special routers in AS run intra-as routing protocol with all other routers in AS also responsible for routing to destinations outside AS run inter-as routing protocol with other gateway routers Why different Intra- and Inter-AS routing? Policy: Inter-AS: admin wants control over how its traffic routed, who routes through its net. Intra-AS: single admin, so no policy decisions needed Scale: hierarchical routing saves table size, reduced update traffic Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance 23
Internet inter-as routing: BGP BGP (Border Gateway Protocol): the de facto standard Path Vector protocol: similar to Distance Vector protocol each Border Gateway broadcast to neighbors (peers) entire path (i.e., sequence of AS s) to destination BGP routes to networks (ASs), not individual hosts E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,,Z Figure 21.21 Path vector messages Path Vector Messages 24
Table 21.3 Path vector routing table Path Vector Routing Table Network Next Router Path N01 R01 AS14, AS23, AS67 N02 R05 AS22, AS67, AS05, AS89 N03 R06 AS67, AS89, AS09, AS34 N04 R12 AS62, AS02, AS09 AS = Autonomous System = Organisation BGP operation Q: What does a BGP router do? Receiving and filtering route advertisements from directly attached neighbor(s). Route selection. To route to destination X, which path (of several advertised) will be taken? Sending route advertisements to neighbors. 25
BGP Operations (Simplified) Establish session on TCP port 179 AS1 Exchange all active routes BGP session AS2 Exchange incremental updates While connection is ALIVE exchange route UPDATE messages 51 BGP Route Processing Open ended programming. Constrained only by vendor configuration language Receive BGP Updates Apply Policy = filter routes & tweak attributes Based on Attribute Values Best Routes Apply Policy = filter routes & tweak attributes Transmit BGP Updates Apply Import Policies Best Route Selection Best Route Table Apply Export Policies Install forwarding Entries for best Routes. IP Forwarding Table 52 26
Tweak Tweak Tweak For inbound traffic Filter outbound routes Tweak attributes on outbound routes in the hope of influencing your neighbor s best route selection For outbound traffic Filter inbound routes Tweak attributes on inbound routes to influence best route selection inbound traffic outbound traffic outbound routes inbound routes In general, an AS has more control over outbound traffic BGP messages BGP messages exchanged using TCP. BGP messages: OPEN:opens TCP connection to peer and authenticates sender UPDATE: advertises new path (or withdraws old) KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request NOTIFICATION: reports errors in previous msg; also used to close connection 27
BGP Attributes Value Code Reference ----- --------------------------------- --------- 1 ORIGIN [RFC1771] 2 AS_PATH [RFC1771] 3 NEXT_HOP [RFC1771] 4 MULTI_EXIT_DISC [RFC1771] 5 LOCAL_PREF [RFC1771] 6 ATOMIC_AGGREGATE [RFC1771] 7 AGGREGATOR [RFC1771] 8 COMMUNITY [RFC1997] 9 ORIGINATOR_ID [RFC2796] 10 CLUSTER_LIST [RFC2796] 11 DPA [Chen] 12 ADVERTISER [RFC1863] 13 RCID_PATH / CLUSTER_ID [RFC1863] 14 MP_REACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 16 EXTENDED COMMUNITIES [Rosen]... 255 reserved for development From IANA: http://www.iana.org/assignments/bgp-parameters Not all attributes need to be present in every announcement Route Selection Summary Highest Local Preference Enforce relationships Shortest ASPATH Lowest MED i-bgp < e-bgp Lowest IGP cost to BGP egress Lowest router ID traffic engineering Throw up hands and break ties 28
Hot Potato Routing: Go for the Closest Egress Point 192.44.78.0/24 egress 1 egress 2 15 56 IGP distances This Router has two BGP routes to 192.44.78.0/24. Hot potato: get traffic off of your network as Soon as possible. Go for egress 1! 57 Hot Potato Routing Also: Routing without queuing 29
Customer-Provider Hierarchy Address aggregation! Local Geographical Nation Global provider customer IP traffic Deaggregation Due to Multihoming If AS 1 does not announce the more specific prefix, then most traffic to AS 2 will go through AS 3 because it is a longer match 12.2.0.0/16 12.0.0.0/8 AS 1 provider AS 3 provider 12.2.0.0/16 AS 2 customer AS 2 is punching a hole in The CIDR block of AS 1 12.2.0.0/16 30
Scarry? BGP is not guaranteed to converge on a stable routing. Policy interactions could lead to livelock protocol oscillations. See Persistent Route Oscillations in Inter-domain Routing by K. Varadhan, R. Govindan, and D. Estrin. ISI report, 1996 Corollary: BGP is not guaranteed to recover from network failures. Is There A Problem? packetswitching routing interdomain routing Border Gateway Protocol v4 Single Point of failure! 31
Figure 19.25 NAT Figure 19.12 NAT address translation Alternative: External Source Address 200.24.5.8 goes here 19.64 32
Table 19.4 Five-column translation table 19.65 Alternative: External source address 200.24.5.8 goes here Alternative: External source port goes here 33