Skip to Main Content
In recent years, hardware based packet classification has became an essential component in many networking devices. Ternary Content-Addressable Memories (TCAMs) are one of the most popular solutions in this domain, allowing to compare in parallel the packet header against a large set of rules, and to retrieve the first match. However, using TCAM to match a range of values is much more problematic and dramatically reduces the cost effectiveness of the solution. In this paper we study ways to use simple built-in TCAM mechanisms in order to increase the efficiency of range coverage. While current techniques have a worst expansion ratio of 2W-4, we present an efficient algorithm enabling to encode any range with at most W TCAM entries (where W in the number of bits), without using additional processing, extra bits, and without any external encoding. The same paradigm can be applied to multiple raging rules as well, resulting in significant improvement over current known techniques. Moreover, our simulation results indicate that these techniques can be used to reduce the actual TCAM size of hardware networking devices under realistic scenarios.