1. A method comprising: encoding a key matching rule having at least one dimension by storing in a memory (i) a header of the key matching rule having at least one header field, and (ii) at least one rule value field of the key matching rule corresponding to one of the dimensions.