This object is devised to support equal cost multipath forwarding, where the node has multiple equal cost routes to the same destination, and would like to use all of them simultaneously. This object does not look at any field in the packet. With every succeeding packet, it simply returns the next filled slot in round robin fashion. The definitions for this classifier are in ~ns/classifier-mpath.cc, and are shown below:
class MultiPathForwarder : public Classifier { public: MultiPathForwarder() : ns_(0), Classifier() {} virtual int classify(Packet* const) { int cl; int fail = ns_; do { cl = ns_++; ns_ %= (maxslot_ + 1); } while (slot_[cl] == 0 && ns_ != fail); return cl; } private: int ns_; /* next slot to be used. Probably a misnomer? / };