doc/tutorial/introduction.texi
author Craig Dowell <craigdo@ee.washington.edu>
Sun, 29 Jun 2008 21:22:33 -0700
changeset 3346 2e205ef88dab
parent 3345 b0af63b9f9a6
parent 3343 2f13fb6901b5
child 3352 4b3c76369b28
permissions -rw-r--r--
merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
@c Begin document body here
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
@c PART:  Introduction
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
@c The below chapters are under the major heading "Introduction"
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
@c This is similar to the Latex \part command
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
@c
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
@c Introduction
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
@node Introduction
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
@chapter Introduction
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    18
@menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    19
* For ns-2 Users::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
* Contributing::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
* Tutorial Organization::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
@end menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    23
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    24
The @command{ns-3} simulator is a discrete-event network simulator targeted 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    25
primarily for research and educational use.  The 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
@uref{http://www.nsnam.org,,ns-3 project}, 
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3333
diff changeset
    27
started in 2006, is an open-source project developing ns-3.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
3346
Craig Dowell <craigdo@ee.washington.edu>
parents: 3345 3343
diff changeset
    29
Primary documentation for the @command{ns-3} project is available in four
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    30
forms:
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    31
@itemize @bullet
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
@item @uref{http://www.nsnam.org/doxygen/index.html,,ns-3 Doxygen/Manual}:  
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    33
Documentation of the public APIs of the simulator
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    34
@item Tutorial (this document)
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3333
diff changeset
    35
@item @uref{http://www.nsnam.org/docs/manual.html,,Reference Manual}:  Reference Manual
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
@item @uref{http://www.nsnam.org/wiki/index.php,, ns-3 wiki}
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    37
@end itemize
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    39
The purpose of this tutorial is to introduce new @command{ns-3} users to the 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    40
system in a structured way.  It is sometimes difficult for new users to
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    41
glean essential information from detailed manuals and to convert this
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    42
information into working simulations.  In this tutorial, we will build 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
several example simulations, introducing and explaining key concepts and
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
features as we go.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    45
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    46
As the tutorial unfolds, we will introduce the full ns-3 documentation 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
and provide pointers to source code for those interested in delving deeper
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
into the workings of the system.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    49
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
A few key points are worth noting at the onset:
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
@itemize @bullet
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    52
@item Ns-3 is not an extension of @uref{http://www.isi.edu/nsnam/ns,,ns-2}; 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    53
it is a new simulator.  The two simulators are both written in C++ but 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    54
@command{ns-3} is a new simulator that does not support the ns-2 APIs.  Some 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    55
models from ns-2 have already been ported from ns-2 to ns-3. The project will
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    56
continue to maintain ns-2 while ns-3 is being built, and will study transition
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    57
and integration mechanisms.
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    58
@item @command{Ns-3} is open-source, and the project strives to maintain an 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    59
open  environment for researchers to contribute and share their software.  
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
@end itemize
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    61
 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
@node For ns-2 Users
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
@section For ns-2 Users
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
For those familiar with ns-2, the most visible outward change when moving to 
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    66
@command{ns-3} is the choice of scripting language.  Ns-2 is typically 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    67
scripted in Tcl and results of simulations can be visualized using the 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    68
Network Animator @command{nam}.  In @command{ns-3} there is currently no
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    69
visualization module, and Python bindings have been developed (Tcl bindings
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    70
have been prototyped using @uref{http://www.swig.org,,SWIG}, but are not 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    71
currently supported).  In this tutorial, we will concentrate on scripting 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    72
directly in C++ and interpreting results via trace files.  
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    74
But there are similarities as well (both, for example, are based on C++ 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    75
objects, and some code from ns-2 has already been ported to @command{ns-3}). 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    76
We will try to highlight differences between ns-2 and @command{ns-3}
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    77
as we proceed in this tutorial.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
@node Contributing
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
@section Contributing
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    82
@cindex contributing
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    83
@command{Ns-3} is a research and educational simulator, by and for the 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    84
research community.  It will rely on the ongoing contributions of the 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    85
community to develop new models, debug or maintain existing ones, and share 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    86
results.  There are a few policies that we hope will encourage people to 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    87
contribute to @command{ns-3} like they have for ns-2:
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
@itemize @bullet
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    89
@item Open source licensing based on GNU GPLv2 compatibility;
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    90
@item @uref{http://www.nsnam.org/wiki/index.php,,wiki};
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
@item @uref{http://www.nsnam.org/wiki/index.php/Contributed_Code,,Contributed Code} page, similar to ns-2's popular 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
@uref{http://nsnam.isi.edu/nsnam/index.php/Contributed_Code,,Contributed Code} 
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    93
page;
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    94
@item @code{src/contrib} directory (we will host your contributed code);
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    95
@item Open @uref{http://www.nsnam.org/bugzilla,,bug tracker};
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    96
@item @command{Ns-3} developers will gladly help potential contributors to get
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
    97
started with the simulator (please contact @uref{http://www.nsnam.org/people.html,,one of us}).
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
@end itemize  
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3333
diff changeset
   100
If you are an ns-3 user, please consider providing your feedback, bug fixes, or
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
code to the project.  
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
@node Tutorial Organization
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
@section Tutorial Organization
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
The tutorial assumes that new users might initially follow a path such as the
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
following:
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
@itemize @bullet
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
@item Browse the source code and documentation, to get a feel for 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
the simulator and what it might be like to use;
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   112
@item Try to download and build a copy;
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
@item Try to run a few sample programs, and perhaps change some configurations;
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   114
@item Look at simulation output, and try to adjust it.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   115
@end itemize
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   116
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
As a result, we have tried to organize the tutorial along the above
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
broad sequences of events.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   120
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   121
@c Browsing ns-3
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   122
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   123
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   124
@node Browsing ns-3
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   125
@chapter Browsing ns-3
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   126
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   127
@menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   128
* Source Code::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   129
* Doxygen::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
* Other Documentation::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
@end menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
@node Source Code
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
@section Source Code 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
The most recent code can be browsed on our web server at the following link:
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
@uref{http://code.nsnam.org/?sort=lastchange}.  If you click on the bold
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   138
repository names on the left of the page, you will see @emph{changelogs} for
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
these repositories, and links to the @emph{manifest}.  From the manifest
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
links, one can browse the source tree.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   142
The top-level directory for one of our @emph{repositories} will look 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   143
something like:
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
@verbatim
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   145
drwxr-xr-x  [up]   
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   146
drwxr-xr-x         doc             manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   147
drwxr-xr-x         examples        manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   148
drwxr-xr-x         ns3             manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   149
drwxr-xr-x         regression      manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   150
drwxr-xr-x         samples         manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   151
drwxr-xr-x         scratch         manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   152
drwxr-xr-x         src             manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   153
drwxr-xr-x         tutorial        manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   154
drwxr-xr-x         utils           manifest 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   155
-rw-r--r-- 135     .hgignore       file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   156
-rw-r--r-- 891     .hgtags         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   157
-rw-r--r-- 441     AUTHORS         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   158
-rw-r--r-- 17987   LICENSE         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   159
-rw-r--r-- 4948    README          file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   160
-rw-r--r-- 4917    RELEASE_NOTES   file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   161
-rw-r--r-- 7       VERSION         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   162
-rwxr-xr-x 99143   waf             file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   163
-rwxr-xr-x 28      waf.bat         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   164
-rw-r--r-- 30584   wscript         file | revisions | annotate 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   165
@end verbatim
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   166
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   167
The source code is mainly in the @code{src} directory.  You can view source
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   168
code by clicking on the @code{manifest} link to the right of the directory 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   169
name.  If you click on the @code{manifest} link to the right of the src
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   170
directory you will find a subdirectory.  If you click on the @code{manifest}
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   171
link next to the @code{core} subdirectory in under @code{src}, you will find
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   172
a list of files.  The first file you will find is @code{assert.h}.  If you 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   173
click on the @code{file} link, you will be sent to the source file for
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   174
@code{assert.h}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   175
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   176
Example scripts are in the @code{examples} directory.  The @code{examples}
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   177
directory is a good place to start browsing the code.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   178
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   179
@node Doxygen
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   180
@section Doxygen
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   181
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   182
We document all of our APIs using @uref{http://www.stack.nl/~dimitri/doxygen/,,Doxygen}.  Current builds of this documentation are available at:
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   183
@uref{http://www.nsnam.org/doxygen/index.html}, which are worth an initial
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   184
look.  
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   185
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   186
@node Other Documentation
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   187
@section Other Documentation
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   188
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   189
We provide a large amount of documentation regarding the various components
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   190
of @command{ns-3} on our website.  See:  
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   191
@uref{http://www.nsnam.org/documents.html}.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   192
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   193
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   194
@c Resources
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   195
@c ========================================================================
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   196
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   197
@node Resources
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   198
@chapter Resources
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   199
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   200
@menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   201
* The Web::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   202
* Mercurial::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   203
* Waf::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   204
* Environment Idioms Design Patterns::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   205
* Socket Programming::
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   206
@end menu
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   207
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   208
@node The Web
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   209
@section The Web
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   210
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   211
@cindex www.nsnam.org
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   212
There are several important resources of which any @command{ns-3} user must be
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   213
aware.  The main web site is located at @uref{http://www.nsnam.org} and 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   214
provides access to basic information about the ns-3 system.  Detailed 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   215
documentation is available through the main web site at
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   216
@uref{http://www.nsnam.org/documents.html}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   217
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   218
@cindex documentation
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   219
@cindex architecture
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   220
You can find documents relating to the system architecture from this page,
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   221
and also gain access to the detailed software documentation.  There is a Wiki
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   222
that complements the main ns-3 web site which you will find at 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   223
@uref{http://www.nsnam.org/wiki/}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   224
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   225
You will find user and developer FAQs there, as well as troubleshooting 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   226
guides, third-party contributed code, papers, etc. 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   227
3339
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3333
diff changeset
   228
@cindex mercurial repository
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3333
diff changeset
   229
@cindex ns-3-dev repository
ff29f4ba75ed finish up with a wifi example
Craig Dowell <craigdo@ee.washington.edu>
parents: 3333
diff changeset
   230
@cindex release repository
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   231
The source code may be found and browsed at @uref{http://code.nsnam.org/}. 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   232
There you will find the current development tree in the repository named
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   233
@code{ns-3-dev}. Past releases and experimental repositories of the core
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   234
developers may also be found there.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   235
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   236
@node Mercurial
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   237
@section Mercurial
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   238
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   239
Complex software systems need some way to manage the organization and 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   240
changes to the underlying code and documentation.  There are many ways to
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   241
perform this feat, and you may have heard of some of the systems that are
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   242
currently used to do this.  The Concurrent Version System (CVS) is probably
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   243
the most well known.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   244
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   245
@cindex software configuration management
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   246
@cindex Mercurial
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   247
The @command{ns-3} project uses Mercurial as its source code management system.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   248
Although you do not need to know much about Mercurial in order to complete
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   249
this tutorial, we recommend becoming familiar with Mercurial and using it 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   250
to access the source code.  Mercurial has a web site at 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   251
@uref{http://www.selenic.com/mercurial/},
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   252
from which you can get binary or source releases of this Software
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   253
Configuration Management (SCM) system.  Selenic (the developer of Mercurial)
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
also provides a tutorial at 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   255
@uref{http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial/},
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   256
and a QuickStart guide at
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   257
@uref{http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   258
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   259
You can also find vital information about using Mercurial and @command{ns-3}
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   260
on the main @command{ns-3} web site.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   261
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
@node Waf
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   263
@section Waf
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   265
@cindex Waf
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   266
@cindex make
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   267
@cindex build
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   268
Once you have source code downloaded to your local system, you will need 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   269
to compile that source to produce usable programs.  Just as in the case of
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   270
source code management, there are many tools available to perform this 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   271
function.  Probably the most will known of these tools is @code{make}.  Along
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   272
with being the most well known, @code{make} is probably the most difficult to
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
use in a very large and highly configurable system.  Because of this, many
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   274
alternatives have been developed.  Recently these systems have been developed
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   275
using the Python language.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   277
The build system @code{Waf} is used on the @command{ns-3} project.  It is one 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   278
of the new generation of Python-based build systems.  You will not need to 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   279
understand any Python to build the existing ns-3 system, and will 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   280
only have to understand a tiny and intuitively obvious subset of Python in 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   281
order to extend the system in most cases.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   283
For those interested in the gory details of Waf, the main web site can be 
3341
7130a81b683c nits on Sections 1-4
Tom Henderson <tomh@tomh.org>
parents: 3333
diff changeset
   284
found at @uref{http://freehackers.org/~tnagy/waf.html}.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   286
@node Environment Idioms Design Patterns
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
@section Environment, Idioms, and Design Patterns
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   289
@cindex C++
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   290
As mentioned above, scripting in ns-3 is done in C++.  A working 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   291
knowledge of C++ and object-oriented concepts is assumed in this document.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   292
We will take some time to review some of the more advanced concepts or 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   293
possibly unfamiliar language features, idioms and design patterns as they 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   294
appear.  We don't want this tutorial to devolve into a C++ tutorial, though,
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   295
so we do expect a basic command of the language.  There are an almost 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   296
unimaginable number of sources of information on C++ available on the web or
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
in print.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   298
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   299
If you are new to C++, you may want to find a tutorial- or cookbook-based
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   300
book or web site and work through at least the basic features of the language
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   301
before proceeding.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   302
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   303
@subsection Environment
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   304
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   305
@cindex toolchain
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   306
@cindex GNU
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   307
The @command{ns-3} system uses the GNU ``toolchain'' for development.  A 
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   308
software toolchain is the set of programming tools available in the given 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   309
environment. For a quick review of what is included in the GNU toolchain see,
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   310
@uref{http://en.wikipedia.org/wiki/GNU_toolchain}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   311
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
@cindex Linux
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   313
Typically an @command{ns-3} author will work in Linux or a Linux-like
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   314
environment.  For those running under Windows, there do exist environments 
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   315
which simulate the Linux environment to various degrees.  The @command{ns-3} 
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   316
project supports development in the Cygwin and the MinGW environments for 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   317
these users.  See @uref{http://www.cygwin.com/} and 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
@uref{http://www.mingw.org/} for details on downloading and using these
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   319
systems.  Cygwin provides many of the popular Linux system commands.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
It can, however, sometimes be problematic due to the way it actually does its 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   321
emulation, and sometimes interactions with other Windows software can cause 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   322
problems.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   323
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   324
@cindex Cygwin
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   325
@cindex MinGW
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   326
If you do use Cygwin or MinGW; and use Logitech products, we will save you
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
quite a bit of heartburn right off the bat and encourage you to take a look
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
at the @uref{http://www.mingw.org/MinGWiki/index.php/FAQ,,MinGW FAQ}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   330
@cindex Logitech
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   331
Search for ``Logitech'' and read the FAQ entry, ``why does make often 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   332
crash creating a sh.exe.stackdump file when I try to compile my source code.''
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
Believe it or not, the @code{Logitech Process Monitor} insinuates itself into
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
every DLL in the system when it is running.  It can cause your Cygwin or
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   335
MinGW DLLs to die in mysterious ways and often prevents debuggers from 
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   336
running.  Beware of Logitech software.
3333
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   338
@node Socket Programming
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   339
@section Socket Programming
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   340
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   341
@cindex sockets
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   342
We will assume a basic facility with the Berkeley Sockets API in the examples
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   343
used in this tutorial.  If you are new to sockets, we recommend reviewing the
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   344
API and some common usage cases.  For a good overview of programming TCP/IP
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   345
sockets we recommend @uref{http://www.elsevier.com/wps/product/cws_home/680765,,Practical TCP/IP Sockets in C, Donahoo and Calvert}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   346
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   347
There is an associated web site that includes source for the examples in the
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   348
book, which you can find at:
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   349
@uref{http://cs.baylor.edu/~donahoo/practical/CSockets/}.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   350
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   351
If you understand the first four chapters of the book (or for those who do
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   352
not have access to a copy of the book, the echo clients and servers shown in 
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   353
the website above) you will be in good shape to understand the tutorial.
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   354
There is a similar book on Multicast Sockets,
76188c437e2e swapping in all of tutorial would be better
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   355
@uref{http://www.elsevier.com/wps/product/cws_home/700736,,Multicast Sockets, Makofske and Almeroth}.
3345
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   356
that covers material you may need to understand for the multicast examples in
b0af63b9f9a6 editing pass through the tutorial
Craig Dowell <craigdo@ee.washington.edu>
parents: 3339
diff changeset
   357
the distribution.