Explain the networking basics you rely on when building software for Palo Alto Networks.
For this coding task, implement IPv4 longest prefix matching using CIDR routes. Given route entries and a destination address, return the next hop for the most specific matching network, or None if no route matches.
Use the signature longest_prefix_match(routes, ip); each route is an object with cidr and next_hop strings.
next_hopdef longest_prefix_match(routes, ip):