Title :
Hashed and hierarchical timing wheels: efficient data structures for implementing a timer facility
Author :
Varghese, George ; Lauck, Anthony
Author_Institution :
Dept. of Comput. Sci., Washington Univ., St. Louis, MO, USA
fDate :
12/1/1997 12:00:00 AM
Abstract :
The performance of timer algorithms is crucial to many network protocol implementations that use timers for failure recovery and rate control. Conventional algorithms to implement an operating system timer module take O(n) time to start or maintain a timer, where n is the number of outstanding timers: this is expensive for large n. This paper shows that by using a circular buffer or timing wheel, it takes O(1) time to start, stop, and maintain timers within the range of the wheel. Two extensions for larger values of the interval are described. In the first, the timer interval is hashed into a slot on the timing wheel. In the second, a hierarchy of timing wheels with different granularities is used to span a greater range of intervals. The performance of these two schemes and various implementation tradeoffs are discussed. We have used one of our schemes to replace the current BSD UNIX callout and timer facilities. Our new implementation can support thousands of outstanding timers without much overhead. Our timer schemes have also been implemented in other operating systems and network protocol packages
Keywords :
Unix; buffer storage; channel capacity; data structures; modules; network operating systems; packet switching; queueing theory; telecommunication congestion control; telecommunication network reliability; timing; transport protocols; BSD UNIX callout facilities; BSD UNIX timer facilities; TCP; circular buffer; data structures; failure recovery; hashed timing wheels; hierarchical timing wheels; implementation tradeoffs; network protocol; network protocol packages; operating system timer module; overhead; packet transmission; queues; rate control; timer algorithms performance; timer facility; timer interval; Clocks; Communication system control; Data structures; Hardware; Operating systems; Packaging; Protocols; Scheduling algorithm; Timing; Wheels;
Journal_Title :
Networking, IEEE/ACM Transactions on