This paper deals with packet classification in computer networks.After the analysis of synthetic and real rulesets, we propose newalgorithm suitable for hardware implementation.Unique property of this algorithm is constant time complexity in termsof external memory accesses.We also provide method for reduction of occupied memory space.Expected maximal throughput of the algorithm is 32 Gbit/s in the worst case.