​Static Vs Dynamic Routing

What Is A Static Route

Static routes are routes that have been manually configured on a device by a network admin. These routes do not change until they are manually adjusted.

Advantages Of Static Routing

  • It uses fewer router resources – CPU and memory.
  • It does not use bandwidth between routers, as there are no route advertisements.
  • It is potentially more secure than dynamic routing.

Disadvantages Of Static Routing

  • Increased administrative overhead to manually manage routes.
  • Less able to deal with changes or failures in the network.
  • Less able to detect an intermediary link failure.
  • Increased risk of a router having stale information and sending traffic in the wrong direction.

Use Cases For Static Routing

Static routing is normally used when:

  • The network is either small or has limited available paths.
  • The network seldom changes.
  • There is a need to retain more control over the routing in a network.

Let’s look at a few examples.

  • Stub networks. A stub network is one where there is usually only one path in or out of the network. If that path goes down for any reason, there is no other path that can be used, so there is little benefit to using a dynamic routing protocol.
  • Management routes. Many network devices connect to a management network. In many cases, the network devices have a static route telling them how to reach the management hosts over the management network. They then have dynamic routing enabled for the production traffic.
  • A specific requirement for certain routes. In some environments, there may be specific routing needs that are more easily achievable using a static route
  • Lack of support for dynamic protocols. Sometimes static routes are used when devices don’t support dynamic protocols. Either because they don’t support them outright or they don’t have the right licensing.
  • Routes to or from a firewall. Although many firewalls support dynamic routing, they often use static routing instead. One poor argument for this is that if traffic was suddenly on another interface, the firewall policy may restrict traffic anyway. A better argument is where the firewall represents the main way in or out of a network anyway, so dynamic routing has little benefit.

What Is A Dynamic Route

Dynamic routes are routes that have been learned via a routing protocol. They adapt as the network changes, choosing the best path towards a destination network.

Each routing protocol has its method for calculating the cost or metric for a given network link. When multiple paths are available to reach the destination, the routing protocol will choose the one with the lowest metric.

Advantages Of Dynamic Routing

  • Less administrative overhead to manage routing information.
  • Able to deal with changes or failures in the network and route around damage, assuming an additional path is available.

Disadvantages Of Dynamic Routing

  • It uses more router resources – CPU and memory.
  • It uses more bandwidth between routers to advertise routes or update link-state information. This is only likely to be an issue on low-speed links.
  • Risk of issues if bad routing information is received.
  • It is potentially less secure than static routing.

Use Cases For Dynamic Routing

It is easy to think that dynamic routing is only used in large or complex networks. However, it is used in networks of all sizes as it reduces the overhead of managing the network.

  • Large or complex networks with many paths. The Internet is a good example.
  • Networks that need high availability, to failover automatically, or to choose between multiple possible network paths.
  • Networks where changes in network paths are common or new networks are added frequently.

Types Of Routing Protocol

Routing protocols can be grouped by various methods.

  • Whether they are internal or external routing protocols.
  • What method or algorithm is used to find a path through the network.

Interior Gateway Protocols (IGPs) are generally used within an organization. Exterior Gateway Protocols (EGPs) are usually used between organizations.

In terms of methods or algorithms used, the two most common are:

  • Distance Vector
  • Link-State

Distance vector or Bellman-Ford algorithms say a route or network is available in X direction and is Y distance away. For example, the network 10.0.0.0/24 is available via interface 1 (direction) and 4 hops away (distance). Routers periodically advertise their full routing information to other routers. Distance vector protocols are sometimes referred to as routing by rumor due to the way they work.

In comparison, link-state protocols advertise information about the links each router has. Each device then takes these updates and builds a “map” of the network based on the information in the link-state advertisements. The router then runs the shortest path or Dijkstra algorithm to find the best path to a destination network. This best path is then moved from the OSPF process to the routing table.

For Link-State protocols to work each router needs to have the same consistent view of the network.

The table below shows how common routing protocols are categorized.

ProtocolIGP or EGPType
RIPIGPDistance-Vector
IGRPIGPDistance-Vector
EIGRPIGPEnhanced Distance-Vector or Hybrid
OSPFIGPLink-State
IS-ISIGPLink-State
BGPEGPPath Vector

Can I Use Static And Dynamic Routing At The Same Time?

A single router can run several dynamic protocols and have static routes configured simultaneously. If the same route is learned via multiple protocols administrative distance is used as a tie-breaker.

It is common for a device to use a mix of both static and dynamic routing to achieve a desired behavior.

Do Dynamic Routes Always Follow The Shortest Path?

No, they don’t. Dynamic routing protocols choose the route with the lowest metric.

As a simple example, OSPF by default calculates the cost of a link by dividing a reference bandwidth by the bandwidth of the physical link.

This means a path with several higher-speed interfaces will be preferred, instead of one with one slower-speed interface. The lowest metric in this case represents a “longer” path.

This is shown in the diagram below. Router-1 can reach Router-2 over the direct link but prefers the path via Router-3 and Router-4 as the “longer” path has a lower overall cost.

Should I Use Static Or Dynamic Routing?

Even with the information above, it can sometimes still be confusing whether to use static or dynamic routing, particularly for people new to routing.

The truth is, it is almost always a trade-off and the answer depends on the environment and what you are trying to achieve. Most networks use a mix of static and dynamic routing to meet their needs.

Leave a Comment

Your email address will not be published. Required fields are marked *