beautypg.com

30 ‘gimask set’ command – DSS Networks 8261-RTM User Manual

Page 44

background image

Gigabit Ethernet Metro-Switch

Board and Firmware Users Manual

DSS NETWORKS, INC.

Version: 1.14g

Page: 44

9.1.30 ‘GIMASK SET’ COMMAND


The ‘gimask set’ command is used to setup the GIMASK tables for the FFP processor.
The command takes seven numeric arguments. The first argument is the ‘link’ index (0-
11) and the second argument is the ‘mask’ index (0-15). The third argument is the table
entry index (0 – 11). The last 4 arguments are the data bytes comprising the 32-bit
dword. The rightmost argument ‘d1’ is the least significant byte (bits 0 – 7) while the
leftmost ‘d3’ is the most significant byte (bits 24-31) of the 32-bit dword.

metro-sw> gimask set <0xd4 0xd3 0xd2 0xd1>

Usage examples:

The following example shows setting up the FFP IMASK and IRULE tables for a simple
method of filtering, re-routing and mirroring. Ports 0 and 4 are connected to external
PC’s and there is a ping traffic running into port 4 from one PC going to the second PC
connected to port 0. The ping reply goes in the opposite direction.

The example filters the packets arriving at port 0 and if a match is found sends the
packets out port 1. In addition, the egress of port 0 (going out port 1) is mirrored to port
4 resulting in the original ping traffic being returned to the source port 4 as well as being
sent out port 1.

The FFP IMASK and IRULE configuration below sets up the FFP to filter the Ethernet II
IP frame type of ‘0x0800’ with the first word of the IP header of ‘0x4500’ which is found
at offset 12 in the packet header. In the FFP matching, it occurs at offset 16 which is
probably due to packet type normalization.

The example shown sets up one mask and one rule entry to filter the four bytes of 08 00
45 00. The action in the IRULE instructs the FFP to send the packet out and alternate
port as specified in the rule table. A ‘GFFPCOUNTER’ is also instructed to be
incremented for each action taken (packet send to port 1). The comments next to the
following commands indicate which settings are taking place.

# GIMASK settings

metro-sw> gimask set 0 0 0 0 0x80 0 0

# set rules-size=1 and start-index=0

midx: 00, eidx: 00

metro-sw> gimask set 0 0 1 0 0 0 0x18

# set DATAOFF-2 = 3 (bytes 16-19)

midx: 00, eidx: 01

metro-sw> gimask set 0 0 2 0 0x2 0 0

# set the ‘untag’ bit

midx: 00, eidx: 02

metro-sw> gimask set 0 0 5 0xff 0 0xff 0

# set FMASK-2 (for dataoff-2 mask)

midx: 00, eidx: 05

# GIRULE settings