packet classification
play

Packet Classification Peng He (Institute of Computing Technology, - PowerPoint PPT Presentation

Meta-algorithms for Software based Packet Classification Peng He (Institute of Computing Technology, China) Gaogang Xie(Institute of Computing Technology, China) Kav Salamatian (University of Savoie, France) Laurent Mathy (University of


  1. Meta-algorithms for Software based Packet Classification Peng He (Institute of Computing Technology, China) Gaogang Xie(Institute of Computing Technology, China) Kavé Salamatian (University of Savoie, France) Laurent Mathy (University of Liège, Belgium)

  2. Agenda  Motivation  Key Observations  Two Meta Methods  Memory Consumption Model  Characterizing range distribution uniformity  The AutoPC framework and SmartSplit algorithm  Experiment Results. 2 ICNP 2014

  3. Agenda  Motivation  Key Observations  Two Meta Methods  Memory Consumption Model  Characterizing range distribution uniformity  The AutoPC framework and SmartSplit algorithm  Experiment Results. 3 ICNP 2014

  4. Packet Classification Packet Classification: find the highest priority rule that matches a packet Classifier: a set of rules Source IP Destination IP Source Destination Protocol Action Port Port 120.0.0.0/24 198.12.130.0/2 0:65535 11:17 0xFF/0xFF Accept 138.42.83.1/0 174.3.18.0/8 50:10000 0:65535 0x06/0xFF Deny Packet classification is key for  Security  Traffic monitoring and analysis  QoS Packet classification prevalent in modern routers 4 ICNP 2014

  5. Two Solutions  TCAM based Solutions  fast, deterministic performance.  power-hungry, expensive.  RAM based (algorithmic) Solutions  Tradeoff between memory size and memory accesses .  Theoretical Bounds  O(log N) speed and O(N k ) space  O(log k-1 N) speed and O(N) space  All existing algorithms are heuristic algorithms, exploiting special ruleset structures . 5 ICNP 2014

  6. Performance Unpredictability HyperSplit EffiCuts Ruleset 1 Ruleset 2 same algorithm, different ruleset, Choose the right algorithm for different ruleset! same algorithm, different ruleset, 6 ICNP 2014

  7. Our contributions  Study this performance unpredictability  Two ruleset features  Develop methods to predict performance  Two meta methods  choose the right algorithm and develop more efficient one  The AutoPC framework and SmartSplit Algorithms  Workaround  Compare all the alternative algorithms, choose one with better performance.  Need more than 24 hours to build a tree for some rule- sets. (INFOCOM 09’) 7 LANMAN 2013

  8. Agenda  Motivation  Key Observations  Two Meta Methods  Memory Consumption Model  Characterizing range distribution uniformity  The AutoPC framework and SmartSplit algorithm  Experiment Results. 8 ICNP 2014

  9. Geometric View of rulesets Each rule can be viewed as a hyperrectangle Algorithms performs “cuts” or “splits” on the space to reduce the search space. 9 ICNP 2014

  10. An Example (HiCuts and HyperSplit) Unequal sized Equal sized splitting cutting 00* 01* 10*11* [0,13] [14,15] A lot of rule Less rule duplications, duplications, large smaller memory size memory size 2 dimension rule-set Each field has 4 bits 10 ICNP 2014

  11. Non-uniformly distributed ranges Need 8 equal-sized cuts to separate R1 and R2, however R3, R4 and R5 get duplicated. 111* and 110* just concentrate in a small part of the full range range distribution on Field 1 is not uniform, resulting in [0,15] more memory accesses or more rule duplications. 11 ICNP 2014

  12. Sparse rules and orthogonal structure rules No matter how to cut, Rules can be easily rules get duplicated. sperated Memory size increases. 12 ICNP 2014

  13. EffiCuts Untangle the orthogonal structures Smallest memory size No rules get duplicated 13 ICNP 2014

  14. Orthogonal Structures can be invalid. Field 1 is enough to separate rules. Orthogonal structures can be ignored. 2 memory accesses 1 memory access 14 ICNP 2014

  15. Discussions  “Orthogonal structures” should be considered, and rules should be eventually splitted in order to untangle these structure and avoid memory explosion.  When splitting a ruleset, if a dimension appears that contain only small ranges, it should be used to separate the rules with a single tree.  Equal-sized cutting becomes more efficient when ruleset ranges are uniform, if not splitting with non- equal sized intervals should be considered. 15 ICNP 2014

  16. Agenda  Motivation  Key Observations  Two Meta Methods  Memory Consumption Model  Characterizing range distribution uniformity  The AutoPC framework and SmartSplit algorithm  Experiment Results. 16 ICNP 2014

  17. Memory Consumption Model 90% memory is for rule duplications. R1 F1 R2 R1, R2, R3, R4 are R5 R6 R7 R8 (small, large) rules R3 while R5, R6, R7 and R8 ls rules R4 X cuts are (large small) rules. Key Observations: F2 Cutting F1 will usually sl rules cause (small, large) Y cuts rules duplicate. Cutting F2, (large,small) 𝑚𝑡 × 𝑍 + 𝑡𝑚 × 𝑌 rule duplications rules will get duplicated. 17 ICNP 2014

  18. Memory Consumption Model Assume: in each divided space, there are binth rules. Half of rules are (large, small) rules and the other half are (small, large) rules. 𝑚𝑡 𝑡𝑚 We need 𝑐𝑗𝑜𝑢ℎ/2 cuts on F1, 𝑐𝑗𝑜𝑢ℎ/2 cuts on F2 𝑚𝑡 𝑡𝑚 In total, we have 𝑐𝑗𝑜𝑢ℎ/2 × 𝑡𝑚 + 𝑐𝑗𝑜𝑢ℎ/2 × 𝑚𝑡 rule duplications 18 ICNP 2014

  19. Memory Consumption Model  How about (small, small) rules and (large, large) rules?  See paper for details.  How to minimize the estimation error?  See paper for details 𝑁 𝑡𝑡 = 𝑡𝑡 × 𝑄𝑈𝑆 𝑁 𝑚𝑡 = 𝑚𝑡 × 𝑡𝑚 + 𝑡𝑡 × 𝛽 × 𝑄𝑈𝑆 𝑐𝑗𝑜𝑢ℎ/2 𝑚𝑡+𝑡𝑡 ×(1−𝛽) 𝑁 𝑡𝑚 = 𝑡𝑚 × × 𝑄𝑈𝑆 𝑐𝑗𝑜𝑢ℎ/2 𝑁 𝑚𝑚 = 𝑚𝑚 × 𝑡𝑚 + 𝑡𝑡 × 𝛽 × 𝑚𝑡 + 𝑡𝑡 × (1 − 𝛽) × 𝑄𝑈𝑆 𝑐𝑗𝑜𝑢ℎ/2 𝑐𝑗𝑜𝑢ℎ/2 19 ICNP 2014

  20. Characterizing range distribution uniformity Build a interval tree for the ranges on each field. Characterizing range distribution by the shape of interval tree! 20 ICNP 2014

  21. The shape of Interval trees Quasi-Balanced subtrees # 𝑂𝑝𝑒𝑓𝑡 𝑗𝑜 𝑢ℎ𝑓 𝑙𝑢ℎ 𝑚𝑓𝑤𝑓𝑚 𝐶 𝑠𝑏𝑢𝑗𝑝 = #𝑂𝑝𝑒𝑓𝑡 𝑗𝑜 𝑢ℎ𝑓 𝑙−1 𝑢ℎ 𝑚𝑓𝑤𝑓𝑚 ≥ 1.5 Balance tree distance D Max Balance tree distance D max D max = 3 for this tree 21 ICNP 2014

  22. The threshold of range distribution uniformity 𝟐 #𝒔𝒗𝒎𝒇𝒕 When 𝑬 𝒏𝒃𝒚 ≤ 𝟑 𝒎𝒑𝒉 𝒄𝒋𝒐𝒖𝒊 One should use equal-sized cut based algorithm See paper for details. 22 ICNP 2014

  23. SmartSplit Algorithm all Split the ruleset according to large/small ranges on IP fields ls ll ss sl Merge rulesets (ss, sl) or (ss, ls) rs2 rs3 rs1 Use different algorithms on three rulesets. al2 al3 al1 23 ICNP 2014

  24. The AutoPC framework Automatically perform the tradeoff for a given ruleset. 24 ICNP 2014

  25. Experiments Results  We conduct extensive experiments for memory model and compare the performance of AutoPC and SmartSplit.  The performance of different algorithms is related the logarithm of the memory 25 ICNP 2014

  26. Experiments Results  For 60 rulesets of various size, the real memory size .vs. the memory estimation 26 ICNP 2014

  27. Memory estimation is fast 1000x faster then really building a decision tree 27 ICNP 2014

  28. Experiments Results 10x small memory  Compare SmartSplit and EffiCuts 2~4x fast 28 ICNP 2014

  29. Real Evaluation  On Xeon machines, the SmartSplit is in average 2 times faster.  AutoPC can choose right algorithm, which can be 3.8 / 18.9 faster than using EffiCuts or HyperSplit alone. 29 ICNP 2014

  30. Conclusion  Orthogonal structure and non-uniformly distributed ranges have impact on algorithm performance  Memory size can be roughly estimated by simply counting orthogonal structure rules (memory consumption model)  Through exploiting uniformity of range distributions, we can improve the performance (SmartSplit)  Through carefully choose right algorithm, we can automatically achieve better tradeoff between memory size and memory accesses (AutoPC) 30 ICNP 2014

  31. Thank you! hepeng@ict.ac.cn

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend