Check out the new USENIX Web site. next up previous
Next: Algorithm Up: MULTOPS implementation Previous: MULTOPS implementation

Data structure

IPRateMonitor is a C++ class that defines two private structs: Record and Table. Figure 5.1 contains the C++ code that defined these structs.

Figure 4: C++ code that defines Record and Table
\begin{figure}\begin{center}
\begin{alltt}
\relax{} {\small\\ struct Record \{
\...
...
\\ Table *root; // root node
\\ }
\\ \relax \end{alltt}\end{center}\end{figure}

from_rate and to_rate in Record are used to store packet rates. EWMA implements an exponentially weighted moving average and is used to keep track of rates. child contains a pointer to a child or NULL if no child exists. Besides 256 pointers to Record, Table contains a pointer to the parent record (parent) and two pointers (prev and next) that are used to maintain a doubly-linked list of nodes--their use is explained in Section 5.3. root points to the root node.



2001-05-11