Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman

Similar presentations


Presentation on theme: "Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman"— Presentation transcript:

1 Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman http://www.cs.princeton.edu/courses/archive/spring10/cos461/ 1

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

3 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 3 3 2 2 1 1 4 1 4 5 3 u s 6

4 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 4 3 2 2 1 1 4 1 4 5 3 u v w x y z s t d u (z) = min{c(u,v) + d v (z), c(u,w) + d w (z)}

5 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 5

6 Distance Vector Algorithm 6 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:

7 Distance Vector Example: Step 1 7 A E F C D B 2 3 6 4 1 1 1 3 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

8 Distance Vector Example: Step 2 8 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 2 3 6 4 1 1 1 3

9 Distance Vector Example: Step 3 9 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 2 3 6 4 1 1 1 3

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

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

12 Distance Vector: Poison Reverse 12 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 1 4 50 Y 60 algorithm terminates

13 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 13

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) 14

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 15


Download ppt "Distance-Vector Routing COS 461: Computer Networks Spring 2010 (MW 3:00-4:20 in COS 105) Michael Freedman"

Similar presentations


Ads by Google