Distance Vector Routing and RIP Neil Tang 10292008

  • Slides: 16
Download presentation
Distance Vector Routing and RIP Neil Tang 10/29/2008 CS 440 Computer Networks 1

Distance Vector Routing and RIP Neil Tang 10/29/2008 CS 440 Computer Networks 1

Overview Ø Forwarding and Routing Ø Network Model Ø Routing Problem and Protocol Ø

Overview Ø Forwarding and Routing Ø Network Model Ø Routing Problem and Protocol Ø Distance Vector Routing Ø RIP CS 440 Computer Networks 2

Routing VS. Forwarding Ø Forward: the procedure of looking up the forwarding table based

Routing VS. Forwarding Ø Forward: the procedure of looking up the forwarding table based on the destination address of a packet and sending it to the corresponding output port. Ø Routing: the procedure of building the forwarding/routing table. CS 440 Computer Networks 3

Routing Table VS. Forwarding Table A routing table Network. Num Next. Hop 18 171.

Routing Table VS. Forwarding Table A routing table Network. Num Next. Hop 18 171. 69. 245. 10 A forwarding table Network. Num Interface MAC Addr 18 8: 0: 2 b: e 4: b: 1: 2 if 0 CS 440 Computer Networks 4

Network Model Ø A network is usually modeled as a graph such that the

Network Model Ø A network is usually modeled as a graph such that the networking problems can be transformed to the corresponding problems in the graph and solved by algorithms in graph theory. Ø A node in the graph can represent a host, a router or even a network. But usually a node represents a router. Ø An edge in the graph corresponds to a link in the network. There is normally a cost associated with a link, which indicates the communication cost, delay, bandwidth, reliability or … of that link. CS 440 Computer Networks 5

Network Model CS 440 Computer Networks 6

Network Model CS 440 Computer Networks 6

Routing Problem and Protocol Ø The routing problem seeks a route between a pair

Routing Problem and Protocol Ø The routing problem seeks a route between a pair of nodes such that it has the smallest cost among all possible routes. Ø A routing protocol must be able to solve the routing problem in a dynamic way. Ø A routing protocol must be able to solve the routing problem in a distributed way but maintain a correct and consistent routing table in each router. CS 440 Computer Networks 7

Distance Vector Routing The Basic Idea Ø Each node constructs a vector containing distance

Distance Vector Routing The Basic Idea Ø Each node constructs a vector containing distance (costs) to all other nodes and distributes the vector to its intermediate neighbors periodically. Ø Each node updates its routing table based on the received distance vectors and the best solutions received so far. Ø This idea comes from the distributed Bellman-Ford algorithm. CS 440 Computer Networks 8

Distance Vector Routing Initial routing table in node A CS 440 Computer Networks Destination

Distance Vector Routing Initial routing table in node A CS 440 Computer Networks Destination Cost Next. Hop B 1 B C 1 C D ∞ - E 1 E F 1 F G ∞ - 9

Distance Vector Routing table in node A after one round of update Destination Cost

Distance Vector Routing table in node A after one round of update Destination Cost Next. Hop B 1 B C 1 C D 2 C E 1 E F 1 F G 2 F All node do the same thing simultaneously. After O(n) updating rounds, the system will stabilize and converge to the optimal solution. CS 440 Computer Networks 10

Table Updating Method Ø Periodical update (proactive): each node automatically send an update message

Table Updating Method Ø Periodical update (proactive): each node automatically send an update message every so often even if nothing changes and routing tables are updated accordingly. Ø Triggered update (reactive): it happens whenever a node receives an update from one of its neighbors that causes it to change one of the routes in its routing table. CS 440 Computer Networks 11

Failure Testing Ø Each node periodically sends out HELLO messages to all its neighbors

Failure Testing Ø Each node periodically sends out HELLO messages to all its neighbors and see if it can receives acknowledgements. Ø Each node uses the periodical update message and see if it does not receive it from some node after a certain period of time. CS 440 Computer Networks 12

Failure Handling Routing table in node A after link failure CS 440 Computer Networks

Failure Handling Routing table in node A after link failure CS 440 Computer Networks Destination Cost Next. Hop B 1 B C 1 C D 2 C E 1 E F 1 F G 3 C 13

Count-to-Infinity Problem A(E, ∞)->B, C(E, 2)->B before A(E, ∞)->C, then B(E, 3)->A, then A(E,

Count-to-Infinity Problem A(E, ∞)->B, C(E, 2)->B before A(E, ∞)->C, then B(E, 3)->A, then A(E, 4)->C, then C(E, 5)->D …, More importantly, no one realizes that E is unreachable. CS 440 Computer Networks 14

Routing Information Protocol Ø RIP is an intra-domain routing protocol for small scale networks.

Routing Information Protocol Ø RIP is an intra-domain routing protocol for small scale networks. Ø Based on RIP, each entry in the routing table corresponds to a network and specifies the cost and nexhop router to reach that network. Ø Each RIP packet includes a set of (network-address, distance) tuples. Ø In RIP, all link costs are set to one. Ø Every node sends out an route update message every 30 seconds, and also uses the triggered (reactive) updating method. CS 440 Computer Networks 15

RIP Packet Format CS 440 Computer Networks 16

RIP Packet Format CS 440 Computer Networks 16