Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 EE384Y: Packet Switch Architectures Part II Address Lookup and Classification (2) Nick McKeown Professor of Electrical Engineering and Computer Science,

Similar presentations


Presentation on theme: "1 EE384Y: Packet Switch Architectures Part II Address Lookup and Classification (2) Nick McKeown Professor of Electrical Engineering and Computer Science,"— Presentation transcript:

1 1 EE384Y: Packet Switch Architectures Part II Address Lookup and Classification (2) Nick McKeown Professor of Electrical Engineering and Computer Science, Stanford University

2 2 Outline I.Routing Lookups II.Packet Classification Motivation and problem definition Classification algorithms –Linear search –Associative search (TCAM) –Trie-based techniques –Crossproducting –Tradeoffs in classification –Heuristic algorithms References

3 3 Motivation: Desire for Additional Services ISP1 NAP E1 ISP2 ISP3 X ServiceExample Differentiated Service Ensure that traffic from ISP2 is given higher priority over traffic from ISP3. Packet Filtering Deny all web traffic from ISP3 at interface X. Policy-based routing Ensure that all web traffic from ISP2 is sent via interface Z. Y Z Other examples: Accounting & billing, rate-limiting, etc.

4 4 Special Processing Requires Identification of Flows All packets of a flow obey a pre-defined rule and are processed similarly by the router E.g. a flow = (src-IP-address, dst-IP- address), or a flow = (dst-IP-prefix, protocol) etc. Router needs to identify the flow of every incoming packet and then perform appropriate special processing based on negotiated service agreements Classification Rules or policies (aka ACL entries, filters)

5 5 Special processing Control Datapath: (per-packet processing) Routing lookup Flow-aware Router: Basic Architectural Components Routing, resource reservation, admission control, SLAs Packet classificati on Switching Scheduling

6 6 Multi-field Packet Classification Packet Classification: Find the action associated with the highest priority rule matching an incoming packet header. Field 1Field 2…Field kAction Rule / /32…UDPA1A1 Rule / / 16 …TCPA2A2 ……………… Rule N / /8…ANYANAN Example: packet ( , , …, TCP) L3-DAL3-SAL4-PROT

7 7 Formal Problem Definition Given a classifier C with N rules, Rj, 1 j N, where Rj consists of three entities: 1)A regular expression Rj[i], 1 i d, on each of the d header fields, 2)A number, pri(Rj), indicating the priority of the rule in the classifier, and 3)An action, referred to as action(Rj). For an incoming packet P with the header considered as a d-tuple of points (P1, P2, …, Pd), the d-dimensional packet classification problem is to find the rule Rm with the highest priority among all the rules Rj matching the d-tuple; i.e., pri(Rm) > pri(Rj), j m, 1 j N, such that Pi matches Rj[i], 1 i d. We call rule Rm the best matching rule for packet P.

8 8 Routing Lookup: Instance of 1D Classification One-dimension (destination address) Forwarding table classifier Routing table entry rule Outgoing interface action Prefix-length priority

9 9 Example 4D Classifier RuleL3-DAL3-SAL4-DPL4- PROT Action R / / **Deny R / / eq wwwudpDeny R / / range udpPermit R / / eq wwwtcpDeny R5 ****Deny

10 10 Example Classification Results Pkt Hdr L3-DAL3-SAL4-DPL4- PROT Rule, Action P wwwtcpR1, Deny P wwwudpR2, Deny

11 11 R5 Geometric Interpretation R4 R3 R1 R2 R7 Dimension 1 Dimension 2 R6 e.g. ( , *) e.g. (144.24/24, 64/16) P2 P1 Packet classification problem: Find the highest priority rectangle containing an incoming point

12 12 Outline I.Routing Lookups II.Packet Classification Motivation and problem definition Classification algorithms –Linear search –Associative search (TCAM) –Trie-based techniques –Crossproducting –Tradeoffs in classification –Heuristic algorithms References

