[ndnSIM] Help

Asmaa ELBAKKOUCHI aelbakkouchi at gmail.com
Wed Jan 17 11:35:37 PST 2018


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/asmaa-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/strategy/best-rout
e");

 

//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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180117/11144a7a/attachment-0001.html>


More information about the ndnSIM mailing list