CSE 577 – Design and Analysis of Switching Systems Review Questions Advanced Packet Classification Jonathan Turner

1. Consider the set of three-dimensional packet filters shown below. Convert the ranges to prefixes, using the method describedin the notes, and show the resulting set of prefixes.

1 1101* 010* 1-6

2 10* 010* 2

3 * 00* 4-6

4 110* 001* 4-6

5 110* * 8-12

6 1101* 0101* 8-10

7 10* 0101* 7-10

The range 7-10 needs to be split into two sub-ranges, 7 and 8-10. Then, two filters are provided for filter number 7 (we’ll call them 7a and 7b). The tree that defines the prefixes corresponding to the ranges is shown below. The ranges that are underlined correspond to prefixes used in the filter set. 0-12 0 1 1-6 7-12 0 1 0 1 2 4-6 7 8-12 0 8-10

- 1 - The new set of filters is shown below.

1 1101* 010* 0*

2 10* 010* 00*

3 * 00* 01*

4 110* 001* 01*

5 110* * 11*

6 1101* 0101* 110*

7a 10* 0101* 10*

7b 10* 0101* 110*

2. For each column in the modified filter set from problem 1, construct a 1d lookup table and for each prefix, list all the filters that are matched by packets for which the given prefix is the longest match.

1 1101*/F13456 0101*/F12567a7b 110*/F567b

2 110* /F345 010* /F125 11*/

3 10* /F237a7b 001* /F345 10*/F7a

4 */ 00* /F35 01*/F134

5 * /F5 00*/F12

6 0*/

Create a cross-product table based on your 1d tables.

114 F1 134 F3, 111 F5 151 F5 241 F5

115 F1 144 F3 112 F5 152 F5 242 F5

116 F1 234 F3,F4 121 F5 211 F5 251 F5

124 F1 244 F3 122 F5 212 F5 252 F5

125 F1 334 F3 131 F5 221 F5 111

126 F1 344 F3 132 F5 222 F5 313 F7a

315 434 F3 141 F5 231 F5 311 F7b

324 F2 444 F3 142 F5 232 F5

- 2 - 3. For each filter in the modified table from problem 1, give its tuple and its nesting level tuple. Uses the nesting level tuples to find a grouping of the filters into two subsets, that can be expected to have small cross-product tables. In the table below, the tuple is in the fourth column and the nesting level tuple in the fifth.

1 1101* 010* 0* [4,3,1] [3,2,1]

2 10* 010* 00* [2,3,2] [1,2,2]

3 * 00* 01* [0,2,2] [1,2,2]

4 110* 001* 01* [3,3,2] [2,3,2]

5 110* * 11* [3,0,2] [2,1,1]

6 1101* 0101* 110* [4,4,3] [3,3,2]

7a 10* 0101* 10* [2,4,2] [1,3,1]

7b 10* 0101* 110* [2,4,3] [1,3,2]

Only two filters (2 and 3) have the same NLtuple. We certainly want to group these together. For the rest, we need to compromise. In general, we want to group filters together whose NLtuples are as similar to each other as possible. So for example, combining [1,3,1] and [1,3,2] is a reasonable but combining [2,1,1] and [1,3,2] is probably not a good idea. If we define the difference between two NLtuples to be the sum of their differences in each of the tree dimensions, then the NLtuple grouping [1,2,2],[1,2,2], [3,2,1],[2,1,1] [1,3,1],[1,3,2],[2,3,2],[3,3,2] produces a maximum difference of 3 within each group, and most of the differences are smaller than that. This tuple grouping produces the filter grouping F1, F2, F3, F5 F4, F6, F7a, F7b 4. One variant of a decision-tree based classifier represents all dimensions as prefixes and then makes a decision based on the next bit of one of the dimensions. The data structure for the decision tree specifies the dimension on which to split at every node. Apply this procedure to produce a decision tree for the modified set of filters from problem 1. Label each of the tree’s internal nodes with the dimension on which you are splitting, and each of the leaves with the set of filters that match packets that reach that point in the tree. Construct the tree so that there are at most two filters per leaf node. Select the splitting dimensions to produce the shallowest possible tree.

3 0 1 3 1 0 1 1 F12 2 1 0 1 0 2 F7b 0 1

F34 F2

- 3 -