doc/tutorial/getting-started.texi
author Craig Dowell <craigdo@ee.washington.edu>
Wed, 25 Mar 2009 09:34:39 -0700
changeset 4295 6f7c05fd0f9b
parent 4294 ebb973fdb763
child 4304 9da5383b0c87
permissions -rw-r--r--
fix some tutorial nits
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
@c Begin document body here
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
@c PART:  Getting Started
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
@c The below chapters are under the major heading "Getting Started"
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
@c This is similar to the Latex \part command
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
@c
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
@c Getting Started
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
@node Getting Started
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
@chapter Getting Started
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    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
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3332
diff changeset
    22
* Running a Script::
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
@end menu
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    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
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    27
@c ========================================================================
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    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
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
@cindex Linux
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
@cindex Cygwin
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
@cindex GNU
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    35
@cindex toolchain
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    36
@cindex Mercurial
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    37
@cindex Waf
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
From this point forward, we are going to assume that the reader is working in
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
Linux or a Linux emulation environment (Linux, Cygwin, etc.) and has the GNU
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    40
toolchain installed and verified.  We are also going to assume that you have
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    41
Mercurial and Waf installed and running on the target system as described in
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    42
the Getting Started section of the  @command{ns-3} web site: 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    43
@uref{http://www.nsnam.org/getting_started.html}.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
@cindex tarball
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    46
The @command{ns-3} code is available in Mercurial repositories on the server
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    47
code.nsnam.org.  You can also download a tarball release at
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
    48
@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
    49
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
    50
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
    51
release.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    52
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    53
@cindex repository
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    54
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
    55
@code{ns-3-allinone} environment.  This is a set of scripts that manages the 
4293
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
    56
downloading and building of various subystems of @command{ns-3} for you.  We 
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
    57
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
    58
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
    59
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    60
@subsection Downloading ns-3 Using Mercurial
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    61
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
    62
directory under which one can keep local Mercurial repositories.  
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    63
@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
    64
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
    65
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
    66
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    67
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    68
  cd
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    69
  mkdir repos
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    70
  cd repos
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    71
  hg clone http://code.nsnam.org/ns-3-allinone
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    72
@end verbatim
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
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
    75
following displayed,
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    76
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    77
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    78
  destination directory: ns-3-allinone
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    79
  requesting all changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    80
  adding changesets
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    81
  adding manifests
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    82
  adding file changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    83
  added 26 changesets with 40 changes to 7 files
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    84
  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
    85
@end verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    86
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    87
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
    88
@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
    89
look something like the following:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    90
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    91
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
    92
  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
    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
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
    96
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
    97
distribution of your choice.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
@cindex repository
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
If you go to the following link: @uref{http://code.nsnam.org/},
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
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
   102
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
   103
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
   104
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
   105
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
   106
@code{ns-3.9.2}.
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
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
   109
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
   110
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
   111
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
   112
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
   113
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
   114
@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
   115
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
   116
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
   117
to verify everything has built correctly.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   119
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
   120
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
   121
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
   122
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
   123
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
   124
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
   125
introduced features.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
Since the release numbers are going to be changing, I will stick with 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
the more constant ns-3-dev here in the tutorial, but you can replace the 
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   129
string ``ns-3-dev'' with your choice of release (e.g., ns-3.4 and 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   130
ns-3.4-ref-traces) in the text below.  You can find the latest version  of the
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   131
code either by inspection of the repository list or by going to the ``Getting 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   132
Started'' web page and looking for the latest release identifier.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   134
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
   135
you cloned that repository.  We are now going to use the @code{download.py} 
4293
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   136
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
   137
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   138
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
   139
the name of your chosen release number instead of @code{ns-3-dev} -- like
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   140
@code{"ns-3.4"} and @code{"ns-3.4-ref-traces"} if you want to work with a 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   141
stable release).
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
@verbatim
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   144
  ./download.py -n ns-3-dev -r ns-3-dev-ref-traces
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   147
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
   148
following,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   150
@verbatim
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   151
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   152
      # Get NS-3
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   153
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   154
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   155
  Cloning ns-3 branch
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   156
   =>  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
   157
  requesting all changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   158
  adding changesets
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   159
  adding manifests
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   160
  adding file changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   161
  added 4292 changesets with 15368 changes to 1671 files
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   162
  823 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
   163
@end verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   164
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   165
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
   166
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
   167
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   168
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   169
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   170
      # Get the regression traces
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   171
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   172
  
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   173
  Synchronizing reference traces using Mercurial.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   174
   =>  hg clone http://code.nsnam.org/ns-3-dev-ref-traces ns-3-dev-ref-traces
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   175
  requesting all changes
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   176
  adding changesets
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   177
  adding manifests
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   178
  adding file changes
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   179
  added 79 changesets with 1102 changes to 222 files
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   180
  206 files updated, 0 files merged, 0 files removed, 0 files unresolved
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   182
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   183
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
   184
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
   185
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
   186
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
   187
continue with something like,
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   188
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   189
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   190
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   191
      # Get PyBindGen
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   192
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   193
  
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   194
  Required pybindgen version:  0.10.0.630
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   195
  Trying to fetch pybindgen; this will fail if no network connection is available.  Hit Ctrl-C to skip.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   196
   =>  bzr checkout -rrevno:630 https://launchpad.net/pybindgen pybindgen
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   197
  Fetch was successful.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   198
@end verbatim
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
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
   201
Next you should see (modulo platform variations) something along the lines of,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   202
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   203
@verbatim
4292
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
      # Get NSC
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   206
      #
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   207
  
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   208
  Required NSC version:  nsc-0.5.0
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   209
  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
   210
   =>  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
   211
  requesting all changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   212
  adding changesets
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   213
  adding manifests
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   214
  adding file changes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   215
  added 270 changesets with 17375 changes to 14991 files
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   216
  10614 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
   217
@end verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   218
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   219
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
   220
Cradle for you.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   221
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   222
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
   223
under @code{~/repos/ns-3-allinone}:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   224
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   225
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   226
  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
   227
  constants.py  dist.py*       ns-3-dev/     nsc/                  README      util.pyc
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   228
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   229
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   230
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
   231
directory.  You should see something like the following there:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   232
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   233
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   234
  AUTHORS       examples/  regression/    scratch/  waf*
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   235
  bindings/     LICENSE    regression.py  src/      waf.bat*
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   236
  CHANGES.html  ns3/       RELEASE_NOTES  utils/    wscript
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   237
  doc/          README     samples/       VERSION   wutils.py
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   238
@end verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   239
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   240
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
   241
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   242
@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
   243
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
   244
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
   245
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
   246
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   247
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
   248
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
   249
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
   250
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
   251
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
   252
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
   253
(substitute the appropriate version numbers, of course):
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   254
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   255
@verbatim
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   256
  cd
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   257
  mkdir tarballs
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   258
  cd tarballs
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   259
  wget http://www.nsnam.org/releases/ns-allinone-3.4.tar.bz2
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   260
  bunzip2 ns-allinone-3.4.tar.bz2
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   261
  tar xf ns-3.4.tar
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   262
@end verbatim 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   263
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   264
If you change into the directory @code{ns-allinone-3.4} you should see a
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   265
number of files:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   266
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   267
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   268
build.py*     ns-3.4-RC2/             nsc-0.5.0/             util.py
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   269
constants.py  ns-3.4-RC2-ref-traces/  pybindgen-0.10.0.630/
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   270
@end verbatim 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   271
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   272
You are now ready to build the @command{ns-3} distribution.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   274
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   275
@c Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   276
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   277
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   278
@node Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   279
@section Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   280
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   281
@subsection Building with build.py
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   282
@cindex building with build.py
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   283
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
   284
@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
   285
in the most commonly useful way.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   286
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   287
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
   288
downloaded using Mercurial you should have a directory called 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   289
@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
   290
using a tarball you should have a directory called something like 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   291
@code{ns-3-allinone-3.4} under your @code{~/tarballs} directory.  Take a deep
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   292
breath and type the following:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   293
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   294
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   295
  ./build.py
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   296
@end verbatim
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
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
   299
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
   300
following magic words:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   301
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   302
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   303
  Build finished successfully (00:02:37)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   304
  Leaving directory `./ns-3-dev'
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   305
@end verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   306
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   307
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
   308
@code{ns-3-allinone} scripts.  You got what you needed from them and will now 
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   309
interact directly with Waf and we do it in the @code{ns-3-dev} directory and
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   310
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
   311
@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
   312
downloaded.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   313
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   314
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   315
  cd ns-3-dev
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   316
@end verbatim
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
@subsection Building with Waf
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   319
@cindex building with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   320
@cindex configuring Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   321
@cindex building debug version with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   322
@cindex compiling with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   323
@cindex unit tests with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   324
@cindex regression tests with Waf
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   325
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
   326
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
   327
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
   328
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
   329
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
   330
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
   331
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
   332
builds you will need to execute the following command,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
@verbatim
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   335
  ./waf -d optimized configure
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   336
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   338
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
   339
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
   340
output that looks similar to the following,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   341
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   342
@verbatim
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   343
Checking for program g++                 : ok /usr/bin/g++
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   344
Checking for program cpp                 : ok /usr/bin/cpp
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   345
Checking for program ar                  : ok /usr/bin/ar
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   346
Checking for program ranlib              : ok /usr/bin/ranlib
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   347
Checking for g++                         : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   348
Checking for program pkg-config          : ok /usr/bin/pkg-config
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   349
Checking for regression reference traces  : ok ../ns-3-dev-ref-traces (guessed)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   350
Checking for -Wno-error=deprecated-declarations support : yes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   351
Checking for header stdlib.h                            : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   352
Checking for header signal.h                            : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   353
Checking for header pthread.h                           : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   354
Checking for high precision time implementation         : 128-bit integer
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   355
Checking for header stdint.h                            : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   356
Checking for header inttypes.h                          : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   357
Checking for header sys/inttypes.h                      : not found
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   358
Checking for library rt                                 : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   359
Checking for header netpacket/packet.h                  : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   360
Checking for header linux/if_tun.h                      : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   361
Checking for pkg-config flags for GTK_CONFIG_STORE      : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   362
Package libxml-2.0 was not found in the pkg-config search path.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   363
Perhaps you should add the directory containing `libxml-2.0.pc'
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   364
to the PKG_CONFIG_PATH environment variable
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   365
No package 'libxml-2.0' found
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   366
Checking for pkg-config flags for LIBXML2               : not found
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   367
Checking for library sqlite3                            : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   368
Checking for NSC location                               : ok ../nsc (guessed)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   369
Checking for library dl                                 : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   370
Checking for NSC supported architecture x86_64          : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   371
Package goocanvas was not found in the pkg-config search path.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   372
Perhaps you should add the directory containing `goocanvas.pc'
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   373
to the PKG_CONFIG_PATH environment variable
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   374
No package 'goocanvas' found
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   375
Checking for pkg-config flags for MOBILITY_VISUALIZER   : not found
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   376
Checking for program python                             : ok /usr/bin/python
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   377
Checking for Python version >= 2.3                      : ok 2.5.2
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   378
Checking for library python2.5                          : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   379
Checking for program python2.5-config                   : ok /usr/bin/python2.5-config
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   380
Checking for header Python.h                            : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   381
Checking for -fvisibility=hidden support                : yes
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   382
Checking for pybindgen location                         : ok ../pybindgen (guessed)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   383
Checking for Python module pybindgen                    : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   384
Checking for pybindgen version                          : ok 0.10.0.630
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   385
Checking for Python module pygccxml                     : ok
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   386
Checking for pygccxml version                           : ok 0.9.5
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   387
Checking for program gccxml                             : ok /usr/local/bin/gccxml
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   388
Checking for gccxml version                             : ok 0.9.0
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   389
Checking for program sudo                               : ok /usr/bin/sudo
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   390
Checking for program hg                                 : ok /usr/bin/hg
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   391
Checking for program valgrind                           : ok /usr/bin/valgrind
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   392
---- Summary of optional NS-3 features:
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   393
Threading Primitives          : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   394
Real Time Simulator           : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   395
Emulated Net Device           : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   396
Tap Bridge                    : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   397
GtkConfigStore                : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   398
XmlIo                         : not enabled (library 'libxml-2.0 >= 2.7' not found)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   399
SQlite stats data output      : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   400
Network Simulation Cradle     : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   401
Python Bindings               : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   402
Python API Scanning Support   : enabled
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   403
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   404
Configuration finished successfully (00:00:02); project is now ready to build.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   405
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   406
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   407
Note the last part of the above output.  Some ns-3 options are not enabled by
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   408
default or require support from the underlying system to work properly
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   409
For instance, to enable XmlTo, the library libxml-2.0 must be found on the
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   410
system.  in the example above, this library was not found and the corresponding
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   411
feature was not enabled.  There is a feature to use sudo to set the suid bit of
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   412
certain programs.  This was not enabled by default.
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   413
4295
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   414
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
   415
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   416
@verbatim
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   417
  ./waf -d debug configure
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   418
@end verbatim
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   419
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   420
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
   421
the @command{ns-3} programs by simply typing,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   422
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   423
@verbatim
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   424
  ./waf
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   425
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   426
4295
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   427
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
   428
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
   429
features of @command{ns-3} you might want to enable setting the suid bit using
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   430
sudo.  This is a configuration command, and so you could have run the following
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   431
command
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   432
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   433
@verbatim
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   434
  ./waf -d debug --enable-sudo configure
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   435
@end verbatim
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   436
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   437
If you had done this, waf would have run sudo to change the socket creator 
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   438
programs to run as root.  There are many other configure- and build-time options
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   439
available in waf.  To explore these options, type:
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   440
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   441
@verbatim
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   442
  ./waf -- help
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   443
@end verbatim
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   444
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   445
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
   446
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   447
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
   448
but now you know how to change the configuration and build optimized code.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   449
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   450
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   451
@c Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   452
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   453
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   454
@node Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   455
@section Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   456
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   457
@cindex unit tests
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   458
You can run the unit tests of the @command{ns-3} distribution by running the 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   459
``check'' command,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   460
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   461
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   462
  ./waf check
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   463
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   464
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   465
You should see a report from each unit test that executes indicating that the
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   466
test has passed.
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   467
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   468
@verbatim
4294
ebb973fdb763 wrap up tutorial updates
Craig Dowell <craigdo@ee.washington.edu>
parents: 4293
diff changeset
   469
  Entering directory `repos/ns-3-allinone/ns-3-dev/build'
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   470
  Build finished successfully (00:00:00)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   471
  -- Running NS-3 C++ core unit tests...
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   472
  PASS AddressHelper
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   473
  PASS Wifi
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   474
  PASS DcfManager
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   475
  ...
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   476
  PASS Object
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   477
  PASS Ptr
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   478
  PASS Callback
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   479
  -- Running NS-3 Python bindings unit tests...
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   480
  ...........
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   481
  ----------------------------------------------------------------------
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   482
  Ran 11 tests in 0.003s
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   483
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   484
  OK
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   485
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   486
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   487
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
   488
@command{ns-3} distribution has built correctly.  
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   489
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   490
@cindex regression tests
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   491
You can also run our regression test suite to ensure that your distribution and
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   492
tool chain 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
   493
known-good reference output files.  You downloaded these reference traces to 
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   494
your machine during the download process above.  (Warning:  The @code{ns-3.2} 
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   495
and @code{ns-3.3} releases do not use the @code{ns-3-allinone} environment
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   496
and require you to be online when you run regression tests because they
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   497
dynamically synchronize the reference traces directory with an online
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   498
repository immediately prior to the run).
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   499
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   500
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
   501
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
   502
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
   503
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
   504
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
   505
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
   506
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
   507
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
   508
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   509
Some regression tests wmay be SKIPped if the required support
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   510
is not present.
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   511
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   512
To run the regression tests, you provide Waf with the regression flag.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   513
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   514
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   515
  ./waf --regression
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   516
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   517
4293
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   518
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
   519
passing.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   520
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   521
@verbatim
4294
ebb973fdb763 wrap up tutorial updates
Craig Dowell <craigdo@ee.washington.edu>
parents: 4293
diff changeset
   522
  Entering directory `repos/ns-3-allinone/ns-3-dev/build'
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   523
  [647/669] regression-test (test-csma-bridge)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   524
  [648/669] regression-test (test-csma-broadcast)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   525
  [649/669] regression-test (test-csma-multicast)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   526
  [650/669] regression-test (test-csma-one-subnet)
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   527
  PASS test-csma-multicast
4292
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   528
  [651/669] regression-test (test-csma-packet-socket)
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   529
  PASS test-csma-bridge
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   530
  ...
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   531
  Regression testing summary:
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   532
  PASS: 22 of 22 tests passed
ef09115f80ca tutorial changes for allinone
Craig Dowell <craigdo@ee.washington.edu>
parents: 3733
diff changeset
   533
  Build finished successfully (00:00:23)
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   534
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   535
4293
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   536
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
   537
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
   538
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   539
@verbatim
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   540
  cd build/debug/regression/traces/second.ref
4295
6f7c05fd0f9b fix some tutorial nits
Craig Dowell <craigdo@ee.washington.edu>
parents: 4294
diff changeset
   541
  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
   542
@end verbatim
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   543
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   544
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
   545
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
   546
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   547
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
   548
after you are done:
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   549
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   550
@verbatim
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   551
  cd ../../../../..
11a2cda6a096 clean up tutorial up through tweaking section
Craig Dowell <craigdo@ee.washington.edu>
parents: 4292
diff changeset
   552
@end verbatim
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   553
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   554
@c ========================================================================
3346
Craig Dowell <craigdo@ee.washington.edu>
parents: 3345 3343
diff changeset
   555
@c Running a Script
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   556
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   557
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3332
diff changeset
   558
@node Running a Script
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   559
@section Running a Script
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   560
@cindex running a script with Waf
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   561
We typically run scripts under the control of Waf.  This allows the build 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   562
system to ensure that the shared library paths are set correctly and that
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   563
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
   564
@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
   565
ubiquitous hello world program by typing the following:
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   566
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   568
  ./waf --run hello-simulator
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   569
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   570
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   571
Waf first checks to make sure that the program is built correctly and 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   572
executes a build if required.  Waf then then executes the program, which 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   573
produces the following output.
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   574
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   575
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   576
  Hello Simulator
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   577
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   578
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   579
@emph{Congratulations.  You are now an ns-3 user.}
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   580
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   581
If you want to run programs under another tool such as gdb or valgrind,
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   582
see this @uref{http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool,,wiki entry}.
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   583