<div dir="ltr">


        
        
        
        


<p class="MsoNormal"><span lang="ES">I have been doing simulations based on the
example of Wifi in infrastructure mode, adding the ndn modules developed by
your team and I get the following errors after compilation.</span></p>

<p class="MsoNormal"><span lang="ES"> </span></p>

<p class="MsoNormal"><span lang="ES">I would also like to ask you if it is possible
to run simulation of LTE based on NDN. I ask you this because I also have been
running some scripts including both technologies but it gives me errors
associated with the ndn module, saying that ndnHelpers cannot we recognized. </span></p>

<p class="MsoNormal"><span lang="ES"> </span></p>

<p class="MsoNormal"><span>I appreciate all the
help and hints you could provide me in order to fix this issues. </span></p>

<p class="MsoNormal"><span> </span></p>

<p class="MsoNormal"><span>Best regards. </span></p><p style="margin-bottom:0in">----------------------------------------------------------------------------------------------------------------------------------------------------------------<br></p><p style="margin-bottom:0in">[1914/2070] cxx:
scratch/wifi-simple-infra.cc ->
build/scratch/wifi-simple-infra.cc.17.o
</p>
<p style="margin-bottom:0in">../scratch/wifi-simple-infra-v2.cc: In
function ‘int ns3::main(int, char**)’:
</p>
<p style="margin-bottom:0in">../scratch/wifi-simple-infra-v2.cc:215:41:
error: overloaded function with no contextual type information
</p>
<p style="margin-bottom:0in">../scratch/wifi-simple-infra-v2.cc:215:41:
error: base operand of ‘->’ is not a pointer
</p>
<p style="margin-bottom:0in">../scratch/wifi-simple-infra-v2.cc: At
global scope:
</p>
<p style="margin-bottom:0in">../scratch/wifi-simple-infra-v2.cc:224:1:
error: expected ‘}’ at end of input
</p>
<p style="margin-bottom:0in">Waf: Leaving directory
`/root/ndnSIM/ns-3/build'
</p>
<p style="margin-bottom:0in">Build failed
</p>
<p style="margin-bottom:0in"> -> task in 'wifi-simple-infra-v2'
failed (exit status 1): 
</p>
<p style="margin-bottom:0in">   {task 170263564: cxx
wifi-simple-infra-v2.cc -> wifi-simple-infra-v2.cc.8.o}
</p>
<p style="margin-bottom:0in">['/usr/bin/g++', '-std=c++0x', '-O0',
'-ggdb', '-g3', '-Wall', '-Wno-error=deprecated-declarations',
'-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-fPIC',
'-fno-strict-aliasing', '-fwrapv', '-fstack-protector',
'-fno-strict-aliasing', '-I.', '-I..', '-Isrc/ndnSIM',
'-I../src/ndnSIM', '-Isrc/ndnSIM/NFD', '-I../src/ndnSIM/NFD',
'-Isrc/ndnSIM/NFD/daemon', '-I../src/ndnSIM/NFD/daemon',
'-Isrc/ndnSIM/NFD/core', '-I../src/ndnSIM/NFD/core',
'-I/usr/local/include', '-I/usr/include', '-I/usr/include/python2.7',
'-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1',
'-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_PACKET_H=1',
'-DHAVE_NDN_CXX=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1',
'-DNDEBUG', '../scratch/wifi-simple-infra-v2.cc', '-c', '-o',
'scratch/wifi-simple-infra-v2.cc.8.o']
</p>
<p style="margin-bottom:0in">root@gonzalezcga-VirtualBox:~/ndnSIM/ns-3#

</p>
<p style="margin-bottom:0in"><br></p><p style="margin-bottom:0in">-------------------------------------------------------------------------------------------------------------------------------------------------------------------<br></p><p style="margin-bottom:0in"><br>
</p>
<p style="margin-bottom:0in">#include "ns3/core-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/network-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/mobility-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/config-store-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/wifi-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/internet-module.h"
</p>
<p style="margin-bottom:0in">#include "ns3/ndnSIM-module.h"
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">#include <iostream>
</p>
<p style="margin-bottom:0in">#include <fstream>
</p>
<p style="margin-bottom:0in">#include <vector>
</p>
<p style="margin-bottom:0in">#include <string>
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">NS_LOG_COMPONENT_DEFINE
("WifiSimpleInfra");
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">using namespace std;
</p>
<p style="margin-bottom:0in">namespace ns3{
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">void ReceivePacket (Ptr<Socket>
socket)
</p>
<p style="margin-bottom:0in">{
</p>
<p style="margin-bottom:0in">  while (socket->Recv ())
</p>
<p style="margin-bottom:0in">    {
</p>
<p style="margin-bottom:0in">      NS_LOG_UNCOND ("Received one
packet!");
</p>
<p style="margin-bottom:0in">    }
</p>
<p style="margin-bottom:0in">}
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">static void GenerateTraffic
(Ptr<Socket> socket, uint32_t pktSize, 
</p>
<p style="margin-bottom:0in">                             uint32_t
pktCount, Time pktInterval )
</p>
<p style="margin-bottom:0in">{
</p>
<p style="margin-bottom:0in">  if (pktCount > 0)
</p>
<p style="margin-bottom:0in">    {
</p>
<p style="margin-bottom:0in">      socket->Send (Create<Packet>
(pktSize));
</p>
<p style="margin-bottom:0in">      Simulator::Schedule (pktInterval,
&GenerateTraffic, 
</p>
<p style="margin-bottom:0in">                           socket,
pktSize,pktCount-1, pktInterval);
</p>
<p style="margin-bottom:0in">    }
</p>
<p style="margin-bottom:0in">  else
</p>
<p style="margin-bottom:0in">    {
</p>
<p style="margin-bottom:0in">      socket->Close ();
</p>
<p style="margin-bottom:0in">    }
</p>
<p style="margin-bottom:0in">}
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">int main (int argc, char *argv[])
</p>
<p style="margin-bottom:0in">{
</p>
<p style="margin-bottom:0in">  std::string phyMode
("DsssRate1Mbps");
</p>
<p style="margin-bottom:0in">  double rss = -80;  // -dBm
</p>
<p style="margin-bottom:0in">  uint32_t packetSize = 1000; // bytes
</p>
<p style="margin-bottom:0in">  uint32_t numPackets = 1;
</p>
<p style="margin-bottom:0in">  double interval = 1.0; // seconds
</p>
<p style="margin-bottom:0in">  bool verbose = false;
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  CommandLine cmd;
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("phyMode",
"Wifi Phy mode", phyMode);
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("rss",
"received signal strength", rss);
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("packetSize",
"size of application packet sent", packetSize);
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("numPackets",
"number of packets generated", numPackets);
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("interval",
"interval (seconds) between packets", interval);
</p>
<p style="margin-bottom:0in">  cmd.AddValue ("verbose",
"turn on all WifiNetDevice log components", verbose);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  cmd.Parse (argc, argv);
</p>
<p style="margin-bottom:0in">  // Convert to time object
</p>
<p style="margin-bottom:0in">  Time interPacketInterval = Seconds
(interval);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // disable fragmentation for frames
below 2200 bytes
</p>
<p style="margin-bottom:0in">  Config::SetDefault
("ns3::WifiRemoteStationManager::FragmentationThreshold",
StringValue ("2200"));
</p>
<p style="margin-bottom:0in">  // turn off RTS/CTS for frames below
2200 bytes
</p>
<p style="margin-bottom:0in">  Config::SetDefault
("ns3::WifiRemoteStationManager::RtsCtsThreshold",
StringValue ("2200"));
</p>
<p style="margin-bottom:0in">  // Fix non-unicast data rate to be
the same as that of unicast
</p>
<p style="margin-bottom:0in">  Config::SetDefault
("ns3::WifiRemoteStationManager::NonUnicastMode", 
</p>
<p style="margin-bottom:0in">                      StringValue
(phyMode));
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  NodeContainer c;
</p>
<p style="margin-bottom:0in">  c.Create (2);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // The below set of helpers will help
us to put together the wifi NICs we want
</p>
<p style="margin-bottom:0in">  WifiHelper wifi;
</p>
<p style="margin-bottom:0in">  if (verbose)
</p>
<p style="margin-bottom:0in">    {
</p>
<p style="margin-bottom:0in">      wifi.EnableLogComponents ();  //
Turn on all Wifi logging
</p>
<p style="margin-bottom:0in">    }
</p>
<p style="margin-bottom:0in">  wifi.SetStandard
(WIFI_PHY_STANDARD_80211b);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  YansWifiPhyHelper wifiPhy = 
YansWifiPhyHelper::Default ();
</p>
<p style="margin-bottom:0in">  // This is one parameter that matters
when using FixedRssLossModel
</p>
<p style="margin-bottom:0in">  // set it to zero; otherwise, gain
will be added
</p>
<p style="margin-bottom:0in">  wifiPhy.Set ("RxGain",
DoubleValue (0) ); 
</p>
<p style="margin-bottom:0in">  // ns-3 supports RadioTap and Prism
tracing extensions for 802.11b
</p>
<p style="margin-bottom:0in">  wifiPhy.SetPcapDataLinkType
(YansWifiPhyHelper::DLT_IEEE802_11_RADIO); 
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  YansWifiChannelHelper wifiChannel;
</p>
<p style="margin-bottom:0in">  wifiChannel.SetPropagationDelay
("ns3::ConstantSpeedPropagationDelayModel");
</p>
<p style="margin-bottom:0in">  // The below FixedRssLossModel will
cause the rss to be fixed regardless
</p>
<p style="margin-bottom:0in">  // of the distance between the two
stations, and the transmit power
</p>
<p style="margin-bottom:0in">  wifiChannel.AddPropagationLoss
("ns3::FixedRssLossModel","Rss",DoubleValue
(rss));
</p>
<p style="margin-bottom:0in">  wifiPhy.SetChannel
(wifiChannel.Create ());
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // Add a non-QoS upper mac, and
disable rate control
</p>
<p style="margin-bottom:0in">  NqosWifiMacHelper wifiMac =
NqosWifiMacHelper::Default ();
</p>
<p style="margin-bottom:0in">  wifi.SetRemoteStationManager
("ns3::ConstantRateWifiManager",
</p>
<p style="margin-bottom:0in">                               
"DataMode",StringValue (phyMode),
</p>
<p style="margin-bottom:0in">                               
"ControlMode",StringValue (phyMode));
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // Setup the rest of the upper mac
</p>
<p style="margin-bottom:0in">  Ssid ssid = Ssid ("wifi-default");
</p>
<p style="margin-bottom:0in">  // setup sta.
</p>
<p style="margin-bottom:0in">  wifiMac.SetType ("ns3::StaWifiMac",
</p>
<p style="margin-bottom:0in">                   "Ssid",
SsidValue (ssid),
</p>
<p style="margin-bottom:0in">                   "ActiveProbing",
BooleanValue (false));
</p>
<p style="margin-bottom:0in">  NetDeviceContainer staDevice =
wifi.Install (wifiPhy, wifiMac, c.Get (0));
</p>
<p style="margin-bottom:0in">  NetDeviceContainer devices =
staDevice;
</p>
<p style="margin-bottom:0in">  // setup ap.
</p>
<p style="margin-bottom:0in">  wifiMac.SetType ("ns3::ApWifiMac",
</p>
<p style="margin-bottom:0in">                   "Ssid",
SsidValue (ssid));
</p>
<p style="margin-bottom:0in">  NetDeviceContainer apDevice =
wifi.Install (wifiPhy, wifiMac, c.Get (1));
</p>
<p style="margin-bottom:0in">  devices.Add (apDevice);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // Note that with FixedRssLossModel,
the positions below are not 
</p>
<p style="margin-bottom:0in">  // used for received signal strength.

</p>
<p style="margin-bottom:0in">  MobilityHelper mobility;
</p>
<p style="margin-bottom:0in">  Ptr<ListPositionAllocator>
positionAlloc = CreateObject<ListPositionAllocator> ();
</p>
<p style="margin-bottom:0in">  positionAlloc->Add (Vector (0.0,
0.0, 0.0));
</p>
<p style="margin-bottom:0in">  positionAlloc->Add (Vector (5.0,
0.0, 0.0));
</p>
<p style="margin-bottom:0in">  mobility.SetPositionAllocator
(positionAlloc);
</p>
<p style="margin-bottom:0in">  mobility.SetMobilityModel
("ns3::ConstantPositionMobilityModel");
</p>
<p style="margin-bottom:0in">  mobility.Install (c);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  <b>// 3. Install NDN stack
</b></p>
<p style="margin-bottom:0in">  <b>NS_LOG_INFO("Installing NDN
stack");
</b></p>
<p style="margin-bottom:0in">  <b>ndn::StackHelper ndnHelper;
</b></p>
<p style="margin-bottom:0in"> 
<b>ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru",
"MaxSize", "1000");
</b></p>
<p style="margin-bottom:0in">  <b>ndnHelper.SetDefaultRoutes(true);
</b></p>
<p style="margin-bottom:0in">  <b>ndnHelper.Install(c);
</b></p>
<p style="margin-bottom:0in"><b>
</b></p>
<p style="margin-bottom:0in">  <b>// Set BestRoute strategy
</b></p>
<p style="margin-bottom:0in">  <b>ndn::StrategyChoiceHelper::Install(c,
"/", "/localhost/nfd/strategy/best-route");
</b></p>
<p style="margin-bottom:0in"><b>
</b></p>
<p style="margin-bottom:0in">  <b>// 4. Set up applications
</b></p>
<p style="margin-bottom:0in">  <b>NS_LOG_INFO("Installing
Applications");
</b></p>
<p style="margin-bottom:0in"><b>
</b></p>
<p style="margin-bottom:0in">  <b>ndn::AppHelper
consumerHelper("ns3::ndn::ConsumerCbr");
</b></p>
<p style="margin-bottom:0in"> 
<b>consumerHelper.SetPrefix("/test/prefix");
</b></p>
<p style="margin-bottom:0in"> 
<b>consumerHelper.SetAttribute("Frequency",
DoubleValue(10.0));
</b></p>
<p style="margin-bottom:0in">  <b>consumerHelper.Install(c.Get(0));
</b></p>
<p style="margin-bottom:0in"><b>
</b></p>
<p style="margin-bottom:0in">  <b>ndn::AppHelper
producerHelper("ns3::ndn::Producer");
</b></p>
<p style="margin-bottom:0in">  <b>producerHelper.SetPrefix("/");
</b></p>
<p style="margin-bottom:0in"> 
<b>producerHelper.SetAttribute("PayloadSize",
StringValue("1200"));
</b></p>
<p style="margin-bottom:0in">  <b>producerHelper.Install(c.Get(1));
</b></p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // Tracing
</p>
<p style="margin-bottom:0in">  wifiPhy.EnablePcap
("wifi-simple-infra", devices);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  // Output what we are doing
</p>
<p style="margin-bottom:0in">  NS_LOG_UNCOND ("Testing "
<< numPackets  << " packets sent with receiver rss "
<< rss );
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  Simulator::ScheduleWithContext
(source->GetNode ()->GetId (),
</p>
<p style="margin-bottom:0in">                                 
Seconds (1.0), &GenerateTraffic, 
</p>
<p style="margin-bottom:0in">                                 
source, packetSize, numPackets, interPacketInterval);
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  Simulator::Stop (Seconds (30.0));
</p>
<p style="margin-bottom:0in">  Simulator::Run ();
</p>
<p style="margin-bottom:0in">  Simulator::Destroy ();
</p>
<p style="margin-bottom:0in">
</p>
<p style="margin-bottom:0in">  return 0;
</p>
<p style="margin-bottom:0in">}</p>

</div>