Ternary CAM Compaction For IP Address Lookup
Yi-Ting Fang, Tzung-Chian Huang, Pi-Chung Wang
Department of Computer Science
National Chung Hsing University, Taichung, Taiwan
phd9509, s9456026, pcwang@cs.nchu.edu.tw
Abstract
Motivated by the high cost problem of ternary CAM, we
proposed a new technique for providing a compaction rout-
ing table. With the comparisons with existing algorithms,
our new technique can improve the use of ternary-CAM
space under reasonable compressing time, performs well
without consider the size of routing table size. And our
scheme outperforms other existing schemes in terms of the
use of the ternary-CAM space and the processing time.
1 Introduction
Many commercial router designers have chosen to
use ternary-CAM (Content Addressable Memory) for IP
routing lookup in order to keep pace with high speed
requirement despite their power consumption, large size,
cost and long update time relative to SRAM (Static
Random Access Memory). Among the existing hardware
approaches, ternary-CAMs are presently dominant devices
since longest prefix matching is required to implement the
most recent IP routing lookup problem standard. In spite
of the success in using ternary-CAMs, some problems are
usually found to be associated with ternary-CAM routing
tables:
1. All conventional implementations of ternary-CAMs
have high power consumption because for every
lookup operation all memory cells must be active. As
a result, the power consumption of ternary-CAMs is
about two to three times more than SRAMs.
2. An important limiting factor is the priority encoder at
the ternary-CAMs’ output stage. With the size of rout-
ing table rapidly growing up, the size of ternary-CAMs
is still bounded by the priority encoder.
3. Another issue being focused is the cost of ternary-
CAMs. Commercially available CAMs cost much than
SRAMs, and ternary-CAMs is even more expensive,
the cost is about 8 to 10 times then SRAMs.
4. Ternary-CAMs have long update time. Entries in the
ternary-CAM routing table require sorting based on
prefix lengths. This lead to that each addition requires
the complexity of O(N), where the N is the total num-
ber of prefixes to be stored in the routing table [6].
Several researchers have explored the pros and cons of a
ternary-CAM based route lookup approach in the past few
years. Pei and Zokowski [5] proposed the basic ternary-
CAM approach for the longest prefix matching problem.
McAuley and Francis [4] described a multiple-cycle single-
logic CAM lookup algorithm which is what we refer to as
a conventional ternary-CAM approach. One of the impor-
tant issues concerns fast updating in ternary-CAM. As the
entries in ternary-CAM need to be stored in decreasing or-
der of prefix lengths, the addition of prefix may require a
large number of entries to be shifted. Shah and Gupta [6]
proposed two algorithms to reduce the ternary-CAM update
time. Their PLO OPT algorithm reduces the update time by
a factor of two over earlier solutions. Their CAO OPT al-
gorithm offers an average of 1.02 to 1.06 memory accesses
each update. Liu [3] offers two techniques to reduce the
ternary-CAM table size in order to optimize ternary-CAM
utility. The first technique, pruning, identifies the redundant
prefixes and remove them. The second technique, mask ex-
tension, combines prefixes by using mask bits arbitrarily.
This two techniques claim that the resultant compaction ra-
tio can be achieved up to 45 percent.
2 Routing Table Merging Algorithm
2.1 Background and Definition
Our idea comes from the observation on the routing
tables. First, we know that there are typically many routing
entries — in the range of several thousands in the routing
22nd International Conference on Advanced Information Networking and Applications - Workshops
978-0-7695-3096-3/08 $25.00 © 2008 IEEE
DOI 10.1109/WAINA.2008.168
1462
22nd International Conference on Advanced Information Networking and Applications - Workshops
978-0-7695-3096-3/08 $25.00 © 2008 IEEE
DOI 10.1109/WAINA.2008.168
1462