1 tcam razor: a systematic approach towards minimizing packet classifiers in tcams department of...

29
1 TCAM Razor: A Systematic Ap proach Towards Minimizing P acket Classifiers in TCAMs Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C. Authors: Chad R. Meiners, Alex X. Liu, Eric Torng Publisher: ICNP 2007 Present: Yu-Tso Chen Date: November, 6, 2007

Upload: denis-edwards

Post on 17-Dec-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

1

TCAM Razor: A Systematic Approach Towards Minimizing Packet C

lassifiers in TCAMs

Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C.

Authors: Chad R. Meiners, Alex X. Liu, Eric Torng

Publisher: ICNP 2007

Present: Yu-Tso Chen

Date: November, 6, 2007

Page 2: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

2

Outline

1. Introduction 2. Definitions and problem description 3. Multi-dimensional TCAM Mnimization 4. Experimental Result 5. Conclusion

Page 3: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

3

Occam’s Razor

“Of two equivalent theories or explanations, all other things being equal, the simpler one is to be preferred.”

Page 4: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

4

Introduction

TCAMs have their own limitations with respect to packet classification• a) Range expansion – TCAM only store rules that

are encoded in ternary format• Source & Destination port numbers are specified in Rang

es

30 prefixs are needed to represent the single range [1, 65534]

30 X 30 =900 TCAM entries

Page 5: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

5

Encoding Considerations

Range expansions• Encoding ranges has a multiplicative effect

• [1,14] => 0001, 001*, 01**, 10**, 110*, 1110

• [1,14] /\ [1,14] => 6 × 6 = 36 entries

• 1 rule can lead to over 900 TCAM entries.

• Each port interval can leads to 30 rules

• w-bit interval => 2w-2 maximum entries

Prefix Encoding• Standard practice to encode entries in prefix format

• Each field is in prefix format

• Minimizing arbitrary ternary lists is NP-hard

Page 6: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

6

TCAM Challenges

b) Low capacity• – Maximum of 18 Mb

• – 2 Mb and 1Mb modules are the most popular

• – Each entry has 144 bits

c) Larger capacity consumes more energy• – More power, more heat

• – Cooling is a concern

d) Larger capacity consumes more board space

e) Larger capacity is more expensive• – 1Mb module is ~ $250

Page 7: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

7

Outline

1. Introduction 2. Definitions and problem

description 3. Matching of Individual Patterns 4. Selective Grouping of Multiple

Patterns 5. Evaluation Result 6. Conclusion

Page 8: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

8

Definitions and problem description

Reducing the number of rules in a TCAM directly 900 entries

6 entries

Page 9: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

9

Our solution : TCAM Razor Above problem is NP-hard, we using

three techniques• Decision diagrams

• Dynamic programming

• Redundancy removal

Page 10: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

10

Our solution : TCAM Razor Our solution consists of four basic step

• 1)Convert a given packet classifier to a reduced decision diagram

• 2)Every non-terminal node in the decision diagram minimize the number of prefixs associated with its outgoing edges using dynamic programming

• 3)Generate rules from the decision diagram

• 4)Remove redundant rules

Page 11: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

11

Outline

1. Introduction 2. Definitions and problem description 3. Multi-dimensional TCAM Mnimizati

on 4. Experimental Result 5. Conclusion

Page 12: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

12

Example one-dimensional TCAM minimization problem

Page 13: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

13

From single to Multiple dimension

First step of TCAM Razor is to convert rules into an FDD (Firewall Decision Diagram)

Page 14: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

14

Multi-dimensional TCAMMinimization

Rule Field Decision

1 10** Accept

2 **** Discard

Rule Field Decision

1 **** Discard

Rule Field Decision

1 1001 V3

2 10** V2

3 **** V3

Work from the bottom upV2

V3

V1

Page 15: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

15

MINIMUM PACKET CLASSIFIER

• 10** (with decision accept and cost 1)

• 0 *** (with decision discard and cost 1)

• 11** (with decision discard and cost 1)

Page 16: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

16

MINIMUM PACKET CLASSIFIER

• 1000 (with decision V2 and cost 1)

• 101* (with decision V2 and cost 1)

• 0 *** (with decision V3 and cost 1)

• 1001 (with decision V3 and cost 1)

• 11** (with decision V3 and cost 1)Rule Field Decision

1 1001 V3

2 10** V2

3 **** V3

V1

Page 17: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

17

Solution Composition

Redundant

Rule Field Decision

1 10** Accept

2 **** Discard

Rule Field Decision

1 **** Discard

Rule Field Decision

1 1001 V3

2 10** V2

3 **** V3

V2

V3

V1

Rule F1 F2 Decision

1 1001 **** Discard

2 10** 10** Accept

3 10** **** Discard

4 **** **** Discard

Page 18: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

18

Outline

1. Introduction 2. Definitions and problem description 3. Multi-dimensional TCAM Mnimization 4. Experimental Result 5. Conclusion

Page 19: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

19

Experimental Data

Real-life Packet Classifiers• 42 actual classifiers

• 17 structurally distinct classifiers

Synthetic Packet Classifiers• Difficult to get real-life packet classifiers

• 18 sets of 100 uniformly sized classifiers

Randomly generated Generated to look like real classifiers

Page 20: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

20

Experimental Metrics

Direct Rule Expansion Direct(f)• Number of rules produced by encoding classif

ier f into prefix format

• Each rule is the expansion of the minimal prefix representations of each interval

Algorithm application A(f)• Number of prefix rules produced applying algo

rithm A on classifier f• TCAM Razor

• Redundancy Removal

Page 21: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

21

Experimental Metrics

For a set of classifiers S

Page 22: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

22

Experimental Factors

Field Ordering• FDD field order results in a substantial difference

• 5! = 120 permutations

Permutation 49 is the best with an average compression of 18.2%• (Source IP, Protocol type, Dest. IP, Dest. Port, So

urce Port) TCAM Razor(B) – TCAM Razor using the best of the

permutations for f

Page 23: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

23

Compression Ratios

TCAM Razor: 18.2% average compression ratio

Redundancy Removal: 41.8%

Page 24: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

24

Compression Ratios

13 of 17 classifiers have less than 1%

Page 25: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

25

Expansion Ratio

Page 26: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

26

Synthetic Packet Classifiers

Average compression ratio – .046 Total compression ratio – .016

Page 27: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

27

Synthetic Packet Classifiers

Average expansion ratio – 8.737 Total expansion ratio – 3.082

Page 28: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

28

Outline

1. Introduction 2. Definitions and problem description 3. Multi-dimensional TCAM Mnimization 4. Experimental Result 5. Conclusion

Page 29: 1 TCAM Razor: A Systematic Approach Towards Minimizing Packet Classifiers in TCAMs Department of Computer Science and Information Engineering National

29

Concluding Remarks

TCAM Razor usually produces significant space savings• 82% reduction in TCAM entries on average

No hardware modification• Can be used to improve existing hardware