[ndnSIM] NDN with Wifi in Infrastructure Mode

Gustavo Gonzalez gonzalezcga at gmail.com
Sun Jun 7 11:59:39 PDT 2015


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.



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.



I appreciate all the help and hints you could provide me in order to fix
this issues.



Best regards.

----------------------------------------------------------------------------------------------------------------------------------------------------------------

[1914/2070] cxx: scratch/wifi-simple-infra.cc ->
build/scratch/wifi-simple-infra.cc.17.o

../scratch/wifi-simple-infra-v2.cc: In function ‘int ns3::main(int,
char**)’:

../scratch/wifi-simple-infra-v2.cc:215:41: error: overloaded function with
no contextual type information

../scratch/wifi-simple-infra-v2.cc:215:41: error: base operand of ‘->’ is
not a pointer

../scratch/wifi-simple-infra-v2.cc: At global scope:

../scratch/wifi-simple-infra-v2.cc:224:1: error: expected ‘}’ at end of
input

Waf: Leaving directory `/root/ndnSIM/ns-3/build'

Build failed

-> task in 'wifi-simple-infra-v2' failed (exit status 1):

{task 170263564: cxx wifi-simple-infra-v2.cc ->
wifi-simple-infra-v2.cc.8.o}

['/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']

root at gonzalezcga-VirtualBox:~/ndnSIM/ns-3#


-------------------------------------------------------------------------------------------------------------------------------------------------------------------


 #include "ns3/core-module.h"

#include "ns3/network-module.h"

#include "ns3/mobility-module.h"

#include "ns3/config-store-module.h"

#include "ns3/wifi-module.h"

#include "ns3/internet-module.h"

#include "ns3/ndnSIM-module.h"

 #include <iostream>

#include <fstream>

#include <vector>

#include <string>

 NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");

 using namespace std;

namespace ns3{

  void ReceivePacket (Ptr<Socket> socket)

{

while (socket->Recv ())

{

NS_LOG_UNCOND ("Received one packet!");

}

}

 static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,

uint32_t pktCount, Time pktInterval )

{

if (pktCount > 0)

{

socket->Send (Create<Packet> (pktSize));

Simulator::Schedule (pktInterval, &GenerateTraffic,

socket, pktSize,pktCount-1, pktInterval);

}

else

{

socket->Close ();

}

}

  int main (int argc, char *argv[])

{

std::string phyMode ("DsssRate1Mbps");

double rss = -80; // -dBm

uint32_t packetSize = 1000; // bytes

uint32_t numPackets = 1;

double interval = 1.0; // seconds

bool verbose = false;

 CommandLine cmd;

 cmd.AddValue ("phyMode", "Wifi Phy mode", phyMode);

cmd.AddValue ("rss", "received signal strength", rss);

cmd.AddValue ("packetSize", "size of application packet sent", packetSize);

cmd.AddValue ("numPackets", "number of packets generated", numPackets);

cmd.AddValue ("interval", "interval (seconds) between packets", interval);

cmd.AddValue ("verbose", "turn on all WifiNetDevice log components",
verbose);

 cmd.Parse (argc, argv);

// Convert to time object

Time interPacketInterval = Seconds (interval);

 // disable fragmentation for frames below 2200 bytes

Config::SetDefault
("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue
("2200"));

// turn off RTS/CTS for frames below 2200 bytes

Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold",
StringValue ("2200"));

// Fix non-unicast data rate to be the same as that of unicast

Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",

StringValue (phyMode));

 NodeContainer c;

c.Create (2);

 // The below set of helpers will help us to put together the wifi NICs we
want

WifiHelper wifi;

if (verbose)

{

wifi.EnableLogComponents (); // Turn on all Wifi logging

}

wifi.SetStandard (WIFI_PHY_STANDARD_80211b);

 YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();

// This is one parameter that matters when using FixedRssLossModel

// set it to zero; otherwise, gain will be added

wifiPhy.Set ("RxGain", DoubleValue (0) );

// ns-3 supports RadioTap and Prism tracing extensions for 802.11b

wifiPhy.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11_RADIO);

 YansWifiChannelHelper wifiChannel;

wifiChannel.SetPropagationDelay
("ns3::ConstantSpeedPropagationDelayModel");

// The below FixedRssLossModel will cause the rss to be fixed regardless

// of the distance between the two stations, and the transmit power

wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue
(rss));

wifiPhy.SetChannel (wifiChannel.Create ());

 // Add a non-QoS upper mac, and disable rate control

NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();

wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",

"DataMode",StringValue (phyMode),

"ControlMode",StringValue (phyMode));

 // Setup the rest of the upper mac

Ssid ssid = Ssid ("wifi-default");

// setup sta.

wifiMac.SetType ("ns3::StaWifiMac",

"Ssid", SsidValue (ssid),

"ActiveProbing", BooleanValue (false));

NetDeviceContainer staDevice = wifi.Install (wifiPhy, wifiMac, c.Get (0));

NetDeviceContainer devices = staDevice;

// setup ap.

wifiMac.SetType ("ns3::ApWifiMac",

"Ssid", SsidValue (ssid));

NetDeviceContainer apDevice = wifi.Install (wifiPhy, wifiMac, c.Get (1));

devices.Add (apDevice);

 // Note that with FixedRssLossModel, the positions below are not

// used for received signal strength.

MobilityHelper mobility;

Ptr<ListPositionAllocator> positionAlloc =
CreateObject<ListPositionAllocator> ();

positionAlloc->Add (Vector (0.0, 0.0, 0.0));

positionAlloc->Add (Vector (5.0, 0.0, 0.0));

mobility.SetPositionAllocator (positionAlloc);

mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");

mobility.Install (c);

 *// 3. Install NDN stack *

*NS_LOG_INFO("Installing NDN stack"); *

*ndn::StackHelper ndnHelper; *

*ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000"); *

*ndnHelper.SetDefaultRoutes(true); *

*ndnHelper.Install(c); *

 *// Set BestRoute strategy *

*ndn::StrategyChoiceHelper::Install(c, "/",
"/localhost/nfd/strategy/best-route"); *

 *// 4. Set up applications *

*NS_LOG_INFO("Installing Applications"); *

 *ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr"); *

*consumerHelper.SetPrefix("/test/prefix"); *

*consumerHelper.SetAttribute("Frequency", DoubleValue(10.0)); *

*consumerHelper.Install(c.Get(0)); *

 *ndn::AppHelper producerHelper("ns3::ndn::Producer"); *

*producerHelper.SetPrefix("/"); *

*producerHelper.SetAttribute("PayloadSize", StringValue("1200")); *

*producerHelper.Install(c.Get(1)); *

 // Tracing

wifiPhy.EnablePcap ("wifi-simple-infra", devices);

 // Output what we are doing

NS_LOG_UNCOND ("Testing " << numPackets << " packets sent with receiver rss
" << rss );

 Simulator::ScheduleWithContext (source->GetNode ()->GetId (),

Seconds (1.0), &GenerateTraffic,

source, packetSize, numPackets, interPacketInterval);

 Simulator::Stop (Seconds (30.0));

Simulator::Run ();

Simulator::Destroy ();

 return 0;

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150607/391f45cd/attachment.html>


More information about the ndnSIM mailing list