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