Problem facing using IEEE 802.11p

149 views
Skip to first unread message

Moyukh Laha

unread,
May 26, 2017, 3:26:51 AM5/26/17
to ns-3-users
I have used the following code for using 802.11p

void
DtnExample::CreateDevices ()
{
  Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue ("ErpOfdmRate6Mbps"));
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
  Wifi80211pHelper pHelper;
  pHelper.SetStandard (WIFI_PHY_STANDARD_80211_20MHZ);
  YansWifiPhyHelper wifiPhy =  YansWifiPhyHelper::Default ();
  YansWifiChannelHelper wifiChannel;
  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
  wifiPhy.SetChannel (wifiChannel.Create ());

  NqosWave80211pMacHelper wifi80211pMac = NqosWave80211pMacHelper::Default();
 
  pHelper.SetRemoteStationManager ("ns3::IdealWifiManager");
  wifiPhy.Set ("TxPowerLevels", UintegerValue (1) ); // default: 1
  wifiPhy.Set ("TxPowerStart",DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("TxPowerEnd", DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-74.5) ); // default: -96
  wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-77.5) ); // default: -99
  wifiPhy.Set ("RxNoiseFigure", DoubleValue (7) ); // default: 7
  wifiPhy.Set ("TxGain", DoubleValue (1.0) ); // default: 1.0
  wifiPhy.Set ("RxGain", DoubleValue (1.0) ); // deafult: 1.0

  wifi80211pMac.SetType ("ns3::AdhocWifiMac");
 
  devices = pHelper.Install (wifiPhy, wifi80211pMac, nodes);
 
  if (pcap)
    wifiPhy.EnablePcapAll (std::string ("rtprot"));
}


 But I am getting the following error while simulating it-

../examples/DTN_SF_UDP/my_dtn.cc: In member function ‘void DtnExample::CreateDevices()’:
../examples/DTN_SF_UDP/my_dtn.cc:1422:24: error: ‘WIFI_PHY_STANDARD_80211_20MHZ’ was not declared in this scope
   pHelper.SetStandard (WIFI_PHY_STANDARD_80211_20MHZ);
                        ^
../examples/DTN_SF_UDP/my_dtn.cc:1439:3: error: ‘NqosWave80211pMacHelper’ was not declared in this scope
   NqosWave80211pMacHelper wifi80211pMac = NqosWave80211pMacHelper::Default();
   ^
../examples/DTN_SF_UDP/my_dtn.cc:1453:3: error: ‘wifi80211pMac’ was not declared in this scope
   wifi80211pMac.SetType ("ns3::AdhocWifiMac");
   ^

Please Help. Thanks

Konstantinos

unread,
May 26, 2017, 4:39:32 AM5/26/17
to ns-3-users
Hi,

From what I can see, you are working on a non stadard ns-3 codebase, therefore my replies may not apply.
I'm answering only based on the standard ns-3 (ns-3-dev repository).

- There is no 20Mhz standard in the ns-3 codebase
Please refer here for the list of available standards https://www.nsnam.org/docs/doxygen/group__wifi.html#ga1299834f4e1c615af3ca738033b76a49 

- Further, there is no class "NqosWave80211pMacHelper". There is just NqosWaveMacHelper (without the 80211p).or Wifi80211pHelper (without the Wave).

Regards,
K

Moyukh Laha

unread,
May 26, 2017, 9:30:32 AM5/26/17
to ns-3-...@googlegroups.com
Thanks Konstantinos. I have made the following changes:


void
DtnExample::CreateDevices ()
{
  Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",StringValue ("ErpOfdmRate6Mbps"));
  Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("0"));
  //WifiHelper wifi;

  Wifi80211pHelper p;
  p.SetStandard (WIFI_PHY_STANDARD_80211_10MHZ);


  YansWifiPhyHelper wifiPhy =  YansWifiPhyHelper::Default ();
  YansWifiChannelHelper wifiChannel;
  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
  wifiPhy.SetChannel (wifiChannel.Create ());


  QosWaveMacHelper pMac = QosWaveMacHelper::Default();
 
//QosWifiMacHelper wifiMac = QosWifiMacHelper::Default ();
  p.SetRemoteStationManager ("ns3::IdealWifiManager");

  wifiPhy.Set ("TxPowerLevels", UintegerValue (1) ); // default: 1
  wifiPhy.Set ("TxPowerStart",DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("TxPowerEnd", DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-74.5) ); // default: -96
  wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-77.5) ); // default: -99
  wifiPhy.Set ("RxNoiseFigure", DoubleValue (7) ); // default: 7
  wifiPhy.Set ("TxGain", DoubleValue (1.0) ); // default: 1.0
  wifiPhy.Set ("RxGain", DoubleValue (1.0) ); // deafult: 1.0

  pMac.SetType ("ns3::AdhocWifiMac");
 
  devices = p.Install (wifiPhy, pMac, nodes);

 
  //devices = wifi.Install (wifiPhy, wifiMac, nodes);

 
  if (pcap)
    wifiPhy.EnablePcapAll (std::string ("rtprot"));
}


