Allied Telesis x900-24 series manual Appendix a How to use the layer 4 mask in classifiers, Binary

Page 13

 

 

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

Image 13
Contents Introduction AlliedWareTM OSThis document contains the following What information will you find in this document?Creating dedicated hardware filters Configuring packet classificationCore port 1st tag 2nd tag Nested VLANs disabled Configuring inner parameters for nested VLANsCustomer port 1st tagCreating hardware filters Then, enter the following commandFor example, imagine you have the following set of filters Effects of the action parameters Logic of the operation of the hardware filtersHow many filters can you create? Combining hardware filters and QoSFilter rules table Rule Empty Rule table Extra rules used when combining QoS and hardware filtersFollowing figure shows the copies of these rules Profile maskRule Are there enough bytes for your set of filters? Some protocols also use filters, so use some of the length Disabled by defaultOkay length For example, this set of filters would work How to see the current filter resource usage on the switch Default mask Appendix a How to use the layer 4 mask in classifiersBinary 07D0 in hexadecimalPoints to remember Example 1 portsExample 3 ports Example 2 portsNow it is really easy to write the classifiers 256 128512 02465536 Following table shows the port ranges for the largest blocksC613-16058-00 REV C