Routing Protocols – Part 1

In this series, we’ll discuss routing and routing protocols. First, let’s define what we mean by a “route”. In common usage, a “route” is an entry in the IP routing table. You can display the IP routing table (available routes) with the command show ip route.

Each entry in the routing table gives the best way for that router to reach a particular IP prefix. Remember that a “prefix” is a particular address/mask combination. Examples of prefixes are:

  • 10.0.0.0/8 (a classful network)
  • 172.168.100/24 (a subnet)
  • 192.168.1.32/29 (another subnet)
  • 200.100.200.3/32 (a host route)
  • 0.0.0.0/0 (the default route)

For each prefix displayed in the routing table, the entry will indicate how the route was learned, the next hop router’s address and/or outbound interface used to reach it, and other information. Although a routing table entry always represents the best known way to reach a particular prefix, the router may be aware of other possible paths to that prefix. If so, those additional paths would be tracked in other behind-the-scenes data structures separate from the routing table.

There are three ways that a router can learn about the existence of a route:

  • Directly connected (to an interface)
  • Static configured (by a person)
  • Dynamically learned (via a routing protocol)

Directly connected routes are those prefixes to which the router has a direct physical connection. Assuming that the interface is “up/up”, the router will calculate the prefix based on the address and mask configured on the interface, and place a “C” (Connected) route for that prefix in the routing table.

Static routes are those that are configured by an administrator with the ip route command, instructing the router to use a particular next hop or outbound interface to reach a particular prefix. Assuming that the interface in question is “up/up”, the router will place an “S” (Static) route for that prefix in the routing table.

Dynamic routes are those learned via a routing protocol. The mechanism by which the router learns the route varies by routing protocol, as does the letter representing the way the route was learned. Examples include “R” (RIP), “O” (OSPF) and “D” (EIGRP) routes.

Once all routers have learned their best paths to all available prefixes, the network is said to be “converged”. Note that after the network is converged, the routers do not have identical routing tables, but the tables are consistent and correct. When a change occurs, the time lag between the change and re-convergence is referred to as the “convergence interval” or “convergence time”, and is a function of the routing protocol(s) and the size of the network.

We can classify the dynamic protocols several ways. First there’s the method of operation, which can include:

  • Distance-Vector (D-V)
  • Link-State
  • Hybrid
  • Path-Vector

The basic idea of a D-V protocol such as RIP is that each router determines its directly-connected routes, and places them in its routing table. The router then sends advertisements on all participating interfaces to inform its neighbors about what it knows.

When a router receives an update, it checks its routing table to see if the update contains an advertised prefix that was previously unknown. If so, that prefix is added to the routing table, with the advertising router as the best next hop.

If a router receives an advertisement for a known prefix, the router checks to see if the advertised route has a better metric than the current route. If so, the router updates the routing table to use the advertising router as the next hop for that prefix. If not, the router ignores the advertisement.

When all information has been passed around and the routing tables have stabilized, the network is converged. So that all routers become aware of changes to the topology in a timely fashion, the routing tables are advertised periodically.

D-V protocols get their name from the fact that each update sent from router to router is a mathematical vector (a multi-valued variable) containing prefix and metric (distance) information. The metric varies by routing protocol, and include such things as hop count, cost, bandwidth, and delay. The vectors used with routing protocols are mathematical vectors, not navigational vectors (such as Northeast).

Author: Al Friebe

In this article

Join the Conversation