Routing is the method whereby a network packet travels from one device to another. There are several ways routing is setup – dynamic vs static – as well as different ways for the router (the device doing the routing) to determine which route is best.

Why Route

First, as a quick refresher, routing through different gateways is really only an issue when a network packet needs to get from one network to another – if the source and destination are on the same network, there’s no real need to route it to a different network, obviously. The way a device determines how to send the packet is by comparing its IP Address and Subnet Mask to the IP of the destination. The Subnet Mask is essentially a formula applied to its IP address to determine what other IPs are part of the same network. If the formula determines the destination is outside the network, the sender will then route the packet to the IP address set in its Default Gateway, which is responsible for routing the packet appropriately.

As an aside, this is why I remind our tier-1 folks that packet will never get where it should if the IP address, subnet mask, and default gateway aren’t defined properly. That’s the bare minimum for a DHCP or static device.

Routing Methods

There are two ways that the routing table is filled – static or dynamic. At work we tend to define everything manually (static), as it gives us control over exactly where the traffic flows. The downside to this is that it takes a lot of work – every route must be manually defined.

The alternative is to let the routes be determined dynamically – the work of building the routing table is handled by the actual router as part of its functionality. But obviously this removes some of the advantages to manually-defining the routes.

For the most part, we statically-define the routes at a high level (specific subnets are defined manually, and the rest is handled by the router).

Distance and Metric/Priority

The router may occasionally find itself with multiple routes – how does it know which to use? This is where Administrative Distance and Metric/Priority come in (I use priority as that’s what our hardware uses, instead of Metric).

Generally, this more attractive/faster route has a lower number than worse ones. This can occasionally cause confused when a “higher” administrative distance can either mean a higher number (which will be less prioritized) or it can mean a higher-priority (use this!) which is a lower number. So 0 is a higher-priority than 10, though 10 is higher than 0 numerically.

Administrative Distance is mainly used when different Routing Protocols are in place. For example, something may be plugged directly into the router – this would be more ideal than something that spans across multiple networks. A Static Route (defined manually) also usually has a lower distance than other methods like RIP, OSPF, etc. The Administrative Distance is set to determine which routing methods are preferred.

The Metric, on the other hand, can be thought of as “how hard this route is” for routes that use the same method. If multiple static routes are set, the metric/priority is used to determine which ones should be preferred. On our hardware, since we primarily use Static Routes, we leave Administrative Distance alone and only change the Metric (called Priority on our systems). This again can introduce some confusion, as a “higher priority route” has a lower number than a “lower priority” route.

Leave a Reply

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