
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.
Содержание 4007
Страница 1: ...http www 3com com Switch 4007 Implementation Guide Release 3 0 5 Part No 10013673 Published May 2000 ...
Страница 36: ...36 ABOUT THIS GUIDE ...
Страница 37: ...I UNDERSTANDING YOUR SWITCH 4007 SYSTEM Chapter 1 Configuration Overview ...
Страница 38: ......
Страница 50: ...50 CHAPTER 1 CONFIGURATION OVERVIEW ...
Страница 52: ......
Страница 70: ...70 CHAPTER 3 INSTALLING MANAGEMENT MODULES ...
Страница 110: ...110 CHAPTER 4 CONFIGURING AND USING EME OPTIONS ...
Страница 130: ...130 CHAPTER 5 MANAGING THE CHASSIS POWER AND TEMPERATURE ...
Страница 222: ...222 CHAPTER 11 IP MULTICAST FILTERING WITH IGMP ...
Страница 240: ...240 CHAPTER 13 RESILIENT LINKS ...
Страница 304: ...304 CHAPTER 14 VIRTUAL LANS VLANS ...
Страница 350: ...350 CHAPTER 15 PACKET FILTERING ...
Страница 506: ...506 CHAPTER 19 OPEN SHORTEST PATH FIRST OSPF ROUTING ...
Страница 534: ...534 CHAPTER 20 IPX ROUTING ...
Страница 612: ...612 CHAPTER 22 QOS AND RSVP ...
Страница 656: ...656 CHAPTER 23 DEVICE MONITORING ...
Страница 657: ...IV REFERENCE Appendix A Technical Support Index ...
Страница 658: ......
Страница 664: ......