Routing: Distance Vector Algorithm

Slides:



Advertisements
Similar presentations
What is “Routing”? Routing algorithm that part of the network layer responsible for deciding on which output line to transmit an incoming packet Adaptive.
Advertisements

Data Communication and Networks Lecture 11 Internet Routing Algorithms and Protocols December 5, 2002 Joseph Conron Computer Science Department New York.
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.
CIS 235: Networks Fall, 2007 Western State College Computer Networks Fall, 2007 Prof Peterson.
Routing So how does the network layer do its business?
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.
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,
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
CSE 461: Distance Vector Routing. Next Topic  Focus  How do we calculate routes for packets?  Routing is a network layer function  Routing Algorithms.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Computer Networking Intra-Domain Routing, Part I RIP (Routing Information Protocol)
1 Computer Communication & Networks Lecture 22 Network Layer: Delivery, Forwarding, Routing (contd.)
Review: routing algorithms. –Choose the appropriate paths. –Routing algorithms Flooding Shortest path routing (example). –Dijkstra algorithm. –Bellman-Ford.
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 Chapter 22 Network layer Delivery, Forwarding and Routing (part2)
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface UGH00emd UH10lo0.
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.
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)
The Network Layer & Routing
Network Layer4-1 Distance Vector: link cost changes Link cost changes: r node detects local link cost change r updates distance table (line 15) r if cost.
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
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.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
CS 6401 Intra-domain Routing Outline Introduction to Routing Distance Vector Algorithm.
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.
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.
Network Layer.
The network layer: routing
CS 5565 Network Architecture and Protocols
Routing: Link State Algorithm
CSE390 – Advanced Computer Networks
Network Layer Introduction Datagram networks IP: Internet Protocol
Intra-Domain Routing Jacob Strauss September 14, 2006.
Distance Vector Routing: overview
Dan LI CS Department, Tsinghua University
Network layer functions
Chapter 4 – The Network Layer & Routing
14: Intro to Routing Algorithms
Road Map I. Introduction II. IP Protocols III. Transport Layer
Lecture 10 Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from.
CS 4700 / CS 5700 Network Fundamentals
Routers Routing algorithms
CS 3700 Networks and Distributed Systems
Intradomain Routing Outline Introduction to Routing
CS 640: Introduction to Computer Networks
RFC 1058 & RFC 2453 Routing Information Protocol
ECE453 – Introduction to Computer Networks
Communication Networks NETW 501
CS4470 Computer Networking Protocols
CS 3700 Networks and Distributed Systems
COMP/ELEC 429 Introduction to Computer Networks
Chapter 4: Network Layer
Computer Networking Lecture 10: Intra-Domain Routing
Communication Networks
ECSE-4730: Computer Communication Networks (CCN)
Chapter 4: Network Layer
Network Layer (contd.) Routing
EE 122: Intra-domain routing: Distance Vector
Communication Networks
Network Layer.
Chapter 4: Network Layer
Presentation transcript:

Routing: Distance Vector Algorithm Networking CS 3470, Section 1

Review So how is routing different from forwarding?

The University of Adelaide, School of Computer Science 19 September 2018 Routing Network as a Graph The basic problem of routing is to find the lowest-cost path between any two nodes Where the cost of a path equals the sum of the costs of all the edges that make up the path 5 3 B C 2 5 A 2 1 F 3 1 2 D E 1 Chapter 2 — Instructions: Language of the Computer

Routing Routing protocols need to be both dynamic and distributed Deal with node and link failures, changing link costs, and scalability

Distributed Routing Algorithms Two standard distributed routing algorithms Link state routing Distance vector routing What link state routing protocol did we discuss last time?

Link State vs Distance Vector Both assume that The address of each neighbor is known The cost of reaching each neighbor is known Both find global information By exchanging routing info among neighbors Differ in info exchanged and route computation LS: tells every other node its distance to neighbors DV: tells neighbors its distance to every other node