13 13 Metrics for Classification Algorithms Speed Storage requirements Ability to handle large classifiers Low preprocessing time Update time Scalability in the number of header fields Flexibility in rule specification

14 14 Size/Update-rate of Classifier? Micro-flow recognition –128K-1M flows in a metro/edge router –Also requires high update rate (but have few wildcards) Firewall applications –<2K rules per interface –Requires low update rate (usually configured at start-up/boot-up time) Depends heavily on the type of router

15 15 Linear Search Keep rules in a linked list O(N) storage, O(N) lookup time, O(1) update complexity

16 16 Ternary Match Operation Each TCAM entry stores a value, V, and mask, M Hence, two bits (Vi and Mi) for each bit position i (i=1..W) For an incoming packet header, H = {Hi}, the TCAM entry outputs a match if Hi matches Vi in each bit position for which Mi equals 1. ViMiMatch in bit position I ? X0Yes 01Iff (Hi==0) 11Iff (Hi==1) Optional Exercise: What is the logic equation for Z (boolean variable denoting whether a TCAM entry matched)? Optional Exercise: What is the logic equation for Z (boolean variable denoting whether a TCAM entry matched), if instead of (Vi, Mi) we store (Ai,Bi) where (0,0) = always match, (1,1) = always mismatch, (0,1) = match0, and (1,0) = match1

17 17 Lookups/Classification with Ternary CAM Memory array Priority encoder Action Memory Packet Header Action TCAMRAM M , tcp 1.23.x.x, x P 32 P 31 P8P8 For LPM

18 18 Maximal Prefixes 0011, 01**, 10** 001*, 01** 01**, 10** 01** 0001, 001*, 01**, 10**, 110*, 1110 Range-to-prefix Blowup RuleRange R1[3,11] R2[2,7] R3[4,11] R4[4,7] R5[1,14] Maximum memory blowup = factor of (2W-2) d Luckily, real-life does not see too many arbitrary ranges.

19 19 TCAMs Advantages Extensible to multiple fields Fast: ns today ( M searches per second) going to 250 Msps Simple to understand and use Disadvantages Inflexible: range-to-prefix blowup Power: 100Msps Cost: $200-$250 for ~2MByte Density: largest available in is ~2MB, i.e., 128K x 128 (can be cascaded) Tough memory soft-error problem

20 20 Example Classifier RuleDestination Address Source Address R10*10* R20*01* R30*1* R400*1* R500*11* R610*1* R7*00*

21 21 Hierarchical Tries Dimension DA O(NW) memory O(W 2 ) lookup RuleDASA R10*10* R20*01* R30*1* R400*1* R500*11* R610*1* R7*00* Search (000,010) Dimension SA R5R2R1 R3 R6 R7 R4

22 22 Set-pruning Tries [Tsuchiya, Sri98] Dimension DA RuleDASA R10*10* R20*01* R30*1* R400*1* R500*11* R610*1* R7*00* R7 Dimension SA R2R1R5R7R2R1 R3 R7 R6 R7 R4 O(N 2 ) memory O(2W) lookup Search (000,010)

23 23 Grid-of-Tries [Sri98] Dimension DA Dimension SA R5R2R1 R3 R6 R7 R4 O(NW) memory O(2W) lookup RuleDASA R10*10* R20*01* R30*1* R400*1* R500*11* R610*1* R7*00* Search (000,010)

24 24 Grid-of-Tries Advantages Good solution for two dimensions Disadvantages Difficult to carry out updates Not easily extensible to more than two dimensions 20K 2D rules: 2MB, 9 memory accesses (with prefix-expansion)

25 25 Crossproducting [Sri98] R4 R3 R2 R P1 (1,3) (8,4)

26 26 Crossproducting Advantages Fast accesses Suitable for multiple fields Disadvantages Large amount of memory Need caching for bigger classifiers (> 50 rules) 50 rules: 1.5MB, need caching (on-demand crossproducting) for bigger classifiers Need: d 1-D lookups + 1 memory access, O(N d ) space

