1. A method for a forwarding element that forwards packets, the method comprising: receiving a packet; consulting a tree structure to identity a prefix length associated with an IP address in the packet header; skipping lookup of each subtable with a set of IP addresses that have a different prefix length than the identified prefix length; identifying a matching rule from a particular subtable; and generating a flow based on the matching rule, wherein the flow is used to process packets that have the same prefix.