5. Could you elaborate on the role of CIDR notation in routing and how it helps the kernel make decisions, particularly in situations where there are multiple matching routes with different prefix lengths?
Let's say the host wants to send something on an ip address "10.23.2.132" which matches both the rules in a routing table, the default route and 10.23.2.0/24. Here, the kernel chooses the longest destination prefix that matches. This is where CIDR notation comes handy 10.23.2.0/24 matches and its prefix is 24 bits long. 0.0.0.0/0 i.e. the default address also matches but since the prefix length is 0 hence 10.23.2.0/24 takes priority.
Classless Inter-Domain Routing (CIDR) is important in routing for efficiently representing network addresses and prefixes. It assists the kernel by providing a flexible way to organize and prioritize routes. In scenarios with multiple matching routes of varying prefix lengths, CIDR notation enables the kernel to make informed decisions by selecting routes with the longest matching prefixes, enhancing the precision of routing choices.