helper+docs+examples: New helper to simplify link failing
Thanks to Saran Tarnoi for providing base implementation of the code
diff --git a/docs/source/examples.rst b/docs/source/examples.rst
index be27f0b..41142c9 100644
--- a/docs/source/examples.rst
+++ b/docs/source/examples.rst
@@ -6,6 +6,9 @@
.. note::
:red:`!!! This page only shows up examples of how to config topology and perform basic operations in ndnSIM (an example equivalent to "Hello, world1") !!! These are **NOT** examples of real experimentations (just like "Hello, world!" is not a real program).`
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
.. _simple-scenario:
Simple scenario
@@ -46,6 +49,9 @@
NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-simple
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
.. _9-node-grid-example:
9-node grid example
@@ -95,6 +101,9 @@
NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-grid
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
.. _9-node-grid-example-using-topology-plugin:
9-node grid example using topology plugin
@@ -155,6 +164,8 @@
NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-grid-topo-plugin
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
6-node bottleneck topology
--------------------------
@@ -195,6 +206,9 @@
NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-congestion-topo-plugin
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
.. _11-node 2-bottleneck topology with custom forwarding strategy:
11-node 2-bottleneck topology with custom forwarding strategy
@@ -260,6 +274,9 @@
./waf --run=ndn-congestion-alt-topo-plugin --visualize
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
3-level binary tree with packet-level trace helpers
---------------------------------------------------
@@ -309,6 +326,33 @@
tcpdump -r ndn-simple-trace.pcap
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
+.. _Simple scenario with link failures:
+
+Simple scenario with link failures
+----------------------------------
+
+The following example (``ndn-simple-with-link-failure.cc``) shows how to "fail" links in ndnSIM simulation.
+The basic idea is to set ndn::Faces that correspond to the failed link to DOWN state.
+ndnSIM now includes a simple helper that simplifies this process.
+
+.. literalinclude:: ../../examples/ndn-simple-with-link-failure.cc
+ :language: c++
+ :linenos:
+ :lines: 21-31,52-
+ :emphasize-lines: 54-56
+
+If this code is placed into ``scratch/ndn-simple-with-link-failure.cc`` and NS-3 is compiled in debug mode, you can run and see progress of the
+simulation using the following command (in optimized mode nothing will be printed out)::
+
+ NS_LOG=ndn.Consumer:ndn.Producer:ndn.LinkControlHelper ./waf --run=ndn-simple-with-link-failure
+
+.. note::
+ If you compiled ndnSIM with examples (``./waf configure --enable-examples``) you can directly run the example without putting scenario into ``scratch/`` folder.
+
+
25-node tree topology with L2Tracer
-----------------------------------