Memory-Efficient Membership Encoding in Switches Mengying Pan , Robert MacDavid, Shir Landau-Feibish, Jennifer Rexford 1
Policy-Based Forwarding β’ Forward packets to achieve sophisticated policy goals. If set contains A β forward to π΄ Set of attributes If set contains B β forward to π΅ = { A, D, F, β¦ } β¦β¦ π΄ π΅ πΆ 2
Policy-Based Forwarding β’ A packet is tagged with a set of attributes at an edge device. β’ A switch queries the members in the attribute set to forward. If set contains A β forward to π΄ Set of attributes If set contains B β forward to π΅ = { A, D, F, β¦ } β¦β¦ π΄ π΅ πΆ 3
Examples of membership-based forwarding Middlebox chain Attributes: middleboxes Attribute set: set of middleboxes to visit A C B S = { A, C } S 1 S 2 S 4 S 3 A β S β A else β S 2 4
Examples of membership-based forwarding Middlebox chain Attributes: middleboxes Attribute set: set of middleboxes to visit A C B S = { A, C } S 1 S 2 S 4 S 3 B β S β B else β S 3 5
Examples of membership-based forwarding Middlebox chain Attributes: middleboxes Attribute set: set of middleboxes to visit A C B S = { A, C } S 1 S 2 S 4 S 3 C β S β C else β S 4 6
Examples of membership-based forwarding Middlebox chain S = { A, C } A C B Attributes: middleboxes Attribute set: set of middleboxes to visit S 1 S 2 S 3 S 4 A β S β A B β S β B C β S β C Internet Exchange Point A S = { A, C } Attributes: peers Attribute set: set of peers reaching IP destination B C 7
Membership encoding scheme β’ Encoding: a set of attributes β a tag attached to the packet β’ Querying: an attribute β one or multiple match strings a set contains an attribute β the tag matches any of the attributeβs match strings. If tag matches Aβs match string #1 β forward to A If set contains A β forward to A β If tag matches Aβs match string #2 β forward to A β¦β¦ 8
Attribute matrix A chain of six middleboxes A-F with six classes of traffic A B C D E F Attribute set β’ Column = attribute S 1 1 S 1 {A} β’ Row = attribute set S 2 1 1 1 S 2 {A,B,C} β’ Matrix width: W S 3 1 1 S 3 {B,C} H = 6 S 4 1 1 1 S 4 {C,D,E} β’ Matrix height: H S 5 1 1 1 S 5 {C,D,F} β’ Matrix density: D S 6 1 1 1 S 6 {D,E,F} W = 6 9
Two strawman approaches: bitmap A B C D E F S 1 1 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 10
Two strawman approaches: bitmap A B C D E F Tag S 1 1 0 0 0 0 0 S 1 A 100000 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 11
Two strawman approaches: bitmap A B C D E F Tag S 1 1 S 1 A 100000 S 2 A B C 111000 S 2 1 1 1 0 0 0 S 3 B C 011000 S 3 1 1 S 4 C D E 001110 S 4 1 1 1 S 5 C D F 001101 S 5 1 1 1 S 6 D E F 000111 S 6 1 1 1 12
Two strawman approaches: bitmap Match String A B C D E F Tag A 1***** S 1 1 S 1 A 100000 B *1**** S 2 A B C 111000 S 2 1 1 1 S 3 B C 011000 C **1*** S 3 1 1 S 4 C D E 001110 D ***1** S 4 1 1 1 S 5 C D F 001101 E ****1* S 5 1 1 1 S 6 D E F 000111 F *****1 S 6 1 1 1 β’ Number of strings: W = 6 β’ Long match strings! βΉ β’ Width of strings: W = 6 bits β’ High memory cost! β’ Memory cost: W 2 = 36 bits 13
Two strawman approaches: flat tags A B C D E F S 1 1 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 14
Two strawman approaches: flat tags A B C D E F Tag S 1 1 S 1 A 000 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 15
Two strawman approaches: flat tags A B C D E F Tag S 1 1 S 1 A 000 S 2 A B C 001 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 16
Two strawman approaches: flat tags A B C D E F Tag S 1 1 S 1 A 000 S 2 A B C 001 S 2 1 1 1 S 3 B C 010 S 3 1 1 S 4 C D E 011 S 4 1 1 1 S 5 C D F 100 S 5 1 1 1 S 6 D E F 101 S 6 1 1 1 17
Two strawman approaches: flat tags Match String A B C D E F Tag A 000 S 1 1 S 1 A 000 A 001 S 2 A B C 001 S 2 1 1 1 S 3 B C 010 B 001 S 3 1 1 B 010 S 4 C D E 011 S 4 1 1 1 S 5 C D F 100 β¦ β¦ S 5 1 1 1 S 6 D E F 101 F 100 S 6 1 1 1 F 101 β’ Number of strings: WHD = 15 β’ Many strings! βΉ β’ Width of strings: log(H) = 3 bits β’ High memory cost! β’ Memory cost: WHD log(H) = 45 bits 18
Goals β’ Small memory cost of match strings β’ Small number of match strings β’ Short match strings (i.e. short tags) 19
Why can we compress? β’ Matrix width: W A B C D E F 2 W β’ Matrix height: H << S 1 1 β’ Matrix density: D < 1 % S 2 1 1 1 S 3 1 1 << 2 6 H = 6 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 W = 6 20
Why can we compress? β’ Matrix width: N A B C D E F β’ Matrix height: M << N 2 S 1 1 Sparsity of attribute matrix β’ Matrix density < 1 % S 2 1 1 1 Structures within attributes S 3 1 1 M = 6 S 4 1 1 1 β© S 5 1 1 1 M emory E fficient M embership- E ncoding S 6 1 1 1 N = 6 21
Clustering-based encoding scheme 1 1 1 Mutually exclusive clusters can be 1 encoded efficiently. 1 1 1 1 1 1 1 22
Clustering-based encoding scheme A B C D E F S 1 1 S 2 1 1 1 Mutually exclusive clusters can be S 3 1 1 encoded efficiently. S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 cluster ID + cluster bitmap 23
Clustering-based encoding scheme Match String A B C D E F Cluster ID = 0 A 01* S 1 1 Bitmap of {A, B} B 0*1 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 cluster ID + cluster bitmap 24
Clustering-based encoding scheme Match String A B C D E F A 01* S 1 1 B 0*1 S 2 1 1 1 S 3 1 1 D 11** S 4 1 1 1 Cluster ID = 1 E 1*1* S 5 1 1 1 Bitmap of {D, E, F} F 1**1 S 6 1 1 1 cluster ID + cluster bitmap 25
Clustering-based encoding scheme Match string A B C D E F Tag A 01* S 1 1 S 1 A 010 B 0*1 S 2 A B C 011 S 2 1 1 1 S 3 B C 001 S 3 1 1 D 11** S 4 C D E 1110 S 4 1 1 1 S 5 C D F 1101 E 1*1* S 5 1 1 1 S 6 D E F 1111 F 1**1 S 6 1 1 1 cluster ID + cluster bitmap 26
Clustering-based encoding scheme Match string Tag A B C D E F A 01* * S 1 A 010 0 S 1 1 B 0*1 * S 2 A B C 011 0 S 2 1 1 1 S 3 B C 001 0 S 3 1 1 D 11** S 4 C D E 1110 S 4 1 1 1 E 1*1* S 5 C D F 1101 S 5 1 1 1 F 1**1 S 6 D E F 1111 S 6 1 1 1 β’ Number of match strings: 5 β’ Width of match strings: 4 bits 27
MEME Match String Tag A B D E F C Substr 1 Substr 2 Subtag 1 Subtag 2 S 1 1 A 01** * S 1 A 0100 0 S 2 1 1 1 B 0*1* * S 2 A B C 0110 1 S 3 1 1 C **** 1 S 3 B C 0010 1 S 4 1 1 1 D 11** * S 4 C D E 1110 1 S 5 1 1 1 E 1*1* * S 5 C D F 1101 1 S 6 1 1 1 F 1**1 * S 6 D E F 1111 0 β’ Encode the extracted attribute(s) separately β’ Concatenate subtags & match substrings 28
MEME Tag Match String Substr 1 Substr 2 Subtag 1 Subtag 2 A B D E F C A 01** * S 1 A 0100 0 S 1 1 B 0*1* * S 2 A B C 0110 1 S 2 1 1 1 S 3 B C 0010 1 C **** 1 S 3 1 1 S 4 C D E 1110 1 D 11** * S 4 1 1 1 E 1*1* * S 5 C D F 1101 1 S 5 1 1 1 S 6 D E F 1111 0 F 1**1 * S 6 1 1 1 β’ Number of strings: W = 6 β’ Min number of strings β’ Width of strings: 5 bits βΉ β’ Short match strings β’ Memory cost: 30 bits β’ Low memory cost 29
Bridging attributes Attributes that (1) βbridgeβ over an excessive number of rows, and (2) when extracted, leave small mutually exclusive clusters. A B C D E F S 1 1 S 2 1 1 1 S 3 1 1 S 4 1 1 1 S 5 1 1 1 S 6 1 1 1 30
More in paper β’ We utilized a graph algorithm to detect the bridging attributes. β’ We utilized structures within attributes to further save memory. β’ We designed an incremental update function . 31
Optimization for programmable switches Match String Substr 1 Substr 2 A 01** * If tag matches Aβs match string β β¦β¦ B 0*1* * If tag matches Bβs match string β β¦β¦ If tag matches Cβs match string β β¦β¦ C **** 1 β¦β¦ D 11** * E 1*1* * F 1**1 * 32
Optimization for programmable switches Substr 1 Substr 2 A 01** C 1 B 0*1* If subtag 1 matches Aβs match substring 1 β β¦β¦ If subtag 1 matches Bβs match substring 1 β β¦β¦ D 11** If subtag 2 matches Cβs match substring 2 β β¦β¦ E 1*1* β¦β¦ F 1**1 β’ Replace one tall, wide table with two shorter, narrower tables. β’ Memory cost of match substrings: 21 bits 33
Evaluation Attribute matrix of the worldβs largest IXP A 1 A 2 A 3 β¦ A 691 S 1 β’ Matrix width: W = 691 S 2 β’ Matrix height: H = 293,801 << 2 681 S 3 β¦ β’ Matrix density: D = 0.23% < 1 % S 293,801 34
Compared to prior state-of-art (PathSets) Memory cost: 35
Compared to prior state-of-art (PathSets) Memory cost: 87.7% reduction 36
Recommend
More recommend