implementation of a forwarding table based on an improved "counting" algorithm. More...
#include <fwdtable.h>
Public Member Functions | |
virtual void | ifconfig (if_t, const predicate &) |
Associates a predicate to an interface. More... | |
virtual void | consolidate () |
Prepares the forwarding table for matching. More... | |
virtual void | match (const message &, MatchHandler &) const |
Processes a message, calling the output() function on the given MatchHandler object for each matching interface. More... | |
virtual void | match (const message &, MatchMessageHandler &) const |
Processes a message, calling the output() function on the given MatchMessageHandler object for each matching interface. More... | |
virtual void | clear () |
Clears the forwarding table. More... | |
virtual void | clear_recycle () |
Clears the forwarding table. More... | |
virtual size_t | allocated_bytesize () const |
Memory allocated by the forwarding table. More... | |
virtual size_t | bytesize () const |
Memory used by the forwarding table. More... | |
void | set_preprocess_rounds (unsigned int) |
Determines the number of pre-processing rounds applied to every message. | |
unsigned int | get_preprocess_rounds () const |
Returns the current number of pre-processing rounds. | |
![]() | |
virtual | ~ForwardingTable () |
Destroys the forwarding including all its internal data structures. | |
implementation of a forwarding table based on an improved "counting" algorithm.
This class implements the index structure and matching algorithm described in "Forwarding in a Content-Based Network", Proceedings of ACM SIGCOMM 2003. p. 163-174. Karlsruhe, Germany. August, 2003.
In addition, this algorithm includes a number of improvements. The most notable one uses a fast containment check between the set of attribute names in the message and the constraint names of a candidate filter. If the check is negative, that is, if the set of attribute names is not a superset of the set of names of a candidate filter, then the algorithm does not even bother to "count" the number of matched constraints for that filter. The test is based on a representation of the set of names consisting of a Bloom filter.
Another improvement uses static counters to implement a faster but non-reentrant counting algorithm. This variant can be selected with the –with-non-reentrant-counters
option at configure-time.
|
virtual |
Memory allocated by the forwarding table.
returns the number of bytes of memory allocated by the forwarding table. This value is always greater than or equal to the value returned by bytesize().
Implements siena::ForwardingTable.
|
virtual |
Memory used by the forwarding table.
returns the number of bytes of memory used by the forwarding table. This value is always less than or equal to the value returned by allocated_bytesize().
Implements siena::ForwardingTable.
|
virtual |
Clears the forwarding table.
This method removes all the associations from the forwarding table and releases allocated memory. After a call to this method, the forwarding table is ready to be configured with ifconfig().
Implements siena::ForwardingTable.
|
virtual |
Clears the forwarding table.
This method removes all the associations from the forwarding table recycling the allocated memory. After a call to this method, the forwarding table is ready to be configured with ifconfig().
Implements siena::ForwardingTable.
|
virtual |
Prepares the forwarding table for matching.
This function processes the forwarding table, packing some of its internal data structures and preparing them to be used to match events. This function must therefore be called after all the necessary calls to ifconfig and before matching messages with match().
The forwarding table can be reset by calling clear or clear_recycle.
Reimplemented from siena::ForwardingTable.
Associates a predicate to an interface.
This is the method that constructs the forwarding table. This method must be called once for each interface, after the forwarding table is constructed or after it has been cleared. Using this method twice on the same interface without clearing the forwarding table has undefined effects.
Implements siena::ForwardingTable.
|
virtual |
Processes a message, calling the output() function on the given MatchHandler object for each matching interface.
Matches a message against the predicates stored in the forwarding table. The result is processed through the MatchHandler passed as a parameter to this function.
Notice that the forwarding table must be consolidated by calling siena::ForwardingTable::consolidate() before this function is called.
Implements siena::ForwardingTable.
|
virtual |
Processes a message, calling the output() function on the given MatchMessageHandler object for each matching interface.
Implements siena::ForwardingTable.