4. In the context of routing tables, why does the order of rules in the table not matter when determining the route, and what criterion does the kernel use to prioritize one route over another in case of overlapping matches?
The order of rules doesn't matter because if it mattered, the kernel might prefer one with a small length which may cause errors while routing. The kernel prefers the route which has a bigger destination prefix in case of overlapping matches.
In routing tables, the order of rules doesn't matter because the kernel prioritizes routes based on the longest matching prefix. If there are overlapping matches, the kernel favours the route with the longest matching destination prefix.