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