[ndnSIM] ndnSIM help
Renato Cavalcante
renato.frca at gmail.com
Wed Jan 17 14:20:53 PST 2018
Hi,
Please forward your emails to the list, so that they are visible to all the
subscribers and other can help you too.
Change:
Simulator::Stop(*s*econds(20.0));
to
Simulator::Stop(*S*econds(20.0));
2018-01-17 19:14 GMT-03:00 EL-BAKKOUCHI Asmaa <aelbakkouchi at gmail.com>:
> i got this message:
> hope you can help me
>
>
> 2018-01-17 22:08 GMT+00:00 EL-BAKKOUCHI Asmaa <aelbakkouchi at gmail.com>:
>
>> Hi,
>>
>> Thank you for your answer
>>
>> it's in scratch folder but with .cpp I'm going to change it now and see
>> what it's going to give.
>>
>> 2018-01-17 22:05 GMT+00:00 Renato Cavalcante <renato.frca at gmail.com>:
>>
>>> Hi,
>>>
>>> look if your program is in scratch folder and it is named with the
>>> extension .cc rather than .cpp.
>>>
>>> Programs in scratch folder need of the extension .cc
>>>
>>> I hope it helps.
>>>
>>> 2018-01-17 16:37 GMT-03:00 EL-BAKKOUCHI Asmaa <aelbakkouchi at gmail.com>:
>>>
>>>> Hi everyone,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> It’s my first time using ndnSIM and i tried to create this topology :
>>>>
>>>> But that’s not work, Could you tell me what’s wrong in my code
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> # /----\
>>>>
>>>> # +=>|Rtr2 |<=+
>>>>
>>>> # / \----/ \
>>>>
>>>> # / \
>>>>
>>>> # / \
>>>>
>>>> # /---\ /----\<=+ +=>/----\ /---\
>>>>
>>>> # |Src1 |<------->|Rtr1 | |Rtr4 |<------->|Dst1 |
>>>>
>>>> # \---/ \----/<=+ +=>\----/ \---/
>>>>
>>>> # \ /
>>>>
>>>> # \ /
>>>>
>>>> # \ /----\ /
>>>>
>>>> # +=>|Rtr3 |<=+
>>>>
>>>> # \----/
>>>>
>>>>
>>>>
>>>> I create asmaa.example.txt
>>>>
>>>> in src/ndnSIM/examples/topologies/asmaa-example.txt
>>>>
>>>>
>>>>
>>>> # asmaa-example.txt
>>>>
>>>> router
>>>>
>>>> # node comment yPos xPos
>>>> Src1 NA 2 1
>>>> Rtr1 NA 2 3
>>>> Rtr2 NA 2 4
>>>> Rtr3 NA 1 4
>>>> Rtr4 NA 2 5
>>>> Dst1 NA 2 7
>>>>
>>>> link
>>>>
>>>> # srcNode dstNode bandwidth metric delay queue
>>>> Src1 Rtr1 10Mbps 1 10ms 20
>>>> Rtr1 Rtr3 1Mbps 1 10ms 20
>>>> Rtr1 Rtr2 1Mbps 1 10ms 20
>>>> Rtr2 Rtr4 1Mbps 1 10ms 20
>>>> Rtr3 Rtr4 1Mbps 1 10ms 20
>>>> Rtr4 Dst1 10Mbps 1 10ms 20
>>>>
>>>>
>>>>
>>>> Ans the code in scratch folder. This is my code :
>>>>
>>>>
>>>>
>>>> #include "ns3/core-module.h"
>>>>
>>>> #include "ns3/network-module.h"
>>>>
>>>> #include "ns3/ndnSIM-module.h"
>>>>
>>>>
>>>>
>>>> namespace ns3{
>>>>
>>>>
>>>>
>>>> int
>>>>
>>>> main(int argc, char* argv[])
>>>>
>>>> {
>>>>
>>>> CommandLine cmd;
>>>>
>>>> cmd.Parse(argc, argv);
>>>>
>>>>
>>>>
>>>> AnnotatedTopologyReader topologyReader(" ", 25);
>>>>
>>>> topologyReader.SetFileName("src/ndnSIM/examples/topologies/a
>>>> smaa-example.txt");
>>>>
>>>> topologyReader.Read();
>>>>
>>>>
>>>>
>>>> //install NDN stack on all nodes
>>>>
>>>> ndn::StackHelper ndnHelper;
>>>>
>>>> ndnHelper.InstallAll();
>>>>
>>>> ndnHelper.SetDefaultRoutes (false);
>>>>
>>>>
>>>>
>>>> // Set BestRoute strategy
>>>>
>>>> ndn::StrategyChoiceHelper::InstallAll("/","/localhost/nfd/st
>>>> rategy/best-route");
>>>>
>>>>
>>>>
>>>> //Installing global routing interface on all nodes
>>>>
>>>> ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
>>>>
>>>> ndnGlobalRoutingHelper.InstallAll();
>>>>
>>>>
>>>>
>>>> //Getting containers for the consumer/producer
>>>>
>>>> Ptr<Node> producer = Names::Find<Node>("Dst1");
>>>>
>>>> NodeContainer consumerNode;
>>>>
>>>> consumerNode.Add(Names::Find<Node>("Src1");
>>>>
>>>>
>>>>
>>>> //Install NDN applications
>>>>
>>>> std::string prefix = "/prefix";
>>>>
>>>> ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
>>>>
>>>> consumerHelper.SetPrefix(prefix);
>>>>
>>>> consumerHelper.SetAttribute("Frequency", StringValue("100"));
>>>>
>>>> consumerHelper.Install(consumerNode);
>>>>
>>>>
>>>>
>>>> ndn::AppHelper producerHelper("ns3::ndn::Producer");
>>>>
>>>> producerHelper.SetPrefix(prefix);
>>>>
>>>> producerHelper.SetAttribute("PayloadSize", StringValue("1024");
>>>>
>>>> producerHelper.Install(producer);
>>>>
>>>>
>>>>
>>>> //Add /prefix origins to ndn::GlobalRouter
>>>>
>>>> ndnGlobalRoutingHelper.AddOrigins(prefix, producer);
>>>>
>>>>
>>>>
>>>> //calculate and install FIBs
>>>>
>>>> ndn::GlobalRoutingHelper::CalculateRoutes();
>>>>
>>>>
>>>>
>>>> Simulator::Stop(seconds(20.0));
>>>>
>>>>
>>>>
>>>> Simulator::Run();
>>>>
>>>> Simulator::Destroy();
>>>>
>>>>
>>>>
>>>> return 0;
>>>>
>>>> }
>>>>
>>>> } //namespace ns3
>>>>
>>>>
>>>>
>>>> int
>>>>
>>>> main(int argc, char* argv[])
>>>>
>>>> {
>>>>
>>>> return ns3::main(argc, argv);
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I used this command for simulation :
>>>>
>>>> ./waf –run ndn-example
>>>>
>>>> But that’s not work and i tried with :
>>>>
>>>> NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-example
>>>>
>>>>
>>>>
>>>> It’s give me as message :
>>>>
>>>>
>>>>
>>>> Program ‘ndn-example ‘ not found ; available program are …..
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Thank you
>>>>
>>>>
>>>>
>>>> Kind Regards,
>>>> Asmaa
>>>>
>>>> _______________________________________________
>>>> ndnSIM mailing list
>>>> ndnSIM at lists.cs.ucla.edu
>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>>
>>>>
>>>
>>>
>>> --
>>> Renato Araújo
>>> Computer Science Department
>>> UFBA -- Brazil
>>>
>>>
>>>
>>
>
--
Renato Araújo
Computer Science Department
UFBA -- Brazil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180117/72fb705a/attachment-0001.html>
More information about the ndnSIM
mailing list