And also  done this ----------   #include "ns3/wave-module.h"



But still getting the error:


examples/DTN_SF_UDP/my_dtn.cc.1.o: In function `DtnExample::CreateDevices()':
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1423: undefined reference to `ns3::Wifi80211pHelper::Wifi80211pHelper()'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1424: undefined reference to `ns3::Wifi80211pHelper::SetStandard(ns3::WifiPhyStandard)'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1433: undefined reference to `ns3::QosWaveMacHelper::Default()'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1446: undefined reference to `ns3::QosWaveMacHelper::SetType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, ns3::AttributeValue const&)'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1448: undefined reference to `ns3::Wifi80211pHelper::Install(ns3::WifiPhyHelper const&, ns3::WifiMacHelper const&, ns3::NodeContainer) const'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1433: undefined reference to `ns3::QosWaveMacHelper::~QosWaveMacHelper()'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1423: undefined reference to `ns3::Wifi80211pHelper::~Wifi80211pHelper()'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1433: undefined reference to `ns3::QosWaveMacHelper::~QosWaveMacHelper()'
/home/moyukh/ns-allinone-3.22/ns-3.22/build/../examples/DTN_SF_UDP/my_dtn.cc:1423: undefined reference to `ns3::Wifi80211pHelper::~Wifi80211pHelper()'
collect2: error: ld returned 1 exit status



Can't get why this is happening. Please help. Thanks.


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/1S0oG3syUEg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Konstantinos

unread,
May 26, 2017, 9:43:27 AM5/26/17
to ns-3-users
Hi,

As I have already mentioned, you are working on an un-supported code-base; I don't know the DTN modifications, you are using ns-3.22 as base (old release, we are now on ns-3.26).
Adding the header files is not the only requirement for linking the modules. You need to add the corresponding dependencies in the wscript file. Also note that after modifying a wscript a file, you need to re-configure your ns-3.

Regards,

Moyukh Laha

unread,
Jul 8, 2017, 3:28:55 AM7/8/17
to ns-3-...@googlegroups.com
Thank you Sir.
Can you help me with how to re-configure/edit wscript/ns3 to make it work? any tutorial/source for that.
Actually that DTN code is only supported in 3.22 and I cant shift to 3.26.


The following is the updated code:

DtnExample::CreateDevices ()      
{

 
  YansWifiPhyHelper wifiPhy =  YansWifiPhyHelper::Default ();
  YansWifiChannelHelper wifiChannel;
  wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
  wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel");
  wifiPhy.SetChannel (wifiChannel.Create ());
  QosWaveMacHelper wifi80211pMac = QosWaveMacHelper::Default ();
  Wifi80211pHelper wifi80211p = Wifi80211pHelper::Default ();
  wifi80211p.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
                                      "DataMode",StringValue ("OfdmRate6MbpsBW10MHz"),
                                      "ControlMode",StringValue ("OfdmRate6MbpsBW10MHz"));

  wifiPhy.Set ("TxPowerLevels", UintegerValue (1) ); // default: 1
  wifiPhy.Set ("TxPowerStart",DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("TxPowerEnd", DoubleValue (12.5)); // default: 16.0206
  wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-74.5) ); // default: -96
  wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-77.5) ); // default: -99
  wifiPhy.Set ("RxNoiseFigure", DoubleValue (7) ); // default: 7
  wifiPhy.Set ("TxGain", DoubleValue (1.0) ); // default: 1.0
  wifiPhy.Set ("RxGain", DoubleValue (1.0) ); // deafult: 1.0
  devices = wifi80211p.Install (wifiPhy, wifi80211pMac, nodes);
}

But getting this error:

DTN_my/test-dtn-wave.cc:1494: undefined reference to `ns3::QosWaveMacHelper::Default()'
/DTN_my/test-dtn-wave.cc:1495: undefined reference to `ns3::Wifi80211pHelper::Default()'
/DTN_my/test-dtn-wave.cc:1512: undefined reference to `ns3::Wifi80211pHelper::Install(ns3::WifiPhyHelper const&, ns3::WifiMacHelper const&, ns3::NodeContainer) const'
/DTN_my/test-dtn-wave.cc:1495: undefined reference to `ns3::Wifi80211pHelper::~Wifi80211pHelper()'
/DTN_my/test-dtn-wave.cc:1494: undefined reference to `ns3::QosWaveMacHelper::~QosWaveMacHelper()'
/DTN_my/test-dtn-wave.cc:1495: undefined reference to `ns3::Wifi80211pHelper::~Wifi80211pHelper()'
/DTN_my/test-dtn-wave.cc:1494: undefined reference to `ns3::QosWaveMacHelper::~QosWaveMacHelper()'


Thank you.

Konstantinos

unread,
Jul 8, 2017, 4:50:17 AM7/8/17
to ns-3-users
To re-configure ns-3, you simply call "./waf configure" followed by any other parameters that you did the first time you configured, e.g. enable examples, tests, etc.
It is documented in the tutorial.
Reply all
Reply to author
Forward
0 new messages