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

[ns] CBR_Traffic start() method



I'm having terrible difficulty figuring out which code actually causes a
packet to be sent when a CBR agent is started in a simulation.

>From what I can see, the CBR_Traffic::start() method in ns/cbr_traffic.cc
calls the method timeout(), inherited from the class TrafficGenerator in
trafgen.cc, which in turn calls its send(int) method inherited from class
Application.  Application::send(int) calls Agent::sendmsg(int), which I
assume is inherited from class Connector, since the signatures of the
other sendmsg methods within Agent do not match a single int argument.

However, Connector has no sendmsg(int) method, so I checked NsObject,
which Connector inherits from.  But it doesn't have a sendmsg(int) method
either, and neither does TclObject.  

I don't get it.  Is CBR_Traffic::start() not the method invoked when the
following OTcl line is interpreted?

$ns at 1.0 "$cbr0 start"

(where cbr0 is an Application/Traffic/CBR agent)

--Pat.