Exploiting Order Independence for Scalable and Expressive Packet - - PowerPoint PPT Presentation

β–Ά
exploiting order independence for scalable and expressive
SMART_READER_LITE
LIVE PREVIEW

Exploiting Order Independence for Scalable and Expressive Packet - - PowerPoint PPT Presentation

Exploiting Order Independence for Scalable and Expressive Packet Classification Author: Kirill Kogan, Sergey I. Nikolenko, Ori Rottenstreich, William Culhane, and Patrick Eugster Presenter: Qing Lyu 2017/04/12 IEEE/ACM TRANSACTIONS ON


slide-1
SLIDE 1

Exploiting Order Independence for Scalable and Expressive Packet Classification

Author: Kirill Kogan, Sergey I. Nikolenko, Ori Rottenstreich, William Culhane, and Patrick Eugster Presenter: Qing Lyu 2017/04/12

IEEE/ACM TRANSACTIONS ON NETWORKING, VOL. 24, NO. 2, APRIL 2016

slide-2
SLIDE 2

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

2 Outline

slide-3
SLIDE 3

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

3 Outline

slide-4
SLIDE 4

Packet Classification

4 lIntroduction

slide-5
SLIDE 5

Packet Classification

TCAM

lNFV, power consumption and heat lcannot efficiently represent range rules, especially multiple fields lexponential space growth

Software (SW)

ltradeoffs between (memory) space and (lookup) time.

5 Introduction

slide-6
SLIDE 6

TCAM

Advantages: efficiently represent multi-field classification with prefixes Disadvantages: suffers an exponential blowup from range expansion each range-based field in a rule introduces an additional multiplicative factor

6 Introduction

slide-7
SLIDE 7

SW-Complexity bounds

