Description

This article provides information on how to calculate the TCAM entries in QFX3500, for filter terms with multiple (ranges) match conditions.


Symptoms

How to calculate the TCAM entries in QFX3500, for filter terms with multiple (ranges) match conditions.

Solution


Case 1:

term1: match [sipA, dipB, sportA, dportB]

This will boil down to 1 rule in TCAM, where you can match for [sipA AND dipB AND sportA AND dportB]

Now, suppose the user did (like in this case):

term1: match [sipA, sipB, dipB, dipC, sportA, dportB]

Here, there are 2 sips and 2 dips. You can interpret this as:

an OR conditions (as an AND condition of two of the same match types does not make sense). So the filter really becomes:

term1:
term1.1: match [sipA, dipB, sportA, dportB]
term1.2: match [sipA, dipC, sportA, dportB]
term1.3: match [sipB, dipB, sportA, dportB]
term1.4: match [sipB, dipc, sportA, dportB]


It is basically a matrix multiplication and it factors in the ranges.

Basically when you have a range [x..y], the brute force way of doing this is to consider each of them as an OR condition, just as shown above. But there is an optimization that can be applied.

The optimization is to play with the TCAM mask, so as to subsume all [2 Power n] boundaries by one term using the appropriate mask (same as subnet aggregation); this will result in using less lines of TCAM.

These are treated as OR conditions and applied to the matrix multiplication algorithm to determine the final exploded size.