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

 

 

 

Command output

 

Description

 

 

 

Profile #1:

 

Profile used to match on packets

IPv4 bytes used ......... 3

of 16

z Number of bytes being used in the profile for matching

IPv4 packets

Other-Eth bytes used .... 5

of 16

 

 

z Number of bytes being used in the profile for matching

 

 

non-IPv4 ethernet packets

 

 

 

Device Resource, device #1:

 

Resources used by device number 2 - accelerator card

Number of rules used ........ 1

z 1 default rule in the IPv6 card

z One 8-rule block has been allocated in the rule table on

Rule space usage ............ 8

 

 

the accelerator card

 

 

Number of rules per application:

Splitting the rule allocation out on a per-application basis

Accel. Card(IPv6)

1

z 1 default IPv6 rule

Device rule space limit ...

1024

z Total number of rules in the rule table on the accelerator

 

 

 

 

card

 

 

 

Profile Usage:

 

Profile used to match on packets

Profile #1:

 

z Number of bytes being used in the profile for matching

 

 

IPv4 bytes used ......... 0

of 16

IPv4 packets

Other-Eth bytes used .... 6

of 16

z Number of bytes being used in the profile for matching

 

 

non-IPv4 ethernet packets

 

 

 

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

This section describes the use of L4 mask in classifiers and gives some examples on L4 masks.

The way that L4 masks work is similar to IP subnet masks. You need to be familiar with the binary system to set the right mask for your need.

The L4 mask is a 2-byte hexadecimal number, the base-16 number system, which consists of 16 unique symbols: the numbers 0 to 9 and the letters A to F.

For example, if we want to set our UDP destination port to 2000:

2000

=

11111010000 (in binary)

2000

=

07D0 (in hexadecimal)

The default mask

=

FF FF

 

 

which is 11111111 11111111 (in binary)

Applying a L4 mask to an UDP/TCP port allows you to identify the constant and variable parts of the port number. The constant bits are represented by the 1s in the mask, and the variable bits are represented by the 0s. Performing a bitwise logical AND operation between the port number and the L4 mask results in the first port number of the range.

Note: The logical AND operation compares 2 bits and if they are both “1”, then the result is “1”, otherwise, the result is “0”.

Let’s look at some examples.

Page 13 AlliedWare™ OS How To Note: Hardware Filters

Page 13
Image 13
Allied Telesis x900-24 series manual Appendix a How to use the layer 4 mask in classifiers, Binary, 07D0 in hexadecimal