[ndnSIM] No packet transmission on ndn-simple-wifi.cc for multiple consumers

SUBODH MISHRA 1911602 at iiitdmj.ac.in
Wed Jun 1 10:35:09 PDT 2022


Dear all
I am running the ndn-simple-wifi.cc example with 10 nodes with nodes.Get(0)
as producer and from nodes.Get(1) to nodes.Get(9) as consumers. The problem
is that no packet transmission is seen at the python visualizer. The code
is as follows:-

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/wifi-module.h"
#include "ns3/mobility-module.h"
#include "ns3/internet-module.h"

#include "ns3/ndnSIM-module.h"

using namespace std;
namespace ns3 {

NS_LOG_COMPONENT_DEFINE("ndn.WifiExample");


int
main(int argc, char* argv[])
{
ns3::PacketMetadata::Enable ();


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

  CommandLine cmd;
  cmd.Parse(argc, argv);


  WifiHelper wifi;
  wifi.SetStandard(WIFI_PHY_STANDARD_80211a);
  wifi.SetRemoteStationManager("ns3::ConstantRateWifiManager", "DataMode",
                               StringValue("OfdmRate24Mbps"));

  YansWifiChannelHelper wifiChannel; // = YansWifiChannelHelper::Default ();
  wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayMode");

wifiChannel.AddPropagationLoss("ns3::ThreeLogDistancePropagationLossModel");
  wifiChannel.AddPropagationLoss("ns3::NakagamiPropagationLossModel");
 YansWifiPhyHelper wifiPhyHelper = YansWifiPhyHelper::Default();
  wifiPhyHelper.SetChannel(wifiChannel.Create());
  wifiPhyHelper.Set("TxPowerStart", DoubleValue(0.01));
  wifiPhyHelper.Set("TxPowerEnd", DoubleValue(0.01));

  WifiMacHelper wifiMacHelper;
  wifiMacHelper.SetType("ns3::AdhocWifiMac");

  Ptr<UniformRandomVariable> randomizer =
CreateObject<UniformRandomVariable>();
  randomizer->SetAttribute("Min", DoubleValue(10));
  randomizer->SetAttribute("Max", DoubleValue(100));

  MobilityHelper mobility;
 mobility.SetPositionAllocator("ns3::RandomBoxPositionAllocator", "X",
PointerValue(randomizer), "Y", PointerValue(randomizer), "Z",
PointerValue(randomizer));

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

  NodeContainer nodes;
  nodes.Create(10);


  NetDeviceContainer wifiNetDevices = wifi.Install(wifiPhyHelper,
wifiMacHelper, nodes);

   mobility.Install(nodes);
  NS_LOG_INFO("Installing NDN stack");
  ndn::StackHelper ndnHelper;
  ndnHelper.setPolicy("nfd::cs::lru");
  ndnHelper.setCsSize(1000);
  ndnHelper.SetDefaultRoutes(true);
  ndnHelper.Install(nodes);

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

    NS_LOG_INFO("Installing Applications");

  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
  consumerHelper.SetPrefix("/test/prefix");
  consumerHelper.SetAttribute("Frequency", DoubleValue(10.0));
  consumerHelper.Install(nodes.Get(0));
  consumerHelper.Install(nodes.Get(1));
  consumerHelper.Install(nodes.Get(2));
  consumerHelper.Install(nodes.Get(3));
  consumerHelper.Install(nodes.Get(4));
  consumerHelper.Install(nodes.Get(5));
  consumerHelper.Install(nodes.Get(6));
  consumerHelper.Install(nodes.Get(7));
  consumerHelper.Install(nodes.Get(8));
  consumerHelper.Install(nodes.Get(9));

  ndn::AppHelper producerHelper("ns3::ndn::Producer");
  producerHelper.SetPrefix("/");
  producerHelper.SetAttribute("PayloadSize", StringValue("1200"));
  producerHelper.Install(nodes.Get(1));
  Simulator::Stop(Seconds(30.0));
  Simulator::Run();
  Simulator::Destroy();

  return 0;
}

}

int
main(int argc, char* argv[])
{
  return ns3::main(argc, argv);
}

Please help me to identify the real cause why the packets are not
transmitted. Thanks in advance
-- 
Thanks & Regards
Subodh Mishra

Research Scholar (Ph.D),
Department of Computer Science and Engineering,
PDPM-Indian Institute of Information Technology,
Design and Manufacturing, Jabalpur

Email: 1911602 [at] iiitdmj [dot] ac [dot] in ,
           subodhkmishra [at] gmail [dot] com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20220601/e3cd450e/attachment.html>


More information about the ndnSIM mailing list