blob: 27ca8dff77c7d6c265706c1652af92a29a6960af [file] [log] [blame]
Alexander Afanasyev4d325162012-06-01 12:28:50 -07001.. ndnSIM: NS-3 based NDN simulator
2.. ============================================================
3
Alexander Afanasyevf34fe562013-08-09 17:16:12 -07004============
Alexander Afanasyev4d325162012-06-01 12:28:50 -07005Introduction
Alexander Afanasyev5d79e682012-11-19 14:12:23 -08006============
Alexander Afanasyev4d325162012-06-01 12:28:50 -07007
Alexander Afanasyevfc9d9e12013-08-10 14:17:49 -07008.. sidebar:: ndnSIM components
9
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080010 .. image:: _static/ndnSIM-structure.*
Alexander Afanasyevfc9d9e12013-08-10 14:17:49 -070011 :width: 100%
12
Alexander Afanasyev5dee3612015-08-25 16:09:04 -070013- Packet format changed to [NDN Packet Specification](http://named-data.net/doc/ndn-tlv/)
Alexander Afanasyev4d325162012-06-01 12:28:50 -070014
Alexander Afanasyev5dee3612015-08-25 16:09:04 -070015- ndnSIM uses implementation of basic NDN primitives from
16 [ndn-cxx library (NDN C++ library with eXperimental eXtensions)](http://named-data.net/doc/ndn-cxx/)
17
18- All NDN forwarding and management is implemented directly using source code of
19 [Named Data Networking Forwarding Daemon (NFD)](http://named-data.net/doc/NFD/)
20
21- Allows [simulation of real applications](http://ndnsim.net/2.1/guide-to-simulate-real-apps.html)
22 written against ndn-cxx library
23
24
25A new release of `NS-3 based Named Data Networking (NDN) simulator <http://ndnsim.net/1.0/>`__
26went through a number of extensive refactoring and rewriting. The key new features of the
27new version:
28
29- Packet format changed to the `NDN packet format <http://named-data.net/doc/ndn-tlv/>`_
30
31- ndnSIM uses implementation of basic NDN primitives from
32 `ndn-cxx library (NDN C++ library with eXperimental eXtensions)
33 <http://named-data.net/doc/ndn-cxx/>`_
34
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080035- All NDN forwarding and management is implemented directly using source code of `Named
36 Data Networking Forwarding Daemon (NFD) <http://named-data.net/doc/NFD/>`_
Alexander Afanasyev5dee3612015-08-25 16:09:04 -070037
38- It is possible to :doc:`simulation some real applications <guide-to-simulate-real-apps>`
39 written against ndn-cxx library
Alexander Afanasyev4d325162012-06-01 12:28:50 -070040
41.. note::
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080042 Please note that ndnSIM 2.0 has major refactoring and simulation scenario written for
43 previous releases most likely would need to be changed to run on ndnSIM 2.0 platform.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070044
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080045Such integration with ndn-cxx and NFD ensures that the simulations are maximally realistic
46and can be reproduced in real environments with virtually no changes to the source code.
47In addition to that, any experiments with NDN forwarding (e.g., custom forwarding
48strategies) inside ndnSIM can be directly used within the real NFD implementation.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070049
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080050Specifically, the simulator directly uses NFD implementations of :nfd:`pending Interest
51table (PIT) <nfd::Pit>`, :nfd:`forwarding information base (FIB) <nfd::Fib>`, and
Spyridon Mastorakis5897c962015-08-31 15:37:18 -070052:nfd:`content store <nfd::cs::Cs>` data structures. In addition to that, ndnSIM allows
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080053experimentation with :ndnSIM:`ndnSIM-specific content store <ndn::ContentStore>` along
54with its cache replacement policies ported from the previous version of ndnSIM.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070055
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080056ndnSIM is implemented as a new network-layer protocol model and can run on top of any
57available link-layer protocol model (point-to-point, CSMA, wireless, etc.).
58In addition, the simulator provides an extensive collection of interfaces and helpers to
59perform detailed tracing behavior of every component, as well as NDN traffic flow.
60
Alexander Afanasyev4d325162012-06-01 12:28:50 -070061
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -080062More documentation
63------------------
Alexander Afanasyev4d325162012-06-01 12:28:50 -070064
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080065Overall structure of ndnSIM is described in our `technical report
66<http://lasr.cs.ucla.edu/afanasyev/data/files/Afanasyev/ndnSIM-TR.pdf>`_.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070067
Alexander Afanasyev97fb44d2012-06-04 18:50:47 -070068`ndnSIM API documentation <doxygen/index.html>`_
Alexander Afanasyev4d325162012-06-01 12:28:50 -070069
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080070Also, you can `join our mailing list
71<http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_ to see and participate in
72discussions about ndnSIM implementation and simulations in general. Do not forget to
73check 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
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080079The code of ndnSIM is in active development. Bug reports (issues) as well as new feature
80implementation are always welcome.
Alexander Afanasyev508269a2012-07-28 13:59:54 -070081
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080082To file a bug report, please use `NDN Redmine
83<http://redmine.named-data.net/projects/ndnsim>`_.
Alexander Afanasyev508269a2012-07-28 13:59:54 -070084
85To create new feature, please fork the code and submit Pull Request on GitHub.
86
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -080087And of course, `our mailing list <http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>`_
88is the best way to communicate with and get support from ndnSIM team and other users of
89ndnSIM.
Alexander Afanasyev4d325162012-06-01 12:28:50 -070090
91A very short guide to the code
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -070092------------------------------
Alexander Afanasyev4d325162012-06-01 12:28:50 -070093
Alexander Afanasyev6315ef72012-06-01 20:56:31 -070094All the NDN related code is in ``ns-3/src/ndnSIM``
Alexander Afanasyev4d325162012-06-01 12:28:50 -070095
96+-----------------+---------------------------------------------------------------------+
97| Folder | Description |
98+=================+=====================================================================+
Alexander Afanasyevf6807a52012-08-10 18:11:43 -070099| ``model/`` | implementation of NDN base: :ndnsim:`L3Protocol`, faces |
spirosmastorakisc09bb402016-10-28 19:16:58 -0700100| | (:ndnsim:`Face`, :ndnsim:`NetDeviceLinkService`, |
101| | :ndnsim:`AppLinkService`), |
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700102| | etc. |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700103+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev5dee3612015-08-25 16:09:04 -0700104| ``NFD/`` | submodule of `NDN Forwarding Daemon (NFD)`_ source code with few |
105| | modifications to make it compatible with the simulator |
106+-----------------+---------------------------------------------------------------------+
107| ``ndn-cxx/`` | submodule of `ndn-cxx library`_ source code with few |
108| | modifications to make it compatible with the simulator |
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800109+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700110| ``apps/`` | applications (in NS-3 sense) that can be installed on the nodes. |
Alexander Afanasyevf6807a52012-08-10 18:11:43 -0700111| | Right now we have one producer (:ndnsim:`Producer`) and a |
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800112| | collection of consumer applications (:ndnsim:`ConsumerCbr`, |
113| | :ndnsim:`ConsumerWindow`, :ndnsim:`ConsumerBatches`, |
114| | :ndnsim:`ConsumerZipfMandelbrot`). See doxygen documentation or |
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700115| | source code for details |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700116+-----------------+---------------------------------------------------------------------+
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800117| ``utils/`` | helper classes, including implementation of generalized data |
118| | structures, topology readers and tracers |
119+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700120| ``helper/`` | a number of :doc:`useful helpers <helpers>` |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700121+-----------------+---------------------------------------------------------------------+
Alexander Afanasyev6315ef72012-06-01 20:56:31 -0700122| ``examples/`` | contain :doc:`several example scenarios <examples>` |
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700123+-----------------+---------------------------------------------------------------------+
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800124
Alexander Afanasyev5dee3612015-08-25 16:09:04 -0700125.. _NDN Forwarding Daemon (NFD): http://named-data.net/doc/NFD/
126
127.. _ndn-cxx library: http://named-data.net/doc/ndn-cxx/
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700128
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700129Logging
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -0800130-------
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700131
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800132Almost every component in ndnSIM exports logging interface, so in debug compilation it is
133possible to track many internal details. For example, logging of :ndnsim:`Face` and
134:ndnsim:`Consumer` shows everything what happens in :ndnsim:`Face` and :ndnsim:`Consumer`
135classes::
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700136
Alexander Afanasyevf6807a52012-08-10 18:11:43 -0700137 NS_LOG=ndn.Face:ndn.Consumer ./waf --run=ndn-simple
Alexander Afanasyevd4e97b32012-06-04 15:09:50 -0700138
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800139Refer to the source code and NS-3 documentation to see what logging interfaces are
140available and about details how enable one or more logging interfaces.
Alexander Afanasyev4d325162012-06-01 12:28:50 -0700141
Spyridon Mastorakis460f57c2014-12-17 00:44:14 -0800142.. note::
143
144 Please remember that logging is enabled **only** in debug mode. When simulator is
145 compiled in optimized mode (``./waf configure -d optimized``), logging will be
146 completely disabled as it significantly slows down execution.
147
148.. note::
149
150 A list of log components available in the current version of NS-3 and ndnSIM is listed
151 `in this page <doxygen/LogComponentList.html>`_.