blob: 02ae5044cacb4d1af2e12c02456b10b792c6353b [file] [log] [blame]
Alexander Afanasyeve095f0f2012-11-21 17:43:32 -08001Getting Started
2===============
3
4Portability
5------------
6
7ndnSIM has been successfully compiled and used under Ubuntu Linux 12.04 (stock gcc, boost 1.48), Mac OS 10.8 (gcc-4.2 apple/llvm, macports gcc 4.7, boost 1.49-1.52).
8
9.. _requirements:
10
11Requirements
12-------------
13
141. ndnSIM requires the customized version of NS-3 simulator (a number of patches required to make ndnSIM work with the latest development branch of NS-3).
15
162. Boost libraries should be installed on the system:
17
18 * For Ubuntu::
19
20 sudo aptitude install libboost-all-dev
21
22 * For MacOS (macports)::
23
24 sudo port instal boost
25
26.. note::
27 !!! If you do not have root permissions to install boost, you can install it in your home folder. However, you need to be make sure that `libboost_iostreams` library is successfully compiled and is installed. Please refer to :doc:`the following example <boost-custom-install>` for the hints how to successfully compile and install boost libraries on Ubuntu Linux.
28
29
303. If you are planning to use other modules, like visualizer, a number of additional dependencies should be installed. For example, in
31order to run `visualizer`_ module, the following should be installed:
32
33 * For Ubuntu::
34
35 sudo apt-get install python-dev python-pygraphviz python-kiwi
36 sudo apt-get install python-pygoocanvas python-gnome2
37 sudo apt-get install python-gnomedesktop python-rsvg ipython
38
39 * For MacOS (macports)::
40
41 sudo port install py27-pygraphviz py27-goocanvas
42
43.. py27-kiwi
44
45.. _visualizer: http://www.nsnam.org/wiki/index.php/PyViz
46
47Downloading ndnSIM source
48-------------------------
49
50Download a custom branch of NS-3 that contains all necessary patches and more::
51
52 mkdir ndnSIM
53 cd ndnSIM
54 git clone git://github.com/cawka/ns-3-dev-ndnSIM.git ns-3
55 git clone git://github.com/cawka/pybindgen.git pybindgen
56
57The first command is to create a directory, which will contain everything NS-3 related. The bare minimum is just base NS-3 (the first clone above). The second clone gets a module necessary to build python bindings, which are necessary for the visualizer module.
58
59Finally, clone actual ndnSIM code and place it in src/ folder::
60
61 git clone git://github.com/NDN-Routing/ndnSIM.git ns-3/src/ndnSIM
62
63There are quite a few modification to the base NS-3 code that are necessary to run ndnSIM, and the code is periodically synchronized with the official developer branch. Eventually, all the changes will be merged to the official branch, but for the time being, it is necessary to use the customized branch.
64
65Compiling and running ndnSIM
66----------------------------
67
68ndnSIM uses standard NS-3 compilation procedure. Normally the following commands should be sufficient to configure and build ndnSIM with python bindings enabled::
69
70 cd <ns-3-folder>
71 ./waf configure --enable-examples --enable-ndn-plugins=topology,mobility
72 ./waf
73
74On MacOS (with macports), you may need to modify the configure command to use macports version of python::
75
76 cd <ns-3-folder>
77 ./waf configure --with-python=/opt/local/bin/python2.7 --enable-examples --enable-ndn-plugins=topology,mobility
78 ./waf
79
80Python bindings is an optional and not very stable feature of NS-3 simulator. It is possible to disable python bindings compilation either to speed up compilation or to avoid certain compilation errors (e.g., "Could not find a task generator for the name 'ns3-visualizer'")::
81
82 cd <ns-3-folder>
83 ./waf configure --disable-python --enable-examples --enable-ndn-plugins=topology,mobility
84 ./waf
85
86For more configuration options, please refer to ``./waf --help``.
87
88To run :doc:`sample ndnSIM simulations <examples>`::
89
90 ./waf --run=ndn-simple
91
92or::
93
94 ./waf --run=ndn-grid
95
96If you have compiled with python bindings, then you can try to run these simulations with visualizer::
97
98 ./waf --run=ndn-simple --vis
99
100or::
101
102 ./waf --run=ndn-grid --vis
103
104.. note::
105 Do not forget to configure and compile NS-3 in optimized mode (``./waf configure -d optimized``) in order to run actual simulations.
106
107Additional compiling options
108++++++++++++++++++++++++++++
109
110ndnSIM contains a number of NS-3 extensions that are not technically part of the ndnSIM. Right now there are two optional plugins---topology and mobility---which can be enabled using the following configuration option::
111
112 ./waf configure --enable-ndn-plugins=topology,mobility
113