
The Packet Filtering Language
329
Implementing
Sequential Tests in a
Packet Filter
Filter language expressions are normally evaluated to completion —
a packet is accepted if the value remaining on the top of the stack is
nonzero. Frequently, however, a single test is insufficient to filter packets
effectively. When more tests are warranted, you want to accept a packet
that satisfies one of two cases:
■
At least one criterion specified in two or more tests (that is, ORs the
results of the tests)
OR
■
All criteria specified in two or more tests (that is, ANDs the results of
the tests)
The
accept
and
reject
instructions are used to implement sequential tests,
as shown in Figure 26.
In order to optimize a filter’s performance, it is best to exit a filter as early
as possible. If you wait until the last instruction to make the forward or
filter decision, more processing is needed.
The accept and reject criteria allow you to exit a filter early. When using
these instructions, construct the packet filter so that tests that apply to
the majority of the network traffic are performed first. This ensures that
the filter is exited after the first instruction for the majority of packets.
Only a small number of packets will require additional tests.
For example, assume you want to create a filter that checks for particular
IPX attributes that you want to filter, but most of the traffic on your
network is IP traffic. In this case, it would be best to first check each
packet to see if it is a IP frame. If it is, you could accept the packet
immediately. Now only the smaller number of packets that contain IPX
information would be subjected to additional tests.
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: ......