The entries contain the following information:
Remote network entries:
- Route source – Identifies how the route was learned. Directly connected interfaces have two route source codes.
- C identifies a directly connected network. Directly connected networks are automatically created whenever an interface is configured with an IP address and activated.
- L identifies that this is a local route. Local routes are automatically created whenever an interface is configured with an IP address and activated.
- D – Identifies that the route was learned dynamically from another router using the EIGRP routing protocol.
- O – Identifies that the route was learned dynamically from another router using the OSPF routing protocol.
- R – Identifies that the route was learned dynamically from another router using the RIP routing protocol.
- S – Identifies that the route was manually created by an administrator to reach a specific network. This is known as a static route.
- Destination network – The address of the remote network and how that network is connected.
- Administrative distance – Identifies the trustworthiness of the route source. see more here.
- Metric – Identifies the value assigned to reach the remote network. Lower values indicate preferred routes.Note that static route and directly connect route all have value of 0.
- Next hop – Identifies the IPv4 address of the next router to forward the packet to.
- Route timestamp – Identifies from when the route was last heard.
- Outgoing interface – Identifies the exit interface to use when forwarding packets to the destination network.
Don’t confuse with the administrative distance(AD) and Metric, they are used for different purpose. The AD is used for choosing routing method(protocol) the lower value will be chosen, and Metric is used for choosing path the lower value will be chosen. Metrics are only helpful INSIDE a routing protocol’s database (called a RIB – Routing Information Base).
We can say, AD is like which kind of vehicle we use to get to a destination, like car, bike, train. And then Metric is like in which path the vehicle will use less time. We can say that this depend on the route the vehicle use, they use different rail, road, which result in different time may be used.
- Ultimate Route: An ultimate route is a routing table entry that contains either a next-hop IPv4 address or an exit interface. Directly connected, dynamically learned, and local routes are ultimate routes.
- Level 1 Route:A level 1 route is a route with a subnet mask equal to or less than the classful mask of the network address. Therefore, a level 1 route can be a:
- Network route – A network route that has a subnet mask equal to that of the classful mask.
- Supernet route – A supernet route is a network address with a mask less than the classful mask, for example, a summary address.
- Default route – A default route is a static route with the address 0.0.0.0/0.
- Level 1 parent route:A level 1 parent route is a level 1 network route that is subnetted, in the routing table, it shows the summary of the subnets. A parent route can never be an ultimate route, because it does not have a exit-interface nor next-hop IP address.
- Level2 child route: A level 2 child route is a route that is a subnet of a classful network address, can be a directly connected network, a static route, or a dynamically learned route. Level 2 child routes are also ultimate routes.
When a packet arrives on a router interface, the router examines the IPv4 header, identifies the destination IPv4 address, and proceeds through the router lookup process.
1. If the best match is a level 1 ultimate route, then this route is used to forward the packet.
2. If the best match is a level 1 parent route, proceed to the next step.
3. If there is a match with a level 2 child route, that subnet is used to forward the packet.
4. If there is not a match with any of the level 2 child routes, proceed to the next step.
5. If there is now a lesser match with a level 1 supernet or default routes, the router uses that route to forward the packet.
6. If there is not a match with any route in the routing table, the router drops the packet.
Note: A route referencing only a next-hop IP address and not an exit interface must be resolved to a route with an exit interface, if Cisco Express Forwarding is not being used. Without CEF, a recursive lookup is performed on the next-hop IP address until the route is resolved to an exit interface.
If there are multiple path that can get to the destination network, the best match is the route in the routing table that has the most number of far left matching bits with the destination IPv4 address of the packet. The route with the greatest number of equivalent far left bits, or the longest match, is always the preferred route. Eg, if the packet destination address is 192.168.0.5, in the routing table, there are entries like: route 1: 192.168.0.0/16; route 2:192.168.0.0/24; route 3: 192.168.0.0/20. The router will choose route 2, because there are more bits match in the network address.
IPv6 routing table
IPv6 routing table and table entries are similar to IPv4. Because IPv6 is classless by design, all routes are effectively level 1 ultimate routes. There is no level 1 parent of level 2 child routes.