does ns3 support dynamically adding a node in the simulation when the simulation is still running?

213 views
Skip to first unread message

stella

unread,
Jun 1, 2012, 5:18:57 AM6/1/12
to ns-3-users
Hi,

I wonder does ns3 support dynamically adding a node in the
simulation when the simulation is still running? For example, I have
created csma network, and start the simulation. Meanwhile, I want to
create another node, add this node in the csma network. Is this
doable in ns-3?

Thanks for your kind help!

/Stella

Vedran Miletić

unread,
Jun 1, 2012, 5:28:11 AM6/1/12
to ns-3-...@googlegroups.com
Don't know why you want this, but you could probably do something
along the lines (untested):

void
AddNodeAfterSimulationStarts (Ptr<CsmaChannel> ch)
{
/* initialize a Node n and it's NetDevice nd */
ch->Attach (nd);
}

int main()
{
/* initialize CsmaChannel and CsmaNetDevices */
Simulator::Schedule (Seconds (2.0), &AddNodeAfterSimulationStarts,
csmaChannel);
}

and hope that it will work.

Vedran

2012/6/1 stella <xing.f...@googlemail.com>:
> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
>
Reply all
Reply to author
Forward
0 new messages