Sunday, October 16, 2011

CCNA :: Part 5 - IP Routing Distance Vector

Distance Vector Routing Protocols

Distance vector protocols work by having each router advertise all the routes they know out all their interfaces. Other routers that share the same physical network receive the routing updates and learn the routes. The routers that share a common physical network are generally called neighbors. For instance, all routers attached to the same Ethernet are neighbors; the two routers on either end of a point-to-point serial link are also neighbors. If all routers advertise all their routes out all their interfaces, and all their neighbors receive the routing updates, eventually every router will know the routes to all the subnets in the network.

The following list spells out the basic distance vector logic and introduces a few important concepts:

_Routers add directly connected subnets to their routing tables, even without a routing protocol.

_Routers send routing updates out their interfaces to advertise the routes that this router already knows. These routes include directly connected routes, as well as routes learned from other routers.

_Routers listen for routing updates from their neighbors so that they can learn new routes.

_The routing information includes the subnet number and a metric. The metric defines how good the route is; lower metric routes are considered better routes.

_When possible, routers use broadcasts or multicasts to send routing updates. By using a broadcast or multicast packet, all neighbors on a LAN can receive the same routing information in a single update.

_If a router learns multiple routes to the same subnet, it chooses the best route based on the metric.

_Routers send periodic updates and expect to receive periodic updates from neighboring routers.

_Failure to receive updates from a neighbor in a timely manner results in the removal of the routes previously learned from that neighbor.

_A router assumes that, for a route advertised by Router X, the next-hop router in that route is Router X.

The following examples explain the concepts in the list in a little more depth. Fig. 28 demonstrates how Router A’s directly connected subnets are advertised to Router B and the whole advertising process with the metrics of the routes. In this case, Router A advertises two directly connected routes and Router C - one.
                                                                   Fig -28

The following table shows the resulting routing table on Router B
.
Network (Mask is /24)
Outgoing interface
Next-hop Router
Metric
Comments
172.16.5.0
S1/0
172.16.8.1
1
This is one of two routes learned via the update in the figure.
172.16.7.0
FE0/0
-
0
Directly connected route.
172.16.8.0
S1/0
-
0
Directly connected route.
172.16.9.0
S1/0
172.16.8.1
1
This is one of two routes learned via the update in the figure.
172.16.10.0
S1/0
172.16.8.1
2
This one was learned from Router A, which learned it from Router C.

Two interesting facts about what a Cisco IOS software-based Cisco router puts in the routing table become obvious in this example. First, just like for any other directly connected route, the two directly connected routes on Router B do not have an entry in the table’s Next-Hop Router field, because packets to those subnets can be sent directly to hosts in those subnets. In other words, there is no need for Router B to forward packets destined for those subnets to another router, because Router B is attached to those subnets. The second interesting fact is that the Next-Hop Router entries for the routes learned from Router A show Router A’s IP address as the next router. In other words, a route learned from a neighboring router goes through that router. Router B typically learns Router A’s IP address for these routes simply by looking at the routing update’s source IP address.

Router B believes some subnets are nearer than others, based on the metric. The show ip route EXEC command shows connected routes as metric 0, because there is no router between Router B and those subnets. Router B uses a metric of 1 for routes directly connected to Router A for two reasons. First, Router A advertises those two routes (172.16.5.0 and 172.16.9.0) with metric 1, so Router B believes those metrics. (Router A, before advertising those two routes, adds 1 to the metric value of its own routes to those subnets.) Conceptually, one router (Router A) separates Router B from those subnets. Because RIP’s metric is hop count, a metric of 1 implies that only one router separates Router B from the subnets in question. Similarly, Router B’s metric for subnet 172.16.10.0 is 2, because the routing update from Router A advertises the router with a metric of 2. Conceptually, Router B believes that two routers separate it from 172.16.10.0.

The next core concept of distance vector routing protocols relates to when to doubt the validity of routing information. Each router sends periodic routing updates. A routing update timer, which is equal on all routers, determines how often the updates are sent. The absence of routing updates for a preset number of routing timer intervals results in the removal of the routes previously learned from the router that has become silent.

Loop-Avoidance Features

Routing protocols carry out their most important functions when redundancy exists in the network. Most importantly, routing protocols ensure that the currently-best routes are in the routing tables by reacting to network topology changes. Routing protocols also prevent loops. Distance vector protocols need several mechanisms to prevent loops. The following table summarizes these issues and lists the solutions.

ISSUE
Solution
Multiple routes to the same subnet have equal metrics
Implementation options involve either using the first route learned or putting multiple routes to the same subnet in the routing table.
Routing loops occur due to updates passing each other over a single link
Split horizon-The routing protocol advertises routes out an interface only if they were not learned from updates entering that interface.

Split horizon with poison reverse-The routing protocol uses split-horizon rules unless a route fails. In that case, the route is advertised out all interfaces, including the interface in which the route was learned, but with an infinite-distance metric.
Routing loops occur because routing information loops through alternative paths
Hold-down timer-After finding out that a route to a subnet has failed, a router waits a certain period of time before believing any other routing information about that subnet.

Triggered updates-When a route fails, an update is sent immediately rather than waiting on the update timer to expire. Used in conjunction with route poisoning, this ensures that all routers know of failed routes before any hold-down timers can expire.

No comments:

Post a Comment