Claims
- 1. A method for optimizing use of statistics counters comprising:
determining a total number of counter bits to be used to track two or more statistics; and allocating the total number of counter bits among the two or more statistics to provide for each statistic a counter comprising the number of bits allocated for that statistic, the allocation being such that each counter overflows at a rate desired for that counter.
- 2. The method of claim 1 wherein determining a total number of counter bits to be used comprises determining the size of a standard-sized statistic counter and determining how many standard-sized statistics counters will be used to track said two or more statistics.
- 3. The method of claim 1 wherein allocating the total number of counter bits comprises balancing the respective overflow periods of the counters, such that each overflows in about the same period as the others.
- 4. The method of claim 3 wherein said two or more statistics comprise a first statistic expected to be incremented at a first rate and a second statistic expected to be incremented at a second rate that is faster than the first rate and balancing the respective overflow periods comprises allocating to the counter for the second statistic a number of bits that is k bits larger than a number of bits allocated to the counter for the first statistic, where k is equal to the integer nearest to log2(second rate/first rate).
- 5. The method of claim 3 wherein said two or more statistics comprise a first statistic expected to be incremented at a first rate and a second statistic expected to be incremented at a second rate that is faster than the first rate and balancing the respective overflow periods comprises allocating to the counter for the second statistic, from the total number of counter bits “t” to be used, a number of bits equal to the integer nearest to the quantity (t/2+½ log2(second rate/first rate)).
- 6. The method of claim 1 wherein the two or more statistics comprise statistics associated with a network switch.
- 7. The method of claim 6 wherein the two or more statistics comprise a frame count and a byte count.
- 8. A system for optimizing use of statistics counters comprising:
a statistics counter split so as to provide a counter for each of two or more statistics, wherein the statistics counter comprises a total number of counter bits and the total number of counter bits are allocated among the two or more statistics to provide for each statistic a counter comprising the number of bits allocated for that statistic, the allocation being such that no counter overflows in an unacceptably short period; and for each of said two or more statistics and incrementor configured to increment the counter for that statistic.
- 9. A computer program product for optimizing use of statistics counters, the computer program product being embodied in a computer readable medium and comprising computer instructions for:
determining a total number of counter bits to be used to track two or more statistics; and allocating the total number of counter bits among the two or more statistics to provide for each statistic a counter comprising the number of bits allocated for that statistic, the allocation being such that no counter overflows in an unacceptably short period.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to U.S. Provisional Patent Application No. 60/465,653 entitled MANAGING NETWORK PACKET PROCESSOR AND NETWORK TRAFFIC MANAGER INTERACTIONS Apr. 25, 2003 which is incorporated herein by reference for all purposes.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60465653 |
Apr 2003 |
US |