doc/tutorial/getting-started.texi
author Tom Henderson <tomh@tomh.org>
Mon, 15 Sep 2008 21:37:40 -0700
changeset 3700 fa1c7b813873
parent 3354 f11e4def3fc4
child 3733 28107d803a54
permissions -rw-r--r--
freshen tutorial
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
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
    47
code.nsnam.org.  You can download a tarball release at
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
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
    49
using Mercurial.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
@cindex repository
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    52
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
    53
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
    54
the @command{ns-3} development team.  The repositories of interest to you will
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    55
be prefixed with ``ns-3''.  The current development snapshot (unreleased)
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    56
of @command{ns-3} may be found at: @uref{http://code.nsnam.org/ns-3-dev/}.
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    57
Official releases of @command{ns-3} will be numbered as @code{ns-3.<release>}
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    58
with any requred  hotfixes added as minor release numbers.  For example, a 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    59
second hotfix to a hypothetical release nine of @command{ns-3} would be
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    60
numbered @code{ns-3.9.2}.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    62
The current development snapshot (unreleased) of @command{ns-3} may be found 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    63
at:  @uref{http://code.nsnam.org/ns-3-dev/}.  The developers attempt to keep
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    64
this repository in a consistent, working state but it is a development area 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    65
with unreleased code present, so you may want to consider staying with an 
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
    66
official release if you do not need newly-introduced features.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    67
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
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
    69
the more constant ns-3-dev here in the tutorial, but you can replace the 
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
    70
string ``ns-3-dev'' with your choice of release (e.g., ns-3.2) in the text 
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    71
below.  You can find the latest version  of the code either by inspection of 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    72
the repository list or by going to the ``Getting Started'' web page and 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    73
looking for the latest release identifier.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    74
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
One practice is to create a directory called @code{repos} in one's home 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
directory under which one can keep local Mercurial repositories.  
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
@emph{Hint:  we will assume you do this later in the tutorial.}  If you adopt
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    78
that approach, you can get a copy of the development version of 
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    79
@command{ns-3} by typing the following into your Linux shell (assuming you 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    80
have installed Mercurial):
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    82
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    83
  cd
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
  mkdir repos
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    85
  cd repos
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    86
  hg clone http://code.nanam.org/ns-3-dev
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
    89
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
    90
following,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
  destination directory: ns-3-dev
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
  requesting all changes
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
  adding changesets
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
  adding manifests
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
  adding file changes
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
  added 3276 changesets with 12301 changes to 1353 files
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
  594 files updated, 0 files merged, 0 files removed, 0 files unresolved
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
After the clone command completes, you should have a directory called 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
ns-3-dev under your @code{~/repos} directory, the contents of which should 
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
look something like the following:
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
@verbatim
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   107
  AUTHORS  examples/  README         samples/  utils/   waf.bat*
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   108
  build/   LICENSE    regression/    scratch/  VERSION  wscript
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   109
  doc/     ns3/       RELEASE_NOTES  src/      waf*
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   112
Similarly, if working from a released version instead, you can simply
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   113
@verbatim
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   114
  cd
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   115
  mkdir repos
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   116
  wget http://www.nsnam.org/releases/ns-3.2.tar.bz2
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   117
  bunzip2 ns-3.2.tar.bz2
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   118
  tar xvf ns-3.2.tar
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   119
@end verbatim 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   120
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   121
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
   122
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   123
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   124
@c Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   125
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   126
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   127
@node Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   128
@section Building ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   129
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   130
@cindex building with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   131
@cindex configuring Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   132
@cindex building debug version with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   133
@cindex compiling with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   134
@cindex unit tests with Waf
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   135
@cindex regression tests with Waf
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   136
We use Waf to build the @command{ns-3} project.  The first thing you will need
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   137
to do is to configure the build.  For reasons that will become clear later, 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   138
we are going to work with debug builds in the tutorial.  To explain to Waf 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   139
that it should do debug builds you will need to execute the following command,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
  ./waf -d debug configure
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   145
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
   146
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
   147
output that looks similar to the following,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
@verbatim
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   150
Checking for program g++                 : ok /usr/bin/g++ 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   151
Checking for compiler version            : ok Version 4.0.1 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   152
Checking for program cpp                 : ok /usr/bin/cpp 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   153
Checking for program ar                  : ok /usr/bin/ar 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   154
Checking for program ranlib              : ok /usr/bin/ranlib 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   155
Checking for compiler could create programs : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   156
Checking for compiler could create shared libs : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   157
Checking for compiler could create static libs : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   158
Checking for flags -O2 -DNDEBUG                : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   159
Checking for flags -g -DDEBUG                  : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   160
Checking for flags -g3 -O0 -DDEBUG             : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   161
Checking for flags -Wall                       : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   162
Checking for g++                               : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   163
Checking for -Wno-error=deprecated-declarations compilation flag support : no 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   164
Checking for header stdlib.h                   : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   165
Checking for header stdlib.h                   : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   166
Checking for header signal.h                   : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   167
Checking for library rt                        : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   168
Checking for header pthread.h                  : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   169
Checking for high precision time implementation: 128-bit integer 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   170
Checking for header stdint.h                   : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   171
Checking for header inttypes.h                 : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   172
Checking for header sys/inttypes.h             : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   173
Checking for package gtk+-2.0 >= 2.12          : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   174
Checking for library sqlite3                   : ok  
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   175
Checking for package goocanvas gthread-2.0     : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   176
Checking for program python                    : ok /usr/local/bin/python 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   177
Checking for Python version >= 2.3             : ok 2.4.3 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   178
Checking for library python2.4                 : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   179
Checking for library python2.4                 : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   180
Checking for library python24                  : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   181
Checking for program python2.4-config          : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   182
Checking for header Python.h                   : not found 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   183
Checking for program diff                      : ok /usr/bin/diff 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   184
Checking for program hg                        : ok /opt/local/bin/hg 
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   185
---- Summary of optional NS-3 features:
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   186
Threading Primitives        : enabled
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   187
Real Time Simulator         : enabled
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   188
GtkConfigStore              : not enabled (library 'gtk+-2.0 >= 2.12' not found)
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   189
SQlite stats data output    : enabled
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   190
Network Simulation Cradle   : not enabled (--enable-nsc configure option not given)
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   191
Python Bindings             : not enabled (Python development headers not found.)
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   192
Configuration finished successfully; project is now ready to build. 
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   193
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   195
Note the trailing portion of the above output.  Some ns-3 options are
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   196
not enabled by default or require support from the underlying system.
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   197
For instance, to enable Python bindings, Python development headers must
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   198
be installed on the host machine, and they were not found in the above
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   199
example, so Python scripting will not be supported in the resulting build.
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   200
For this tutorial, we will focus on the non-optional pieces of ns-3.
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   201
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   202
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
   203
the @command{ns-3} programs by simply typing,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
@verbatim
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   206
  ./waf
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   208
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   209
(Hint:  if you have a multicore machine, use the "-j JOBS" option to speed
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   210
up your build, where JOBS is the number of cores)
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   211
You will see many Waf status messages displayed as the system compiles.  The
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   212
most important is the last one:
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   213
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   214
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   215
  Compilation finished successfully
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   216
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   217
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   218
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   219
@c Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   220
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   221
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   222
@node Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   223
@section Testing ns-3
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   224
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   225
@cindex unit tests
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   226
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
   227
``check'' command,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   228
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   229
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   230
  ./waf check
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   231
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   232
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   233
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
   234
test has passed.
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   235
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   236
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   237
  ~/repos/ns-3-dev > ./waf check
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   238
  Entering directory `/home/craigdo/repos/ns-3-dev/build'
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   239
  Compilation finished successfully
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   240
  PASS AddressHelper
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   241
  PASS Wifi
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   242
  PASS DcfManager
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   243
  
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   244
  ...
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   245
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   246
  PASS Object
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   247
  PASS Ptr
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   248
  PASS Callback
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   249
  ~/repos/ns-3-dev >
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   250
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   251
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   252
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
   253
@command{ns-3} distribution has built correctly.  
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   255
@cindex regression tests
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   256
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
   257
tool chain have produced binaries that generate output that is identical to
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   258
reference output files stored in a central location.  To run the regression 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   259
tests, you provide Waf with the regression flag.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   260
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   261
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
  ./waf --regression
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   263
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   265
Waf will verify that the current files in the @command{ns-3} distribution are
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   266
built and will then look for trace files in the aforementioned centralized 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   267
location.  If your tool chain includes Mercurial, the regression tests will 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   268
be downloaded from a repository at @code{code.nsnam.org}.  If you do not have 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   269
Mercurial installed, the reference traces will be downloaded from a tarball 
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   270
located in the releases section of @code{www.nsnam.org}.  The particular name 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   271
of the reference trace location is built from the @command{ns-3} version 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   272
located in the VERSION file, so don't change that string yourself unless you 
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   273
know what you are doing.  (Warning:  The ns-3.2 release requires you
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   274
to be online when you run regression tests because it synchronizes the
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   275
trace directory with an online repository).
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   277
Once the reference traces are downloaded to your local machine, Waf will run
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   278
a number of tests that generate what we call trace files.  The content of 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   279
these trace files are compared with the reference traces just downloaded.  If 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   280
they are identical, the regression tests report a PASS status.  If the 
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   281
regression tests pass, you should see something like,
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   283
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   284
  ~/repos/ns-3-dev > ./waf --regression
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
  Entering directory `/home/craigdo/repos/ns-3-dev/build'
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   286
  Compilation finished successfully 
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
  ========== Running Regression Tests ==========
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
  Synchronizing reference traces using Mercurial.
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   289
  Pulling http://code.nsnam.org/ns-3-dev-ref-traces from repo.
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   290
  Skipping csma-bridge: Python bindings not available.
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   291
  SKIP test-csma-bridge
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   292
  PASS test-csma-broadcast
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   293
  PASS test-csma-multicast
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   294
  PASS test-csma-one-subnet
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   295
  PASS test-csma-packet-socket
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   296
  PASS test-realtime-udp-echo
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
  PASS test-simple-error-model
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   298
  PASS test-simple-global-routing
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   299
  PASS test-simple-point-to-point-olsr
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   300
  PASS test-tcp-large-transfer
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   301
  PASS test-udp-echo
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   302
  PASS test-wifi-wired-bridging
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   303
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   304
  ~/repos/ns-3-dev >
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   305
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   306
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   307
If a regression tests fails you will see a FAIL indication along with a
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   308
pointer to the offending trace file and its associated reference trace file
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   309
along with a suggestion on diff parameters and options in order to see what 
3700
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   310
has gone awry.  Python regression tests will be SKIPped if Python bindings
fa1c7b813873 freshen tutorial
Tom Henderson <tomh@tomh.org>
parents: 3354
diff changeset
   311
are not built.
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   313
@c ========================================================================
3346
Craig Dowell <craigdo@ee.washington.edu>
parents: 3345 3343
diff changeset
   314
@c Running a Script
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   315
@c ========================================================================
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   316
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3332
diff changeset
   317
@node Running a Script
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
@section Running a Script
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3332
diff changeset
   319
@cindex running a script with Waf
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
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
   321
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
   322
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
   323
@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
   324
ubiquitous hello world program by typing the following:
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   325
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   326
@verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
  ./waf --run hello-simulator
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
@end verbatim
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   330
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
   331
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
   332
produces the following output.
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
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   335
  Hello Simulator
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
3354
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   338
@emph{Congratulations.  You are now an ns-3 user.}
f11e4def3fc4 tweak, tweak the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3347
diff changeset
   339
3332
da67e8efa347 swap in new tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   340
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
   341
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
   342