Distance Vector Routing A router tells neighbors its distance to every router Communication between neighbors only Each router maintains a distance table A row for each possible destination A column for each neighbor DX(Y,Z) : distance from X to Y via Z So far we have talked about link state routing. Under link state routing each router receives complete information about the network topology and computes shortest paths using Dijkstra’s algorithm. Now we will discuss a different routing protocol called distance vector Routing. Under distance vector routing, a router informs its neighbors about the distance from that router to every other router in the network. Unlike in link state routing, here information is exchanged only between neighbors. It is based on Bellman-Ford algorithm for computing shortest paths. We will go through an example to see how this works. Under distance vector routing, each router maintains a distance table. A row for each possible destination and a column for each neighbor. An entry in router X’s table corresponding to a row Y and a column Z is the distance from X to Y via Z. Given a distance table we can find the shortest distance to a destination, i.e., the smallest value in the row corresponding to the destination. A list of <destination, shortest distance> tuples is called a distance vector and these distance vectors are exchanged between neighbors.

Distance Vector Routing Given a distance table we can find the shortest distance to a destination i.e., the smallest value in the row corresponding to the destination. A list of <destination, shortest distance> tuples is called a distance vector Current least cost to each destination Exchanged between neighbors Based on Bellman-Ford algorithm Computes “shortest paths”

Distance Table: Example Distance table at router E D () A B C D 1 7 6 4 14 8 9 11 5 2 E cost to destination via destination A E D C B 7 8 1 2 Lets look at an example. Here A, B, C, D, and E are routers and the links are labeled with their costs. And this is a distance table at router E. You can see that there is one row per each destination an one column per each neighbor. If you look at the third row, it says that you can reach C via A with cost 6, via B with cost 9 and via D with 4. So the shortest distance to C is 4 via D. If E were to advertise its distance vector it will send <A,1>,<B,5>,<C,4>,<D,2>. If E were to advertise its distance vector, it would send <A,1>,<B,5>,<C,4>,<D,2>

Distance Table to Routing Table 1 7 6 4 14 8 9 11 5 2 E cost to destination via destination Outgoing link to use, cost A B C D A,1 D,5 D,4 D,2 What we are really interested in is the routing table. How do we create a routing table from this distance table. Pretty simple. For example, to reach B the shortest path is via D. So the next hop for routing to B is D. We can get the whole routing table this way. Now the question is how do we compute this distance table. That’s where we use Bellman-Ford algorithm. destination Distance table Routing table

Distance Vector Routing Algorithm Now the real question… How do we compute this distance table? That’s where we use Bellman-Ford algorithm.

Distance Vector Routing Algorithm iterative: continues until no nodes exchange info. self-terminating: no “signal” to stop asynchronous: nodes need not exchange info/iterate in lock step! distributed: each node talks only with directly-attached neighbors Distance Table data structure each node has its own row for each possible destination column for each directly-attached neighbor to node example: in node X, for dest. Y via neighbor Z: D (Y,Z) X distance from X to Y, via Z as next hop c(X,Z) + min {D (Y,w)} Z w =

