author | Craig Dowell <craigdo@ee.washington.edu> |
Thu, 22 Apr 2010 09:23:26 -0700 | |
changeset 6267 | 87a6cccfb2b5 |
parent 6189 | 450a3f4d9906 |
child 6489 | ad7efe876e91 |
permissions | -rw-r--r-- |
3332 | 1 |
|
2 |
@c ======================================================================== |
|
3 |
@c Begin document body here |
|
4 |
@c ======================================================================== |
|
5 |
||
6 |
@c ======================================================================== |
|
7 |
@c PART: Getting Started |
|
8 |
@c ======================================================================== |
|
9 |
@c The below chapters are under the major heading "Getting Started" |
|
10 |
@c This is similar to the Latex \part command |
|
11 |
@c |
|
12 |
@c ======================================================================== |
|
13 |
@c Getting Started |
|
14 |
@c ======================================================================== |
|
15 |
@node Getting Started |
|
16 |
@chapter Getting Started |
|
17 |
||
18 |
@menu |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
19 |
* Downloading ns-3:: |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
20 |
* Building ns-3:: |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
21 |
* Testing ns-3:: |
3341 | 22 |
* Running a Script:: |
3332 | 23 |
@end menu |
24 |
||
25 |
@c ======================================================================== |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
26 |
@c Downloading ns-3 |
3332 | 27 |
@c ======================================================================== |
28 |
||
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
29 |
@node Downloading ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
30 |
@section Downloading ns-3 |
3332 | 31 |
|
6267
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
32 |
@cindex Prerequisites |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
33 |
@cindex Dependencies |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
34 |
The @command{ns-3} system as a whole is a fairly complex system and has a |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
35 |
number of dependencies on other components. Along with the systems you will |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
36 |
most likely deal with every day (the GNU toolchain, Mercurial, you programmer |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
37 |
editor) you will need to ensure that a number of additional libraries are |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
38 |
present on your system before proceeding. @command{ns-3} provides a wiki |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
39 |
for your reading pleasure that includes pages with many useful hints and tips. |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
40 |
One such page is the ``Installation'' page, |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
41 |
@uref{http://www.nsnam.org/wiki/index.php/Installation}. |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
42 |
|
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
43 |
The ``Prerequisites'' section of this wiki page explains which packages are |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
44 |
required to support common @command{ns-3} options, and also provides the |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
45 |
commands used to install them for common Linux variants. Cygwin users will |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
46 |
have to use the Cygwin installer (if you are a Cygwin user, you used it to |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
47 |
install Cygwin). |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
48 |
|
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
49 |
You may want to take this opportunity to explore the @command{ns-3} wiki |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
50 |
a bit since there really is a wealth of information there. |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
51 |
|
3332 | 52 |
@cindex Linux |
53 |
@cindex Cygwin |
|
54 |
@cindex GNU |
|
55 |
@cindex toolchain |
|
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
56 |
@cindex Mercurial |
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
57 |
@cindex Waf |
3332 | 58 |
From this point forward, we are going to assume that the reader is working in |
59 |
Linux or a Linux emulation environment (Linux, Cygwin, etc.) and has the GNU |
|
6267
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
60 |
toolchain installed and verified along with the prerequisites mentioned |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
61 |
above. We are also going to assume that you have Mercurial and Waf installed |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
62 |
and running on the target system as described in the ``Getting Started'' section |
87a6cccfb2b5
Mention wiki page with prerequisites in tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
6189
diff
changeset
|
63 |
of the @command{ns-3} web site: |
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
64 |
@uref{http://www.nsnam.org/getting_started.html}. |
3332 | 65 |
|
66 |
@cindex tarball |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
67 |
The @command{ns-3} code is available in Mercurial repositories on the server |
4533 | 68 |
@uref{http://code.nsnam.org}. You can also download a tarball release at |
3700 | 69 |
@uref{http://www.nsnam.org/releases/}, or you can work with repositories |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
70 |
using Mercurial. We recommend using Mercurial unless there's a good reason |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
71 |
not to. See the end of this section for instructions on how to get a tarball |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
72 |
release. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
73 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
74 |
@cindex repository |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
75 |
The simplest way to get started using Mercurial repositories is to use the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
76 |
@code{ns-3-allinone} environment. This is a set of scripts that manages the |
4533 | 77 |
downloading and building of various subsystems of @command{ns-3} for you. We |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
78 |
recommend that you begin your @command{ns-3} adventures in this environment |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
79 |
as it can really simplify your life at this point. |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
80 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
81 |
@subsection Downloading ns-3 Using Mercurial |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
82 |
One practice is to create a directory called @code{repos} in one's home |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
83 |
directory under which one can keep local Mercurial repositories. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
84 |
@emph{Hint: we will assume you do this later in the tutorial.} If you adopt |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
85 |
that approach, you can get a copy of @code{ns-3-allinone} by typing the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
86 |
following into your Linux shell (assuming you have installed Mercurial): |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
87 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
88 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
89 |
cd |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
90 |
mkdir repos |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
91 |
cd repos |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
92 |
hg clone http://code.nsnam.org/ns-3-allinone |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
93 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
94 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
95 |
As the hg (Mercurial) command executes, you should see something like the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
96 |
following displayed, |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
97 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
98 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
99 |
destination directory: ns-3-allinone |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
100 |
requesting all changes |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
101 |
adding changesets |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
102 |
adding manifests |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
103 |
adding file changes |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
104 |
added 31 changesets with 45 changes to 7 files |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
105 |
7 files updated, 0 files merged, 0 files removed, 0 files unresolved |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
106 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
107 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
108 |
After the clone command completes, you should have a directory called |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
109 |
@code{ns-3-allinone} under your @code{~/repos} directory, the contents of which should |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
110 |
look something like the following: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
111 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
112 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
113 |
build.py* constants.py dist.py* download.py* README util.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
114 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
115 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
116 |
Notice that you really just downloaded some Python scripts. The next step |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
117 |
will be to use those scripts to download and build the @command{ns-3} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
118 |
distribution of your choice. |
3332 | 119 |
|
120 |
@cindex repository |
|
121 |
If you go to the following link: @uref{http://code.nsnam.org/}, |
|
122 |
you will see a number of repositories. Many are the private repositories of |
|
3347
dde05296726b
mispeeling in tutorial command sequence
Craig Dowell <craigdo@ee.washington.edu>
parents:
3346
diff
changeset
|
123 |
the @command{ns-3} development team. The repositories of interest to you will |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
124 |
be prefixed with ``ns-3''. Official releases of @command{ns-3} will be |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
125 |
numbered as @code{ns-3.<release>.<hotfix>}. For example, a second hotfix to a |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
126 |
still hypothetical release nine of @command{ns-3} would be numbered as |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
127 |
@code{ns-3.9.2}. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
128 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
129 |
We have had a regression testing framework in place since the first release. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
130 |
For each release, a set of output files that define ``good behavior'' are saved. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
131 |
These known good output files are called reference traces and are associated |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
132 |
with a given release by name. For example, in @uref{http://code.nsnam.org/} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
133 |
you will find a repository named @code{ns-3.1} which is the first stable release |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
134 |
of @command{ns-3}. You will also find a separate repository named |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
135 |
@code{ns-3.1-ref-traces} that holds the reference traces for the @code{ns-3.1} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
136 |
release. It is crucial to keep these files consistent if you want to do any |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
137 |
regression testing of your repository. This is a good idea to do at least once |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
138 |
to verify everything has built correctly. |
3332 | 139 |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
140 |
The current development snapshot (unreleased) of @command{ns-3} may be found |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
141 |
at @uref{http://code.nsnam.org/ns-3-dev/} and the associated reference traces |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
142 |
may be found at @uref{http://code.nsnam.org/ns-3-dev-ref-traces/}. The |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
143 |
developers attempt to keep these repository in consistent, working states but |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
144 |
they are in a development area with unreleased code present, so you may want |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
145 |
to consider staying with an official release if you do not need newly- |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
146 |
introduced features. |
3332 | 147 |
|
148 |
Since the release numbers are going to be changing, I will stick with |
|
149 |
the more constant ns-3-dev here in the tutorial, but you can replace the |
|
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
150 |
string ``ns-3-dev'' with your choice of release (e.g., ns-3.6 and |
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
151 |
ns-3.6-ref-traces) in the text below. You can find the latest version of the |
4533 | 152 |
code either by inspection of the repository list or by going to the |
153 |
@uref{http://www.nsnam.org/getting_started.html,,``Getting Started''} |
|
154 |
web page and looking for the latest release identifier. |
|
3332 | 155 |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
156 |
Go ahead and change into the @code{ns-3-allinone} directory you created when |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
157 |
you cloned that repository. We are now going to use the @code{download.py} |
4533 | 158 |
script to pull down the various pieces of @command{ns-3} you will be using. |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
159 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
160 |
Go ahead and type the following into your shell (remember you can substitute |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
161 |
the name of your chosen release number instead of @code{ns-3-dev} -- like |
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
162 |
@code{"ns-3.6"} and @code{"ns-3.6-ref-traces"} if you want to work with a |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
163 |
stable release). |
3332 | 164 |
|
165 |
@verbatim |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
166 |
./download.py -n ns-3-dev -r ns-3-dev-ref-traces |
3332 | 167 |
@end verbatim |
168 |
||
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
169 |
Note that the default for the @code{-n} option is @code{ns-3-dev} and the |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
170 |
default for the @code{-r} option is @code{ns-3-dev-ref-traces} and so the |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
171 |
above is actually redundant. We provide this example to illustrate how to |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
172 |
specify alternate repositories. In order to download @code{ns-3-dev} you |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
173 |
can actually use the defaults and simply type, |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
174 |
|
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
175 |
@verbatim |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
176 |
./download.py |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
177 |
@end verbatim |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
178 |
|
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
179 |
As the hg (Mercurial) command executes, you should see something like the |
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
180 |
following, |
3332 | 181 |
|
182 |
@verbatim |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
183 |
# |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
184 |
# Get NS-3 |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
185 |
# |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
186 |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
187 |
Cloning ns-3 branch |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
188 |
=> hg clone http://code.nsnam.org/ns-3-dev ns-3-dev |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
189 |
requesting all changes |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
190 |
adding changesets |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
191 |
adding manifests |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
192 |
adding file changes |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
193 |
added 4634 changesets with 16500 changes to 1762 files |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
194 |
870 files updated, 0 files merged, 0 files removed, 0 files unresolved |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
195 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
196 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
197 |
This is output by the download script as it fetches the actual @code{ns-3} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
198 |
code from the repository. Next, you should see something like, |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
199 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
200 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
201 |
# |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
202 |
# Get the regression traces |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
203 |
# |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
204 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
205 |
Synchronizing reference traces using Mercurial. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
206 |
=> hg clone http://code.nsnam.org/ns-3-dev-ref-traces ns-3-dev-ref-traces |
3332 | 207 |
requesting all changes |
208 |
adding changesets |
|
209 |
adding manifests |
|
210 |
adding file changes |
|
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
211 |
added 86 changesets with 1178 changes to 259 files |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
212 |
208 files updated, 0 files merged, 0 files removed, 0 files unresolved |
3332 | 213 |
@end verbatim |
214 |
||
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
215 |
This is the download script fetching the reference trace files for you. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
216 |
The download script is smart enough to know that on some platforms various |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
217 |
pieces of ns-3 are not supported. On your platform you may not see some |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
218 |
of these pieces come down. However, on most platforms, the process should |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
219 |
continue with something like, |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
220 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
221 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
222 |
# |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
223 |
# Get PyBindGen |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
224 |
# |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
225 |
|
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
226 |
Required pybindgen version: 0.10.0.640 |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
227 |
Trying to fetch pybindgen; this will fail if no network connection is available. Hit Ctrl-C to skip. |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
228 |
=> bzr checkout -rrevno:640 https://launchpad.net/pybindgen pybindgen |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
229 |
Fetch was successful. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
230 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
231 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
232 |
This was the download script getting the Python bindings generator for you. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
233 |
Next you should see (modulo platform variations) something along the lines of, |
3332 | 234 |
|
235 |
@verbatim |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
236 |
# |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
237 |
# Get NSC |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
238 |
# |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
239 |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
240 |
Required NSC version: nsc-0.5.0 |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
241 |
Retrieving nsc from https://secure.wand.net.nz/mercurial/nsc |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
242 |
=> hg clone https://secure.wand.net.nz/mercurial/nsc nsc |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
243 |
requesting all changes |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
244 |
adding changesets |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
245 |
adding manifests |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
246 |
adding file changes |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
247 |
added 273 changesets with 17565 changes to 15175 files |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
248 |
10622 files updated, 0 files merged, 0 files removed, 0 files unresolved |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
249 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
250 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
251 |
This part of the process is the script downloading the Network Simulation |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
252 |
Cradle for you. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
253 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
254 |
After the clone command completes, you should have several new directories |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
255 |
under @code{~/repos/ns-3-allinone}: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
256 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
257 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
258 |
build.py* constants.pyc download.py* ns-3-dev-ref-traces/ pybindgen/ util.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
259 |
constants.py dist.py* ns-3-dev/ nsc/ README util.pyc |
3332 | 260 |
@end verbatim |
261 |
||
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
262 |
Go ahead and change into @code{ns-3-dev} under your @code{~/repos/ns-3-allinone} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
263 |
directory. You should see something like the following there: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
264 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
265 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
266 |
AUTHORS examples/ regression/ scratch/ waf* |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
267 |
bindings/ LICENSE regression.py src/ waf.bat* |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
268 |
CHANGES.html ns3/ RELEASE_NOTES utils/ wscript |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
269 |
doc/ README samples/ VERSION wutils.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
270 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
271 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
272 |
You are now ready to build the @command{ns-3} distribution. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
273 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
274 |
@subsection Downloading ns-3 Using a Tarball |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
275 |
The process for downloading @command{ns-3} via tarball is simpler than the |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
276 |
Mercurial process since all of the pieces are pre-packaged for you. You just |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
277 |
have to pick a release, download it and decompress it. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
278 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
279 |
As mentioned above, one practice is to create a directory called @code{repos} |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
280 |
in one's home directory under which one can keep local Mercurial repositories. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
281 |
One could also keep a @code{tarballs} directory. @emph{Hint: the tutorial |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
282 |
will assume you downloaded into a @code{repos} directory, so remember the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
283 |
placekeeper.} If you adopt the @code{tarballs} directory approach, you can |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
284 |
get a copy of a release by typing the following into your Linux shell |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
285 |
(substitute the appropriate version numbers, of course): |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
286 |
|
3700 | 287 |
@verbatim |
288 |
cd |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
289 |
mkdir tarballs |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
290 |
cd tarballs |
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
291 |
wget http://www.nsnam.org/releases/ns-allinone-3.6.tar.bz2 |
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
292 |
tar xjf ns-allinone-3.6.tar.bz2 |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
293 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
294 |
|
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
295 |
If you change into the directory @code{ns-allinone-3.6} you should see a |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
296 |
number of files: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
297 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
298 |
@verbatim |
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
299 |
build.py* ns-3.6/ nsc-0.5.1/ README |
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
300 |
constants.py ns-3.6-ref-traces/ pybindgen-0.12.0.700/ util.py |
3700 | 301 |
@end verbatim |
302 |
||
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
303 |
You are now ready to build the @command{ns-3} distribution. |
3332 | 304 |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
305 |
@c ======================================================================== |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
306 |
@c Building ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
307 |
@c ======================================================================== |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
308 |
|
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
309 |
@node Building ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
310 |
@section Building ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
311 |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
312 |
@subsection Building with build.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
313 |
@cindex building with build.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
314 |
The first time you build the @command{ns-3} project you should build using the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
315 |
@command{allinone} environment. This will get the project configured for you |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
316 |
in the most commonly useful way. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
317 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
318 |
Change into the directory you created in the download section above. If you |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
319 |
downloaded using Mercurial you should have a directory called |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
320 |
@code{ns-3-allinone} under your @code{~/repos} directory. If you downloaded |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
321 |
using a tarball you should have a directory called something like |
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
322 |
@code{ns-allinone-3.6} under your @code{~/tarballs} directory. Take a deep |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
323 |
breath and type the following: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
324 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
325 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
326 |
./build.py |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
327 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
328 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
329 |
You will see lots of typical compiler output messages displayed as the build |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
330 |
script builds the various pieces you downloaded. Eventually you should see the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
331 |
following magic words: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
332 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
333 |
@verbatim |
5404
930965240183
Update tutorial typos
Craig Dowell <craigdo@ee.washington.edu>
parents:
4634
diff
changeset
|
334 |
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build' |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
335 |
'build' finished successfully (2m30.586s) |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
336 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
337 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
338 |
Once the project has built you can say goodbye to your old friends, the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
339 |
@code{ns-3-allinone} scripts. You got what you needed from them and will now |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
340 |
interact directly with Waf and we do it in the @code{ns-3-dev} directory, |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
341 |
not in the @code{ns-3-allinone} directory. Go ahead and change into the |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
342 |
@code{ns-3-dev} directory (or the directory for the appropriate release you |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
343 |
downloaded. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
344 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
345 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
346 |
cd ns-3-dev |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
347 |
@end verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
348 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
349 |
@subsection Building with Waf |
3339
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
350 |
@cindex building with Waf |
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
351 |
@cindex configuring Waf |
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
352 |
@cindex building debug version with Waf |
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
353 |
@cindex compiling with Waf |
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
354 |
@cindex unit tests with Waf |
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
355 |
@cindex regression tests with Waf |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
356 |
We use Waf to configure and build the @command{ns-3} project. It's not |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
357 |
strictly required at this point, but it will be valuable to take a slight |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
358 |
detour and look at how to make changes to the configuration of the project. |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
359 |
Probably the most useful configuration change you can make will be to |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
360 |
build the optimized version of the code. By default you have configured |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
361 |
your project to build the debug version. Let's tell the project to do |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
362 |
make an optimized build. To explain to Waf that it should do optimized |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
363 |
builds you will need to execute the following command, |
3332 | 364 |
|
365 |
@verbatim |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
366 |
./waf -d optimized configure |
3332 | 367 |
@end verbatim |
368 |
||
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
369 |
This runs Waf out of the local directory (which is provided as a convenience |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
370 |
for you). As the build system checks for various dependencies you should see |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
371 |
output that looks similar to the following, |
3332 | 372 |
|
373 |
@verbatim |
|
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
374 |
Checking for program g++ : ok /usr/bin/g++ |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
375 |
Checking for program cpp : ok /usr/bin/cpp |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
376 |
Checking for program ar : ok /usr/bin/ar |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
377 |
Checking for program ranlib : ok /usr/bin/ranlib |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
378 |
Checking for g++ : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
379 |
Checking for program pkg-config : ok /usr/bin/pkg-config |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
380 |
Checking for regression reference traces : ok ../ns-3-dev-ref-traces (guessed) |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
381 |
Checking for -Wno-error=deprecated-declarations support : yes |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
382 |
Checking for -Wl,--soname=foo support : yes |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
383 |
Checking for header stdlib.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
384 |
Checking for header signal.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
385 |
Checking for header pthread.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
386 |
Checking for high precision time implementation : 128-bit integer |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
387 |
Checking for header stdint.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
388 |
Checking for header inttypes.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
389 |
Checking for header sys/inttypes.h : not found |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
390 |
Checking for library rt : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
391 |
Checking for header netpacket/packet.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
392 |
Checking for pkg-config flags for GSL : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
393 |
Checking for header linux/if_tun.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
394 |
Checking for pkg-config flags for GTK_CONFIG_STORE : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
395 |
Checking for pkg-config flags for LIBXML2 : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
396 |
Checking for library sqlite3 : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
397 |
Checking for NSC location : ok ../nsc (guessed) |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
398 |
Checking for library dl : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
399 |
Checking for NSC supported architecture x86_64 : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
400 |
Checking for program python : ok /usr/bin/python |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
401 |
Checking for Python version >= 2.3 : ok 2.5.2 |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
402 |
Checking for library python2.5 : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
403 |
Checking for program python2.5-config : ok /usr/bin/python2.5-config |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
404 |
Checking for header Python.h : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
405 |
Checking for -fvisibility=hidden support : yes |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
406 |
Checking for pybindgen location : ok ../pybindgen (guessed) |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
407 |
Checking for Python module pybindgen : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
408 |
Checking for pybindgen version : ok 0.10.0.640 |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
409 |
Checking for Python module pygccxml : ok |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
410 |
Checking for pygccxml version : ok 0.9.5 |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
411 |
Checking for program gccxml : ok /usr/local/bin/gccxml |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
412 |
Checking for gccxml version : ok 0.9.0 |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
413 |
Checking for program sudo : ok /usr/bin/sudo |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
414 |
Checking for program hg : ok /usr/bin/hg |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
415 |
Checking for program valgrind : ok /usr/bin/valgrind |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
416 |
---- Summary of optional NS-3 features: |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
417 |
Threading Primitives : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
418 |
Real Time Simulator : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
419 |
Emulated Net Device : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
420 |
GNU Scientific Library (GSL) : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
421 |
Tap Bridge : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
422 |
GtkConfigStore : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
423 |
XmlIo : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
424 |
SQlite stats data output : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
425 |
Network Simulation Cradle : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
426 |
Python Bindings : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
427 |
Python API Scanning Support : enabled |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
428 |
Use sudo to set suid bit : not enabled (option --enable-sudo not selected) |
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
429 |
Build examples and samples : enabled |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
430 |
Static build : not enabled (option --enable-static not selected) |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
431 |
'configure' finished successfully (2.870s) |
3332 | 432 |
@end verbatim |
433 |
||
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
434 |
Note the last part of the above output. Some ns-3 options are not enabled by |
4533 | 435 |
default or require support from the underlying system to work properly. |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
436 |
For instance, to enable XmlTo, the library libxml-2.0 must be found on the |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
437 |
system. If this library were not found, the corresponding @command{ns-3} feature |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
438 |
would not be enabled and a message would be displayed. Note further that there is |
6189 | 439 |
a feature to use the program @code{sudo} to set the suid bit of certain programs. |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
440 |
This is not enabled by default and so this feature is reported as ``not enabled.'' |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
441 |
|
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
442 |
Now go ahead and switch back to the debug build. |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
443 |
|
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
444 |
@verbatim |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
445 |
./waf -d debug configure |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
446 |
@end verbatim |
3700 | 447 |
|
3332 | 448 |
The build system is now configured and you can build the debug versions of |
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
449 |
the @command{ns-3} programs by simply typing, |
3332 | 450 |
|
451 |
@verbatim |
|
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
452 |
./waf |
3332 | 453 |
@end verbatim |
454 |
||
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
455 |
Some waf commands are meaningful during the build phase and some commands are valid |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
456 |
in the configuration phase. For example, if you wanted to use the emulation |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
457 |
features of @command{ns-3} you might want to enable setting the suid bit using |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
458 |
sudo as described above. This turns out to be a configuration-time command, and so |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
459 |
you could reconfigure using the following command |
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
460 |
|
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
461 |
@verbatim |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
462 |
./waf -d debug --enable-sudo configure |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
463 |
@end verbatim |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
464 |
|
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
465 |
If you do this, waf will have run sudo to change the socket creator programs of the |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
466 |
emulation code to run as root. There are many other configure- and build-time options |
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
467 |
available in waf. To explore these options, type: |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
468 |
|
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
469 |
@verbatim |
4533 | 470 |
./waf --help |
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
471 |
@end verbatim |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
472 |
|
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
473 |
We'll use some of the testing-related commands in the next section. |
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
474 |
|
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
475 |
Okay, sorry, I made you build the @command{ns-3} part of the system twice, |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
476 |
but now you know how to change the configuration and build optimized code. |
3332 | 477 |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
478 |
@c ======================================================================== |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
479 |
@c Testing ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
480 |
@c ======================================================================== |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
481 |
|
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
482 |
@node Testing ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
483 |
@section Testing ns-3 |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
484 |
|
3339
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
485 |
@cindex unit tests |
3700 | 486 |
You can run the unit tests of the @command{ns-3} distribution by running the |
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
487 |
``./test.py -c core'' script, |
3332 | 488 |
|
489 |
@verbatim |
|
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
490 |
./test.py -c core |
3332 | 491 |
@end verbatim |
492 |
||
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
493 |
These tests are run in parallel by waf. You should eventually |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
494 |
see a report saying that, |
3332 | 495 |
|
496 |
@verbatim |
|
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
497 |
47 of 47 tests passed (47 passed, 0 failed, 0 crashed, 0 valgrind errors) |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
498 |
@end verbatim |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
499 |
|
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
500 |
This is the important message. |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
501 |
|
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
502 |
You will also see output from the test runner and the output will actually look something like, |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
503 |
|
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
504 |
@verbatim |
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
505 |
Waf: Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build' |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
506 |
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build' |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
507 |
'build' finished successfully (1.799s) |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
508 |
PASS: TestSuite ns3-wifi-interference |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
509 |
PASS: TestSuite histogram |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
510 |
PASS: TestSuite sample |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
511 |
PASS: TestSuite ipv4-address-helper |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
512 |
PASS: TestSuite devices-wifi |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
513 |
PASS: TestSuite propagation-loss-model |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
514 |
|
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
515 |
... |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
516 |
|
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
517 |
PASS: TestSuite attributes |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
518 |
PASS: TestSuite config |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
519 |
PASS: TestSuite global-value |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
520 |
PASS: TestSuite command-line |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
521 |
PASS: TestSuite basic-random-number |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
522 |
PASS: TestSuite object |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
523 |
PASS: TestSuite random-number-generators |
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
524 |
47 of 47 tests passed (47 passed, 0 failed, 0 crashed, 0 valgrind errors) |
3332 | 525 |
@end verbatim |
526 |
||
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
527 |
This command is typically run by @code{users} to quickly verify that an |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
528 |
@command{ns-3} distribution has built correctly. |
3332 | 529 |
|
3700 | 530 |
@cindex regression tests |
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
531 |
You can also run our regression test suite to ensure that your distribution and |
4533 | 532 |
toolchain have produced binaries that generate output that is identical to |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
533 |
known-good reference output files. You downloaded these reference traces to |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
534 |
your machine during the @code{./download.py} process above. (Warning: The |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
535 |
@code{ns-3.2} and @code{ns-3.3} releases do not use the @code{ns-3-allinone} |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
536 |
environment and require you to be online when you run regression tests because |
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
537 |
they dynamically synchronize the reference traces directory with an online |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
538 |
repository immediately prior to the run). |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
539 |
|
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
540 |
During regression testing Waf will run a number of tests that generate what we |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
541 |
call trace files. The content of these trace files are compared with the |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
542 |
reference traces. If they are identical, the regression tests report a PASS |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
543 |
status. If a regression test fails you will see a FAIL indication along with a |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
544 |
pointer to the offending trace file and its associated reference trace file |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
545 |
along with a suggestion on diff parameters and options in order to see what |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
546 |
has gone awry. If the error was discovered in a pcap file, it will be useful |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
547 |
to convert the pcap files to text using tcpdump prior to comparison. |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
548 |
|
4533 | 549 |
Some regression tests may be SKIPped if the required support |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
550 |
is not present. |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
551 |
|
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
552 |
Note that the regression tests are also run in parallel and so the messages |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
553 |
may be interleaved. |
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
554 |
|
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
555 |
To run the regression tests, you provide Waf with the regression flag. |
3332 | 556 |
|
557 |
@verbatim |
|
558 |
./waf --regression |
|
559 |
@end verbatim |
|
560 |
||
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
561 |
You should see messages indicating that many tests are being run and are |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
562 |
passing. |
3332 | 563 |
|
564 |
@verbatim |
|
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
565 |
Entering directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build' |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
566 |
[647/669] regression-test (test-csma-bridge) |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
567 |
[648/669] regression-test (test-csma-broadcast) |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
568 |
[649/669] regression-test (test-csma-multicast) |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
569 |
[650/669] regression-test (test-csma-one-subnet) |
3332 | 570 |
PASS test-csma-multicast |
4292
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
571 |
[651/669] regression-test (test-csma-packet-socket) |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
572 |
PASS test-csma-bridge |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
573 |
... |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
574 |
Regression testing summary: |
ef09115f80ca
tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents:
3733
diff
changeset
|
575 |
PASS: 22 of 22 tests passed |
5405
a952a8ac71ee
update tutorial paths for new examples directory
Craig Dowell <craigdo@ee.washington.edu>
parents:
5404
diff
changeset
|
576 |
Waf: Leaving directory `/home/craigdo/repos/ns-3-allinone/ns-3-dev/build' |
4634
46687cc0acb6
update tutorial for ns-3.5
Craig Dowell <craigdo@ee.washington.edu>
parents:
4534
diff
changeset
|
577 |
'build' finished successfully (25.826s) |
3332 | 578 |
@end verbatim |
579 |
||
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
580 |
If you want to take a look at an example of what might be checked during |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
581 |
a regression test, you can do the following: |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
582 |
|
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
583 |
@verbatim |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
584 |
cd build/debug/regression/traces/second.ref |
4295
6f7c05fd0f9b
fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents:
4294
diff
changeset
|
585 |
tcpdump -nn -tt -r second-2-0.pcap |
4293
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
586 |
@end verbatim |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
587 |
|
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
588 |
The output should be clear to anyone who is familiar with tcpdump or net |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
589 |
sniffers. We'll have much more to say on pcap files later in this tutorial. |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
590 |
|
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
591 |
Remember to cd back into the top-level @command{ns-3} directory |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
592 |
after you are done: |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
593 |
|
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
594 |
@verbatim |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
595 |
cd ../../../../.. |
11a2cda6a096
clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents:
4292
diff
changeset
|
596 |
@end verbatim |
3332 | 597 |
|
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
598 |
@c ======================================================================== |
3346 | 599 |
@c Running a Script |
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
600 |
@c ======================================================================== |
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
601 |
|
3341 | 602 |
@node Running a Script |
3332 | 603 |
@section Running a Script |
3339
ff29f4ba75ed
finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents:
3332
diff
changeset
|
604 |
@cindex running a script with Waf |
3332 | 605 |
We typically run scripts under the control of Waf. This allows the build |
606 |
system to ensure that the shared library paths are set correctly and that |
|
607 |
the libraries are available at run time. To run a program, simply use the |
|
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
608 |
@code{--run} option in Waf. Let's run the @command{ns-3} equivalent of the |
3345
b0af63b9f9a6
editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3339
diff
changeset
|
609 |
ubiquitous hello world program by typing the following: |
3332 | 610 |
|
611 |
@verbatim |
|
612 |
./waf --run hello-simulator |
|
613 |
@end verbatim |
|
614 |
||
615 |
Waf first checks to make sure that the program is built correctly and |
|
4533 | 616 |
executes a build if required. Waf then executes the program, which |
3332 | 617 |
produces the following output. |
618 |
||
619 |
@verbatim |
|
620 |
Hello Simulator |
|
621 |
@end verbatim |
|
622 |
||
3354
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
623 |
@emph{Congratulations. You are now an ns-3 user.} |
f11e4def3fc4
tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
3347
diff
changeset
|
624 |
|
6151
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
625 |
@emph{What do I do if I don't see the output?} |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
626 |
|
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
627 |
If you don't see @code{waf} messages indicating that the build was |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
628 |
completed successfully, but do not see the ``Hello Simulator'' output, |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
629 |
chances are that you have switched your build mode to ``optimized'' in |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
630 |
the ``Building with Waf'' section, but have missed the change back to |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
631 |
``debug'' mode. All of the console output used in this tutorial uses a |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
632 |
special @command{ns-3} logging component that is useful for printing |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
633 |
user messages to the console. Output from this component is |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
634 |
automatically disabled when you compile optimized code -- it is |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
635 |
``optimized out.'' If you don't see the ``Hello Simulator'' output, |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
636 |
type the following, |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
637 |
|
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
638 |
@verbatim |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
639 |
./waf -d debug configure |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
640 |
@end verbatim |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
641 |
|
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
642 |
to tell @code{waf} to build the debug versions of the @command{ns-3} |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
643 |
programs. You must still build the actual debug version of the code by |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
644 |
typing, |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
645 |
|
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
646 |
@verbatim |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
647 |
./waf |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
648 |
@end verbatim |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
649 |
|
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
650 |
Now, if you run the @code{hello-simulator} program, you should see the |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
651 |
expected output. |
9f2dea6094da
small explanation about (lack of) logging in optimized builds
Craig Dowell <craigdo@ee.washington.edu>
parents:
5405
diff
changeset
|
652 |
|
3332 | 653 |
If you want to run programs under another tool such as gdb or valgrind, |
654 |
see this @uref{http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool,,wiki entry}. |
|
655 |