[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Classifier in an agent for simple link selection



My ns version is 2.1b4a.

Pretend I have a star topology of nodes, and from the central node I
must send a packet to one of the leaf (non-central) nodes over the link
from the central node to that leaf node.  The decision of which leaf
node should get the packet is made by an agent ("CentralAgent") I've
built  for the central node.  I think I need to incorporate somehow a
classifier in my CentralAgent.  Looking at errmodel.{h,cc} and
mac.{h,cc}, it appears I need a line something like this:

class CentralAgent: public Agent {
	// ...
	Classifier *classifier_;
	// ...
};

===> Q1) I don't see, though, where/how this classifier is/should be
         actually created.  (or is my approach incorrect?)

Once I understand the answer to Q1, I think that I can use the
install{<index> <object>} instproc-like within my Tcl script to populate
the slot table with the object names of the links to the leaf nodes,
sort of like this:

  for {set i 0} {$i < $leaf_count} {incr i} {
    $centralnode install $i [$ns link $centralnode $leaf($i)]
  }

... after I've extended CentralAgent::command() to forward this
'install' command to the central agent's classifier_.

===> Q2) Does this sound right?  Am I going about this correctly?

Many, many thanks!

--dan

---------------------------------------------------------------------------
 Daniel Friedman    [email protected]    http://www.isr.umd.edu/~danielf