Change the root after stack installation in mesh.cc

42 views
Skip to first unread message

Amira Bezzina

unread,
Apr 8, 2019, 10:45:34 AM4/8/19
to ns-3-users
Hello everyone,

I am trying to find a way to change the root of the HWMP proactive mode in the scenario mesh.cc after this line:

meshDevices = mesh.Install (wifiPhy, nodes);

Can anyone help please?

Thank you in advance

jared...@gmail.com

unread,
Apr 10, 2019, 2:36:26 PM4/10/19
to ns-3-users
Looks like if you can get to the MeshPointDevice then you can access its hwmp routing protocol and call SetRoot.  So you can search for the device with maybe the address you want or some other criteria then do:


// assume mpd is the Ptr<MeshPointDevice> selected from meshDevices
auto proto = mpd->GetRoutingProtocol ();
if (proto)
 
{
   
auto hwmp = proto->GetObject <dot11s::HwmpProtocol> ();
   
if (hwmp) hwmp->SetRoot ();
 
}

Good luck,
Jared.

jared...@gmail.com

unread,
Apr 11, 2019, 12:37:54 PM4/11/19
to ns-3-users
You also might want to call hwmp->UnsetRoot() on all the other MeshPointDevice hwmp routing protocols.
Reply all
Reply to author
Forward
0 new messages