1 / 27

Xinan Tang Intel Compiler Lab.

Scalable Packet Classification Using Interpreting -- Cross-platform Multi-core Solution. Haipeng Cheng & Bei Hua Univ. of Science & Technology of China (USTC). Xinan Tang Intel Compiler Lab. Outline. Background Packet Classification Problem Review RFC Algorithm TIC Algorithm

parson
Download Presentation

Xinan Tang Intel Compiler Lab.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scalable Packet Classification Using Interpreting -- Cross-platform Multi-core Solution Haipeng Cheng & Bei Hua Univ. of Science & Technology of China (USTC) Xinan Tang Intel Compiler Lab. Intel Compiler Lab and USTC, PPoPP’08

  2. Outline • Background • Packet Classification Problem • Review RFC Algorithm • TIC Algorithm • Experimental Results and Analysis • Future Work Intel Compiler Lab and USTC, PPoPP’08

  3. 10GbE Smaller, Chapter, and Denser Intel Compiler Lab and USTC, PPoPP’08

  4. Background (Networking) • 10Gbps offers too much bandwidth for the multi-core computers to handle • Traffic complexity: triple-play (voice, video, and data) support is essential • Traffic types: P2P packets occupy 70% of the total network traffic • Packet classification becomes increasingly important to identify and control the traffic Intel Compiler Lab and USTC, PPoPP’08

  5. Background (Multi-core) • Multi-core becomes prevalent • Networking (Intel IXP, Cavium Octeon, RMI XLR) • Multi-media (IBM Cell, Intel Larabee) • General-purpose • Intel Core 2 Duo • AMD Barcelona • IBM Power5 • Sun Niagara Comment: find an efficient solution for one multi-core architecture is hard; find a cross-platform solution even harder Intel Compiler Lab and USTC, PPoPP’08

  6. Classification Problem • The process of partitioning packets into “groups” is called packet classification. • Packet classification typically uses 5-tuples • Enable value-added services: • Security: classify packets based on security policies • QoS: sort packets and ensure the packets receiving an appropriate bandwidth share • P2P management: tame the P2P traffic Intel Compiler Lab and USTC, PPoPP’08

  7. Packet Classification Example Which package does it match to ? How to match? Packet (000, 010) Intel Compiler Lab and USTC, PPoPP’08

  8. Why Is Packet Classification Hard? • Packet classification is NP-hard • Heuristic solutions seek O(1) solutions • At 10Gbps (OC-192) speed, a 64-byte packet needs to be classified within 40ns • one DARM access time • 100 cycles for a 2.5Ghz CPU Intel Compiler Lab and USTC, PPoPP’08

  9. Packet Classification Solutions • At 10Gbps (OC-192) speed, it is done by • Special ASIC • TCAM • Algorithms (?) • Hierarchical Tries • Recursive Flow Classification (RFC) • Two-stage Interpreter based Classification (TIC) Intel Compiler Lab and USTC, PPoPP’08

  10. RFC Example • Even though search space is huge (2^3)*(2^3)*(2^3), for a given packet, the actual matched rules per field is limited • Class bitmap can be used to describe the matched rules: • 0001 means R4 is the matched rule • 1101 means R1, R2, and R4 are the ones matched Intel Compiler Lab and USTC, PPoPP’08

  11. RFC Exam. Intel Compiler Lab and USTC, PPoPP’08

  12. Map an S-bit string concatenated from the d fields of the packet header to a T-bit number through multiple phases (T << S ) Recursive Flow Classification S-IP(32b) D-IP(32b) S-Port(16b) D-Port(16b) Proto(8b) Intel Compiler Lab and USTC, PPoPP’08

  13. What’s Wrong with RFC? • Memory exploded • Too slow to do update in practice • However, 13-memory-access is the fastest classification algorithm Intel Compiler Lab and USTC, PPoPP’08

  14. Two-stage Interpreting based Classification • Domain knowledge: divide the RFC into two stages: • Search source-destination prefix pair • 99.9% of the time the number of rules that match a pair of source-destination prefix is no more than 5 • Search the list of port-range expressions • Range [2..14] in prefix: 001*, 01**, 10**, 110*, 1110 • Range search is based on calculation (<,>,=) • Encoding the type of the range expressions intelligently • Evaluating them sequentially Intel Compiler Lab and USTC, PPoPP’08

  15. TIC Main Ideas • L2 cache size is in the range of mega-bytes • Network applications are memory intensive • Memory is best accessed sequentially • 64bytes cache line size for Core 2 Duo • 64bytes local-memory for IXP • Can compression be used to optimize performance? • CISC encoding for smaller memory footprint Intel Compiler Lab and USTC, PPoPP’08

  16. Putting Everything Together • Domain knowledge: two-stage classification • Architecture features: • Plenty of CPU cycles • Large L2 cache • Block based sequential access • Branch prediction can eliminate infrequent executed paths Intel Compiler Lab and USTC, PPoPP’08

  17. Port-Range Expressions • There are five type of range expressions • WC (wildcard) • HI ([1024, 65535]) • LO ([0, 1023]) • AR (arbitrary range) • EM (exact match) • For (s-port, d-port, proto), there are at least 5x5x2=50 operators Intel Compiler Lab and USTC, PPoPP’08

  18. Characteristics of Range Expressions for Destination Port Intel Compiler Lab and USTC, PPoPP’08

  19. Encoding and Interpreting • Eliminate WC calculation • Introduce HI and LO operators without storing the constants • HI ([1024, 65535]) • LO ([0, 1023]) • Store AR and EM parameters in the operand fields • NOP for code block alignment Intel Compiler Lab and USTC, PPoPP’08

  20. Can we afford to increase #operator? • Interpreter is a big switch-case statement. • Compiler stores the starting address of each case in a jump table. • Interpreter executes two instructions per iteration: • load an address into a register from the jump table • jump to the address in the indirect addressing mode • IXP –E compiler can optimize switch-case with • Default Case Removal • Switch Block Packing Intel Compiler Lab and USTC, PPoPP’08

  21. Experimental Setup • Intel Xeon 5160 Core 2 Duo running at 3.00GHz with 4MB L2 cache and a 1333MHz system bus • Cycle-accurate IXP2800 simulator, and each ME runs at 1.2GHz with 8 threads • Generate packet traces from ClassBench, and use the low locality traces to cancel the locality Intel Compiler Lab and USTC, PPoPP’08

  22. Space Reduction Intel Compiler Lab and USTC, PPoPP’08

  23. Relative Speedups on Core 2 Duo Intel Compiler Lab and USTC, PPoPP’08

  24. Speedups on IXP (RFC vs. TIC) Intel Compiler Lab and USTC, PPoPP’08

  25. Why RFC is better than TIC on IXP? Block size plays an important role in the IXP architecture since SRAM is optimized for 32bit access Intel Compiler Lab and USTC, PPoPP’08

  26. Block Size Impacts on IXP Intel Compiler Lab and USTC, PPoPP’08

  27. Future Work • Improve TIC performance on IXP • Improve TIC performance on firewall rules • Improve update speeds Intel Compiler Lab and USTC, PPoPP’08

More Related