27 27 Outline I.Routing Lookups II.Packet Classification Motivation and problem definition Classification algorithms –Linear search –Associative search (TCAM) –Trie-based techniques –Crossproducting –Tradeoffs in classification –Heuristic algorithms References

28 28 Classification Algorithms: Speed vs. Storage Tradeoff O(log N) time with O(N d ) storage, or O(log d-1 N) time with O(N) storage Lower bounds for Point Location in N regions with d dimensions from Computational Geometry N = 100, d = 4, N d = 100 MBytes and log d-1 N = 350 memory accesses

29 29 Classification Tradeoff in Hardware Switches/Routers Power consumption of classification subsystem Cost Speed Density (Storage)

30 30 Algorithms so far: Summary Good for two fields, but do not scale to more than two fields, OR Good for very small classifiers (< 50 rules) only, OR Have non-deterministic classification time, OR Either too slow or consume too much storage

31 31 One Solution: Heuristics that seem to work well in real-life Recursive Flow Classification [Gupta, McKeown 1999] –Generalization of crossproducting to conserve storage Hierarchical Intelligent Cuttings [Gupta, McKeown 1999] Aggregated Bit-vector [Baboescu, Varghese 2001] Good heuristics do better than worst-case bounds for real-life datasets. Hierarchy (to at least some level) Structure Properties of real-life classifiers:

32 32 Lookup: Whats Used Out There? Overwhelming majority of routers: –Modifications of multi-bit tries (h/w optimized trie algorithms) –DRAM (sometimes SRAM) based, large number of routes (>0.25M) –Parallelism required for speed/storage becomes an issue Others mostly TCAM based –For smaller number of routes (256K) –Used more frequently in L2/L3 switches –Power and cost main bottlenecks

33 33 Classification: Whats Used Out There? Majority of hardware platforms: TCAMs –High performance, cost, power, determinstic worst-case Some others: Modifications of RFC –Low speed, low cost DRAM-based, heuristic –Works well in software platforms Some others: nothing/linear search/simulated-parallel-search etc.

34 34 Packet Classification: References F. Baboescu and G. Varghese, Scalable packet classification, Proc. Sigcomm 2001 [Lak98] T.V. Lakshman. D. Stiliadis. High speed policy based packet forwarding using efficient multi-dimensional range matching, Sigcomm 1998, pp [Sri98] V. Srinivasan, S. Suri, G. Varghese and M. Waldvogel. Fast and scalable layer 4 switching, Sigcomm 1998, pp [Grid-of-tries, crossproducting] V. Srinivasan, G. Varghese, S. Suri. Fast packet classification using tuple space search, Sigcomm 1999, pp P. Gupta, N. McKeown, Packet classification using hierarchical intelligent cuttings, Hot Interconnects VII, 1999 [Gupta99] P. Gupta, N. McKeown, Packet classification on multiple fields, Sigcomm 1999, pp [RFC]

35 35 Packet Classification: References (contd.) P. Gupta, Algorithms for routing lookups and packet classification, PhD Thesis, Ch 1 and 4, Dec 2000, available at ~pankaj/phd.html [Background and introduction to Classification] P. Gupta and N. McKeown, Algorithms for packet classification, IEEE Network, March/April 2001, vol. 15, no. 2, pp S. Iyer, R.R. Kompella, and A. Shelat, ClassiPI: An architecture for fast and flexible packet classification, IEEE Network, March/April 2001, vol. 15, no. 2, pp TCAM vendors: netlogicmicro.com, sibercore.com, idt.com, cypress.com


Download ppt "1 EE384Y: Packet Switch Architectures Part II Address Lookup and Classification (2) Nick McKeown Professor of Electrical Engineering and Computer Science,"

Similar presentations


Ads by Google