Dynamic routing is crucial to the Internet and to service provider networks. Although the protocols are sophisticated and fairly "intelligent," dynamic routing requires a skilled hand to configure and manage.

How routing works

The router learns the next hop for packets using one of two methods:

  1. Static routing: With static routing, the network engineer manually enters the routes and tells the router, for each IP network, what next hop that traffic should be delivered to.
  2. Dynamic routing: With dynamic routing, the network engineer configures a routing protocol on the network interfaces. The routing protocol learns about other routers automatically. The 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, the engineer tells the 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 the network grows. To keep a large network fully connected via static routes, you need to create a route on every router for every other router. This is unworkable for very large networks.

Benefits of dynamic routing

A dynamic routing protocol can resolve these

    Requires Free Membership to View

issues. 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, users may see more uptime.
  • Greater network throughput: Because the routing protocol may be able to calculate the most responsive network link to use, users may see less latency and more performance out of the network.

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 have a high level of complexity and require staff that understand how to configure and troubleshoot them.

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 basic dynamic routing protocols all network engineers need to know.

First off, there are the interior gateway routing protocols (IGPs). 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. 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:

In our basic example, 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:

Location A
Router rip
Ver 2
No auto-summary
Network 10.1.1.0
Network 63.248.129.0

Location A
Router rip
Ver 2
No auto-summary
Network 10.2.2.0
Network 63.248.129.0

What this does is:

  • Enter routing configuration mode on each router.
  • Enable Version 2 of the RIP routing protocol.
  • Enable RIP routing on both the LAN and the WAN networks. This will tell the router both to advertise these networks to other routers and to try and find other routers on these networks.

    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 63.248.129.2, 00:00:16, Serial0
    C       10.1.1.0 is directly connected, Ethernet0
         63.0.0.0/30 is subnetted, 1 subnets
    C       63.248.129.0 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 63.248.129.1, 00:00:00, Serial0
    C       10.2.2.0 is directly connected, Ethernet0
         63.0.0.0/8 is subnetted, 1 subnets
    C       63.248.129.0 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.

    About the author:
    David Davis (CCIE #9369, CWNA, MCSE, CISSP, Linux+, CEH) has been configuring routers 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 July 2007

  • There are Comments. Add yours.

     
    TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

    REGISTER or login:

    Forgot Password?
    By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
    Sort by: OldestNewest

    Forgot Password?

    No problem! Submit your e-mail address below. We'll send you an email containing your password.

    Your password has been sent to:

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.