Distance-Vector and Path-Vector Routing COS 461: Computer Networks Spring 2009 (MW 1:30-2:50 in COS 105) Michael Freedman Teaching Assistants: Wyatt Lloyd.

Slides:



Advertisements
Similar presentations
BGP Convergence Jennifer Rexford. Outline Border Gateway Protocol (BGP) –Prefix-based routing at the AS level –Policy-based path-vector protocol –Incremental.
Advertisements

Fundamentals of Computer Networks ECE 478/578 Lecture #18: Policy-Based Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
Courtesy: Nick McKeown, Stanford
1 Interdomain Routing Protocols. 2 Autonomous Systems An autonomous system (AS) is a region of the Internet that is administered by a single entity and.
Distance-Vector and Path-Vector Routing Sections , 4.3.2, COS 461: Computer Networks Spring 2011 Mike Freedman
Routing - I Important concepts: link state based routing, distance vector based routing.
PATH VECTOR ROUTING AND THE BORDER GATEWAY PROTOCOL READING: SECTIONS PLUS OPTIONAL READING COS 461: Computer Networks Spring 2010 (MW 3:00-4:20.
1 Policy-Based Path-Vector Routing Reading: Sections COS 461: Computer Networks Spring 2006 (MW 1:30-2:50 in Friend 109) Jennifer Rexford Teaching.
Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side, delivers.
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Routing.
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
1 Interdomain Routing Policy Reading: Sections plus optional reading COS 461: Computer Networks Spring 2008 (MW 1:30-2:50 in COS 105) Jennifer Rexford.
Announcement r Project 2 Extension ? m Previous grade allocation: Projects 40% –Web client/server7% –TCP stack21% –IP routing12% Midterm 20% Final 20%
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Interdomain Routing and the Border Gateway Protocol (BGP) Reading: Section COS 461: Computer Networks Spring 2011 Mike Freedman
CS 4700 / CS 5700 Network Fundamentals Lecture 9: Intra Domain Routing Revised 7/30/13.
ROUTING ON THE INTERNET COSC Aug-15. Routing Protocols  routers receive and forward packets  make decisions based on knowledge of topology.
1 Computer Communication & Networks Lecture 22 Network Layer: Delivery, Forwarding, Routing (contd.)
CS 640: Introduction to Computer Networks Aditya Akella Lecture 10 - Intra-Domain Routing.
Intra-Domain Routing D.Anderson, CMU Intra-Domain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)
Computer Networking Lecture 10: Intra-Domain Routing
Network Layer r Introduction r Datagram networks r IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP r What’s inside a router r Routing.
1 Interdomain Routing (BGP) By Behzad Akbari Fall 2008 These slides are based on the slides of Ion Stoica (UCB) and Shivkumar (RPI)
Routing protocols Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF)
10-1 Last time □ Transitioning to IPv6 ♦ Tunneling ♦ Gateways □ Routing ♦ Graph abstraction ♦ Link-state routing Dijkstra's Algorithm ♦ Distance-vector.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
PATH VECTOR ROUTING AND THE BORDER GATEWAY PROTOCOL 1.
Network Layer4-1 Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y)
Routing 2 CS457 Fall 2010.
Introduction 1 Lecture 19 Network Layer (Routing Algorithms) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
Routing protocols. Static Routing Routes to destinations are set up manually Route may be up or down but static routes will remain in the routing tables.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
An internet is a combination of networks connected by routers. When a datagram goes from a source to a destination, it will probably pass through many.
Routing in the Inernet Outcomes: –What are routing protocols used for Intra-ASs Routing in the Internet? –The Working Principle of RIP and OSPF –What is.
1 Agenda for Today’s Lecture The rationale for BGP’s design –What is interdomain routing and why do we need it? –Why does BGP look the way it does? How.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
4: Network Layer4a-1 Distance Vector Routing Algorithm iterative: r continues until no nodes exchange info. r self-terminating: no “signal” to stop asynchronous:
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
Michael Schapira, Princeton University Fall 2010 (TTh 1:30-2:50 in COS 302) COS 561: Advanced Computer Networks
Inter-domain Routing Outline Border Gateway Protocol.
Computer Networking Lecture 11: Intra-Domain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)
1 Internet Routing: BGP Routing Convergence Jennifer Rexford Princeton University
Application Layer 2-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
ROUTING ON THE INTERNET COSC Jun-16. Routing Protocols  routers receive and forward packets  make decisions based on knowledge of topology.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 10: Intra-domain routing Slides used with.
1 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
Network Layer4-1 Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol.
CS 5565 Network Architecture and Protocols
COS 561: Advanced Computer Networks
Introduction to Internet Routing
Intra-Domain Routing Jacob Strauss September 14, 2006.
Distance Vector Routing: overview
Road Map I. Introduction II. IP Protocols III. Transport Layer
CS 4700 / CS 5700 Network Fundamentals
COS 561: Advanced Computer Networks
Routers Routing algorithms
CS 3700 Networks and Distributed Systems
CS 640: Introduction to Computer Networks
COS 561: Advanced Computer Networks
CS 3700 Networks and Distributed Systems
COS 561: Advanced Computer Networks
COS 461: Computer Networks
EE 122: Intra-domain routing: Distance Vector
BGP Instability Jennifer Rexford
Computer Networks Protocols
Presentation transcript:

