Download presentation
Presentation is loading. Please wait.
Published byAlban Blankenship Modified over 9 years ago
1
On Finding an Optimal TCAM Encoding Scheme for Packet Classification Ori Rottenstreich (Technion, Israel) Joint work with Isaac Keslassy (Technion, Israel) Avinatan Hassidim (Google Israel & Bar-Ilan Univ.) Haim Kaplan (Tel Aviv Univ.) Ely Porat (Bar-Ilan Univ.)
2
Network Structure 2 Accept?
3
Packet Classification Action ---- RuleAction Policy Database (classifier) Packet Classification Forwarding Engine Incoming Packet HEADERHEADER Switch 3
4
TCAM Architecture Encoder Match lines 0 1 2 3 4 6 5 7 8 9 deny accept deny accept deny accept 001110111111 1 00 0000110 10 010110 01000 001110 1110 010 0 11 10010 01 0011100 1010 11111111111 0011101000011100 0 0 0 1 0 1 0 1 0 1 row 3 Each entry is a word in {0,1, } W Packet Header TCAM Array Source Port Width W 4
5
ActionProt ocol Dest. Port Dest. address Source port Source address Rule Accept TCP80 255.2.3.4/3280123.25.0.0/16 Rule 1 Deny TCP 5556255.2.127.4/31>102313.24.35.0/24 Rule 2 Accept UDP 50-70255.2.3.4/3120-5016.32.223.14 Rule 3 Deny TCP 20-22255.2.3.0/211-622.2.3.4 Rule 4 Range Rules Range rule = rule that contains range field Usually source-port or destination-port How many entries are required to represent one range field? 5
6
Reducing number of TCAM entries by exploiting TCAM properties Example: R=[1,6] TCAM Encoding Example 010011001110100101 111000 6 Basic encoding with 6 entries
7
Reducing number of TCAM entries by exploiting TCAM properties Example: R=[1,6] TCAM Encoding Example 010011001110100101 111000 6 Shorter encoding with 4 entries
8
Reducing number of TCAM entries by exploiting TCAM properties Example: R=[1,6] TCAM Encoding Example 010011001110100101 111000 6 Improved encoding with only 3 entries
9
Definition: An encoding in which in all entries “*”-s appear only as a suffix Example: Encoding of the range R = [0,2] Property: For a general function F, it is easy to find an optimal prefix encoding TCAM enables non-prefix encoding Can we use this TCAM property to do better than past algorithms? Past Work: Prefix Encoding 7 Prefix encodingNon-prefix encoding [Suri et al. ’03]
10
Outline Introduction Optimal Encoding of Extremal Ranges Average Expansion of Extremal Ranges Bounds on the Worst-Case Expansion 8
11
Given a function F, we define - The size of a smallest encoding of F. - The size of a smallest prefix encoding of F. Property: For a general function F, the equality does not necessarily hold. Example: General Functions 9 010 011001 000 Optimal encoding Optimal prefix encoding
12
Given a range R, does necessarily ? Extremal ranges = Ranges that start or end a sub-tree (e.g. [0,2] or [4,6] in tree [0,7]) Real life database: 97% of all rules are extremal ranges Theorem: For an extremal range R, Corollary: Finding an optimal encoding of extremal ranges is easy Open Question: Non–extremal ranges? Range Functions 10 010 011 001110100101 111 000
13
Given a subtree T and a range R, we define - The size of a smallest encoding of R∩T with a last entry of Example: If and then and Property: Optimal Encoding 11 D
14
Illustration of the algorithm for the extremal range R=[0,22] Values are calculated recursively for T 0,…,T 5 The range R can be encoded in entries: Algorithm Illustration 1 1 1 0 0 T 0 :(1,2) T 1 :(2,2) T 2 :(2,3) T 3 :(2,3) T 4 :(3,3) T W=5 :(3,4) 0 22 31 R = [0,22] 1212 T 0 :[22,22] T 1 :[22,23] T 2 :[20,23]
15
For simplicity, let’s focus on the simple extremal ranges [0,y] Another Way to Look at it… 1313 1 1 1 0 0 T 0 :(1,2) T 1 :(2,2) T 2 :(2,3) T 3 :(2,3) T 4 :(3,3) T W=5 :(3,4) 0 22 31 R = [0,22]=[00000,10110] A (a,a+1) C (c+1,c) B (b,b) 0 0 1 1 1 0 Deterministic Finite Automaton (DFA) start
16
Theorem: For a range, let be the number of blue transitions of the DFA in the processing of. Then,. For simplicity, let’s focus on the simple extremal ranges [0,y] Another Way to Look at it… 1414 A (a,a+1) C (c+1,c) B (b,b) 0 0 1 1 1 0 Deterministic Finite Automaton (DFA) start
17
Theorem: For a range, let be the number of blue transitions of the DFA in the processing of. Then,. Corollary: is affected by the average number of blue transitions (among the first W transitions) in the Markov Chain derived from the DFA. For simplicity, let’s focus on the simple extremal ranges [0,y] Another Way to Look at it… 14 A (a,a+1) C (c+1,c) B (b,b) 0 0 1 1 1 0 Deterministic Finite Automaton (DFA) start 1/2 A (a,a+1) C (c+1,c) B (b,b) 1/2 Corresponding Markov Chain
18
Theorem: The average range expansion of simple extremal ranges [0,y] satisfies: Corollary: Average Expansion of Simple Extremal Ranges 15
19
Outline Introduction Optimal Encoding of Extremal Ranges Average Expansion of Extremal Ranges Bounds on the Worst-Case Expansion 16
20
Our ContributionKnown 1-D Ranges 2-D Ranges Bounds on the Worst-Case Expansion 17 - Worst-case expansion over all ranges of W bits: = = Optimality over all coding schemes for 1-D ranges Optimality over all coding schemes for 2-D ranges
21
Concluding Remarks Optimal encoding of extremal ranges Formula for the average range expansion of simple extremal ranges Tight worst-case bounds r(W) (1-D ranges, all coding schemes) r 2 (W) (2-D ranges, all coding schemes) 18
22
Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.