Configure Receive and Transmit Leaky Bucket Properties
Congestion control is particularly difficult in high-speed networks with high volumes of traffic. When congestion occurs in such a network, it is usually too late to react. You can avoid congestion by regulating the flow of packets into your network. Smoother flows prevent bursts of packets from arriving at (or being transmitted from) the same interface and causing congestion.
For all interface types except ATM, Channelized E1, E1, Fast Ethernet, Gigabit Ethernet, and Channelized QPP, you can configure leaky bucket properties, which allow you to limit the amount of traffic received on and transmitted by a particular interface. You effectively specify what percentage of the interface's total capacity can be used to receive or transmit packets. You might want to set leaky bucket properties to limit the traffic flow from a link that is known to transmit high volumes of traffic.
Instead of configuring leaky bucket properties, you can limit traffic flow by configuring policers. Policers work on all interfaces. For more information, see Apply Policers and the JUNOS Internet Software Configuration Guide: Policy Framework.
The leaky bucket is used at the host-network interface to allow packets into the network at a constant rate. Packets might be generated in a bursty manner, but after they pass through the leaky bucket, they enter the network evenly spaced. In some cases, you might want to allow short bursts of packets to enter the network without smoothing them out. By controlling the number of packets that can accumulate in the bucket, the
thresholdproperty controls burstiness. The maximum number of packets entering the network inttime units isthreshold + rate *t.By default, leaky buckets are disabled, and the interface can receive and transmit packets at the maximum line rate.
To configure leaky bucket properties, include one or both of the
receive-bucketandtransmit-bucketstatements at the[edit interfacesinterface-name]hierarchy level:[edit interfacesinterface-name]receive-bucket{overflow (tag | discard);ratepercentage;thresholdbytes;}transmit-bucket{overflow discard;ratepercentage;thresholdbytes;}In the
ratestatement, specify the percentage of the interface line rate that is available to receive or transmit packets. The percentage can be a value from 0 (none of the interface line rate is available) to 100 (the maximum interface line rate is available). For example, when you set the line rate to 33, the interface receives or transmits at one third of the maximum line rate.In the
thresholdstatement, specify the bucket threshold, which controls the burstiness of the leaky bucket mechanism. The larger the value, the more bursty the traffic, which means that over a very short amount of time the interface can receive or transmit close to line rate, but the average over a longer time is at the configured bucket rate. The threshold can be a value from 0 through 16777215 bytes. For ease of entry, you can enternumbereither as a complete decimal number or as a decimal number followed by the abbreviationk(1,000) orm(1,000,000). For example, the entrythreshold 2mcorresponds to a threshold of 2,000,000 bytes.In the
overflowstatement, specify how to handle packets that exceed the threshold: