Routing Jens A Andersson Communication Systems
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 R5 10
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
Local Routing.105.10.1 Netid: 192.168.1.0/24 router
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
Technology of Distributed Routing 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 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
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
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 Protocol
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
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? 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
Figure 21-23 Example 21.1
RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/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 poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)
The Count to Infinity Problem 1 1 C B A C C I can reach C at cost 1 I can reach C at cost 3 (via A) I can reach C at cost 5 (via A) B B 1 1 A A I can reach C at cost 2 I can reach C at cost 4 (via B) I can reach C at cost 6 (via B)
Split Horizon 1 1 C B A C C I can reach C at cost 1 I can t reach C B B 1 1 A A I can reach C at cost 2, But I won t tell B! I can t reach C
Split Horizon with Poison Reverse 1 1 C B A C C I can reach C at cost 1 I can t reach C B B 1 1 A A I can reach C at cost 2, But I ll tell B that I can t! Now I really can t reach C
Unsolved routing-loop C I can reach C at cost 1 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
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
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
Figure 21.8 Types of links Types of Links
Figure 21.9 Point-to-point link Point-to-Point Link
Figure 21.10 Transient link Transient Link
Figure 21.11 Stub link Stub Link
Figure 21.14 Types of LSAs Types of LSAs
Figure 21.15 Router link Router Link
Figure 21.16 Network link Network Links
Figure 21.17 Summary link to network Summary Link to Network
Figure 21.18 Summary link to AS boundary router Summary link to AS boundary router
Figure 21.19 External link External Link
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 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
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
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
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
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 N04 R06 R12 AS67, AS89, AS09, AS34 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.
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 47
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 48
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) KEEPALIVEkeeps connection alive in absence of UPDATES; also ACKs OPEN request NOTIFICATION: reports errors in previous msg; also used to close connection
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
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! 53
Hot Potato Routing Also: Routing without queuing
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
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? packet switching routing interdomain routing Border Gateway Protocol v4 Single Point of failure!
Figure 19.25 NAT
Figure 19.26 Address translation
Figure 19.27 Translation
Table 19.3 Five-column translation table Private Address Private Port External Address External Port Transport Protocol 172.18.3.1 1400 25.8.3.2 1234 TCP 172.18.3.2 1400 25.8.3.2 1245 TCP............... Service in private network: table entry must be manually entered