Home networks are relatively simple things. They tend to have a single router responsible for routing traffic around the network and routing traffic to and from the internet. Home networks tend not to be subdivided further, with mobile devices, computers, IoT devices, file servers, and more all generally located on one network. This design is intended to keep networks as simple as possible, given the broad range of technical skills people may or may not have to configure their home network.
Some routers may offer functionality to run a second network simultaneously, often for guest devices. This is intended to provide connectivity for less trusted devices while limiting their ability to communicate with your devices for security reasons.
In enterprise-grade networks, there may be many smaller networks. Generally, however, these are supposed to be able to communicate with one another, though some networks with more sensitive data may still be separated. To be able to route network traffic between different networks, a routing protocol is needed. A routing protocol works in the background to generate and maintain a network map. It then uses this map to route traffic around the network optimally.
OSPF
OSPF is a routing protocol that stands for Open Shortest Path First. Like all routing protocols, OSPF attempts to identify and utilize the most efficient way to route traffic around the network. OSPF does so with several different functions.
- Routers running OSPF automatically identify other connected routers
- Each connection is automatically assigned a “weight”
- Routing information is exchanged
- Routes can be summarized
- Connections are regularly polled to ensure they’re still active
When connected to the network, an OSPF router will send “Hello” packets out on each physical network port. Connected routers will respond and become neighbors. To share routing information, neighbors must establish bidirectional communication and become “adjacent.” Once in this state, the routers can share their link state advertisements. Available routes can be provided in summarised CIDR format to minimize the size of routing tables in large networks.
Once connected, routers regularly resend “Hello” packets to keep the connection alive. If no “Hello” packet is received for a configurable period called the dead interval, it will assume the link has gone down.
Routing Metrics
In OSPF, each connection is given a “path cost” metric. This determines which connections are superior or inferior to others, enabling optimal routing performance. Path cost doesn’t translate to a dollar figure for home much it costs to use a connection. The number itself is entirely unitless. The price is derived from a set of link metrics: the distance of a router (round-trip time), data throughput of a link, link availability, and link reliability.
The path cost has been designed not to be hard linked to a specific metric such as connection speed. This allows network architects to provide more nuanced override specifications if needed. This can be particularly helpful if low throughput ultra-low latency is essential for some connections, for example. In practice, though, the primary metric does relate to speed. A reference bandwidth is set, and then the actual configured or auto-configured bandwidth of a connection is divided by the reference bandwidth to get the cost.
The default reference bandwidth is 100Mb/s. A connection with a bandwidth of 10Mb/s would have a cost of 10, while a 100MB/s connection would have a cost of 1. Connections with bandwidths more significant than the default, i.e., a gigabit connection, have their cost rounded up to 1. Routes with the lowest cost are preferred. When two routes with exact costs are available, traffic may be load balanced across them.
Areas
While these routing metrics are critical for routing, they’re not everything. OSPF can be configured with an array of areas. Routes inside an area are always preferred over a route via another area, even if that second route via another area has a lower metric. Routes via other areas are preferred over routes that leave the OSPF network, i.e., via the internet, even if the routing metric for that is lower.
By convention, the backbone area is always labeled as area 0. Other areas must all be directly connected to area 0. If this isn’t feasible, they can instead be tunneled through one or more transit areas using a virtual link. Technically, areas are labeled in the same format as IP addresses, I.e., 1.1.1.1; however, these labels are not IP addresses and can conflict with IP addresses without issue.
OSPF can also be tunneled over multi-site VPN protocols like MPLS to provide one overarching OSPF network for a broader enterprise WAN.
Conclusion
OSPF, or Open Shortest Path First, is a routing protocol. It’s designed to allow configurable link metrics based on bandwidth primarily but not exclusively. It can provide load balancing between equivalent cost links and offers fault tolerance. Converging an OSPF network can be completed in seconds, meaning there is minimal spin-up time and downtime in case of issues. Don’t forget to share your thoughts in the comments below.
Did this help? Let us know!