28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

which traffic is more important and which traffic should just be discarded when congestion<br />

occurs. It also provides protection against DoS attacks. You set up packet<br />

rate limiting by configuring policers that define the conditions under which traffic is<br />

dropped.<br />

This recipe sets up rate limiting for ICMP traffic. These policers traffic can be dropped<br />

if the flow exceeds a set bandwidth or if a burst of packets exceeds a certain size. The<br />

first command accepts ICMP traffic flowing at a sustained rate of up to 1 Mbps and<br />

drops all packets when this rate is exceeded (if-exceeding bandwidth-limit 1m).<br />

The second command accepts traffic bursts up to 50 Kbps and drops all packets<br />

when this rate is exceeded (if-exceeding burst-size-limit 50k). When the flow of<br />

ICMP packets exceeds either limit, all ICMP traffic will be discarded until the flow<br />

rate subsides. To verify the configuration and see if any traffic has been discarded,<br />

use the show firewall filter command:<br />

aviva@RouterF> show firewall filter incoming-to-me<br />

Filter: incoming-to-me<br />

Counters:<br />

Name Bytes Packets<br />

incoming-accepted 160 2<br />

Policers:<br />

Name<br />

Packets<br />

limit-icmp-icmp 0<br />

The policer counters are shown at the end of the output. The policer name is a concatenation<br />

of the policer name (limit-icmp) and the term in which it is used (icmp).<br />

At this point, no congestion has occurred, so no packets have been discarded as a<br />

result of the policer.<br />

Before configuring a policer, you need to have some idea of what normal traffic loads<br />

are on your network and on your router. You generally do this with your network<br />

traffic management tools. You can also gather some of this data from the router itself<br />

by configuring counters for each term in the firewall filter over a representative<br />

period of time, generally several days or weeks. The following command adds a<br />

counter to the icmp term:<br />

[edit firewall filter incoming-to-me]<br />

aviva@RouterF# set term icmp then count icmp-counter<br />

Then use the show firewall filter command to see the statistics:<br />

aviva@RouterF> show firewall filter incoming-to-me<br />

Filter: incoming-to-me<br />

Counters:<br />

Name Bytes Packets<br />

icmp-counter 0 0<br />

incoming-accepted 1680 25<br />

Limiting Traffic on an Interface | 319<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!