Distance Vector Routing Protocols (Part I) - CCNA
Sunday, October 26th, 2008When routers communicate with each other they use their own language, as you would assume. You no doubt are aware that a router’s main function is to receive a packet and then figure out the best path, based on what the router knows, to get the packet to its destination.
The packet received by the router - for example an IP (Internet Protocol) packet - is a <u>routed</u> protocol. The router takes the routed protocol and encapsulates it (entirely) inside its own protocol data unit (PDU). When the router performs this process, the newly-created PDU is sent to the next router.
Before the router sends the PDU to the next router, it needs to determine to which next router the PDU should be sent. Routers learn about best paths by communicating with other routers and use routing protocols like RIP (Routing Internet Protocol), OSPF (Open Shortest Path First), and EIGRP (Cisco routers only: Enhanced Internet Gateway Routing Protocol) to accomplish this goal.
RIP and EIGRP are classified as distance vector (DV) routing protocols, whereas OSPF is classified as a link state (LS) routing protocol. DV routing protocols keep track of distances and directions (or vectors) using a simple metric called hop count. Each router through which a packet must pass is equal to one hop. It’s that easy. One catch is that a DV routing protocol such as RIP will only route a PDU 16 times. Any hop count beyond that is considered unreachable. Therefore RIP seemingly does the impossible by defining infinity.
DV routing protocols talk to each other using the logic, or algorithm, of their underlying logic, and this talk results in the shortest distance to a destination. Of course, a router should have a path to every destination (unless you specifically do not want that). RIP’s algorithm is known as the <i>Bellman-Ford</i> algorithm, named after the men who developed it. Routers record what they learn about routes in what is called a topology table but the actual routes a router will use is recorded in a routing table. In other words, the topology table might contain more than one path to one destination, but the routing table will only record the one path that has the lowest metric (which makes this route the best path to a given destination).
LS routing protocols such as OSPF utilize the more complex <i>Dijkstra</i> algorithm, again, named after the person who created it. LS routing protocols create a composite metric by learning about the bandwidth and speed of the media through which the PDU will pass. We will discuss LS routing protocols in a later discussion.
Finally, EIGRP, which, again, is a Cisco proprietary routing protocol, is referred to by Cisco as a hybrid routing protocol. A hybrid routing protocol (according to Cisco) takes the best features from the DV and LS routing protocols and uses them all. As with LS routing protocols. we will reserve our comments about EIGRP to a later discussion, when we can cover it fully.
If you noticed that I didn’t even mention IGRP, then you are ahead of the pack! Since IGRP and RIP (version 1) are no longer supported, I’m not going to discuss them in much detail. However, many features of RIP are common to IGRP with the exception of using only hop count to calculate its metric.
When a router boots up, like any other computer (or sentient being for my Star Trek fans), it first does an internal awareness check known as POST (power-on, self test). Once the router knows its internals are functioning as expected, the router next loads its operating system (OS). Cisco named its router (and switch) OS the Internetwork Operating System or IOS. Once the router loads its IOS, it next looks to see if it possesses a specific configuration file.
When a Windows computer reaches this stage of its boot process, it applies a specific configuration from its database known as the registry. The registry is stored on a computer’s hard drive, which means that it can be changed - such as when a user changes her desktop background - and then saved so that the next time the user logs in the new desktop color is applied. A router does not have an internal hard drive, however, it does have memory that is very similar to another type of memory found in computers - EPROM (erasible programmable read-only memory). Cisco refers to this memory as NVRAM (non-volatile random-access memory). Think of NVRAM as RAM that does <u>not</u> lose its contents when the router loses power. The configuration file stored in NVRAM contains router-specific information such as the router’s name, its IP addresses, security settings, and more.
Once the router applies its startup configuration file settings, it is now, finally, ready to talk to its neighbors. On Cisco routers, a router talks to its directly-connected neighbors using another special language via CDP (Cisco Discovery Protocol). Note that whenever you encounter a protocol with a vendor’s name in it, this protocol will only be installed and available if your equipment was manufactured by that vendor. In other words, a Juniper router will not run CDP and it won’t be able to use EIGRP.
When Cisco routers communicate using CDP, they only tell each other about the network that directly connects them to each other. So, if Router1 is connected to another network, which is usually the case, Router2 will not learn of that network’s existance, meaning that if Router2 receives a packet addressed to the other network, Router2 just might drop the packet (not route it). Of course, the the Router2 human administrator can program a (static) route to the other network, but this is a lot of work and outside of a small network, this would not work!
After reading the above, you no doubt are thinking that if the router could communicate directly with other routers, without much human intervention, this process would work in small and large networks. If you are thinking along those lines, then you understand why RIP, EIGRP, OSPF, and other routing protocols were created. When a router is provided with a basic routing protocol configuration, the router is able to dynamically talk to other routers, learn about routes, send requests for information and answer such requests, all without human intervention. When routers operate in this fashion, the network is said to be <i>scalable</i>, meaning that regardless of the network’s size, the process still functions with little or no human intervention required.
So, after a Cisco router learns all it can via CDP, it needs a dynamic routing protocol, such as RIP, to learn about paths to networks beyond its directly-connected neighbors. The router’s next step, after completing the CDP process, is to send its entire routing table to each of its directly-connected neighbors. Once the neighbors receive this routing table, they recalculate their routing table using RIP’s algorithm and then send out their entire routing table to each of their directly-connected neighbors. This process continues until all of the routers in the network have no new routes to learn. In other words, when a router receives its neighbors routing table and learns nothing new, the process is complete. At this stage, the routers have reached agreement on how to reach known destinations. This stage of agreement is known as <i>convergence</i>.
In our next discussion, we will address timers, triggered updates, routing loops, split horizon, and route poisoning. Stay tuned for next week’s continuation!