Configure Hardware Filters on AT-9900, x900-48,
and x900-24 Series Switches
Introduction
The AT-9900, x900-48, and x900-24 series switches support a powerful hardware based
packet-filtering facility.
These switches can filter on a range of Layer 2, Layer 3, and Layer 4 packet attributes, and
perform a variety of different actions on the packets that match the filters.
Because the filters are hardware-based, they put no load on the CPU of the switch, and have
1
no affect on the throughput of the switch. It is possible to configure over
filters, and still have complete wire speed throughput on the switch.
The following configuration methods are available:
1. To filter traffic across all ports on the switch, create dedicated hardware filters.
2. To filter traffic on a per-port basis, apply filtering actions to QoS flow groups or traffic
classes.
1
This Note only describes method
on QoS Flow Groups and Traffic Classes, available from www.alliedtelesis.com/resources/
literature/howto.aspx.
. Method 2 is described in How To Configure Filtering Actions
From this, it can be seen that there are a large number of different attributes upon which
packets can be classified.
Most of these options are self-evident, but the following sections give more information
about the L4 mask and the “inner” options. For information about the other options, see the
Generic Classifier chapter of the Software Reference.
Page 3 | AlliedWare™ OS How To Note: Hardware Filters
Creating dedicated hardware filters
Configuring Layer 4 source and destination port number masks
A common filtering requirement is the ability to filter on a range of TCP or UDP port
numbers. For example, we often want to be able to allow through all packets with a TCP
1
destination port greater than
sessions initiated from the other side of the switch.The l4smask and l4dmask parameters
make it possible for a single classifier to match a whole range of port numbers.
These parameters take on HEX values, and are used in conjunction with the parameters
tcpsport, tcpdport, udpsport, and udpdport. A range of port numbers matches the
classifier if performing a logical AND with the mask would give the same result as performing
a logical AND with the value specified in the corresponding sport or dport parameter.
Of course, this is not quite so convenient as being able to simply specify a range of decimal
numbers. Often it can require multiple port/mask combinations to cover a particular range of
numbers.
This maths of all this is described in detail in Appendix A of this How To Note—see page 13.
024, as such packets are deemed to be replies coming back to
Note:The default value of each mask is FFFF. This means that if you specify a port number
without specifying a mask, then the classifier matches only that one value of the port
number. This is the same as specifying a port number and a mask of FFFF.
Configuring “inner” parameters for nested VLANs
The tpid, innertpid, innervlanid, and innervlanpriority parameters all apply to nested
VLAN configuration. In this situation, the packets arriving at the core-facing port can have
two VLAN tags configured on them.
zThe tpid parameter matches on the first Tag Protocol Identifier field in the packet.
zThe innertpid parameter matches on the TPID in the second 802.
zThe innervlanid parameter matches on the tunnelled VLAN ID in the second 802.
in the packet.
zThe innervlanpriority parameter matches on the 802.
1
P field in the second tag in the
packet.
The following table shows where in the packet the inner and outer tags will be matched.
Outer VLAN parameters
(normal)
Customer portVLAN
1
Core port
Nested VLANs disabled
st tag2nd tag
1
st tag2nd tag
Inner VLAN parameters
1
st tag
1
Q tag in the packet.
1
Q tag
Some important points to keep in mind while configuring the “inner” parameters are:
zWhen packets arrive at a customer port of a nested VLAN, the parameter vlan will match
the VID of the nested VLAN that the port is a member of, which is just how this parameter
normally operates.
Page 4 | AlliedWare™ OS How To Note: Hardware Filters
Creating dedicated hardware filters
zWhen packets arrive at a customer port of a nested VLAN, the “inner” parameters will
match the attributes of the first tag in the packets. This is because when the packet is
forwarded from the core port, that first tag will have become the inner tag. So, from the
point of view of the nested VLAN, the tag that is on the packet when it arrives into the
customer port is the inner tag.
zWhen nested VLANs are disabled, and “inner” parameters have been configured, these
parameters will be applied as though all packets arriving at the switch were double tagged.
In other words, there will be no attempt to make a distinction between “customer” and
“core” ports. So, if the packets arriving at the switch are not double tagged, then the
“inner” parameters will just match on whatever data happens to be in the packets at the
position where an inner tag would have been.
Therefore, when you disable nested VLANs, you should also remove the classifiers.
zWhen nested VLANs are being used, the parameters tpid and vlanpriority cannot be
used in classifiers on filters applied to customer ports.
zIf you attach the classifier to a number of ports, they will all be treated like core ports if
at least one of the ports is a core port.
Creating hardware filters
Once you have created a classifier, create a filter. The filter uses the classifier, and specifies an
action.
Note that it is possible, but not required, to specify a ID number for the filter. If you do not
specify an ID, then the filter is simply added to the end of the existing list of filters. However,
if you want to actually insert a filter into a specific position in the list, then you can specify a
filter ID. That way, the filter will be inserted at the position indicated by the filter-id value, and
all the existing filters from that position and above will all move up one position.
For example, imagine you have the following set of filters:
add swi hwfilt class=1 action=xxx
add swi hwfilt class=4 action=xxx
add swi hwfilt class=3 action=xxx
add swi hwfilt class=6 action=xxx
Then, enter the following command:
add swi hwfilt=2 class=8
The new filter will be inserted at position 2 in the list. The previous filter #2 will become
filter #3, the previous filter #3 will become filter #4, and the previous filter #4 will become
filter #5:
add swi hwfilt class=1 action=xxx
add swi hwfilt class=8 action=xxx
add swi hwfilt class=4 action=xxx
add swi hwfilt class=3 action=xxx
add swi hwfilt class=6 action=xxx
Page 5 | AlliedWare™ OS How To Note: Hardware Filters
Creating dedicated hardware filters
The logic of the operation of the hardware filters
The operation of the filters follows the standard ACL logic: if a packet matches an filter, the
comparison process stops and the action attached to the filter is performed. If a packet fails
to match any of the filters, then the default action (forward) is taken.
Note:Hardware filters will act on packets that are destined for the switch itself (packets
that would be passed up to the switch's own CPU) in exactly the same way as they
act on packets that were destined to be forwarded directly by the switching chip.
The effects of the action parameters
Let us consider the effect of each the possible action keywords.
ActionWhat it doesWhen do you need this action?
discardDrops the traffic.Use this when the filtering policy is to disallow certain
traffic flows.
forwardForwards the traffic normally.Use this when you want to discard a wide range of traffic,
but still forward some small subset of traffic within that
range.
copyForwards the traffic normally, and
also sends a copy of each packet to
the CPU.
copy,discardDrops the traffic, but also sends a
copy of each packet to the CPU.
setl2qos
Note that this action has the other parameters associated with it, as the following syntax shows:
This action means you can use hardware filters to set the queue, 802.
There is an elaborate QoS mechanism available for allocating these values to packets, but this filter type provides a
simple method if you do not require a full QoS configuration. The principle use for this filter action, though, is as a
mechanism for elevating the probability of CPU reception for packets that you determine to be “important”.
In heavily congested networks, data streams can sometimes use up all the available bandwidth of the CPU receive
process. This increases the probability of losing infrequently-sent control or management packets, for example,
routing protocol packets (BGP, OSPF, PIM, DVMRP) or STP packets. By creating an appropriate classifier and
hardware filter, such packets can be given higher priority forwarding up to the CPU.
If you are using the filter to prioritise packets going up to the CPU, you only need to specify a value for the
l2qosqueue parameter. The higher the value given to this parameter, the higher the priority the matching packets
will be given in forwarding up to the CPU. It is possible to specify the priority and bandwidthclass parameters
in this case, but they will have no effect, because the CPU ignores these parameters. The default value for the
l2qosqueue parameter is 0.
The priority parameter specifies the 802.
The bandwidthclass parameter specifies the bandwidth class (colour) to assign matching packets to. The default
is 1 (green).
1
p user priority with which to re-mark matching packets. The default is 0.
Use this when you want software monitoring of a certain
packet flow. If you want to log, or count, or output debug
pertaining to a certain stream, then create a filter that
matches the packets in the stream, and specify copy for
the action.
Use this when you want software monitoring of a certain
packet flow that is being dropped. If you want to log,
count, or output debug pertaining to a certain disallowed
stream, then create a filter that matches the packets in the
stream, and specify copy,discard for the action.
1
p user priority or bandwidth class for packets.
Page 6 | AlliedWare™ OS How To Note: Hardware Filters
Loading...
+ 12 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.