|
| 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 | |||
of 16 | |||
|
| z Number of bytes being used in the profile for matching | |
|
| ||
|
|
| |
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 | |||
Rule space usage ............ 8 | |||
|
| the accelerator card | |
|
| ||
Number of rules per application: | Splitting the rule allocation out on a | ||
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 | |
of 16 | z Number of bytes being used in the profile for matching | ||
|
| ||
|
|
|
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
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