260 likes | 446 Views
Dynamic Algorithms with Worst-case Performance for Packet Classification. Pankaj Gupta and Nick McKeown Stanford University {pankaj, nickm}@stanford.edu. May 17, 2000. Outline. Motivation for packet classification Problem definition Previous work Goals of this work
E N D
Dynamic Algorithms with Worst-case Performance for Packet Classification Pankaj Gupta and Nick McKeown Stanford University {pankaj, nickm}@stanford.edu May 17, 2000
Outline • Motivation for packet classification • Problem definition • Previous work • Goals of this work • Algorithm 1: Heap-on-trie (HoT) • Algorithm 2: Binarysearchtree-on-trie (BoT) • Conclusions and open problems
Need for differentiated services E1 Y E2 Z ISP3 NAP X ISP2 ISP1
Multi-field Packet Classification Given a classifier with N rules, find the action associated with the highest priority rule matching an incoming packet. Example: A packet (152.168.3.32, 152.163.171.71, …, TCP) would have action AN-1 applied to it.
Performance Metrics of a Classification Algorithm • Data structure storage requirements • Packet classification time (query time) • Incremental update time
Undesirable values of Performance Metrics • Data structure storage requirements: O(Nd) • Packet classification time (query time): O(N) • Incremental update time: O(N)
Previous Work (contd.) • Crossproducting (Srinivasan et al[Sigcomm98]) • Recursive Flow Classification (Gupta et al[Sigcomm99]) • FIS tree (Muthukrishnan et al [Infocom00]) • Please see paper for more references All of this work “sacrifices” one metric (among update time, query time or storage) for another, OR achieves good performance on the basis of observed structure of classifiers
Goal of this work • Achieve good update time, storage and query time characteristics • Do not rely on the structure of classifiers for good performance, i.e., work in worst case • Extend to generic multi-dimensional classifiers Algorithms that simultaneously:
Heap-on-trie (HoT) One-dimensional generic 4-bit classifier
Heap-on- Search 0011 Update R4 {R5,R4,R3,R2,R1} {R4, R1} Search: O(W) Update: O(WlogN) Storage: O(NW) Trie 0 1 1 1 0 0 {R5,R3,R1} 1 {R5,R4,R3,R2,R1} 0 0 1 0 {R1} 1 {R4, R1} 1 {R1} {R5} {R1}
Dynamic case: need to keep the prefixes around Static case: pre-compute highest priority rule One range is allocated to at most 2W nodes 0 1 1 1 0 0 {R5,R3,R1} 1 {R5,R4,R3,R2,R1} 0 0 1 {R1} 1 {R4, R1} 1 0 {R1} {R1} {R5}
Store rules at each trie node in a separate heap {R5,R4,R3,R2,R1} 5 4 3 2 1
Heap-on- Search 0011 Update R4 {R5,R4,R3,R2,R1} {R4, R1} Search: O(W) Update: O(WlogN) Storage: O(NW) Trie 0 1 1 1 0 0 {R5,R3,R1} 1 {R5,R4,R3,R2,R1} 0 0 1 0 {R1} 1 {R4, R1} 1 {R1} {R5} {R1}
HoT: multiple dimensions All rules that have 01* as first dimension Dimension-1 01* Heaps Dimension-2
Basic Idea: Assign each range to only one trie node instead of 2W trie nodes Binarysearchtree-on-trie (BoT) Improves update time at the cost of search time
Assigning ranges to trie nodes: Definitions Range represented by a prefix * at trie node v 11..1 00..0 10..0 St(v) Pt(v) En(v) (D-point) 4-bit prefix = 01** St(v) = 0100 = 4 En(v) = 0111 = 7 Pt(v) = 0110 = 6
0 1 1 3 Assigning ranges to nodes 4-bit trie *: d-point = 1000 = 8 8 0 1 0*: d-point = 0100 = 4 12 4 1 1 0 0 2 6 10 14 1 0 1 0 1 0 1 5 7 9 11 13 15
Assigning ranges to nodes Range represented by a prefix * at trie node v 11..1 00..0 10..0 St(v) Pt(v) En(v) (D-point) Assign range H to node v, if v satisfies both of the following: • H contains Pt(v) • H does not contain Pt(parent(v))
Assigning ranges to nodes {R5, R3, R1} 8 0 1 {R4, R2} 12 4 1 1 0 0 2 6 10 14 1
R4 d R3 a Rules R1 c R2 b Store left endpoint coordinates in BBSTleft(v) Store left endpoint coordinates in BBSTright(v) BoT: data structure and algorithms 00..0 10..0 Node v(*) Q Pt(v) St(v) En(v) If Q < Pt(v), find the highest priority of all ranges whose left endpoints are less than or equal to Q.
Search 5 {R4, R2} Update Binarysearchtree-on-trie Search: O(WlogN) Update: O(logN) Storage: O(NW) Multi-dimension: similar extension as HoT {R5, R3, R1} 8 0 {R4, R2} 4 BBSTleft BBSTright
Conclusions and open problems • Presented two algorithms with reasonable worst-case bounds in all performance metrics • The algorithms seem to be simple to implement though no implementation results were shown • What are non-trivial lower bounds to the query time in d-dimensional classification, both static and dynamic, in a given amount of space? • Can we improve upon both the search and update times in the paper in the same or better storage complexity?