Routing Behaviour

Routing Behaviour - routing behaviour is different from routing protocol. routing protocol (classless/classfull) determines how to populate the routing table, while routing behaviour determines how to search the routing table after it's populated.

what is a match? For there to be a match between the destination IP address of a packet and a route in the routing table, a minimum number of left-most bits must match between the IP address of the packet and the route in the routing table. The subnet mask of the route in the routing table is used to determine the minimum number of left-most bits that must match. (Remember, an IP packet only contains the IP address and not the subnet mask.)

level 1 routes = classfull address, supernet
level 2 routes = subnets

level 1 route that has level 2 routes is called a parent route while those level 2 routes are called child routes.

Routing table lookup step
step1 - look for level 1 routes, if there's a match forward the packet. if this is a parent route continue to step 2.
step2 - match level2 routes. if there's a match forward the packet.
step3 - if there's no match. if this is classful routing behaviour drop the packet (see, why classful routing behaviour never use the default route to forward packets). if classles check level 1 routes again for supernet.
step4 - if no match for supernet but supplied a default route forward the packet through the default route.
step5 - if there's no default route, drop the packet

recursive lookups = if route entry doesn't specify outgoin interface only the next hop ip address (like BGP entry routes), router will check the routing table again to find out what is the outgoing interface to forward the packet.

classfull routing - prefer classfull entry, default route will not be used when there are no match to forward the packet in the routing table.
classless routing - when there are no match after checking the level2 routes (subnetted entry / network). it will check the level1 routes again to check for lesser match (supernet, summary route, etc)