Distance Vector Routing: Overview Each node: Iterative, asynchronous: each iteration caused by: local link cost change message from neighbor: its least cost path change from neighbor Distributed: each node notifies neighbors only when its least cost path to any destination changes neighbors then notify their neighbors if necessary wait for (change in local link cost or msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors

Distance Vector Algorithm: Example Z 1 2 7 Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = 7+1 = 8 Z At beginning, a node only knows the distance to their immediate neighbors. After a few iteration, a node progressively learns the distance to other nodes. D (Z,Y) X c(X,Y) + min {D (Z,w)} w = 2+1 = 3 Y

Distance Vector Algorithm: Example Z 1 2 7 Y This process continues until no one changes the shortest path to others. Some later steps are not shown in the figure.

Distance Vector Algorithm: Example Z 1 2 7 Y This process continues until no one changes the shortest path to others. Some later steps are not shown in the figure.

Convergence of DV Routing router detects local link cost change updates distance table if cost change in least cost path, notify neighbors X Z 1 4 50 Y “good news travels fast” algorithm terminates Now lets look at the convergence of distance vector routing. Here we show only the cost of reaching X from Y and Z. Suppose that the cost of link between X and Y changes from 4 to 1. The router Y notices the change and updates its distance table. Since the shortest distance changed, it notifies Z. The router Z changes the distance to X via Y as 2 from the previous value 5. It then notifies Y since the shortest distance changed. Y once again changes the distance table. However, this time no change in the shortest distance. This is the case when the link cost decreases which is a good news. Now lets see what happens when the link cost increases.

Problems with DV Routing 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! Suppose that link cost is increased from 4 to 60. Once again router Y senses the change, updates the distance table. It sees that it can reach X via Z with distance 6. Since the shortest distance changed, it notifies the neighbor Z. The router Z in turn updates its table and informs Y. This goes on and on. Do you know when it terminates? What will be the entries in distance table when it converges? It finally reaches steady state with distance from Y to X via Z as 51 and Z to X via Y as 52. This is the problem with distance vector routing. Good news travels fast but bad news travels slow. This results in what is known as count to infinity problem.

Fixes to Count-to-Infinity Problem Split horizon A router never advertises the cost of a destination to a neighbor If this neighbor is the next hop to that destination Split horizon with poisonous reverse If X routes traffic to Z via Y, then X tells Y that its distance to Z is infinity Instead of not telling anything at all Accelerates convergence

Split Horizon with Poisoned Reverse X Z 1 4 50 Y 60 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) algorithm terminates Lets look at the earlier example again. Note that the initially the cost to reach Z from Y via X is infinity since Y is the next hop for Z to reach X. When the cost changes to 60, Y senses it, updates its table and notifies Z. The router Z realizes that direct link to X is shorter than going thru Y and updates its routing table. It then notifies Y which updates its table and makes Z its next hop to reach X. Then as per the rule, Y announces its cost to reach X as infinity. This way routers quickly converge to stable state. Does this solution completely solve the count to infinity problem?

Count-to-Infinity Problem X Y Z W What happens when the link Y to Z goes down? All three routers X, Y, and W together count to infinity. Split horizon solution works only when two routers are involved in a loop. What happens when the link Y to Z goes down. All three routers X, Y, and W together count to infinity. Split horizon solution works only when two routers are involved in a loop. So what is the solution? To completely eliminate the problem, a router some how need to figure out the complete path to a destination. Obvious solution is to pass on the path information along with the distance vector. This path vector approach is used in BGP. Split horizon with poison reverse does not help.

Count-to-Infinity Problem X Y Z W To completely eliminate the problem, a router some how need to figure out the complete path to a destination. Obvious solution is to pass on the path information along with the distance vector. This path vector approach is used in BGP. What happens when the link Y to Z goes down. All three routers X, Y, and W together count to infinity. Split horizon solution works only when two routers are involved in a loop. So what is the solution? To completely eliminate the problem, a router some how need to figure out the complete path to a destination. Obvious solution is to pass on the path information along with the distance vector. This path vector approach is used in BGP. Split horizon with poison reverse does not help.

Link State vs Distance Vector Tells everyone about neighbors Controlled flooding to exchange link state Dijkstra’s algorithm Each router computes its own table May have oscillations Tells neighbors about everyone Exchanges distance vectors with neighbors Bellman-Ford algorithm Each router’s table is used by others May have routing loops Now lets compare these two routing protocols. Under link state, a router tells everyone about its neighbors using controlled flooding. Distance vector case a router communicates with neighbors only to inform about everyone. Link state each router gathers global information and computes its own table using Dijkstra’s algorithm. Distance vector performs distributed computation using other routers tables. We saw that distance vector can cause routing loops. There may be frequent changes in routes in the case of link state. This results in out of order delivery of packets which is undesirable. Both these approaches have advantages and disadvantages. Both are used in the Internet. OSPF is the most popularly used intra-domain routing protocol that is based on link state. RIP is based on distance vector which is being taken over by OSPF. BGP is an inter-domain protocol that uses path vectors.

RIP RIP == Routing Information Protocol RIP is a distance vector implementation Instead of advertising costs to the next router, RIP advertises the cost to the next network. (network_address, distance) pairs