blob: b39f2117d3736eb728d2f8deb2784c54cac410b9 [file] [log] [blame]
Alexander Afanasyev4d325162012-06-01 12:28:50 -07001.. ndnSIM: NS-3 based NDN simulator
2.. ============================================================
3
4.. .. toctree::
5.. :maxdepth: 2
6
Alexander Afanasyevf34fe562013-08-09 17:16:12 -07007============
Alexander Afanasyev4d325162012-06-01 12:28:50 -07008Introduction
Alexander Afanasyev5d79e682012-11-19 14:12:23 -08009============
Alexander Afanasyev4d325162012-06-01 12:28:50 -070010
Alexander Afanasyevf34fe562013-08-09 17:16:12 -070011The ndnSIM is NS-3 module that implements Named Data Networking (NDN) communication model, the clean slate Internet design. ndnSIM is specially optimized for simulation purposes and has a cleaner and more extensible internal structure comparing to the existing NDN implementation (NDNx).
Alexander Afanasyev4d325162012-06-01 12:28:50 -070012
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070013Following the NDN architecture, ndnSIM is implemented as a new network-layer protocol model, which can run on top of any available link-layer protocol model (point-to-point, CSMA, wireless, etc.).
Alexander Afanasyev4d325162012-06-01 12:28:50 -070014
15.. note::
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070016 It will also be possible to run ndnSIM on top of network-layer (IPv4, IPv6) and transport-layer (TCP, UDP) protocols.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070017 However, it is not yet implemented and patches are welcome.
18
19.. This flexibility allows ndnSIM to simulate scenarios of various homogeneous and heterogeneous networks (e.g., NDN-only, NDN-over-IP, etc.).
20
Alexander Afanasyevf6807a52012-08-10 18:11:43 -070021The simulator is implemented in a modular fashion, using separate C++ classes to model behavior of each network-layer entity in NDN: :ndnsim:`pending Interest table (PIT) <Pit>`, :ndnsim:`forwarding information base (FIB) <Fib>`, :ndnsim:`content store <ContentStore>`, :ndnsim:`network <NetDeviceFace>` and :ndnsim:`application <AppFace>` interfaces, :ndnsim:`Interest forwarding strategies <ForwardingStrategy>`, etc.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070022This modular structure allows any component to be easily modified or replaced with no or minimal impact on other components.
23In addition, the simulator provides an extensive collection of interfaces and helpers to perform detailed tracing behavior of every component, as well as NDN traffic flow.
24
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070025
26.. aafig::
27 :aspect: 60
28 :scale: 120
29
30 +----------------+ +-----------+
31 | "Applications" | | NetDevice |
32 +----------------+ +-----------+
33 ^ ^
34 .................|......................................|......................
35 . v v .
Alexander Afanasyev79206512013-07-27 16:49:12 -070036 . +----------------------+ +----------------------+ .
37 . | "Face" | | "Face" | .
38 . | "(AppFace, ApiFace)" | | "(NetDeviceFace)" | .
39 . +----------------------+ +----------------------+ .
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070040 . ^ ^ .
41 . | | .
42 . v v .
43 . XXXXXXXXXXXXXXXXXXXXXXXXXXXXX .
44 . XX XX .
45 . XX Core NDN protocol XX .
Alexander Afanasyevf6807a52012-08-10 18:11:43 -070046 . XX "(L3Protocol)" XX
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070047 . XX XX .
48 . XXXXXXXXXXXXXXXXXXXXXXXXXXXXX .
49 . ^ ^ ^ ^ .
50 . | | | | .
51 . +-------------------+ +---+ +---+ +------------+ .
52 . | | | | .
53 . v v v v .
54 . +-------------------+ +-------+ +-------+ +-------------+ .
Alexander Afanasyevf6807a52012-08-10 18:11:43 -070055 . | "ContentStore" | | PIT | | FIB | | "Forwarding"| .
56 . +-------------------+ +-------+ +-------+ | "Strategy" | .
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070057 . +-------------+ .
58 . .
59 ...............................................................................
60
61
Alexander Afanasyev9fb2e3d2013-03-30 21:11:07 -070062The current wire format for the Interest and Data packets used by ndnSIM is defined in :ref:`ndnSIM packet format`.
Alexander Afanasyevf34fe562013-08-09 17:16:12 -070063ndnSIM also has an option to be compatible to wire format used by `NDNx implementation <http://named-data.net/>`_ (NDNx binary XML encoding). However currently, this option is deprecated, but can be reintroduced in the future as an optional wire format.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070064
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080065More documentation
66------------------
Alexander Afanasyev4d325162012-06-01 12:28:50 -070067
Alexander Afanasyev5b147e82012-06-22 10:39:46 -070068Overall structure of ndnSIM is described in our `technical report <http://lasr.cs.ucla.edu/afanasyev/data/files/Afanasyev/ndnSIM-TR.pdf>`_.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070069
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070070`ndnSIM API documentation <doxygen/index.html>`_
Alexander Afanasyev4d325162012-06-01 12:28:50 -070071
Alexander Afanasyev9c0794a2012-12-10 01:02:33 -080072Also, you can `join our mailing list <http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_ to see and participate in discussions about ndnSIM implementation and simulations in general.
73Do not forget to check mailling list `archives <http://www.lists.cs.ucla.edu/pipermail/ndnsim/>`_.
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070074
Alexander Afanasyev4d325162012-06-01 12:28:50 -070075
Alexander Afanasyev508269a2012-07-28 13:59:54 -070076Support
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080077-------
Alexander Afanasyev508269a2012-07-28 13:59:54 -070078
79The code of ndnSIM is in active development. Bug reports (issues) as well as new feature implementation are always welcome.
80
81To file a bug report, please use `GitHub Issues <https://github.com/NDN-Routing/ndnSIM/issues>`_.
82
83To create new feature, please fork the code and submit Pull Request on GitHub.
84
Alexander Afanasyev26b558b2012-12-13 11:39:46 -080085And of course, `our mailing list <http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_ is the best way to communicate with and get support from ndnSIM team and other users of ndnSIM.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070086
87A very short guide to the code
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -070088------------------------------
Alexander Afanasyev4d325162012-06-01 12:28:50 -070089
Alexander Afanasyev6315ef72012-06-01 20:56:31 -070090All the NDN related code is in ``ns-3/src/ndnSIM``
Alexander Afanasyev4d325162012-06-01 12:28:50 -070091
92+-----------------+---------------------------------------------------------------------+
93| Folder | Description |
94+=================+=====================================================================+
Alexander Afanasyevf6807a52012-08-10 18:11:43 -070095| ``model/`` | implementation of NDN base: :ndnsim:`L3Protocol`, faces |
96| | (:ndnsim:`Face`, :ndnsim:`NetDeviceFace`, forwarding |
97| | :ndnsim:`AppFace`), |
98| | strategies (:ndnsim:`ForwardingStrategy`, |
Alexander Afanasyevb8d14ad2012-08-09 13:19:37 -070099| | :ndnsim:`Flooding`, :ndnsim:`SmartFlooding`, :ndnsim:`BestRoute`), |
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700100| | etc. |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700101+-----------------+---------------------------------------------------------------------+
102| ``apps/`` | applications (in NS-3 sense) that can be installed on the nodes. |
Alexander Afanasyevf6807a52012-08-10 18:11:43 -0700103| | Right now we have one producer (:ndnsim:`Producer`) and a |
104| | collection of consumer (:ndnsim:`ConsumerCbr`, |
105| | :ndnsim:`ConsumerWindow`, |
106| | :ndnsim:`ConsumerBatches`). See doxygen documentation or |
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700107| | source code for details |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700108+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700109| ``helper/`` | a number of :doc:`useful helpers <helpers>` |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700110+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700111| ``examples/`` | contain :doc:`several example scenarios <examples>` |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700112+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev508269a2012-07-28 13:59:54 -0700113| ``utils/`` | helper classes, including implementation of generalized data |
114| | structures |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700115+-----------------+---------------------------------------------------------------------+
116| ``plugins/`` | a number of plugins that may be helpful to run simulation scenarios |
117+-----------------+---------------------------------------------------------------------+
118
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700119Logging
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -0800120-------
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700121
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -0800122Almost every component in ndnSIM exports logging interface, so in debug compilation it is possible to track many internal details.
123For example, logging of :ndnsim:`Face` and :ndnsim:`Consumer` shows everything what happens in :ndnsim:`Face` and :ndnsim:`Consumer` classes::
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700124
Alexander Afanasyevf6807a52012-08-10 18:11:43 -0700125 NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700126
127Refer to the source code and NS-3 documentation to see what logging interfaces are available and about details how enable one or more logging interfaces.
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700128