Patent ID: 8036113

Claim:
An apparatus comprising: an input circuit to receive packets; one or more output circuits to transmit the packets; a forwarding engine to transfer the packets to one or more of the output circuits; and a rate limiting circuit to selectively pass the packets from the input circuit to the forwarding engine, the rate limiting circuit comprising: a counter to keep a count, an increment circuit to increment the count by an increment amount when the input circuit receives one of the packets, a decrement circuit to decrement the count by a decrement amount at a decrement rate, an action circuit to perform one or more actions based on the count and one or more count thresholds, and a configuration register to store a sampling flag, wherein when the sampling flag is set: the decrement amount is set to zero, and the one or more actions include, when the count exceeds a first one of the count thresholds, causing a copy of one of the packets to be sent to a predetermined sampling destination and resetting the count to zero.