Software-based packet classifier with rules and fields K β‰₯ 3 O(𝑂() space, 𝑃(log𝑂) time 𝑃 𝑂 π‘‘π‘žπ‘π‘‘π‘“, 𝑃(π‘šπ‘π‘•(67𝑂) time E.g. 100 rules and 4 fields, O(𝑂() is about 100MB, 𝑃(π‘šπ‘π‘•(67𝑂) time is about 350 memory accesses

7 Introduction

slide-8
SLIDE 8

Ranges

Standard five-tuples with two fields which include ranges Desired implementations for classifiers on ranges: IP or MAC addresses dates packet lengths etc

8 Introduction

slide-9
SLIDE 9

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

9 Outline

slide-10
SLIDE 10

Contributions

Exploit the order-independenceof classifiers Reduce the number of classification fields represented by prefixes or ranges Implemented in linear space and with worst-case guaranteed logarithmic time Allows the addition of more fields including range constraints without impacting space and time complexities

10 Introduction

slide-11
SLIDE 11

Model Description

A packet header contains 𝑙 fields A field 𝑗, 1 ≀ i ≀ 𝑙 is a string of 𝑋

? bits

A classifier K is an ordered set of rules, 𝑆7, … , 𝑆B A rule 𝑆C is a is an ordered set of 𝑙 fields and an associated action 𝐡C A field 𝐺

? is represented by a range of values on 𝑋 ?

bits each rule contains 𝑙 ranges 𝑆 = (𝐽7, … , 𝐽(), 𝐽? = [π‘š?, 𝑣?]

11 Order-independence

slide-12
SLIDE 12

Denotation

K6K the classifier obtained from by K by removing a set

  • f fields 𝐺 from each rule

KLK the classifier obtained from K by extending its rules with 𝐺 (with values defined separately for every rule)

12 Order-independence

slide-13
SLIDE 13

Denotation

π‘—π‘œπ‘’π‘“π‘ π‘‘π‘“π‘‘π‘’

at least one header that matches both rules 𝑆7, 𝑆P

π‘’π‘—π‘‘π‘˜π‘π‘—π‘œπ‘’

𝑆7, 𝑆S

𝑝𝑠𝑒𝑓𝑠 βˆ’ π‘—π‘œπ‘’π‘“π‘žπ‘“π‘œπ‘’π‘“π‘œπ‘’

𝑆7, 𝑆S are order-independent if the corresponding sets of matching headers are disjoint, every header matches at most one of them.

13 Order-independence

𝑆7 = 100 βˆ— 𝑆S = 01 βˆ—βˆ— 𝑆P = 1 βˆ—βˆ—βˆ—

slide-14
SLIDE 14

Denotation

A classifier K is called order-independent if any two

  • f its rules are filter-order-independent

K(S) denotes a classifier that uses only a subset 𝑇

  • f fields in classification

14 Order-independence

slide-15
SLIDE 15

Order-independence

KX: with the same rules as K sorted in a different

  • rder

Then, any packet header π‘ž is matched by the same rule in KX and K The condition is satisfied when rules do not intersect i.e., for each pair of rules there is at least one field in which the corresponding ranges (or prefixes) are disjoint. Transitively order- dependent 𝑆7, 𝑆S 𝑆S, 𝑆P

15 Order-independence

slide-16
SLIDE 16

Cont.

K 𝑆7=([1,3],[4,5]) 𝑆S=([5,6],[4,5]) order-independent KX 𝑆P=([1,3],[4,5]) 𝑆Z=([2,4],[4,5]) order-dependent as (3,4) matches both rules

16 Order-independence

slide-17
SLIDE 17

Two Encoding Schemes

Binary Encoding Worst case 2(𝑋 βˆ’ 1) TCAM entries SRGE Encoding Worst case 2(𝑋 βˆ’ 2) TCAM entries Multi-field (𝑙-field) range, upper bound entries # Binary: (𝑋 βˆ’ 2)(, SRGE: (𝑋 βˆ’ 4)(

17 Order-independence

slide-18
SLIDE 18

Binary Encoding

Binary Encoding 𝑋 βˆ’ 𝑐𝑗𝑒 range is encoded as a union of disjoint subtrees in the binary tree of 2^ leaves Each subtree is represented by a single prefix TCAM entry the maximal number of entries to encode a range (worst-case expansion) is 2(𝑋 βˆ’ 1)

18 Order-independence

slide-19
SLIDE 19

Binary Encoding

𝑋 = 5 Range [16,23] A single entry (01 βˆ—βˆ—βˆ—) Range 1,30 2𝑋 βˆ’ 2 entries (00001),(0001*),(001**),(01***),(10***),(110**),(1 110*),(11110)

19 Order-independence

slide-20
SLIDE 20

SRGE

Improve the worst-case bound to 2(𝑋 βˆ’ 2) entries by representing values in Gray code. Entries are not necessarily prefixes and do not necessarily represent disjoint subsets of the range Range 1,30 2𝑋 βˆ’ 4 entries

20 Order-independence

slide-21
SLIDE 21

Example1

K = 𝑆7, 𝑆S,𝑆P with two fields of 5 bits each 𝑆7 = ( 1,3 , [4,31])

1st field:(00001,0001*) 2nd field:(00100,01***,1****)

𝑆S = ( 4,4 ,[2,30])

1st field:(00100) 2nd field:(00010,001**,01***,10***,110**,1110*,11110)

𝑆P = ( 7,9 ,[5,21])

1st field:(00111,0100*) 2nd field:(00101,0011*,01***,100**,1010*)

21 Order-independence

7 entries 10 entries 6 entries

Binary encoding

slide-22
SLIDE 22

Example1

KL7 = 𝑆7

L7,𝑆S L7, 𝑆P L7 with one additional fields

  • f 5 bits

𝑆7

L7 = ( 1,3 , 4,31 , [1,28])

𝑆S

L7 = ( 4,4 , 2,30 , [4,27])

𝑆P

L7 = ( 7,9 , 5,21 , [3,18])

22 Order-independence

42+28+50=120 entries

slide-23
SLIDE 23

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

23 Outline

slide-24
SLIDE 24

Tested Classifiers

12 classifiers from Classbench generated with real parameters Each with 50K rule on 6 fields 5 real-life classifiers from Cisco Systems

24 Problem formulation and theorem

slide-25
SLIDE 25

Tested Classifiers

12

25 Problem formulation and theorem

slide-26
SLIDE 26

Fields Expansion Theorem

  • --Theorem 1

let KLd be a classifier that results from an order- independent classifier K by adding new fields 𝑛 of any width Then, K with a false-positive check of a single matched rule is a semantically equivalent representation of KLd

26 Problem formulation and theorem

slide-27
SLIDE 27

Theorem 1

Introducing additional fields based on prefixes or ranges to an orderβˆ’dependent classifier

  • 1. affects only the encoding size of its
  • rderβˆ’dependent part
  • 2. new fields in the order-independent part can be

ignored without affecting the classification

  • utcome
  • 3. The space and lookup time complexity of

classification in the order-independent do not increase

27 Problem formulation and theorem

slide-28
SLIDE 28

Theorem 1

Previous new fields based on prefixes or ranges significant increase the software solution 𝑃(π‘šπ‘π‘•(67𝑂) look up time in linear memory Likewise, TCAM-based solution, range converted to prefixes, new field based on ranges adds an additional multiplicative factor for the required TCAM space

28 Problem formulation and theorem

slide-29
SLIDE 29

Theorem 1

Support for additional fields amenable to range rules would greatly improve classification expressiveness e.g., ranges on dates, packet length, etc

29 Problem formulation and theorem

slide-30
SLIDE 30

Theorem 1

fsadf

30 Problem formulation and theorem

slide-31
SLIDE 31

Theorem 1

fsadf

31 Problem formulation and theorem

slide-32
SLIDE 32

Example2

K = 𝑆7, 𝑆S,𝑆P with three fields of 5 bits 𝑆7 = ( 1,3 , 4,31 , [1,28]) 𝑆S = ( 4,4 , 2,30 , [4,27]) 𝑆P = ( 7,9 , 5,21 , [3,18]) K6{S,P} = (𝑆7

6{S,P},𝑆S 6{S,P}, 𝑆P 6{S,P})

𝑆7

6{S,P} = ( 1,3 )

𝑆S

6{S,P} =

4,4 𝑆P

6{S,P} = ( 7,9 )

32 Problem formulation and theorem

42+28+50=120 entries 2+1+2=5 entries

slide-33
SLIDE 33

Fields Reduction Theorem

  • --Theorem 2

let K6d be a classifier that results from an order- independent classifier K by removing 𝑛 fields If K6d is order-independent,then,K6dwith a false-positive check of a single matched rule is a semantically equivalent representation of K

33 Problem formulation and theorem

slide-34
SLIDE 34

Theorem 2

If the reduced classifier K6d contains at most two fields Then, we can efficiently implement lookup in time logarithmic 𝑂 in with (near-) linear memory For TCAM based solutions, reduces the required TCAM space proportionally

34 Problem formulation and theorem

slide-35
SLIDE 35

Theorem 2

asfd

35 Problem formulation and theorem

slide-36
SLIDE 36

Fields Subset Minimization (FSM)

Find a maximal subset of fields M of an order- independent classifier K such that K6d is order-independent,if there are several such subsets, choose M with maximal total width (to minimize lookup word width) multi-group representation 𝛾 groups

36 Problem formulation and theorem

slide-37
SLIDE 37

FSM+multi-group representation

𝛾 groups:

  • 1. each rule belongs to a single group
  • 2. the rules of each group are order-independent
  • n a subset of 𝑙 fields of K
  • 3. different groups can reuse the same fields to

keep order-independence π‘š βˆ’ 𝑁𝐻𝑆: find the minimal number of disjoint groups that each group is order-independent on π‘š fields

37 Problem formulation and theorem

slide-38
SLIDE 38

FSM+multi-group representation

dfs

38 Problem formulation and theorem

slide-39
SLIDE 39

Maximum Rules Coverage

K : order-independent part I and order-dependent part D 1.find a maximal order-independent subset of rules

  • n all 𝑙 fields

2.find an order-independent part that already has the desired properties

39 Problem formulation and theorem

slide-40
SLIDE 40

Maximum Rules Coverage

π‘š βˆ’ 𝑁𝑆𝐷: find a maximal subset I βŠ‚ K which is

  • rder-independent on at most π‘š fields

(𝛾, π‘š) βˆ’ 𝑁𝑆𝐷: find a maximal subset I βŠ‚ K that can be assigned to at most 𝛾 groups, where each group is order-independent on at most π‘š fields. (𝛾, π‘š) βˆ’ 𝑁𝑆𝐷𝐷: no two rules 𝑆7 βŠ‚ I, 𝑆S βŠ‚ D, such that 𝑆7 β€œintersects” with 𝑆S, and 𝑆S β‰Ί 𝑆7

40 Problem formulation and theorem

slide-41
SLIDE 41

Bit-level

R7 = (100 βˆ—, 001 βˆ—), RS = (1010,0001) RP = (000 βˆ—,βˆ—βˆ—βˆ—βˆ—), RZ = (001 βˆ—,βˆ—βˆ—βˆ—βˆ—) First field 𝑆7

67 = (100 βˆ—), 𝑆S 67 = (1010)

𝑆P

67 = (000 βˆ—),𝑆Z 67 = (001 βˆ—)

First and third bit Treat K as 8 one-bit fields, 𝑆7

6w = (10), 𝑆S 6w =

11 , 𝑆P

6w = (00),𝑆Z 6w = (01)

41 Problem formulation and theorem

slide-42
SLIDE 42

Representing Classifier as Boolean Expression

each field is represented by a prefix, so fields can be represented by a string of individual bits Rule set can be written as an unordered disjunction (OR, ⋁) of individual rules, which expressed as a conjunction (AND, β‹€) A rule 𝑑 = 𝑑7 … 𝑑(, 𝑑C ∈ 0,1,βˆ— , can be expressed as a conjunction 𝑑 = 𝑔

|(𝑦7, … , 𝑦()=β‹€|~β€’7𝑦?β‹€|~‒€𝑦̅?

Min-DNF (disjunctive normal form): find a minimal size DNF representation for Boolean function

42 Problem formulation and theorem

slide-43
SLIDE 43

Compare FSM with Boolean Expression

R7 = (100 βˆ—, 001 βˆ—), RS = (1010,0001) RP = (000 βˆ—,βˆ—βˆ—βˆ—βˆ—), RZ = (001 βˆ—,βˆ—βˆ—βˆ—βˆ—) The MinDNF heuristic applicable here is the resolution rule that can be applied to RP and RZ 𝑆P

X = (00 βˆ—βˆ—,βˆ—βˆ—βˆ—βˆ—)

This classifier has width 8; if we discard bits with identical values (second bit in the first field), we still get width 7

43 Problem formulation and theorem

slide-44
SLIDE 44

Cont.

Asf

44 Problem formulation and theorem

slide-45
SLIDE 45

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

45 Outline

slide-46
SLIDE 46

Exact Algorithm

Use a binary search to solve FSM If the classifier is order-independent for some re- moved subset with (

S fields, try to find a subset of

size

P Z 𝑙, otherwise check order-independence for

subsets of size

( Z, and so on

Worst case (

β€š Ζ’

+ (

β€š β€ž

+…+ (

7 < 2(67

FSMBINSEARCH

46 Solution

slide-47
SLIDE 47

Exact Algorithm

Check order-independent 𝑂 rules, 𝑛 removed fields (originally 𝑙) 𝑃(𝑂S(𝑙 βˆ’ 𝑛)) FSMBINSEARCH 𝑃(𝑙2(67𝑂S)

47 Solution

slide-48
SLIDE 48

Exact Algorithm

When fields increase, FSM requires approximation heuristics 2 βˆ’ 𝑁𝑆𝐷: NP-complete (𝛾, π‘š) βˆ’ 𝑁𝑆𝐷: NP-complete as well exponential on 𝑂

48 Solution

slide-49
SLIDE 49

Approximate Solutions

FSM is reducible to SetCover in 𝑃(𝑙 † 𝑂S) and has an approximation factor of 2 ln 𝑂 + 1 Construct set cover problem Define 𝑉 = 𝑗, π‘˜ 𝑗 < π‘˜, 𝑗, π‘˜ ∈ 1, 𝑂 , define 𝑙 sets 𝑇7, …, 𝑇( to cover 𝑉 For π‘š ∈ 1, 𝑙 , 𝑇Š = 𝑗, π‘˜ 𝑗 < π‘˜, 𝑗, π‘˜ ∈ 1, 𝑂 ,𝑆? π‘š ⋂𝑆C π‘š = βˆ… 𝑇Š contains all pairs of rules that do not intersect in field π‘š

49 Solution

Polynomial time 𝑃(𝑙 † 𝑂S)

slide-50
SLIDE 50

Cont.

sdf

each step selects an additional set with maximal number of uncovered elements

50 Solution

slide-51
SLIDE 51

If sets of fields required for order-independence in different groups are pairwise disjoint 2 βˆ’ 𝑁𝐻𝑆 is reducible to SetCover in 𝑃(

(((L7) S

† 𝑂S) and time and has an approximation factor of 2 ln 𝑂 + 1 π‘š βˆ’ 𝑁𝑇𝐷 (Maximum Set Coverage), a set S of 𝑙 sets whose union equals U, select at most π‘š sets of S such that as many elements of U as possible are covered (the union of selected sets has maximal size)

51 Solution

slide-52
SLIDE 52

A variant of Algorithm 3 that stops after π‘š subsets are added solves the π‘š βˆ’ 𝑁𝑇𝐷 problem and has an approximation factor of 1 βˆ’

7

  • + 𝑝(1)

Use an algorithm for the π‘š βˆ’ 𝑁𝑇𝐷 problem as a heuristic to solve the π‘š βˆ’ 𝑁𝑆𝐷 problem worst-case guaranteed lookup time log(𝑂) and a linear space requirement when π‘š=2

52 Solution

slide-53
SLIDE 53

π‘š βˆ’ 𝑁𝑆𝐷 to solve (𝛾, π‘š)βˆ’π‘π‘†π·, once any unassigned rule β€œintersects” with any rule assigned to the current group, open a new group if the total number of groups does not exceed 𝛾 The algorithm for π‘š βˆ’ 𝑁𝐻𝑆 is the same as for (𝛾, π‘š)βˆ’π‘π‘†π· but stop to create new groups all rules

  • f the original classifier is covered

53 Solution

slide-54
SLIDE 54

Classifier Configuration

implementing serviceβˆ’levelβˆ’agreement (SLA) policiesβˆ’βˆ’βˆ’relatively static

  • ffline computation for more efficient representations
  • 1. maximal size of the order-independent part
  • 2. minimal subset of fields that preserve order-

independence

  • 3. minimal number of order-independent groups based on

at most two fields

  • 4. assignment of rules to a predefined number of groups

based on at most two fields

54 Solution

slide-55
SLIDE 55

Classifier Configuration

those required for switching---dynamic Remove: I, D Insert: more complicated, if order-dependentwith I, insert it to D, if D is full recompute I, D; if

  • rder-independentwith I, insert it to I.

Modify existing rules:modified in fields (not) required for order-independence,make sure whether the modified rule intersect with other rules in I.

55 Solution

slide-56
SLIDE 56

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

56 Outline

slide-57
SLIDE 57

Simulations

12 classifiers from Classbench, each with 50 K rules

  • n 6 fields

and on 5 real life classifiers provided by Cisco Systems

57 Simulation

slide-58
SLIDE 58

Cont.

12

58 Simulation

slide-59
SLIDE 59

Cont.

12

59 Simulation

slide-60
SLIDE 60

Outline

lIntroduction lOrder-independence lProblem formulation and theorem lSolutions lSimulations lConclusions

60 Outline

slide-61
SLIDE 61

Conclusions

New properties of classifiers that ignores superfluous information in classification lookup Simplifies classifier matching by firstly solve the rule selection problem which is based only on parts

  • f rules then check false positive on the remainder
  • f the fields not considered

The proposed techniques may be reused in neighboring areas (matching in databases or data mining, Boolean minimization)

61 Simulation

slide-62
SLIDE 62

Thank you!

62

slide-63
SLIDE 63

Reference

l[1] K. Kogan, S. Nikolenko, O. Rottenstreich, W. Culhane, and P. Eugster, Exploiting Order Independence for Scalable and Expressive Packet

  • Classification. IEEE Trans on Networks, Vol. 24, No. 2, pp.1251-1266,

2016. l[2] K. Kogan, S. Nikolenko, O. Rottenstreich, W. Culhane, and P. Eugster, SAX-PAC (Scalable And eXpressive PAcket Classification), in Proc. Of ACM SIGCOMM 2014, 2014. l[3] M. Kerber, Heuristics for Resolution in Propositional Logic, in Proc. of the 32nd annual German conference on Advances in artificial intelligence, 2009. l[4] J. A. Robinson, β€œA machine-oriented logic based on the resolution principle,” J. ACM, vol. 12, no. 1, pp. 23–41, 1965. l[5] A. Bremler-Barr and D. Hendler, β€œSpace-efficient TCAM-based clas- sification using gray coding,” IEEE Trans. Computers, vol. 61, no. 1, pp. 18–30, 2012. 63 Reference

slide-64
SLIDE 64

Reference

l[6] D. Taylor and J. Turner, A Packet Classification Benchmark. IEEE/ACM Trans on Networks, Vol. 15, No. 3, pp. 499-511, 2007. 64 Reference