Dual Band Mesh node

109 views
Skip to first unread message

nabil torjemen

unread,
Mar 26, 2015, 7:29:43 PM3/26/15
to ns-3-...@googlegroups.com
Hi for all,
I'm trying to write a code which allows to setup a mesh network using Dual Band Mesh Node according to the enclosed configuration.
for that reason, I'm trying to make some changes in the meshhelper.cc and .h file to add the interface used as an AP (see the enclosed files).
my script is as below:
/*
         create the mesh part
        */

        mesh_nodes
.Create (6); // Create 6 nodes mesh  
       
       
// Configure YansWifiChannel
   
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
   
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
    wifiPhy
.SetChannel (wifiChannel.Create ());

   
/*
     * Create mesh helper and set stack installer to it
     * Stack installer creates all needed protocols and install them to
     * mesh point device
     */

    mesh
= MeshHelper::Default ();
               
   
if (!Mac48Address (m_root.c_str ()).IsBroadcast())
           
{
                 mesh
.SetStackInstaller (m_stack, "Root", Mac48AddressValue (Mac48Address (m_root.c_str ())));
           
}
       
else
           
{
               
//If root is not set, we do not use "Root" attribute, because it
               
//is specified only for 11s
                mesh
.SetStackInstaller (m_stack);
           
}
       
if (m_chan)
         
{
            mesh
.SetSpreadInterfaceChannels (MeshHelper::SPREAD_CHANNELS);
         
}
       
else
         
{
            mesh
.SetSpreadInterfaceChannels (MeshHelper::ZERO_CHANNEL);
         
}
       
        mesh
.SetMacType ("RandomStart", TimeValue (Seconds (m_randomStart)));
   
       
// Set number of interfaces for mesh node
    mesh
.SetNumberOfInterfaces (m_MeshnIfaces, m_APnIfaces);
           
   
// set mesh standard
        mesh
.SetStandard(WIFI_PHY_STANDARD_80211n_5GHZ, WIFI_PHY_STANDARD_80211n_2_4GHZ);
       
       
// Install protocols and return container if default MeshPointDevices
        mesh_NetDevices
= mesh.Install (wifiPhy, mesh_nodes);      
         
       
       
// Setup mobility - static topology for Mesh nodes
   
MobilityHelper mobility;
   
Ptr<ListPositionAllocator> positionAlloc =
               
CreateObject<ListPositionAllocator>();
    positionAlloc
->Add (Vector (330.0, 380.0, 0.0));// AP in Building 1
        positionAlloc
->Add (Vector (500.0, 300.0, 0.0));// AP in Building 2
    positionAlloc
->Add (Vector (740.0, 350.0, 0.0));// AP in Building 3
    positionAlloc
->Add (Vector (250.0, 800.0, 0.0));// AP in Building 4 : the root node
        positionAlloc
->Add (Vector (500.0, 740.0, 0.0));// AP in Building 5
    positionAlloc
->Add (Vector (720.0, 720.0, 0.0));// AP in Building 6
    mobility
.SetPositionAllocator (positionAlloc);
    mobility
.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
        mobility
.Install (mesh_nodes);
But I get the following error:


[1055/1811] cxx: build/src/mesh/bindings/ns3module.cc -> build/src/mesh/bindings/ns3module.cc.7.o
src/mesh/bindings/ns3module.cc: In function ‘PyObject* _wrap_PyNs3MeshHelper_SetNumberOfInterfaces(PyNs3MeshHelper*, PyObject*, PyObject*)’:
src/mesh/bindings/ns3module.cc:16194:49: error: no matching function for call to ‘ns3::MeshHelper::SetNumberOfInterfaces(unsigned int&)’
src/mesh/bindings/ns3module.cc:16194:49: note: candidate is:
./ns3/mesh-helper.h:144:8: note: void ns3::MeshHelper::SetNumberOfInterfaces(uint32_t, uint32_t)
./ns3/mesh-helper.h:144:8: note:   candidate expects 2 arguments, 1 provided
src/mesh/bindings/ns3module.cc: In function ‘PyObject* _wrap_PyNs3MeshHelper_SetStandard(PyNs3MeshHelper*, PyObject*, PyObject*)’:
src/mesh/bindings/ns3module.cc:16277:36: error: no matching function for call to ‘ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard&)’
src/mesh/bindings/ns3module.cc:16277:36: note: candidate is:
./ns3/mesh-helper.h:121:8: note: void ns3::MeshHelper::SetStandard(ns3::WifiPhyStandard, ns3::WifiPhyStandard)
./ns3/mesh-helper.h:121:8: note:   candidate expects 2 arguments, 1 provided


Even I use ./waf --disable-python, I got the some error.
How can I fix it ?

mesh_configuration.bmp
mesh-helper.cc
mesh-helper.h

