Examples, Policing actions – Znyx Networks bh5700 User Manual

Page 118

Advertising
background image

omitted, and the packet is not dropped, the egress queue will be determined by the priority of the
packet, either from the 802.1p priority for tagged packets or the default priority for untagged
packets for the ingress port.

Examples

The following commands set up priority queues for packets sent to the CPU and then use filters
with policing to direct packets into these queues and limit their bandwidth.

Set up 8 strict priority queues for the cpu port (zrm)

tc qdisc add dev zrm root handle 124:0 prio bands 8 priomap 0 1 2 3

4 5 6 7

Set up bfifo qdiscs to limit the lowest 3 priority queues to 10240 bytes each

tc qdisc add dev zrm parent 124:1 bfifo limit 10240

tc qdisc add dev zrm parent 124:2 bfifo limit 10240

tc qdisc add dev zrm parent 124:3 bfifo limit 10240

Put “BPDU” packets into queue 5, limit rate to 250 kilobits/second

tc filter add dev zrm parent 124:0 protocol all u32 match u32
0x0180c200 0xffffffff at 0 match u16 0 0xffe0 at 4 police rate

250kbit burst 5200 action drop flowid 124:6

Spanning tree BPDU packets go in COS queue 6, no limit

tc filter add dev zrm parent 124:0 protocol all u32 match u32
0x0180c200 0xffffffff at 0 match u16 0x0001 0xffff at 4 match u16

0x4242 0xffff at 18 flowid 124:7

VRRP heartbeat packets go in COS queue 7, limited to 500kbits/second

tc filter add dev zrm parent 124:0 protocol all u32 match u32
0x0100c200 0xffffffff at 0 match u16 0x0012 0xffff at 4 police rate

500kbit burst 5200 action dropok flowid 124:8

Limit unicast traffic to the CPU to 20 Mbits/second, put in COS queue 0

tc filter add dev zrm parent 124:0 protocol all u32 match u8 0x00
0x01 at 0 police rate 20000kbit burst 250kb action dropok flowid

124:1

Allow pings to be received by the CPU with higher priority than other unicast packets. Give
them a much lower rate

tc filter add dev zrm parent 124: protocol ip u32match ip protocol 1

0xFF match icmp type 8 0xFF police rate 64kbit burst 2560 drop
flowid 124:3

Policing Actions

Besides drop, reclassify, and ok, other actions which are permitted by the hardware can be

Ethernet Switch Blade User's Guide

release 3.2.2j

page 118

Advertising