ndnsim tutorial. about ndnsim ns-3 based named data networking (ndn) simulator current version 2.0...

49
ndnSIM Tutorial

Upload: bernice-singleton

Post on 26-Dec-2015

243 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndnSIM Tutorial

Page 2: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

About ndnSIM

ns-3 based Named Data Networking (NDN) simulator

Current version 2.0 Web, http://ndnsim.net

Page 3: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Index

Getting started ndnSIM helpers Examples Metrics

Page 4: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Getting Started

Preferred OS Ubuntu Linux 14.04 Only describe the steps on Ubuntu 14.04 Visit http://ndnsim.net/ for more

Install dependencies

Page 5: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Download ndnSIM source

Download ndn-cxx Download ns3 and add ndnSIM into it May take hours to download, depending

on the github server

Page 6: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Compile ndn-cxx

Compile ns-3

Enable the examples (under ./src/ndnSIM/examples/)

The g++ compiler may crash several times, retry with './waf'

Page 7: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Index

Getting started ndnSIM helpers Examples Metrics

Page 8: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndmSim helpers NDN stack helper

Routing: where Interest can be forwarded Manual routes

Page 9: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Automatic shortest path routes install NDN interfaces on nodes

specify which node exports which prefix

calculate and install FIBs on every node

Page 10: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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

Page 11: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Link Control helper Allows scheduling of link failures and

failure recoveries

Page 12: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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:

Page 13: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Index

Getting started ndnSIM helpers Examples Metrics

Page 14: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-simple.cpp

Page 15: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Consumer is simulated using ConsumerCbr reference application and generates Interests towards the producer with frequency of 10 Interests per second

Page 16: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Producer is simulated using Producer class, which is used to satisfy all incoming Interests with virtual payload data (1024 bytes).

Page 17: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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

Page 18: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-grid-topo-plugin.cpp

A 3 × 3 grid topology

Use AnnotatedTopologyReader to load topology file

Page 19: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

topo-grid-3x3.txt

Page 20: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndn-grid-topo-plugin.cpp

Page 21: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 22: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

$ ./waf --run=ndn-grid-topo-plugin --vis

Page 23: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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

Page 24: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndn-different-strategy-per-prefix.cpp

Page 25: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 26: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 27: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

$ ./waf --run=ndn-different-strategy-per-prefix --vis

Page 28: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-load-balancer.cpp

A load balancer topology

Page 29: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

topo-load-balancer.txt

Page 30: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndn-load-balancer.cpp

Page 31: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 32: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

./waf --run=ndn-load-balancer --vis

Page 33: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-simple-with-link-failure.cpp

Page 34: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 35: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 36: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Index

Getting started ndnSIM helpers Examples Metrics

Page 37: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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

Page 38: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

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

Page 39: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-tree-tracers.cpp topo-tree.txt

Page 40: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

ndn-tree-tracers.cpp

Page 41: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 42: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

./waf --run=ndn-tree-tracers Create "rate-trace.txt", analyze

Page 43: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

Example: ndn-tree-tracers.cpp topo-tree-25-node.txt

Page 44: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 45: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 46: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 47: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 48: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net
Page 49: NdnSIM Tutorial. About ndnSIM  ns-3 based Named Data Networking (NDN) simulator  Current version 2.0  Web, ://ndnsim.net

./waf --run=ndn-tree-with-l2tracer --vis