170 likes | 468 Views
Distance Vector Routing and RIP Neil Tang 10/29/2008. Overview. Forwarding and Routing Network Model Routing Problem and Protocol Distance Vector Routing RIP. Routing VS. Forwarding.
E N D
Distance Vector Routing and RIPNeil Tang10/29/2008 CS440 Computer Networks
Overview • Forwarding and Routing • Network Model • Routing Problem and Protocol • Distance Vector Routing • RIP CS440 Computer Networks
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. CS440 Computer Networks
Routing Table VS. Forwarding Table A routing table A forwarding table CS440 Computer Networks
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. CS440 Computer Networks
Network Model CS440 Computer Networks
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. CS440 Computer Networks
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. CS440 Computer Networks
Distance Vector Routing Initial routing table in node A CS440 Computer Networks
Distance Vector Routing Routing table in node A after one round of update All node do the same thing simultaneously. After O(n) updating rounds, the system will stabilize and converge to the optimal solution. CS440 Computer Networks
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 happenswhenever a node receives an update from one of its neighbors that causes it to change one of the routes in its routing table. CS440 Computer Networks
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. CS440 Computer Networks
Failure Handling Routing table in node A after link failure CS440 Computer Networks
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. CS440 Computer 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. CS440 Computer Networks
RIP Packet Format CS440 Computer Networks