On finding an optimal tcam encoding scheme for packet classification
This presentation is the property of its rightful owner.
Sponsored Links
1 / 22

On Finding an Optimal TCAM Encoding Scheme for Packet Classification PowerPoint PPT Presentation


  • 176 Views
  • Uploaded on
  • Presentation posted in: General

On Finding an Optimal TCAM Encoding Scheme for Packet Classification. Ori Rottenstreich (Technion, Israel). Joint work with Isaac Keslassy (Technion, Israel) Avinatan Hassidim (Google Israel & Bar-Ilan Univ.) Haim Kaplan (Tel Aviv Univ.) Ely Porat (Bar-Ilan Univ.). Network Structure.

Download Presentation

On Finding an Optimal TCAM Encoding Scheme for Packet Classification

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


On finding an optimal tcam encoding scheme for packet classification

On Finding an Optimal TCAM Encoding Scheme for Packet Classification

Ori Rottenstreich (Technion, Israel)

Joint work with

Isaac Keslassy (Technion, Israel)

Avinatan Hassidim (Google Israel & Bar-Ilan Univ.)

Haim Kaplan (Tel Aviv Univ.)

Ely Porat (Bar-Ilan Univ.)


Network structure

Network Structure

Accept?


Packet classification

Packet Classification

Forwarding Engine

Packet Classification

Policy Database (classifier)

Rule

Action

----

----

----

----

----

----

Switch

HEADER

Action

Incoming Packet


Tcam architecture

TCAM Architecture

0

0

1

0

2

0

3

1

4

0

0

5

6

1

7

1

0

8

9

1

TCAM Array

deny

001110111111

deny

Each entry is a word in {0,1,}W

1000000110

accept

1001011001000

deny

row 3

001110

accept

11100100

Encoder

deny

111001001

deny

0011100

accept

1010

deny

11111111111

accept

 

Match lines

Source Port

0011101000011100

Width W

Packet Header


Range rules

Range Rules

Range rule = rule that contains range field

Usually source-port or destination-port

How many entries are required to represent one range field?


Tcam encoding example

TCAM Encoding Example

  • Reducing number of TCAM entries by exploiting TCAM

  • properties

  • Example: R=[1,6]

  • Basic encoding

  • with 6 entries

000

001

010

011

100

101

110

111


Tcam encoding example1

TCAM Encoding Example

  • Reducing number of TCAM entries by exploiting TCAM

  • properties

  • Example: R=[1,6]

  • Shorter encoding

  • with 4 entries

000

001

010

011

100

101

110

111


Tcam encoding example2

TCAM Encoding Example

  • Reducing number of TCAM entries by exploiting TCAM

  • properties

  • Example: R=[1,6]

  • Improved encoding

  • with only 3 entries

000

001

010

011

100

101

110

111


Past work prefix encoding

Past Work: Prefix Encoding

  • Definition: An encoding in which in all entries “*”-s appear only as a suffix

  • Example: Encoding of the range R = [0,2]

  • Property:For a general function F, it is easy to find an optimal prefix encoding

  • TCAM enables non-prefix encoding

  • Can we use this TCAM property to do better than past algorithms?

  • Prefix encoding

Non-prefix encoding

[Suri et al. ’03]


Outline

Outline

Introduction

Optimal Encoding of Extremal Ranges

Average Expansion of Extremal Ranges

Bounds on the Worst-Case Expansion


General functions

General Functions

  • Given a function F, we define

  • - The size of a smallest encoding of F.

  • - The size of a smallest prefix encoding of F.

  • Property:For a general function F, the equality

  • does not necessarily hold.

  • Example:

Optimal prefix encoding

  • Optimal encoding

000

001

010

011


Range functions

Range Functions

  • Given a range R, does necessarily ?

  • Extremal ranges = Ranges that start or end a sub-tree (e.g. [0,2] or [4,6] in tree [0,7])

    • Real life database: 97% of all rules are extremal ranges

  • Theorem:For an extremal range R,

  • Corollary: Finding an optimal encoding of extremal ranges is easy

  • Open Question:Non–extremal ranges?

000

001

010

011

100

101

110

111


Optimal encoding

Optimal Encoding

  • Given a subtree T and a range R, we define

  • - The size of a smallest encoding of R∩T with a last entry of

  • - The size of a smallest encoding of R∩T with a last entry of

  • Example: If and then

    • and

  • Property:

D


On finding an optimal tcam encoding scheme for packet classification

Algorithm Illustration

  • Illustration of the algorithm for the extremal range R=[0,22]

  • Values are calculated recursively for T0,…,T5

  • The range R can be encoded in entries:

T0 :[22,22]

TW=5:(3,4)

1

T4:(3,3)

T1 :[22,23]

0

T3:(2,3)

1

T2 :(2,3)

T2 :[20,23]

1

T1 :(2,2)

0

T0 :(1,2)

22

31

0

R = [0,22]


Another way to look at it

Another Way to Look at it…

  • For simplicity, let’s focus on the simple extremal ranges [0,y]

TW=5:(3,4)

1

T4:(3,3)

0

0

0

1

0

T3:(2,3)

1

start

T2 :(2,3)

A

(a,a+1)

B

(b,b)

C

(c+1,c)

1

T1 :(2,2)

0

T0 :(1,2)

1

1

0

22

31

Deterministic Finite Automaton (DFA)

R = [0,22]=[00000,10110]


Another way to look at it1

Another Way to Look at it…

  • For simplicity, let’s focus on the simple extremal ranges [0,y]

  • Theorem: For a range , let be the number of blue transitions of the DFA in the processing of .

  • Then, .

start

0

0

1

0

A

(a,a+1)

B

(b,b)

C

(c+1,c)

1

1

Deterministic Finite Automaton (DFA)


Another way to look at it2

Another Way to Look at it…

  • For simplicity, let’s focus on the simple extremal ranges [0,y]

  • Theorem: For a range , let be the number of blue transitions of the DFA in the processing of .

  • Then, .

  • Corollary:is affected by the average number of blue transitions (among the first W transitions) in the Markov Chain derived from the DFA.

1/2

1/2

1/2

A

(a,a+1)

B

(b,b)

C

(c+1,c)

1/2

start

0

0

1

0

1/2

1/2

A

(a,a+1)

B

(b,b)

C

(c+1,c)

Corresponding Markov Chain

1

1

Deterministic Finite Automaton (DFA)


Average expansion of simple extremal ranges

Average Expansion of Simple Extremal Ranges

  • Theorem: The average range expansion of simple extremal ranges [0,y] satisfies:

  • Corollary:


Outline1

Outline

Introduction

Optimal Encoding of Extremal Ranges

Average Expansion of Extremal Ranges

Bounds on the Worst-Case Expansion


Bounds on the worst case expansion

Bounds on the Worst-Case Expansion

- Worst-case expansion over all ranges of W bits:

=

Optimality over all coding schemes

for 1-D ranges

=

Optimality over all coding schemes for 2-D ranges


Concluding remarks

Concluding Remarks

  • Optimal encoding of extremal ranges

  • Formula for the average range expansion of simple extremal ranges

  • Tight worst-case bounds

    • r(W) (1-D ranges, all coding schemes)

    • r2(W) (2-D ranges, all coding schemes)


Thank you

Thank You


  • Login