Routing in general
To review from the last tip, the router learns the next hop for packets using one of two methods:
- Static routing: With static routing, you -- as the administrator -- manually enter the routes and tell the router, for each IP network, what next hop that traffic should be delivered to.
- Dynamic routing: With dynamic routing, you -- as the administrator -- configure a routing protocol on your network interfaces. Your routing protocol learns about other routers automatically. Your router and the other routers exchange routes, and each learns about the networks that the other is connected to. When new networks are added or removed, the routers update each other.
Static routing issues
With static routing, you are telling your router to send traffic with a destination IP address to a router with an IP address of x.x.x.x. This is handy for a small network with very few routes or for someone who wants to have absolute control, but it can become very cumbersome as your network grows. To keep a multi-site wide-area network fully connected (fully meshed) via static routes, you have to create a route on every router for every other router. This mean that, as you add more sites, the number of routes you have to create increases exponentially, and when sites go down or links are performing poorly, any corrections must be entered manually.
Benefits of dynamic routing
A dynamic routing protocol can resolve these issues for you. Here are some general benefits of using a dynamic routing protocol:
- More automation: Routing updates are automatically sent to all other routers.
- Change notification: The dynamic routing protocol may be able to reroute traffic around a link that is down or congested.
- Greater uptime for users: Because the routing protocol has intelligence and can react faster, the users may see more uptime.
- Greater network throughput: Because the routing protocol may be able to calculate the most responsive network link to use, the users may see less latency and more performance out of the network.
- Less work for administrators: As the network grows, the administrator doesn't have to worry about configuring all the other routers on the network. Instead, the administrator configures the dynamic routing protocol on the new router to talk to the other routers and let them know what networks the new router has to offer.
Gotchas of dynamic routing
Don't think that dynamic routing protocols are perfect, however. Here are some possible gotchas of using dynamic routing protocols:
- Routers may need more CPU and RAM to hold routing tables and calculate dynamic routes.
- Dynamic routing protocols aren't perfect and can experience routing loops in some cases.
- Dynamic routing protocols will introduce complexity to your network. You will need to understand how to configure and troubleshoot the new dynamic routing protocols.
Dynamic routing protocols
You may be wishing you had some examples of dynamic routing protocols. I'm not going to cover or compare all possible routing protocols, but let's talk about the dynamic routing protocols you need to know.
First off, there are the interior gateway routing protocols (IGP). These are protocols that you would use within your own network. They are the protocols that are supported by just about every router and server operating system (such as Windows 2003 Server and Linux):
- OSPF (Open Shortest Path First) -- RFC2328 -- is the most popular dynamic routing protocol in use today. It is an open protocol, so that any router or server operating system can run OSPF. OSPF selects the best route using "cost" as its metric. OSPF is a full-featured routing protocol and can be complex, but it can also scale to any size of network.
- EIGRP – (Enhanced Interior Gateway Routing Protocol) is a Cisco proprietary protocol. Only Cisco devices run EIGRP. EIGRP is a full-featured routing protocol, similar to OSPF. EIGRP has some great features, but unless you can guarantee that you will always have an all-Cisco network, I would recommend an open protocol like OSPF, instead. EIGRP replaced IGRP, its predecessor. With EIGRP, the metric used to select the best route is calculated using a formula that takes into account the bandwidth, reliability, load and delay of the link.
- RIP (Routing Information Protocol) Version 2 -- RFC2453 -- is also an open source protocol. Version 2 of RIP is what you should use today as it provides support for VLSM (Variable Length Subnet Mask). RIP is the simplest and easiest routing protocol to configure, but it also has fewer features than OSPF and is limited to routing for a network with fewer than 15 hops. RIP works very well for a small network that doesn't plan on growing large, however. Another great thing about RIP is that it is commonly supported by even small routers and firewalls.
And, in a class by itself, there is Border Gateway Protocol (BGP):
- BGP (Border Gateway Protocol) is the routing protocol of the Internet. BGP is an Exterior Gateway Protocol (EGP). What that means is that BGP is used by routers that make routing decisions on the Internet. Just because your home or work router has a connection to the Internet, you don't necessarily need BGP or want to run it. Once your router has more than one dedicated connection to the Internet from business-class providers, you may want to look at running BGP. BGP is a path-vector protocol, and it selects the best route, unlike other routing protocols. BGP uses the "AS-PATH" as its routing metric and would select the route that has the shortest path through the Internet.
Configuring dynamic routing
So all this theoretical stuff is great, right? It gives you a good foundation, but you probably want to see how to configure a dynamic routing protocol.
Let's say that we have the basic network, shown below:
It is our job to configure RIP between these two locations so that each network knows about the other router's networks. Assuming that all normal router IP addressing is configured and interfaces have been enabled, we need issue only a few simple commands on each router to accomplish this. Here is the configuration:
What this does is:
Once completed, here is the routing table and ping output for Location A:
Location-A# show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 2 subnets R 10.2.2.0 [120/1] via 18.104.22.168, 00:00:16, Serial0 C 10.1.1.0 is directly connected, Ethernet0 22.214.171.124/30 is subnetted, 1 subnets C 126.96.36.199 is directly connected, Serial0 Location-A# ping 10.2.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms Location-A# And here is Location B's routing table: Location-B# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is not set 10.0.0.0/8 is subnetted, 2 subnets R 10.1.1.0 [120/1] via 188.8.131.52, 00:00:00, Serial0 C 10.2.2.0 is directly connected, Ethernet0 184.108.40.206/8 is subnetted, 1 subnets C 220.127.116.11 is directly connected, Serial0 Location-B# ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 10.1.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/36 ms Location-B#
As you can see, each router knows about the other router's LAN networks through RIP (the "R" in the routing table source shows that these routes were learned through RIP). Also, each router can ping other routers' Ethernet interfaces.
We could have accomplished the same connectivity with only one static route on each router. However, as this network grows from two routers to 20 or 200, the time needed to administer static routing would be a horrible administrative burden.
In summary, as a network administrator, you should have some basic knowledge of the four most popular dynamic routing protocols in use today. If you are new at this, I recommend that you start by learning about RIP and move up to the other protocols from there.
About the author:
David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been in the IT industry for 15 years. Currently, he manages a group of systems/network administrators for a privately owned retail company and authors IT-related material in his spare time. He has written more than 50 articles, eight practice tests and three video courses and has co-authored one book. His Web site is HappyRouter.com.
This was first published in December 2006