Title: Fast Incremental updates on TernaryCAMs for routing lookups and packet classification
1Fast Incremental updates on Ternary-CAMs for
routing lookups and packet classification
2Ternary-CAM (TCAM)
- TCAM is a special type of fully associative
memory - Each cell in a TCAM can takes three logic states
0, 1, X - X allows the TCAM to store wildcards
- Fully parallel search
3Longest Prefix match and Packet classification
- The need to maintain a sorted list makes
incremental update slow - Adding a new entry result in the need to move
O(N) TCAM entries - ( N the total number of prefixes/rules)
4Longest Prefix matching using TCAM
Empty space
General configuration of a TCM
5Prefix-length ordering constraint
- P j the set of all prefixes length j
- Prefix-length ordering constraint
- If jgtk, all prefixes in the set P j must appear
before P k, but prefixes within P j may appear in
any order
6L-algorithm
- L the width of the destination address field
The prefix-length ordering constraint enables an
empty memory location to be found in at most L
32 memory shifts.
7PLO_OPT algorithm
- The worse case number of memory operations is at
least L/2 - PLO_OPT is optimal on-line algorithm under the
prefix-length ordering constraint
8Chain-ancestor ordering constraint
- If all prefixes were to be stored in a trie, data
structure, only prefixes that lie on the same
chain need to be ordered. - Only considering overlapping prefixes
- Q3, Q2, Q1 must be in order
- Q4 can be stored anywhere with respect to Q2 and
Q3 - Q4 must be stored at a lower location than Q1
9Chain-ancestor ordering constraint
- LC(p) the longest chain comprising prefix p
- rootpath(p) the path from the trie root node to
node p - hcld(p) highest prefix-child of p i.e.,
among the children of p, the node which has the
highest memory location in the TCAM - HCN(p) the chain comprising ancestors of p,
prefix p itself, hcld(p), hcld(hcld(p)) and so on
i.e., a descendant node of p is inHCN(p) if it
is the highest prefix-child of its ancestor
10CAO_OPT algorithm
Every prefix, p, is at a distance less than or
equal to D/2 prefixes from the free space pool,
where D len(LC(p))
11Auxiliary trie data structure
- The information to be keep in a trie node p
- wt(p)
- 1 if p is a leaf
- max(wt(lchild(p),rchild(p))) if p is not a leaf
and not a prefix - 1 max(wt(lchild(p),rchild(p))) otherwise
- wt_ptr(p)
- Keeps a pointer to the prefix-child has the
highest weight - hcld_ptr(p)
- Keeps a pointer to the prefix-child appears at
the highest memory location in TCAM
12Insertion in CAO_OPT
the prefix to be inserted is above the free space
pool
the prefix to be inserted is below the free
space pool
13Deletion in CAO_OPT