Distance-Vector and Path-Vector Routing COS 461: Computer Networks Spring 2009 (MW 1:30-2:50 in COS 105) Michael Freedman Teaching Assistants: Wyatt Lloyd and Jeff Terrace 1

Goals of Today’s Lecture Distance-vector routing – Bellman-Ford algorithm – Routing Information Protocol (RIP) Path-vector routing – Faster convergence than distance vector – More flexibility in selecting paths Interdomain routing – Autonomous Systems (AS) – Border Gateway Protocol (BGP) 2

Shortest-Path Routing Path-selection model – Destination-based – Load-insensitive (e.g., static link weights) – Minimum hop count or sum of link weights

Shortest-Path Problem Compute: path costs to all nodes – From a given source u to all other nodes – Cost of the path through each outgoing link – Next hop along the least-cost path to s u s 6

Bellman-Ford Algorithm Define distances at each node x – d x (y) = cost of least-cost path from x to y Update distances based on neighbors – d x (y) = min {c(x,v) + d v (y)} over all neighbors v u v w x y z s t d u (z) = min{c(u,v) + d v (z), c(u,w) + d w (z)}

Distance Vector Algorithm c(x,v) = cost for direct link from x to v – Node x maintains costs of direct links c(x,v) D x (y) = estimate of least cost from x to y – Node x maintains distance vector D x = [D x (y): y є N ] Node x maintains its neighbors’ distance vectors – For each neighbor v, x maintains D v = [D v (y): y є N ] Each node v periodically sends D v to its neighbors – And neighbors update their own distance vectors – D x (y) ← min v {c(x,v) + D v (y)} for each node y ∊ N Over time, the distance vector D x converges 6

Distance Vector Algorithm 7 Iterative, asynchronous: each local iteration caused by: Local link cost change Distance vector update message from neighbor Distributed: Each node notifies neighbors only when its DV changes Neighbors then notify their neighbors if necessary wait for (change in local link cost or message from neighbor) recompute estimates if distance to any destination has changed, notify neighbors Each node:

Distance Vector Example: Step 1 8 A E F C D B Table for A DstCstHop A0A B4B C  – D  – E2E F6F Table for B DstCstHop A4A B0B C  – D3D E  – F1F Table for C DstCstHop A  – B  – C0C D1D E  – F1F Table for D DstCstHop A  – B3B C1C D0D E  – F  – Table for E DstCstHop A2A B  – C  – D  – E0E F3F Table for F DstCstHop A6A B1B C1C D  – E3E F0F Optimum 1-hop paths

Distance Vector Example: Step 2 9 Table for A DstCstHop A0A B4B C7F D7B E2E F5E Table for B DstCstHop A4A B0B C2F D3D E4F F1F Table for C DstCstHop A7F B2F C0C D1D E4F F1F Table for D DstCstHop A7B B3B C1C D0D E  – F2C Table for E DstCstHop A2A B4F C4F D  – E0E F3F Table for F DstCstHop A5B B1B C1C D2C E3E F0F Optimum 2-hop paths A E F C D B

Distance Vector Example: Step 3 10 Table for A DstCstHop A0A B4B C6E D7B E2E F5E Table for B DstCstHop A4A B0B C2F D3D E4F F1F Table for C DstCstHop A6F B2F C0C D1D E4F F1F Table for D DstCstHop A7B B3B C1C D0D E5C F2C Table for E DstCstHop A2A B4F C4F D5F E0E F3F Table for F DstCstHop A5B B1B C1C D2C E3E F0F Optimum 3-hop paths A E F C D B

Distance Vector: Link Cost Changes 11 Link cost changes: Node detects local link cost change Updates the distance table If cost change in least cost path, notify neighbors X Z Y 1 algorithm terminates “good news travels fast”

Distance Vector: Link Cost Changes 12 Link cost changes: Good news travels fast Bad news travels slow - “count to infinity” problem! X Z Y 60 algorithm continues on!

Distance Vector: Poison Reverse 13 If Z routes through Y to get to X : Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) Still, can have problems when more than 2 routers are involved X Z Y 60 algorithm terminates

Routing Information Protocol (RIP) Distance vector protocol – Nodes send distance vectors every 30 seconds – … or, when an update causes a change in routing Link costs in RIP – All links have cost 1 – Valid distances of 1 through 15 – … with 16 representing infinity – Small “infinity”  smaller “counting to infinity” problem RIP is limited to fairly small networks – E.g., used in the Princeton campus network 14

