next up previous contents index
Next: 5.3.4 Hash Classifier Up: 5.3 The Classifier Previous: 5.3.2 Multicast Classifiers

   
5.3.3 MultiPath Classifier

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 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? /
};




2000-08-24