1 / 34

Existing Range Encoding Schemes

Existing Range Encoding Schemes. Presenter: Kai-Yang, Liu Date: 2011/11/23. Outline. A. Direct range-to-prefix conversion B. Basic elementary interval encoding scheme (BEIE) C. Parallel packet classification encoding scheme D. Ternary vector compaction (Boolean expression)

terra
Download Presentation

Existing Range Encoding Schemes

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. Existing Range Encoding Schemes Presenter: Kai-Yang, Liu Date: 2011/11/23

  2. Outline A. Direct range-to-prefix conversion B. Basic elementary interval encoding scheme (BEIE) C. Parallel packet classification encoding scheme D. Ternary vector compaction (Boolean expression) E.Direct conversion using EIs and BRGC (EIGC) F. Database Independent Pre-Encoding (DIRPE) G. Hybrid scheme H. Semantically-Equivalent rule set

  3. Buddy Code &Binary Reflected Gray Code • The Buddy code (BC), Bn, is defined recursively as B1 = (0, 1) and Bk = (0Bk–1, 1Bk–1) for k = 2 to n. • The binary reflected Gray code (BRGC), Gn, for 1 i n, is defined recursively as G1 = (0, 1) and Gk = (0Gk–1, 1(Gk–1)r) for k = 2 to n.

  4. Example

  5. Elementary Interval (EI)

  6. Direct range-to-prefix conversion • The most straightforward database-independent scheme is the direct range-to-prefix conversion based on Buddy code. Each range is converted into a number of prefixes. • In the worst case, range [1, 2W–2] in the W-bit address space is split into 2W – 2 prefixes.

  7. Example • Convert the range [ 1 , 7 ] [ 1 , 7]= 001 + 01* + 1**

  8. Basic elementary interval encoding scheme (BEIE) • Based on the concept of elementary intervals, each elementary interval is given a unique identifier (code) and each range can then be encoded by the identifiers of the EIs covered by the range. • The ranges encoded by the identifiers of the EIs are called primitive ranges.

  9. Example R1=[5,6] R2=[1,1] R3=[4,7] R4=[3,5] By using direct range-to-prefix conversion, R1 is converted into two prefixes 0101 and 0110; R2 is converted to 0001; R3 is converted to 01**; and R4 is converted to 0011 and 010*.

  10. Parallel packet classification encoding scheme (PPC) • The only difference between PPC and BEIE is that PPC only encodes the valid elementary intervals. PPC divides the primitive ranges into layers.

  11. Bitmap intersection scheme • One layer holds only one range. The n-bit identifier of each EI is computed as follows. The ith bit is set to 1 if the EI is covered by the range in the ith layer; otherwise, it is set to 0. • The range in layer i is assigned an n-bit ternary vector called match condition whose ith bit is set to 1, and other bits are set to *.

  12. Bitmap intersection scheme

  13. PPC style-I • The PPC style-I allows more than one disjoint range in a layer. Consequently, the number of layers required will be equal to the maximum number of ranges that all overlap one another. • The layer consisting of L ranges needs log(L+1)bits.

  14. PPC style-I

  15. PPC style-II • The PPC style-II reduces the number of bits required for each layer by inspecting the code dependencies among layers. • Two ranges at the same layer can be assigned a common identifier if one is nested by a range at another layer and the other is not nested by the same range.

  16. PPC style-II

  17. PPC style-III • PPC style-III reduces the number of bits by converting overlapping primitive ranges at different layers into a larger number of nonoverlapping primitive ranges at the same layer. • A side effect is that a primitive range may be represented as more than one match condition.

  18. PPC style-III

  19. L-BRGC

  20. L-BRGC

  21. Ternary vector compaction (Boolean expression) • It is impossible to combine two prefixes of the same length into a single ternary vector when they come from the set of prefixes converted from a range by the direct range-to-prefix conversion. • Example : [1,14]=0001+001*+01**+10**+110*+1110 None of the pairs can be combined into a single ternary vector!

  22. Ternary vector compaction (Boolean expression) • We can view range [1, 14] as 14 singleton addresses and combine them into four ternary vectors, 1**0, **01, *01*, and 01** in which the addresses 0101 and 1010 are used twice. (1)Karnaugh map(K-map) (2)BRGC

  23. Karnaugh map(K-map)

  24. BRGC

  25. NAF conversion DRPC ↓ [0,0] [0,15 ] [15,15]

  26. Direct conversion using EIs and BRGC (EIGC) • the BRGC has the advantage over the BC in that an h-bit block of BRGC codes can be combined with one of its two neighboring h-bit blocks into a (h+1)-bit block (a ternary vector). • One minor improvement to reduce the code space is that all the default EIs can be given the same code.

  27. Example 000000010011 00100110 0111 01010100 1100 R1= 01*1 R2=0001 R3=01** R4=0010, 011*

  28. Example (improvement) Three bits are sufficient for the code space. R1=11* R2=001 R3=*10, 1*1 R4=01*, 110

  29. Database Independent Pre-Encoding (DIRPE) • fence encoding: Maps a W-bit field to 2W-1 bits: the encoding of a number i consists of i ones preceded by 2W-1-i zeros.

  30. Database Independent Pre-Encoding (DIRPE) • Since the number of unused bits in a TCAM array is much smaller than 2W-1, the natural question is whether we can use the available unused bits to reduce the expansion of the database at all . • To form the ternary representation of a range, let us divide the field into multiple chunks, where each chunk represents a contiguous portion of the bits of W.

  31. Database Independent Pre-Encoding (DIRPE) • Let W be split into l chunks, with chunk i having ki bits. (Then, W = k0 + k1 + …+ kl-1.) • The width of our new encoding is hence (2ko-1)+…+(2kl-1-1) • For a range [s , e], split chunk is defined as the first chunk (or level) in which s and e differ. • Let R=[s , e] denote the range, vsiand veidenote the values of the chunk i of s and e respectively.

  32. Example • W=8, R=[11,54], l=3, k0=2, k1=3, and k2=3 • 11=00001011 ; 54=00110110 Vs0=0,Vs1=1,Vs2=3 ; Ve0=0,Ve1=6,Ve2=6 • R can be written [013 - 066] • split chunk=1 • R= {02x - 05x = 000 00xxx11 xxxxxxx 013 – 017 = 000 0000001 xxxx111 060 – 066 = 000 0111111 0xxxxxx }

  33. Hybrid scheme • The hybrid schemes divide ranges into two groups. Each group uses a different encoding scheme. • One example is the range mapping scheme: each frequently occurring range in one group is encoded by one extra bit based on the bitmap intersection scheme ,and the infrequently occurring ranges in the other group are encoded by the direct range to prefix conversion scheme.

  34. Semantically-Equivalent rule set • Some schemes reduce the number of TCAM entries by identifying semantically equivalent rule sets. • A number of effective techniques such as trimming rules, expanding rules, merging rules, and adding rules are developed. However, these techniques achieve higher compression ratios only in the cases when rules share the same actions.

More Related