Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 1 | Getting Started |
| 2 | =============== |
| 3 | |
| 4 | Portability |
| 5 | ------------ |
| 6 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 7 | .. image:: https://travis-ci.org/named-data-ndnSIM/ndnSIM.svg?branch=test-travis-ci |
| 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 | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 12 | - Ubuntu Linux 14.04 (32- and 64-bit platform) |
Alexander Afanasyev | b4cf179 | 2016-06-26 21:16:24 -0700 | [diff] [blame] | 13 | - Ubuntu Linux 16.04 (32- and 64-bit platform) |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 14 | - macOS 10.10 |
| 15 | - macOS 10.11 |
| 16 | - macOS 10.12 |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 17 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 18 | .. _requirements: |
| 19 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 20 | Prerequisites |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 21 | ------------- |
| 22 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 23 | **1. Core dependencies** |
| 24 | |
| 25 | - ``python`` >= 2.6 |
| 26 | - ``libsqlite3`` |
| 27 | - ``libcrypto++`` |
| 28 | - ``pkg-config`` |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 29 | - ``openssl`` |
| 30 | - Boost libraries >= 1.54 |
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 MacPorts: |
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 | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 49 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 50 | sudo port install pkgconfig boost sqlite3 libcryptopp openssl |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 51 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 52 | * macOS with HomeBrew: |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 53 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 54 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 55 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 56 | brew install boost cryptopp pkg-config openssl libxml2 |
Alexander Afanasyev | b4cf179 | 2016-06-26 21:16:24 -0700 | [diff] [blame] | 57 | brew link --force libxml2 |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 58 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 59 | - Linux |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 60 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 61 | * Ubuntu Linux |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 62 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 63 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 64 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 65 | sudo apt-get install build-essential libsqlite3-dev libcrypto++-dev libboost-all-dev libssl-dev git python-setuptools |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame] | 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 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 71 | sudo yum install gcc-g++ git sqlite-devel cryptopp-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 MacPorts: |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 88 | |
| 89 | .. code-block:: bash |
| 90 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 91 | sudo port install py27-pygraphviz py27-goocanvas py27-kiwi |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 92 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 93 | * macOS with HomeBrew |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 94 | |
Alexander Afanasyev | b4cf179 | 2016-06-26 21:16:24 -0700 | [diff] [blame] | 95 | Currently, there are many missing dependencies, so it is impossible to use visualizer module with HomeBrew. Use MacPorts instead. |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 96 | |
| 97 | - Linux |
| 98 | |
| 99 | * Ubuntu Linux |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 100 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 101 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 102 | |
| 103 | sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas python-gnome2 python-rsvg ipython |
| 104 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 105 | * Fedora Linux |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 106 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 107 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 108 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 109 | sudo yum install pygoocanvas python-kiwi graphviz-python |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 110 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 111 | # easy_install method, since pygraphviz is not (yet?) packaged into Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=740687) |
| 112 | sudo yum install graphviz-devel |
| 113 | sudo yum install python-pip |
| 114 | sudo easy_install pygraphviz |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame] | 115 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 116 | .. _visualizer: http://www.nsnam.org/wiki/index.php/PyViz |
| 117 | |
| 118 | Downloading ndnSIM source |
| 119 | ------------------------- |
| 120 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 121 | ndnSIM package consists of three pieces: |
| 122 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 123 | - a custom branch of NS-3 that contains a few useful patches |
| 124 | - a customized python binding generation library (necessary if you want to use NS-3's python |
| 125 | bindings and/or visualizer module) |
| 126 | - the source code of ndnSIM module |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 127 | - modified source code of ndn-cxx library and NDN Forwarding Daemon (NFD), attached to |
| 128 | ndnSIM git repository as git submodules |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 129 | |
| 130 | The following commands download all pieces from GitHub repositories: |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 131 | |
| 132 | .. code-block:: bash |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 133 | |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 134 | mkdir ndnSIM |
| 135 | cd ndnSIM |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 136 | git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3 |
| 137 | git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen |
Spyridon Mastorakis | a1d135b | 2015-08-20 20:24:59 -0700 | [diff] [blame] | 138 | 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] | 139 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 140 | The last command downloads ndnSIM source code and source code of all submodules (i.e., |
| 141 | ndn-cxx and NFD). If you previously cloned without ``--recursive`` flag, the correct |
| 142 | versions of submodules can be retrieved using: |
| 143 | |
| 144 | .. code-block:: bash |
| 145 | |
| 146 | git submodule update --init |
| 147 | |
| 148 | The same command should be run to update submodules when there are new changes available. |
| 149 | |
| 150 | .. note:: |
| 151 | A few modification to the base NS-3 and pybindgen are necessary to run successfully |
| 152 | compile and run ndnSIM. Some of the changes are specific to ndnSIM and some are |
| 153 | bugfixes that we are submitting to NS-3 upstream. We also periodically update |
| 154 | repository with the new NS-3 releases, usually in form of rebasing (and if necessary |
| 155 | updating or eliminating) our custom patches on top of the released commits. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 156 | |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 157 | |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 158 | Compiling and running ndnSIM |
| 159 | ---------------------------- |
| 160 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 161 | ndnSIM uses a standard NS-3 compilation procedure. Normally the following commands should be |
| 162 | sufficient to configure and build ndnSIM with python bindings enabled: |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 163 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 164 | .. code-block:: bash |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 165 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 166 | cd <ns-3-folder> |
| 167 | ./waf configure --enable-examples |
| 168 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 169 | |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 170 | 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] | 171 | version of python: |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 172 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 173 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 174 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 175 | cd <ns-3-folder> |
| 176 | ./waf configure --with-python=/opt/local/bin/python2.7 --enable-examples |
| 177 | # or run ``sudo port select python python27`` |
| 178 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 179 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 180 | .. note:: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 181 | On macOS configuration stage may get :ref:`stuck at detecting gtk module <Problems with |
| 182 | the gtk python module on macOS>`. Make sure you have `XQuartz |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 183 | <http://xquartz.macosforge.org>`_ installed or disable python as described in the |
| 184 | following instructions. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 185 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 186 | Python bindings is an optional and not very stable feature of NS-3 simulator. It is |
| 187 | possible to disable python bindings compilation either to speed up compilation or to avoid |
| 188 | certain compilation errors (e.g., "Could not find a task generator for the name |
| 189 | 'ns3-visualizer'"): |
Spyridon Mastorakis | c33e288 | 2015-01-20 21:45:44 -0800 | [diff] [blame] | 190 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 191 | .. code-block:: bash |
Alexander Afanasyev | 326410e | 2013-03-09 20:39:11 -0800 | [diff] [blame] | 192 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 193 | cd <ns-3-folder> |
| 194 | ./waf configure --disable-python --enable-examples |
| 195 | ./waf |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 196 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 197 | For more configuration options, please refer to ``./waf --help``. |
Alexander Afanasyev | e095f0f | 2012-11-21 17:43:32 -0800 | [diff] [blame] | 198 | |
Spyridon Mastorakis | f34b319 | 2015-02-16 17:42:01 -0800 | [diff] [blame] | 199 | |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 200 | Simulating using ndnSIM |
| 201 | ----------------------- |
| 202 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 203 | - Example simulation scenarios |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 204 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 205 | When NS-3 is configured with ``--with-examples`` flag, you can directly run all examples |
| 206 | described in :doc:`examples section of this tutorial <examples>`. For example, to run |
| 207 | ``ndn-simple.cpp`` scenario, you can run the following command: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 208 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 209 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 210 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 211 | ./waf --run=ndn-simple |
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 | To run ``ndn-grid.cpp`` scenario: |
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 | .. code-block:: bash |
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 | ./waf --run=ndn-grid |
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 | To run the sample simulation scenarios with the logging module of NS-3 enabled (note that |
| 220 | this will work only when NS-3 is compiled in debug mode): |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 221 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 222 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 223 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 224 | NS_LOG=ndn.Producer:ndn.Consumer ./waf --run=<scenario name> |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 225 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 226 | If you have compiled with python bindings, then you can try to run these simulations with |
| 227 | visualizer: |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 228 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 229 | .. code-block:: bash |
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 | ./waf --run=ndn-simple --vis |
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 | or: |
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 | .. code-block:: bash |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 236 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 237 | ./waf --run=ndn-grid --vis |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 238 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 239 | .. note:: |
| 240 | Do not forget to configure and compile NS-3 in optimized mode (``./waf configure -d |
| 241 | optimized``) in order to run actual simulations. |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 242 | |
| 243 | - Real experimentation |
| 244 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 245 | 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^] | 246 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 247 | Alternative and a recommended way is to write simulation scenarios in a separate |
| 248 | repository, not related to either NS-3 or ndnSIM. For example, you can use the |
| 249 | following template to write your extensions, simulation scenarios, and metric processing |
| 250 | scripts: `<http://github.com/cawka/ndnSIM-scenario-template>`_: |
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 | .. code-block:: bash |
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 | mkdir ndnSIM |
| 255 | cd ndnSIM |
| 256 | git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3 |
| 257 | git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen |
| 258 | 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^] | 259 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 260 | # Build and install NS-3 and ndnSIM |
| 261 | cd ns-3 |
| 262 | ./waf configure -d optimized |
| 263 | ./waf |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 264 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 265 | sudo ./waf install |
| 266 | cd .. |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 267 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 268 | git clone https://github.com/named-data-ndnSIM/scenario-template.git scenario |
| 269 | cd scenario |
| 270 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
| 271 | export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 272 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 273 | ./waf configure |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 274 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 275 | ./waf --run <scenario> |
Spyridon Mastorakis | acd5e1a | 2016-12-07 14:34:25 -0800 | [diff] [blame^] | 276 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 277 | For more detailed information, refer to `README file |
| 278 | <https://github.com/cawka/ndnSIM-scenario-template/blob/master/README.md>`_. |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 279 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 280 | .. |
| 281 | Examples of template-based simulations |
| 282 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 283 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 284 | 1. ndnSIM examples from `<http://ndnsim.net>`_ website and more: |
Spyridon Mastorakis | 460f57c | 2014-12-17 00:44:14 -0800 | [diff] [blame] | 285 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 286 | - `<http://github.com/cawka/ndnSIM-examples>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 287 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 288 | 2. Script scenarios and graph processing scripts for simulations used in "A Case for Stateful |
| 289 | 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] | 290 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 291 | - `<http://github.com/cawka/ndnSIM-comcom-stateful-fw>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 292 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 293 | 3. Script scenarios and graph processing scripts for simulations used in "Rapid Traffic |
| 294 | Information Dissemination Using Named Data" paper by Wang et |
| 295 | al. (`<http://dx.doi.org/10.1145/2248361.2248365>`_): |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 296 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 297 | - `<http://github.com/cawka/ndnSIM-nom-rapid-car2car>`_, or |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 298 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 299 | - Rocketfuel-based topology generator for ndnSIM preferred format (randomly assigned link |
| 300 | delays and bandwidth, based on estimated types of connections between nodes): |
Alexander Afanasyev | 701e508 | 2013-03-13 09:47:50 -0700 | [diff] [blame] | 301 | |
Alexander Afanasyev | 5dee361 | 2015-08-25 16:09:04 -0700 | [diff] [blame] | 302 | - `<http://github.com/cawka/ndnSIM-sample-topologies>`_, or |