Comparison of LS and DV Routing Message complexity LS: with n nodes, E links, O(nE) messages sent DV: exchange between neighbors only Speed of Convergence LS: relatively fast 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 – Each node computes only its own table DV: – DV node can advertise incorrect path cost – Each node’s table used by others (error propagates) 15

Similarities of LS and DV Routing Shortest-path routing – Metric-based, using link weights – Routers share a common view of how good a path is As such, commonly used inside an organization – RIP and OSPF are mostly used as intradomain protocols – E.g., Princeton uses RIP, and AT&T uses OSPF But the Internet is a “network of networks” – How to stitch the many networks together? – When networks may not have common goals – … and may not want to share information 16

Interdomain Routing and Autonomous Systems (ASes) 17

Interdomain Routing Internet is divided into Autonomous Systems – Distinct regions of administrative control – Routers/links managed by a single “institution” – Service provider, company, university, … Hierarchy of Autonomous Systems – Large, tier-1 provider with a nationwide backbone – Medium-sized regional provider with smaller backbone – Small network run by a single company or university Interaction between Autonomous Systems – Internal topology is not shared between ASes – … but, neighboring ASes interact to coordinate routing 18

Autonomous System Numbers 19 AS Numbers are 16 bit values. Level 3: 1 MIT: 3 Harvard: 11 Yale: 29 Princeton: 88 AT&T: 7018, 6341, 5074, … UUNET: 701, 702, 284, 12199, … Sprint: 1239, 1240, 6211, 6242, … … Currently over 50,000 in use.

whois –h whois.arin.net as88 20 OrgName: Princeton University OrgID: PRNU Address: Office of Information Technology Address: 87 Prospect Avenue City: Princeton StateProv: NJ PostalCode: Country: US ASNumber: 88 ASName: PRINCETON-AS ASHandle: AS88 Comment: RegDate: Updated: RTechHandle: PAO3-ARIN RTechName: Olenick, Peter RTechPhone: RTech …

AS Number Trivia AS number is a 16-bit quantity – So, 65,536 unique AS numbers Some are reserved (e.g., for private AS numbers) – So, only 64,510 are available for public use Managed by Internet Assigned Numbers Authority – Gives blocks of 1024 to Regional Internet Registries – IANA has allocated 39,934 AS numbers to RIRs (Jan’06) RIRs assign AS numbers to institutions – RIRs have assigned 34,827 (Jan’06) – Only 21,191 are visible in interdomain routing (Jan’06) Recently started assigning 32-bit AS #s (2007) 21

Growth of AS numbers 22

Interdomain Routing AS-level topology – Destinations are IP prefixes (e.g., /8) – Nodes are Autonomous Systems (ASes) – Edges are links and business relationships Client Web server

Challenges for Interdomain Routing Scale – Prefixes: 200,000, and growing – ASes: 20,000+ visible ones, and 60K allocated – Routers: at least in the millions… Privacy – ASes don’t want to divulge internal topologies – … or their business relationships with neighbors Policy – No Internet-wide notion of a link cost metric – Need control over where you send traffic – … and who can send traffic through you 24

Path-Vector Routing 25

Shortest-Path Routing is Restrictive All traffic must travel on shortest paths All nodes need common notion of link costs Incompatible with commercial relationships 26 Regional ISP1 Regional ISP2 Regional ISP3 Cust1 Cust3 Cust2 National ISP1 National ISP2 YES NO

Link-State Routing is Problematic Topology information is flooded – High bandwidth and storage overhead – Forces nodes to divulge sensitive information Entire path computed locally per node – High processing overhead in a large network Minimizes some notion of total distance – Works only if policy is shared and uniform Typically used only inside an AS – E.g., OSPF and IS-IS 27

Distance Vector is on the Right Track Advantages – Hides details of the network topology – Nodes determine only “next hop” toward the dest Disadvantages – Minimizes some notion of total distance, which is difficult in an interdomain setting – Slow convergence due to the counting-to-infinity problem (“bad news travels slowly”) Idea: extend the notion of a distance vector – To make it easier to detect loops 28

Path-Vector Routing Extension of distance-vector routing – Support flexible routing policies – Avoid count-to-infinity problem Key idea: advertise the entire path – Distance vector: send distance metric per dest d – Path vector: send the entire path for each dest d d “d: path (2,1)” “d: path (1)” data traffic

Faster Loop Detection Node can easily detect a loop – Look for its own node identifier in the path – E.g., node 1 sees itself in the path “3, 2, 1” Node can simply discard paths with loops – E.g., node 1 simply discards the advertisement “d: path (2,1)” “d: path (1)” “d: path (3,2,1)”