Konstantinos

unread,
Mar 26, 2015, 7:40:24 PM3/26/15
to ns-3-...@googlegroups.com
Hi,

These errors come from the python bindings which need to be recreated (https://www.nsnam.org/wiki/Python_bindings).
If you do not want to use python, you could disable them during configuration, then you should not see these errors.

Regards
K.

nabil torjemen

unread,
Mar 27, 2015, 4:03:40 AM3/27/15
to ns-3-...@googlegroups.com
Hi,
I have exactly disable python and use this command :
./waf --disable-python
but the errors are not fixed.
Best regards.

Konstantinos

unread,
Mar 27, 2015, 5:26:03 AM3/27/15
to ns-3-...@googlegroups.com
Are they the same errors or different? 
Have you cleaned the project? (./waf clean) 

nabil torjemen

unread,
Mar 27, 2015, 6:07:30 AM3/27/15
to ns-3-...@googlegroups.com
Hi,
Yes, I have clean the project and it is the same problem and errors.
Best regards.

Tommaso Pecorella

unread,
Mar 27, 2015, 6:31:38 AM3/27/15
to ns-3-...@googlegroups.com
Hi,

Three things.

1) Make sure to have done stuff in the correct order:
./waf distclean
./waf configure --disable-python
./waf

2) you changed an API. Make sure you changed also ALL the places where this API was used (i.e., in all the mesh examples).

3) I honestly don't understand why you did those changes, The network shown in the picture doesn't need them. However, it's none of my business.

Have fun,

T.

As a side note... why don't you look at examples/wireless/mixed-wireless.cc ? It does almost what you want.

nabil torjemen

unread,
Mar 27, 2015, 3:15:17 PM3/27/15
to ns-3-...@googlegroups.com
Hi Tommaso,
Thanks for your reply.
I have just only make the change on my script and not all mesh examples. So I will do it and try again.
however,reagarding your note: I have already see this example and write the following code:


    mesh
.SetNumberOfInterfaces (m_nIfaces);
           
   
// set mesh standard
        mesh
.SetStandard(WIFI_PHY_STANDARD_80211n_5GHZ);

       
       
// Install protocols and return container if default MeshPointDevices
        mesh_NetDevices
= mesh.Install (wifiPhy, mesh_nodes);
     
         
       
       
// Setup mobility - static topology for default AP

   
MobilityHelper mobility;
   
Ptr<ListPositionAllocator> positionAlloc =
               
CreateObject<ListPositionAllocator>();
    positionAlloc
->Add (Vector (330.0, 380.0, 0.0));// AP in Building 1
        positionAlloc
->Add (Vector (500.0, 300.0, 0.0));// AP in Building 2
    positionAlloc
->Add (Vector (740.0, 350.0, 0.0));// AP in Building 3
    positionAlloc
->Add (Vector (250.0, 800.0, 0.0));// AP in Building 4 : the root node
        positionAlloc
->Add (Vector (500.0, 740.0, 0.0));// AP in Building 5
    positionAlloc
->Add (Vector (720.0, 720.0, 0.0));// AP in Building 6
    mobility
.SetPositionAllocator (positionAlloc);
    mobility
.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
        mobility
.Install (mesh_nodes);

       
       
// create the wifi part
                   
       
// Create 7 nodes wifi      
        wifi_AP_nodes
.Add(mesh_nodes);// create 6 AP
        wifi_AP_nodes
.Create (1); // add the second node in building 1
        mobility
.Install (wifi_AP_nodes.Get(6));
       
       
// Create wifi helper and set the wifi frequence at 2.4 GHz
        wifi
.SetStandard(WIFI_PHY_STANDARD_80211n_2_4GHZ);
           
       
QosWifiMacHelper mac = QosWifiMacHelper::Default();  
        wifi
.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
                                     
"DataMode", StringValue ("OfdmRate54Mbps"));
             
       
Ssid ssid = Ssid ("ns-3-ssid");
        mac
.SetType ("ns3::ApWifiMac",
               
"Ssid", SsidValue (ssid),
               
"BeaconGeneration", BooleanValue (true),
               
"BeaconInterval", TimeValue (Seconds (5)));      
       
        wifi_AP_NetDevices
= wifi.Install (wifiPhy, mac, wifi_AP_nodes);

but you tell me last time that it is not the best way to do it :" About setting up the AP in the same node (and the wifi clients) that's done in a totally different way."
For that reason, I'm thinking to change the API.

do yout think that the proposed code is OK or you recammand another way ?
best regards.

nabil torjemen

unread,
Mar 28, 2015, 3:46:42 AM3/28/15
to ns-3-...@googlegroups.com
Hi for all,
the discussion is not yet finished !!!
So why it is marked as finished ???
Best regards.
Reply all
Reply to author
Forward
0 new messages