The purpose of this chapter is a last close look into the UNIX routing table and forwarding information base populated with connected interface routes and static routes. Some aspects are fundamental to understand how this view changes when dynamic routing protocols take over control of the routing table. This chapter also discusses certain aspects that UNIX does differently from Cisco IOS Software. Finally, the chapter deals with two special issues: floating static routes and the unique Equal-Cost Multi-Path (ECMP) feature of Linux.
NOTE
We start populating the forwarding table via powerful dynamic routing protocols in Chapter 9, "Dynamic Routing Protocols—Interior Gateway Protocols."
Administrative Distance and Metric
Cisco IOS Software uses the concept of administrative distance to decide which routes to place in the routing table when learned via different dynamic routing protocol sources. In other words, the administrative distance is used to compare routes originating from different routing protocols (including static and connected), whereas the metric is used to compare routes within one single source of origin or family. The default administrative distance value itself is a proprietary concept and derived from quality aspects of old or modern routing protocols. What matters more is its value for relative comparison. Several other vendors have implemented the Cisco numeric values for administrative distances. However, this is merely common practice and not based on standards.
NOTE
For the discussion in this chapter, the terms routing table and forwarding table are used interchangeably, because this is common practice in the literature as well. However, understanding of the difference between those terms and the Forwarding Information Base (FIB) and Routing Information Base (RIB) is of paramount importance for a thorough grasp of the structures where dynamic routing protocols store their information and how it is ultimately used for forwarding decisions by the stack.
UNIX routing tables and forwarding information bases do not employ the concept of administrative distance per se. Directly connected interfaces, static routes to gateways or interfaces, as well as routes learned via dynamic routing protocols are expressed in terms of metrics/hop count. However, some routing engines such as MRTd, Zebra, or GateD use an administrative distance or equivalent for internal comparison and FIB population. UNIX routing tables employ the fundamental concept of "most specific route/prefix first" as well.
Because Cisco IOS Software employs administrative distances, it uses them to differentiate connected routes (0 or 1) from static routes (usually 1). The subtle reason why connected routes can appear with an administrative distance of both 0 and 1 is explained in the section "The Near and Far End of a Link" later in this chapter. As one notable difference to UNIX forwarding tables, Cisco IOS Software static routes differ from each other in terms of administrative distance. In the UNIX world, they solely differ in terms of metric and nothing else. In the view of the Cisco IOS designers, the view of metrics for connected and static routes is not applicable and reserved for dynamic routes to express the preference of a route.
There is one notable difference between Linux and the BSD world of operating systems: BSD Unices do not provide a metric when adding routes via the route command. In contrast, all BSD ifconfig implementations are capable of metric assignments to an interface.
Classful Routing, VLSM, and CIDR
In this book, I religiously stick to a classless point of view. Classful behavior and archaic routing protocols supporting only classful routing have disappeared almost entirely.
Variable length subnet mask (VLSM) enables us to think and route beyond the limited view of address octets, and classless interdomain routing (CIDR) enables us to form aggregates and summarize prefixes. A prefix is a network/bitmask representation of a classless network, such as 172.16.0.0/12.