Flexible Policies Each node can apply local policies – Path selection: Which path to use? – Path export: Which paths to advertise? Examples – Node 2 may prefer the path “2, 3, 1” over “2, 1” – Node 1 may not let node 3 hear the path “1, 2”

Border Gateway Protocol (BGP) 32

Border Gateway Protocol Interdomain routing protocol for the Internet – Prefix-based path-vector protocol – Policy-based routing based on AS Paths – Evolved during the past 18 years : BGP-1 [RFC 1105], replacement for EGP 1990 : BGP-2 [RFC 1163] 1991 : BGP-3 [RFC 1267] 1995 : BGP-4 [RFC 1771], support for CIDR 2006 : BGP-4 [RFC 4271], update

BGP Operations 34 Establish session on TCP port 179 Exchange all active routes Exchange incremental updates AS1 AS2 While connection is ALIVE exchange route UPDATE messages BGP session

Incremental Protocol A node learns multiple paths to destination – Stores all of the routes in a routing table – Applies policy to select a single active route – … and may advertise the route to its neighbors Incremental updates – Announcement Upon selecting a new active route, add node id to path … and (optionally) advertise to each neighbor – Withdrawal If the active route is no longer available … send a withdrawal message to the neighbors 35

BGP Route Destination prefix (e.g., /16) Route attributes, including – AS path (e.g., “ ”) – Next-hop IP address (e.g., ) 36 AS 88 Princeton /16 AS path = 88 Next Hop = AS 7018 AT&T AS 11 Yale /16 AS path = Next Hop =

ASPATH Attribute 37 AS /16 AS Path = 88 AS 1239 Sprint AS 1755 Ebone AT&T AS 3549 Global Crossing /16 AS Path = /16 AS Path = AS /16 Princeton Prefix Originated AS RIPE NCC RIS project AS 1129 Global Access /16 AS Path = /16 AS Path = /16 AS Path = /16 AS Path =

BGP Path Selection Simplest case – Shortest AS path – Arbitrary tie break Example – Three-hop AS path preferred over a five-hop AS path – AS prefers path through Global Crossing But, BGP is not limited to shortest-path routing – Policy-based routing 38 AS 3549 Global Crossing /16 AS Path = AS RIPE NCC RIS project AS 1129 Global Access /16 AS Path =

AS Path Length != Router Hops AS path may be longer than shortest AS path Router path may be longer than shortest path 39 2 AS hops, 8 router hops s d 3 AS hops, 7 router hops

BGP Convergence 40

Causes of BGP Routing Changes Topology changes – Equipment going up or down – Deployment of new routers or sessions BGP session failures – Due to equipment failures, maintenance, etc. – Or, due to congestion on the physical path Changes in routing policy – Changes in preferences in the routes – Changes in whether the route is exported Persistent protocol oscillation – Conflicts between policies in different ASes 41

BGP Session Failure BGP runs over TCP – BGP only sends updates when changes occur – TCP doesn’t detect lost connectivity on its own Detecting a failure – Keep-alive: 60 seconds – Hold timer: 180 seconds Reacting to a failure – Discard all routes learned from the neighbor – Send new updates for any routes that change 42 AS1 AS2

Routing Change: Before and After (1,0) (2,0) (3,1,0) (2,0) (1,2,0) (3,2,0)

Routing Change: Path Exploration AS 1 – Delete the route (1,0) – Switch to next route (1,2,0) – Send route (1,2,0) to AS 3 AS 3 – Sees (1,2,0) replace (1,0) – Compares to route (2,0) – Switches to using AS (2,0) (1,2,0) (3,2,0)

Routing Change: Path Exploration Initial situation – Destination 0 is alive – All ASes use direct path When destination dies – All ASes lose direct path – All switch to longer paths – Eventually withdrawn E.g., AS 2 – (2,0)  (2,1,0) – (2,1,0)  (2,3,0) – (2,3,0)  (2,1,3,0) – (2,1,3,0)  null (1,0) (1,2,0) (1,3,0) (2,0) (2,1,0) (2,3,0) (2,1,3,0) (3,0) (3,1,0) (3,2,0)

BGP Converges Slowly Path vector avoids count-to-infinity – But, ASes still must explore many alternate paths – … to find the highest-ranked path that is still available Fortunately, in practice – Most popular destinations have very stable BGP routes – And most instability lies in a few unpopular destinations Still, lower BGP convergence delay is a goal – Can be tens of seconds to tens of minutes – High for important interactive applications – … or even conventional application, like Web browsing 46

Conclusions Distance-vector routing – Compute path costs based on neighbors’ path costs – Bellman-Ford algorithm & Routing Information Protocol Path-vector routing – Faster convergence than distance-vector protocols – While hiding information and enabling flexible policy Interdomain routing – Autonomous Systems (ASes) – Policy-based path-vector routing Next time: interdomain routing policies 47