Routing – Understanding Default Route vs. Prefix Length, Administrative Distance, and Metrics

routing

I'm trying to understand how routers make their routing decisions. This is what I'v come up with and I'd like to know whether I'm right or not:

  1. First check whether there is an entry in the routing table for that destination address.
  2. If there is none, send it to the default route.
  3. If there is one, make a longest-route-match, then check administrative distance and then metrics.

Is that correct?

Best Answer

Is that correct?

No.

You need to understand the difference between routing (control plane) e forwarding (data plane).

Routing builds the routing table by performing route selection from protocols like OSPF, BGP, static routes, so on.

Forwarding looks up packet destination by querying the routing table.

Back to your question:

  1. "Metric" usually is a parameter for selecting a route within routing process for SPECIFIC protocol.
  2. "Administrative distance" is a parameter for selecting a route among DISTINCT protocols.

Both "metric" and "administrative distance" lie in the control plane (routing). Thus, they are used to choose the best routes for BUILDING the routing table.

  1. "Prefix length". Longest match first is a route lookup strategy of the data plane. For every received packet, the forwarding engine queries the routing table using the longest match algorithm in order to pick the best route FROM the routing table.

  2. The "default route" can be seen just as the 'shortest prefix ever' (encompassing all other prefixes), useful as last resort option for the longest match lookup.

Related Topic