[ndnSIM] Simulation error with NDN over Wireless

Spyridon (Spyros) Mastorakis spiros.mastorakis at gmail.com
Sun Jun 21 09:20:53 PDT 2015


Hi Gustavo,

please when you want us to review some code, include the source file as an attachment. 

When you mentioned bug #1273, do you refer to NS3?

Thank you.

--
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
PhD Computer Science
UCLA


> On Jun 20, 2015, at 5:20 PM, Gustavo Gonzalez <gonzalezcga at gmail.com> wrote:
> 
> Hello, 
> 
> I am having a problem when I run a simulation of two wired nodes and an access point with two nodes attached. The simulation is based on ndn but when I try to check the transmitted and received packets in the python interface in the access point node and in the other two wired ones the simulation stops suddenly. The error is described below. 
> 
> I have checked and it seems to be a bug (bug#1273).
> 
> I would really appreciate your help to try to solve this issue.
> 
> Regards. 
> 
> ----------------------------
> 
> ERROR: 
> 
> Waf: Entering directory `/root/ndnSIM/ns-3/build'
> Waf: Leaving directory `/root/ndnSIM/ns-3/build'
> 'build' finished successfully (0.892s)
> 
> ** (python:10730): WARNING **: The connection is closed
> Could not load icon applets-screenshooter due to missing gnomedesktop Python module
> Could not load icon gnome-terminal due to missing gnomedesktop Python module
> scanning topology: [0, 5) nodes...
> No OLSR
> 
> ** (python:10730): WARNING **: Unable to create Ubuntu Menu Proxy: The connection is closed
> No OLSR
> No OLSR
> terminate called after throwing an instance of 'ndn::tlv::Error'
>   what():  Empty buffer during TLV processing
> Command ['/root/ndnSIM/ns-3/build/scratch/sim05_1', '--SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
> 
> ----------------------------
> 
> CODE:
> 
> #include "ns3/core-module.h"
> #include "ns3/point-to-point-module.h"
> #include "ns3/csma-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/netanim-module.h"
> #include "ns3/basic-energy-source.h"
> #include "ns3/simple-device-energy-model.h"
> #include "ns3/ndnSIM-module.h"
> 
> using namespace std;
> 
> namespace ns3 {
> 
> int main (int argc, char *argv[]) {
> 
> Config::SetDefault("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue("2200"));
> Config::SetDefault("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue("2200"));
> Config::SetDefault("ns3::WifiRemoteStationManager::NonUnicastMode", StringValue("OfdmRate24Mbps"));
> 
> uint32_t nWifi = 2;
> CommandLine cmd;
> cmd.AddValue ("nWifi", "Number of wifi devices", nWifi);
> 
> cmd.Parse (argc, argv);
> NodeContainer allNodes;
> NodeContainer wifiStaNodes;
> wifiStaNodes.Create (nWifi);
> allNodes.Add (wifiStaNodes);
> NodeContainer wifiApNode;
> wifiApNode.Create (1);
> allNodes.Add (wifiApNode);
> 
> 
> YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
> YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
> phy.SetChannel (channel.Create());
> 
>   WifiHelper wifi = WifiHelper::Default ();
>   wifi.SetRemoteStationManager ("ns3::AarfWifiManager");
> 
> NqosWifiMacHelper mac = NqosWifiMacHelper::Default ();
> 
> Ssid ssid = Ssid ("ns-3-ssid");
> mac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid), "ActiveProbing", BooleanValue (false));
> 
> NetDeviceContainer staDevices;
> staDevices = wifi.Install (phy, mac, wifiStaNodes);
> mac.SetType ("ns3::ApWifiMac", "Ssid", SsidValue (ssid));
> 
> NetDeviceContainer apDevices;
> apDevices = wifi.Install (phy, mac, wifiApNode);
> 
>   NodeContainer p2pNodes;
>   p2pNodes.Add (wifiApNode);
>   p2pNodes.Create (1);
>   allNodes.Add (p2pNodes.Get (1));
> 
>   PointToPointHelper pointToPoint;
>   pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
>   pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
> 
>   NetDeviceContainer p2pDevices;
>   p2pDevices = pointToPoint.Install (p2pNodes);
> 
>   NodeContainer csmaNodes;
>   csmaNodes.Add (p2pNodes.Get (1));
>   csmaNodes.Create (1);
>   allNodes.Add (csmaNodes.Get (1));
> 
>   CsmaHelper csma;
>   csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
>   csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
> 
>   NetDeviceContainer csmaDevices;
>   csmaDevices = csma.Install (csmaNodes);
> 
> 
> MobilityHelper mobility;
> mobility.SetPositionAllocator ("ns3::GridPositionAllocator", 
>                 "MinX", DoubleValue (20.0),
>                 "MinY", DoubleValue (20.0),
>                 "DeltaX", DoubleValue (10.0),
>                 "DeltaY", DoubleValue (10.0),
>                 "GridWidth", UintegerValue (10),
>                 "LayoutType", StringValue ("RowFirst"));
> mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", "Bounds", RectangleValue (RectangleValue (Rectangle (-50, 50, -25, 50))));
> mobility.Install (wifiStaNodes);
> mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
> mobility.Install (wifiApNode);
> AnimationInterface::SetConstantPosition (wifiApNode.Get (1), 10, 10);
> AnimationInterface::SetConstantPosition (p2pNodes.Get (1), 10, 30);
> AnimationInterface::SetConstantPosition (csmaNodes.Get (1), 10, 50);
> 
> ndn::StackHelper ndnHelper;
>   ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "500");
>   ndnHelper.SetDefaultRoutes(true);
>   ndnHelper.InstallAll();
> 
> // Choosing forwarding strategy
>   ndn::StrategyChoiceHelper::Install(wifiStaNodes, "/localhost/nfd", "/localhost/nfd/strategy/best-route"); //
>   ndn::StrategyChoiceHelper::Install(wifiApNode, "/localhost", "/localhost/nfd/strategy/broadcast"); //
>   ndn::StrategyChoiceHelper::Install(csmaNodes, "/localhost", "/localhost/nfd/strategy/broadcast"); //
>   ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
>   ndnGlobalRoutingHelper.Install(wifiStaNodes);
>   ndnGlobalRoutingHelper.Install(wifiApNode);
>   ndnGlobalRoutingHelper.Install(csmaNodes);
> 
> 
>   // 4. Set up applications
> 
>   ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
>   consumerHelper.SetPrefix("/test/prefix");
>   consumerHelper.SetAttribute("Frequency", DoubleValue(1.0));
>   consumerHelper.Install(wifiStaNodes.Get(0));
> 
>  /* ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerCbr");
>   consumerHelper2.SetPrefix("/test/prefix");
>   consumerHelper2.SetAttribute("Frequency", DoubleValue(5.0));
>   consumerHelper2.Install(wifiStaNodes.Get(1));*/
> 
>   ndn::AppHelper producerHelper("ns3::ndn::Producer");
>   producerHelper.SetPrefix("/");
>   producerHelper.SetAttribute("PayloadSize", StringValue("700"));
>   producerHelper.Install(csmaNodes.Get(1));
> 
>   ndn::GlobalRoutingHelper::CalculateRoutes();
> 
>  Simulator::Stop (Seconds (10.0));
> 
>   Simulator::Run ();
>   Simulator::Destroy ();
>   return 0;
> }
> 
> }
> 
> int
> main(int argc, char* argv[])
> {
>   return ns3::main(argc, argv);
> }
> 







More information about the ndnSIM mailing list