[Ns-developers] mixed-wireless example questions

Adrian Sai-Wah TAM adrian at ieaa.org
Sun May 3 21:50:08 PDT 2009


On Sun, May 3, 2009 at 9:13 PM, Duy Nguyen <dnlove at gmail.com> wrote:
> 1) NodeContainer class
> Assume, multiple objects are created from NodeContainer class, then
> NodeList class automatically has access to all these objects like
> indices of the node?

Correct.  Give you an example:

NodeContainer x;
x.Create(10);
Ptr<Node> firstNode = x.Get(0);

> 2)OnOffHelper class
> basically to turn the application on and off
> It does not seem like I can bring the nodes up and down using this
> class.  Do you have any pointers for bringing a specific number of
> nodes down(offline) and up(online) again in the simulation.

OnOffApplication is L7, you can't ask L7 to control L2/L3. I guess you
are talking about turning a DEVICE up/down rather than a node up/down.
I have no idea how to do this in general. But I did extended
PointToPointNetDevice in my own project to include a reactive link up
and down.

> 3)CommandLine Class
> For example;
> int count = 5;
> CommandLine cmd;
> cmd.AddValue("count", "number of nodes", count);
>
> How do I set the count at run time?
> i tried
> ./waf --run --count=20 scratch/filename
> but it does not work

Try: ./waf --run "scratch/filename --count=20"

> 4) device id
> it is the id of the device to generate pcap output,
> I still have a very vague idea of it.  How do you find out the device
> id so you can enablePcap?

In the ASCII trace file, you see things like
"/NodeList/1/DeviceList/2/$ns3::SomeKindOfNetDevice/"
The number after DeviceList is the device id.



More information about the Ns-developers mailing list