Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 1 | Getting Started |
| 2 | =============== |
| 3 | |
| 4 | Portability |
| 5 | ------------ |
| 6 | |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 7 | .. image:: https://travis-ci.org/named-data-ndnSIM/ndnSIM.svg?branch=master |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 8 | :target: https://travis-ci.org/named-data-ndnSIM/ndnSIM |
| 9 | |
Alexander Afanasyev | 0167d58 | 2016-09-08 19:22:08 -0700 | [diff] [blame] | 10 | ndnSIM 2.x has been successfully compiled and used on following platforms: |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 11 | |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 12 | - Ubuntu Linux 18.04 |
| 13 | - Ubuntu Linux 16.04 |
Spyridon Mastorakis | af09eac | 2018-02-22 11:25:26 -0800 | [diff] [blame] | 14 | - macOS 10.13 |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 15 | - macOS 10.14 |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 16 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 17 | .. _requirements: |
| 18 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 19 | Prerequisites |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 20 | ------------- |
| 21 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 22 | **1. Core dependencies** |
| 23 | |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 24 | - ``python`` >= 2.7 |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 25 | - ``libsqlite3`` |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 26 | - ``pkg-config`` |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 27 | - ``openssl`` |
| 28 | - Boost libraries >= 1.54 |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 29 | |
Alexander Afanasyev | 26b558b | 2012-12-13 11:39:46 -0800 | [diff] [blame] | 30 | .. role:: red |
| 31 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 32 | .. note:: |
Spyridon Mastorakis | c33e288 | 2015-01-20 21:45:44 -0800 | [diff] [blame] | 33 | If you do not have root permissions to install boost, you can install it in your home |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 34 | folder. However, you need to be make sure that `libboost_iostreams` library is successfully |
| 35 | compiled and is installed. Please refer to :ref:`the following example <Installing boost |
| 36 | libraries>` for the hints how to successfully compile and install boost libraries on Ubuntu |
| 37 | Linux. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 38 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 39 | Following are the detailed steps for each platform to install the compiler, all necessary |
| 40 | development tools and libraries, and ndn-cxx prerequisites. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 41 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 42 | - macOS |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 43 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 44 | * macOS with HomeBrew: |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 45 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 46 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 47 | |
Alexander Afanasyev | 2481092 | 2019-02-10 22:06:43 -0500 | [diff] [blame] | 48 | brew install boost pkg-config openssl libxml2 |
| 49 | export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" # put this line in ~/.bashrc or manually type before ./waf configure |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 50 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 51 | - Linux |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 52 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 53 | * Ubuntu Linux |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 54 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 55 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 56 | |
Alexander Afanasyev | 2481092 | 2019-02-10 22:06:43 -0500 | [diff] [blame] | 57 | sudo apt install build-essential libsqlite3-dev libboost-all-dev libssl-dev git python-setuptools castxml |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame] | 58 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 59 | * Fedora Linux |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame] | 60 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 61 | .. code-block:: bash |
| 62 | |
Alexander Afanasyev | 2481092 | 2019-02-10 22:06:43 -0500 | [diff] [blame] | 63 | sudo yum install gcc-g++ git sqlite-devel boost-devel openssl-devel |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 64 | |
| 65 | .. note:: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 66 | :red:`ndnSIM requires boost version at least 1.54.` Many linux distribution |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 67 | (Fedora 16, 17 at the time of this writing) ship an old version of boost, making it |
| 68 | impossible to compile ndnSIM out-of-the-box. Please install the latest version, following |
| 69 | :ref:`these simple instructions <Installing boost libraries>`. |
| 70 | |
| 71 | **2. Dependencies for NS-3 Python bindings** |
| 72 | |
| 73 | If you are planning to use NS-3 python bindings, a number of additional dependencies |
| 74 | should be installed. For example, in order to run `visualizer`_ module, the following |
| 75 | should be installed: |
| 76 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 77 | - macOS |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 78 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 79 | * macOS with HomeBrew |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 80 | |
Alexander Afanasyev | 2481092 | 2019-02-10 22:06:43 -0500 | [diff] [blame] | 81 | .. code-block:: bash |
| 82 | |
| 83 | brew install cairo goocanvas gtk+3 graphviz gobject-introspection castxml |
| 84 | |
| 85 | export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" # this needed only for running the next line |
| 86 | pip install pygraphviz pycairo PyGObject pygccxml |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 87 | |
| 88 | - Linux |
| 89 | |
| 90 | * Ubuntu Linux |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 91 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 92 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 93 | |
Alexander Afanasyev | 40b8833 | 2019-02-13 16:19:06 -0500 | [diff] [blame] | 94 | sudo apt install python-dev python-pygraphviz python-kiwi python-gnome2 ipython libcairo2-dev python3-gi libgirepository1.0-dev python-gi python-gi-cairo gir1.2-gtk-3.0 gir1.2-goocanvas-2.0 python-pip |
| 95 | sudo pip install pygraphviz pycairo PyGObject pygccxml |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 96 | |
Alexander Afanasyev | 2481092 | 2019-02-10 22:06:43 -0500 | [diff] [blame] | 97 | .. _visualizer: https://www.nsnam.org/wiki/PyViz |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 98 | |
| 99 | Downloading ndnSIM source |
| 100 | ------------------------- |
| 101 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 102 | ndnSIM package consists of three pieces: |
| 103 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 104 | - a custom branch of NS-3 that contains a few useful patches |
| 105 | - a customized python binding generation library (necessary if you want to use NS-3's python |
| 106 | bindings and/or visualizer module) |
| 107 | - the source code of ndnSIM module |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 108 | - modified source code of ndn-cxx library and NDN Forwarding Daemon (NFD), attached to |
| 109 | ndnSIM git repository as git submodules |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 110 | |
| 111 | The following commands download all pieces from GitHub repositories: |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 112 | |
| 113 | .. code-block:: bash |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 114 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 115 | mkdir ndnSIM |
| 116 | cd ndnSIM |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 117 | git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3 |
| 118 | git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen |
Spyridon Mastorakis | a1d135b | 2015-08-20 20:24:59 -0700 | [diff] [blame] | 119 | git clone --recursive https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 120 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 121 | The last command downloads ndnSIM source code and source code of all submodules (i.e., |
| 122 | ndn-cxx and NFD). If you previously cloned without ``--recursive`` flag, the correct |
| 123 | versions of submodules can be retrieved using: |
| 124 | |
| 125 | .. code-block:: bash |
| 126 | |
| 127 | git submodule update --init |
| 128 | |
| 129 | The same command should be run to update submodules when there are new changes available. |
| 130 | |
| 131 | .. note:: |
| 132 | A few modification to the base NS-3 and pybindgen are necessary to run successfully |
| 133 | compile and run ndnSIM. Some of the changes are specific to ndnSIM and some are |
| 134 | bugfixes that we are submitting to NS-3 upstream. We also periodically update |
| 135 | repository with the new NS-3 releases, usually in form of rebasing (and if necessary |
| 136 | updating or eliminating) our custom patches on top of the released commits. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 137 | |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 138 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 139 | Compiling and running ndnSIM |
| 140 | ---------------------------- |
| 141 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 142 | ndnSIM uses a standard NS-3 compilation procedure. Normally the following commands should be |
| 143 | sufficient to configure and build ndnSIM with python bindings enabled: |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 144 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 145 | .. code-block:: bash |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 146 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 147 | cd <ns-3-folder> |
| 148 | ./waf configure --enable-examples |
| 149 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 150 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 151 | On macOS (with MacPorts), you may need to modify the configure command to use MacPorts |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 152 | version of python: |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 153 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 154 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 155 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 156 | cd <ns-3-folder> |
| 157 | ./waf configure --with-python=/opt/local/bin/python2.7 --enable-examples |
| 158 | # or run ``sudo port select python python27`` |
| 159 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 160 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 161 | .. note:: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 162 | On macOS configuration stage may get :ref:`stuck at detecting gtk module <Problems with |
| 163 | the gtk python module on macOS>`. Make sure you have `XQuartz |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 164 | <http://xquartz.macosforge.org>`_ installed or disable python as described in the |
| 165 | following instructions. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 166 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 167 | Python bindings is an optional and not very stable feature of NS-3 simulator. It is |
| 168 | possible to disable python bindings compilation either to speed up compilation or to avoid |
| 169 | certain compilation errors (e.g., "Could not find a task generator for the name |
| 170 | 'ns3-visualizer'"): |
Spyridon Mastorakis | c33e288 | 2015-01-20 21:45:44 -0800 | [diff] [blame] | 171 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 172 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 173 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 174 | cd <ns-3-folder> |
| 175 | ./waf configure --disable-python --enable-examples |
| 176 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 177 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 178 | For more configuration options, please refer to ``./waf --help``. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 179 | |
Spyridon Mastorakis | f34b319 | 2015-02-16 17:42:01 -0800 | [diff] [blame] | 180 | |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 181 | Simulating using ndnSIM |
| 182 | ----------------------- |
| 183 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 184 | - Example simulation scenarios |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 185 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 186 | When NS-3 is configured with ``--with-examples`` flag, you can directly run all examples |
| 187 | described in :doc:`examples section of this tutorial <examples>`. For example, to run |
| 188 | ``ndn-simple.cpp`` scenario, you can run the following command: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 189 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 190 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 191 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 192 | ./waf --run=ndn-simple |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 193 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 194 | To run ``ndn-grid.cpp`` scenario: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 195 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 196 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 197 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 198 | ./waf --run=ndn-grid |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 199 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 200 | To run the sample simulation scenarios with the logging module of NS-3 enabled (note that |
| 201 | this will work only when NS-3 is compiled in debug mode): |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 202 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 203 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 204 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 205 | NS_LOG=ndn.Producer:ndn.Consumer ./waf --run=<scenario name> |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 206 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 207 | If you have compiled with python bindings, then you can try to run these simulations with |
| 208 | visualizer: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 209 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 210 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 211 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 212 | ./waf --run=ndn-simple --vis |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 213 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 214 | or: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 215 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 216 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 217 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 218 | ./waf --run=ndn-grid --vis |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 219 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 220 | .. note:: |
| 221 | Do not forget to configure and compile NS-3 in optimized mode (``./waf configure -d |
| 222 | optimized``) in order to run actual simulations. |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 223 | |
| 224 | - Real experimentation |
| 225 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 226 | Simulation scenarios can be written directly inside NS-3 in ``scratch/`` or ``src/ndnSIM/examples`` folder. |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 227 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 228 | Alternative and a recommended way is to write simulation scenarios in a separate |
| 229 | repository, not related to either NS-3 or ndnSIM. For example, you can use the |
| 230 | following template to write your extensions, simulation scenarios, and metric processing |
| 231 | scripts: `<http://github.com/cawka/ndnSIM-scenario-template>`_: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 232 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 233 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 234 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 235 | mkdir ndnSIM |
| 236 | cd ndnSIM |
| 237 | git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3 |
| 238 | git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen |
| 239 | git clone --recursive https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 240 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 241 | # Build and install NS-3 and ndnSIM |
| 242 | cd ns-3 |
| 243 | ./waf configure -d optimized |
| 244 | ./waf |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 245 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 246 | sudo ./waf install |
| 247 | cd .. |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 248 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 249 | git clone https://github.com/named-data-ndnSIM/scenario-template.git scenario |
| 250 | cd scenario |
| 251 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
| 252 | export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 253 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 254 | ./waf configure |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 255 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 256 | ./waf --run <scenario> |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame] | 257 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 258 | For more detailed information, refer to `README file |
| 259 | <https://github.com/cawka/ndnSIM-scenario-template/blob/master/README.md>`_. |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 260 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 261 | .. |
| 262 | Examples of template-based simulations |
| 263 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 264 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 265 | 1. ndnSIM examples from `<http://ndnsim.net>`_ website and more: |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 266 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 267 | - `<http://github.com/cawka/ndnSIM-examples>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 268 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 269 | 2. Script scenarios and graph processing scripts for simulations used in "A Case for Stateful |
| 270 | Forwarding Plane" paper by Yi et al. (`<http://dx.doi.org/10.1016/j.comcom.2013.01.005>`_): |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 271 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 272 | - `<http://github.com/cawka/ndnSIM-comcom-stateful-fw>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 273 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 274 | 3. Script scenarios and graph processing scripts for simulations used in "Rapid Traffic |
| 275 | Information Dissemination Using Named Data" paper by Wang et |
| 276 | al. (`<http://dx.doi.org/10.1145/2248361.2248365>`_): |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 277 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 278 | - `<http://github.com/cawka/ndnSIM-nom-rapid-car2car>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 279 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 280 | - Rocketfuel-based topology generator for ndnSIM preferred format (randomly assigned link |
| 281 | delays and bandwidth, based on estimated types of connections between nodes): |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 282 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 283 | - `<http://github.com/cawka/ndnSIM-sample-topologies>`_, or |