Static routing and dynamic routing are two methods used to determine how to send a packet toward its destination.
Static routes are configured in advance of any network communication. Dynamic routing, on the other hand, requires routers to exchange information with other routers to learn about paths through the network. Static and dynamic routing are used where appropriate, and some networks use both.
What is static routing?
Network administrators use static routing, or nonadaptive routing, to define a route when there is a single route or a preferred route for traffic to reach a destination. Static routing uses small routing tables with only one entry for each destination. It also requires less computation time than dynamic routing because each route is preconfigured.
Because static routes are preconfigured, administrators must manually reconfigure routes to adapt to changes in the network when they occur. Static routes are generally used in networks where administrators don't expect any changes.
What is dynamic routing?
Dynamic routing, sometimes called adaptive routing, is more complex than static routing because it creates more possible routes to send packets across a network. Dynamic routes are typically used in larger, fluid networks where static routes would be cumbersome to maintain and frequently reconfigure. Because dynamic routing is more complicated, it consumes more bandwidth than static routing.
Dynamic routing uses algorithms to compute multiple possible routes and determine the best path for traffic to travel through the network. It uses two types of complex algorithms: distance vector protocols and link state protocols.
Both distance vector and link state protocols create a routing table within the router that includes an entry for each possible destination of a network, group of networks or specific subnet. Each entry specifies which network connection to use to send out a received packet.
Distance vector protocols
When using a distance vector protocol -- such as Routing Information Protocol (RIP) or Interior Gateway Routing Protocol (IGRP) -- each routing table entry specifies the number of hops to each destination. The router sends its routing table to each directly connected router and receives the tables of the other routers in return. Routers using distance vector protocols periodically exchange their routing tables with neighboring routers.
Distance vector protocols have their advantages and disadvantages. Routers that use distance vector protocols periodically send out their entire routing tables, which produces a significant load when used in a large network and could create a security risk if the network became compromised. Because distance vector protocols determine routes based on hop count, they can choose a slow link over a high data rate link when the hop count is lower.
Link state protocols
Link state protocols -- such as Open Shortest Path First (OSPF) and Intermediate System to Intermediate System (IS-IS) -- determine routes by exchanging a link state packet (LSP) with each neighboring router. Each router constructs an LSP that contains its preconfigured identifier along with information about connected networks and subnets. The router then sends the LSP to nearby routers. Received LSPs contain additional information about paths to other networks and link data rates. Routers combine this information with previously known information and store it in their routing tables.
Like distance vector protocols, link state protocols have their benefits and drawbacks. One benefit of link state protocols is they send out updates only when there is a change in the network, in contrast to the constant load distance vector protocols place on the network. Link state protocols can also recover more quickly and redetermine a route when a link or router malfunctions. But these protocols are more complicated and more difficult to configure and maintain.
Static vs. dynamic routing: Key differences
Below is an overview of some of the main differences between static routing and dynamic routing.
1. Path selection
Static routing uses a single preconfigured route to send traffic to its destination, while dynamic routing provides multiple available routes to the destination.
2. Ability to update routes
Network administrators must manually reconfigure static routes in order to adjust routes. Dynamic routing uses algorithms to automatically update with the preferred route change.
3. Routing tables
Static routing has a smaller routing table with only one entry for each destination, while dynamic routing requires routers to send out their entire routing tables to identify route availability.
4. Use of protocols and algorithms
Static routing doesn't use protocols or complex routing algorithms. Dynamic routing uses distance vector protocols, such as RIP and IGRP, and link state protocols, such as OSPF and IS-IS, to adjust routes.
5. Computation and bandwidth requirements
Static routing requires less compute power and bandwidth, as it only has one preconfigured route. Dynamic routing requires more computation and bandwidth to generate multiple route possibilities.
Static routing is more secure because it doesn't share routes across the entire network. Dynamic routing creates more security risks because it shares complete routing tables across the network.
7. Use cases
Static routing is best used in smaller networks with fewer routers and is ideal for networks with unchanging network architecture. Dynamic routing is well suited for larger, more complex networks that have multiple routers, and its flexibility makes it ideal for network architectures that frequently change.
Examples of static routing and dynamic routing
Both static and dynamic routing can be used in one network. For example, some enterprises rent dedicated links to connect branch offices to headquarters. All traffic should be routed over that dedicated link so it can be preconfigured as a static route, which would then become the first route choice. If the link is down, a dynamic route could be the second choice. If dynamic routing fails to find a route, a third static route -- such as a dial-up connection -- could provide a slow, minimal connection.
Administrative distance is a preconfigured parameter used in networks that run both routing methods. It is used to define the order to select routing methods. The preferred routing techniques are configured with low numbers, while less preferable routing techniques receive higher numbers. For example, a low number may be assigned to the static link over the rented connection, a higher number would be assigned to dynamic routing and the highest number would be assigned to the dial-up connection.
Whichever routing technique is used, most networks also connect to the internet by connecting one or more routers to a local service provider. Service providers use an exterior gateway protocol, such as Border Gateway Protocol (BGP), to connect to each other and to backbone networks, such as AT&T, Deutsche Telekom, NTT and Verizon.
BGP factors in hop count, link data rates and congestion, as well as prices negotiated between service providers, to send packets over their networks. Backbone networks interconnect at internet exchange points, which are facilities where extremely high throughput routers connect backbone networks.
Networks differ. The best combination of various routing techniques for one network may not be appropriate for another. Network designers must understand the characteristics of each and select the optimal set of techniques for each network.
Dig Deeper on Network Infrastructure
Related Q&A from David Jacobs
Connectivity over longer distances and higher data rates are some of the major differences that separate Carrier Ethernet from traditional wired ... Continue Reading
Network load balancing and application load balancing both handle traffic requests. But they process and direct those requests with different levels ... Continue Reading
Slow network speeds, weak Wi-Fi signals and damaged cabling are just some of the most common network connection issues that IT departments need to ... Continue Reading