blob: 7a5f5e9f34af0f24f03c52e0adc0915442d7006d [file] [log] [blame] [view]
Alexander Afanasyev9ab7d672013-08-11 11:02:52 -07001[ndnSIM documentation](http://ndnsim.net)
2=========================================
Alexander Afanasyeva0d94892012-11-06 17:25:01 -08003
Alexander Afanasyev9ab7d672013-08-11 11:02:52 -07004For more information, including downloading and compilation instruction, please refer to documentation in ``doc/`` or on http://ndnsim.net
Alexander Afanasyeva0d94892012-11-06 17:25:01 -08005
Alexander Afanasyev9ab7d672013-08-11 11:02:52 -07006Getting Started
7---------------
Alexander Afanasyeva0d94892012-11-06 17:25:01 -08008
Alexander Afanasyev9ab7d672013-08-11 11:02:52 -07009### Portability
10
11ndnSIM has been successfully compiled and used under Ubuntu Linux 12.04 (boost libraries **1.48**, with default version 1.46 compilation will probably fail), 12.10 (default version of boost 1.49), 13.04 (default version of boost 1.49), Fedora 18, Mac OS 10.7 and 10.8 (gcc-4.2 apple/llvm, macports gcc 4.7, boost 1.49-1.54).
12
13### Requirements
14
151. 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).
16
172. Boost libraries should be installed on the system:
18
19 * For Ubuntu
20
21 * 12.04
22
23 sudo aptitude install libboost1.48-all-dev
24
25 * 12.10, 13.04, and newer versions
26
27 sudo aptitude install libboost-all-dev
28
29 * For Fedora (for Fedora 18 and later only):
30
31 sudo yum install boost-devel
32
33 * For MacOS (macports):
34
35 sudo port instal boost
36
37 **!!! ndnSIM requires boost version at least 1.48.** Many linux distribution (Fedora 16, 17 at the time of this writing) ship an old version of boost, making it impossible to compile ndnSIM out-of-the-box. Please install the latest version, following these simple instructions (http://ndnsim.net/faq.html#installing-boost-libraries).
38
39 **For Ubuntu 12.04** Ubuntu 12.04 ships with two versions of boost libraries and it is known that if both are installed, then compilation of ndnSIM will most likely fail. Please install ``libboost1.48-dev-all`` package and uninstall ``libboost-dev-all``. If you want to install the latest version of boost libraries, then uninstall both ``libboost1.48-dev-all`` and ``libboost-dev-all``, so the libraries do not interfere with each other.
40
41 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 the following example http://ndnsim.net/faq.html#installing-boost-libraries for the hints how to successfully compile and install boost libraries on Ubuntu Linux.
42
433. If you are planning to use other modules, like visualizer, a number of additional dependencies should be installed. For example, in
44order to run visualizer module (http://www.nsnam.org/wiki/index.php/PyViz), the following should be installed:
45
46 * For Ubuntu (tested on Ubuntu 12.04, 12.10, 13.04, should work on later versions as well):
47
48 sudo apt-get install python-dev python-pygraphviz python-kiwi
49 sudo apt-get install python-pygoocanvas python-gnome2
50 sudo apt-get install python-gnomedesktop python-rsvg ipython
51
52 * For Fedora (tested on Fedora 16):
53
54 sudo yum install pygoocanvas python-kiwi graphviz-python
55
56 # easy_install method, since pygraphviz is not (yet?) packaged into Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=740687)
57 sudo yum install graphviz-devel
58 sudo yum install python-pip
59 sudo easy_install pygraphviz
60
61 * For MacOS (macports):
62
63 sudo port install py27-pygraphviz py27-goocanvas
64
65### Downloading ndnSIM source
66
67Download a custom branch of NS-3 that contains all necessary patches, python binding generation library (optional), and clone actual ndnSIM code and place it in src/ folder:
68
69 mkdir ndnSIM
70 cd ndnSIM
71 git clone git://github.com/cawka/ns-3-dev-ndnSIM.git ns-3
72 git clone git://github.com/cawka/pybindgen.git pybindgen
73 git clone git://github.com/NDN-Routing/ndnSIM.git ns-3/src/ndnSIM
74
75There 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.
76
77If you have problems connecting to github, you can try to clone from google servers:
78
79 mkdir ndnSIM
80 cd ndnSIM
81 git clone https://code.google.com/p/ndnsim.ns3-base/ ns-3
82 git clone https://code.google.com/p/ndnsim.pybindgen/ pybindgen
83 git clone https://code.google.com/p/ndnsim/ ns-3/src/ndnSIM
84
85### Compiling and running ndnSIM
86
87ndnSIM uses standard NS-3 compilation procedure. Normally the following commands should be sufficient to configure and build ndnSIM with python bindings enabled:
88
89 cd <ns-3-folder>
90 ./waf configure --enable-examples
91 ./waf
92
93On MacOS (with macports), you may need to modify the configure command to use macports version of python:
94
95 cd <ns-3-folder>
96 ./waf configure --with-python=/opt/local/bin/python2.7 --enable-examples
97 ./waf
98
99Python 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'"):
100
101 cd <ns-3-folder>
102 ./waf configure --disable-python --enable-examples
103 ./waf
104
105For more configuration options, please refer to ``./waf --help``.
106
107To run :doc:`sample ndnSIM simulations <examples>`:
108
109 ./waf --run=ndn-simple
110
111or:
112
113 ./waf --run=ndn-grid
114
115If you have compiled with python bindings, then you can try to run these simulations with visualizer:
116
117 ./waf --run=ndn-simple --vis
118
119or:
120
121 ./waf --run=ndn-grid --vis
122
123**Do not forget to configure and compile NS-3 in optimized mode (``./waf configure -d optimized``) in order to run actual simulations.**
Alexander Afanasyeva0d94892012-11-06 17:25:01 -0800124
125
Alexander Afanasyev9ab7d672013-08-11 11:02:52 -0700126### Simulating using ndnSIM
127
128While it is possible to write simulations directly inside NS-3 (in ``scratch/`` folder) or ndnSIM (in ``examples/``), the recommended way is to write your simulation scenarios, as well as any custom extensions, separately from the NS-3 or ndnSIM core.
129
130For example, you can use the following template to write your extensions, simulation scenarios, and metric processing scripts: (http://github.com/cawka/ndnSIM-scenario-template):
131
132 mkdir ndnSIM
133 cd ndnSIM
134 git clone git://github.com/cawka/ns-3-dev-ndnSIM.git ns-3
135 git clone git://github.com/cawka/pybindgen.git pybindgen
136 git clone git://github.com/NDN-Routing/ndnSIM.git ns-3/src/ndnSIM
137
138 # Build and install NS-3 and ndnSIM
139 cd ns-3
140 ./waf configure -d optimized
141 ./waf
142
143 sudo ./waf install
144 cd ..
145
146 git clone git://github.com/cawka/ndnSIM-scenario-template.git scenario
147 cd scenario
148 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
149 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
150
151 ./waf configure
152
153 ./waf --run <scenario>
154
155For more detailed information, refer to README file (https://github.com/cawka/ndnSIM-scenario-template/blob/master/README.md).
156
157### Examples of template-based simulations
158
1591. ndnSIM examples from http://ndnsim.net website and more:
160
161- http://github.com/cawka/ndnSIM-examples or
162- http://code.google.com/p/ndnsim.ndnsim-examples/
163
1642. Script scenarios and graph processing scripts for simulations used in "A Case for Stateful Forwarding Plane" paper by Yi et al. (http://dx.doi.org/10.1016/j.comcom.2013.01.005):
165
166- http://github.com/cawka/ndnSIM-comcom-stateful-fw or
167- http://code.google.com/p/ndnsim.ndnsim-comcom/
168
1693. Script scenarios and graph processing scripts for simulations used in "Rapid Traffic Information Dissemination Using Named Data" paper by Wang et al. http://dx.doi.org/10.1145/2248361.2248365
170
171- http://github.com/cawka/ndnSIM-nom-rapid-car2car or
172- http://code.google.com/p/ndnsim.ndnsim-nom-rapid/
173
174- Rocketfuel-based topology generator for ndnSIM preferred format (randomly assigned link delays and bandwidth, based on estimated types of connections between nodes):
175
176- http://github.com/cawka/ndnSIM-sample-topologies or
177- http://code.google.com/p/ndnsim.ndnsim-sample-topo/