Allied Telesis x900-24 series manual Example 2 ports, Example 3 ports

Page 15

Appendix A: How to use the layer 4 mask in classifiers

Example 2: ports 5004-5008

In some more complex situations, we may need more than one classifier to cover all the range we want to. Let’s take UDP destination ports between 5004-5008

5004

=

00010011 10001100

5005

=

00010011 10001101

5006

=

00010011 10001110

5007

=

00010011 10001111

5008

=

00010011 10010000

According to the bolded bits, we may think that the changed bits are the last 5 bits so the mask should be 11111111 11100000.

But remember that if we set the last 5 bits to 0, the mask will cover 25 = 32 ports. But we want to cover only 5 ports, so let’s divide 5 into 4+1.

5004

=

00010011 10001100

 

 

5005

=

00010011 10001101

 

 

5006

=

00010011 10001110

4

ports

5007

=

00010011 10001111

 

 

 

 

 

+

 

5008

=

00010011 10010000

1

port

Now it is really easy to write the classifiers!

create class=1 udpdp=5004 l4dmask=FFFC

create class=2 udpdp=5008

add swi hwfilt class=1,2 action=drop

Example 3: ports 333-777

A more complex situation, let’s try to write the classifiers for UDP ports between 333-777. As we are trying to get rid of odd numbers in the beginning of our port range, we will prefer to write classifiers for single port number for 333.

z777-334+1 = 444 total number of port (+1 for including 333)

z256 + 128 + 32 + 16 + 8 + 4 = 444 (7 classifiers)

z7 classifiers + 1 classifier (for 333) = 8 classifiers

Now the question is how to locate these blocks. The short-cut to do that is, first, find the position of the biggest block, which is 256 for our example. 256 should fit into one of the following blocks:

0

-

255

256

-

512

512

-

767

768- 1024

...

65280 - 65536

Page 15 AlliedWare™ OS How To Note: Hardware Filters

Image 15
Contents Introduction AlliedWareTM OSThis document contains the following What information will you find in this document?Creating dedicated hardware filters Configuring packet classification1st tag Configuring inner parameters for nested VLANsCore port 1st tag 2nd tag Nested VLANs disabled Customer portThen, enter the following command Creating hardware filtersFor example, imagine you have the following set of filters Effects of the action parameters Logic of the operation of the hardware filtersCombining hardware filters and QoS How many filters can you create?Filter rules table Rule Empty Rule table Extra rules used when combining QoS and hardware filtersProfile mask Following figure shows the copies of these rulesRule Are there enough bytes for your set of filters? Disabled by default Some protocols also use filters, so use some of the lengthOkay length For example, this set of filters would work How to see the current filter resource usage on the switch 07D0 in hexadecimal Appendix a How to use the layer 4 mask in classifiersDefault mask BinaryPoints to remember Example 1 portsExample 2 ports Example 3 portsNow it is really easy to write the classifiers 024 128256 51265536 Following table shows the port ranges for the largest blocksC613-16058-00 REV C