
The Packet Filtering Language
319
The Packet Filtering
Language
You define packet filters using a
stack-oriented
language, which uses a
LIFO (last in, first out) queue when the packet filter is running. The
program places values (called
operands
) on the stack and tests them with
various logical expressions (called
operators
), such as
and
,
or
,
equal
, and
not equal.
These expressions typically test the values of various fields in
the received packet, which include MAC addresses, type fields, IP
addresses, or any field within the first 64 bytes of any frame.
Principles for Writing
a Custom Filter
Before you write a packet filter, understand these basic principles:
■
How the Packet Filter Language Works
■
What Can You Filter?
■
Implementing Sequential Tests in a Packet Filter
A packet filter program is stored in a preprocessed format to minimize the
space that is required by the packet filter definition. Comments are
stripped. When assigned to a port, the packet filter is converted from the
stored format to a run-time format to optimize the performance of the
filter. Each module is limited to a maximum of 16 packet filter programs.
How the Packet Filter
Language Works
A program in the packet filter language typically consists of a series of
one or more instructions that results in the top of the stack containing a
byte value after execution of the last instruction in the program. This
top-of-stack byte value determines whether to forward or discard the
packet.
In this stack-oriented language, instructions:
■
Push
operands onto the stack
■
Pop
the operands from the stack for comparison purposes
■
Push
the results back onto the stack
Therefore, with the exception of the push instructions, instructions (such
as logical operators) locate their operands implicitly and do not require
additional operand specifiers in the instruction stream.
Opcodes
are the variables that are used to identify the type of operands
and operators you are specifying in the packet filter instructions.
Summary of Contents for 4007
Page 36: ...36 ABOUT THIS GUIDE ...
Page 37: ...I UNDERSTANDING YOUR SWITCH 4007 SYSTEM Chapter 1 Configuration Overview ...
Page 38: ......
Page 50: ...50 CHAPTER 1 CONFIGURATION OVERVIEW ...
Page 52: ......
Page 70: ...70 CHAPTER 3 INSTALLING MANAGEMENT MODULES ...
Page 110: ...110 CHAPTER 4 CONFIGURING AND USING EME OPTIONS ...
Page 130: ...130 CHAPTER 5 MANAGING THE CHASSIS POWER AND TEMPERATURE ...
Page 222: ...222 CHAPTER 11 IP MULTICAST FILTERING WITH IGMP ...
Page 240: ...240 CHAPTER 13 RESILIENT LINKS ...
Page 304: ...304 CHAPTER 14 VIRTUAL LANS VLANS ...
Page 350: ...350 CHAPTER 15 PACKET FILTERING ...
Page 506: ...506 CHAPTER 19 OPEN SHORTEST PATH FIRST OSPF ROUTING ...
Page 534: ...534 CHAPTER 20 IPX ROUTING ...
Page 612: ...612 CHAPTER 22 QOS AND RSVP ...
Page 656: ...656 CHAPTER 23 DEVICE MONITORING ...
Page 657: ...IV REFERENCE Appendix A Technical Support Index ...
Page 658: ......
Page 664: ......