ndnSIM Tutorial
About ndnSIM ns-3 based Named Data Networking (NDN) simulator Current version 2.0 Web, http://ndnsim.net
Index Getting started ndnSIM helpers Examples Metrics
Getting Started Preferred OS Install dependencies Ubuntu Linux 14.04 Only describe the steps on Ubuntu 14.04 Visit http://ndnsim.net/ for more Install dependencies
Download ndnSIM source Download ndn-cxx Download ns3 and add ndnSIM into it May take hours to download, depending on the github server
Compile ndn-cxx Compile ns-3 Enable the examples (under ./src/ndnSIM/examples/) The g++ compiler may crash several times, retry with './waf'
Index Getting started ndnSIM helpers Examples Metrics
ndmSim helpers NDN stack helper Routing: where Interest can be forwarded Manual routes
Automatic shortest path routes install NDN interfaces on nodes specify which node exports which prefix calculate and install FIBs on every node
Forwarding strategy Specify the desired per-name prefix forwarding strategy for one, more or all the nodes of a topology. Strategy name /localhost/nfd/strategy/best-route /localhost/nfd/strategy/broadcast Install on one node Install on all nodes
Link Control helper Allows scheduling of link failures and failure recoveries
Application Helper Create helper for specific applications class Assign prefix on which application operates Assign application-specific attributes using AppHelper::SetAttribute(): Install application on one or more nodes:
Index Getting started ndnSIM helpers Examples Metrics
Example: ndn-simple.cpp
Consumer is simulated using ConsumerCbr reference application and generates Interests towards the producer with frequency of 10 Interests per second
Producer is simulated using Producer class, which is used to satisfy all incoming Interests with virtual payload data (1024 bytes).
Run the program Run with log model Run with Python visualizer $ NS_LOG=ndn.Producer:ndn.Consumer ./waf --run=ndn-simple ./waf --run=ndn-simple --vis
Example: ndn-grid-topo-plugin.cpp A 3 × 3 grid topology Use AnnotatedTopologyReader to load topology file
topo-grid-3x3.txt
ndn-grid-topo-plugin.cpp
$ ./waf --run=ndn-grid-topo-plugin --vis
Example: ndn-different-strategy-per-prefix.cpp A grid topology The broadcast strategy to be installed for the name prefix "/prefix1" in all the nodes For the name prefix "/prefix2", the best-route strategy will be installed in all the topology nodes
ndn-different-strategy-per-prefix.cpp
$ ./waf --run=ndn-different-strategy-per-prefix --vis
Example: ndn-load-balancer.cpp A load balancer topology
topo-load-balancer.txt
ndn-load-balancer.cpp
./waf --run=ndn-load-balancer --vis
Example: ndn-simple-with-link-failure.cpp
Index Getting started ndnSIM helpers Examples Metrics
Metrics ndn::L3RateTracer Tracing the rate in bytes and in number of packets of Interest/Data packets forwarded by an NDN node Output file format is tab-separated values Time, Node, FaceId, Type, Packets, Kilobytes, PacketsRaw, KilobytesRaw See http://ndnsim.net/2.0/metric.html for details
L2Tracer traces only packet drop on layer 2 (e.g., due to transmission queue overflow). Output file format is tab-separated values, Time, Node, Interface, Type, Packets, Kilobytes, PacketsRaw, KilobytesRaw See http://ndnsim.net/2.0/metric.html for details
Example: ndn-tree-tracers.cpp topo-tree.txt
ndn-tree-tracers.cpp
./waf --run=ndn-tree-tracers Create "rate-trace.txt", analyze
Example: ndn-tree-tracers.cpp topo-tree-25-node.txt
./waf --run=ndn-tree-with-l2tracer --vis