doc/tutorial/source/resources.rst
author Tom Henderson <tomh@tomh.org>
Sat, 16 Jan 2016 08:14:40 -0800
changeset 11683 9142266fbb25
parent 7654 62ecccd96cad
permissions -rw-r--r--
add figures to main documentation build
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
.. include:: replace.txt
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
Resources
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
---------
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
The Web
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
*******
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
There are several important resources of which any |ns3| user must be
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
aware.  The main web site is located at http://www.nsnam.org and 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
provides access to basic information about the |ns3| system.  Detailed 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
documentation is available through the main web site at
7654
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
    13
http://www.nsnam.org/documentation/.  You can also find documents 
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
relating to the system architecture from this page.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    16
There is a Wiki that complements the main |ns3| web site which you will
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
find at http://www.nsnam.org/wiki/.  You will find user and developer 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
FAQs there, as well as troubleshooting guides, third-party contributed code, 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
papers, etc. 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    21
The source code may be found and browsed at http://code.nsnam.org/. 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    22
There you will find the current development tree in the repository named
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
``ns-3-dev``. Past releases and experimental repositories of the core
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
developers may also be found there.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    26
Mercurial
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
*********
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
Complex software systems need some way to manage the organization and 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    30
changes to the underlying code and documentation.  There are many ways to
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    31
perform this feat, and you may have heard of some of the systems that are
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    32
currently used to do this.  The Concurrent Version System (CVS) is probably
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    33
the most well known.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    34
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    35
The |ns3| project uses Mercurial as its source code management system.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
Although you do not need to know much about Mercurial in order to complete
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
this tutorial, we recommend becoming familiar with Mercurial and using it 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
to access the source code.  Mercurial has a web site at 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
http://www.selenic.com/mercurial/,
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    40
from which you can get binary or source releases of this Software
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    41
Configuration Management (SCM) system.  Selenic (the developer of Mercurial)
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    42
also provides a tutorial at 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    43
http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial/,
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    44
and a QuickStart guide at
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    45
http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart/.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    46
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    47
You can also find vital information about using Mercurial and |ns3|
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    48
on the main |ns3| web site.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    49
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    50
Waf
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    51
***
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    52
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    53
Once you have source code downloaded to your local system, you will need 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    54
to compile that source to produce usable programs.  Just as in the case of
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    55
source code management, there are many tools available to perform this 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    56
function.  Probably the most well known of these tools is ``make``.  Along
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    57
with being the most well known, ``make`` is probably the most difficult to
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    58
use in a very large and highly configurable system.  Because of this, many
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
alternatives have been developed.  Recently these systems have been developed
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    60
using the Python language.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    61
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    62
The build system Waf is used on the |ns3| project.  It is one 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    63
of the new generation of Python-based build systems.  You will not need to 
7654
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
    64
understand any Python to build the existing |ns3| system.
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    65
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    66
For those interested in the gory details of Waf, the main web site can be 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    67
found at http://code.google.com/p/waf/.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    68
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    69
Development Environment
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    70
***********************
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    71
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
As mentioned above, scripting in |ns3| is done in C++ or Python.
7654
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
    73
Most of the |ns3| API is available in Python, but the 
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    74
models are written in C++ in either case.  A working 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    75
knowledge of C++ and object-oriented concepts is assumed in this document.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    76
We will take some time to review some of the more advanced concepts or 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    77
possibly unfamiliar language features, idioms and design patterns as they 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    78
appear.  We don't want this tutorial to devolve into a C++ tutorial, though,
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    79
so we do expect a basic command of the language.  There are an almost 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    80
unimaginable number of sources of information on C++ available on the web or
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    81
in print.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    82
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    83
If you are new to C++, you may want to find a tutorial- or cookbook-based
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    84
book or web site and work through at least the basic features of the language
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    85
before proceeding.  For instance, `this tutorial
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    86
<http://www.cplusplus.com/doc/tutorial/>`_.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    87
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
The |ns3| system uses several components of the GNU "toolchain" 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    89
for development.  A 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
software toolchain is the set of programming tools available in the given 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    91
environment. For a quick review of what is included in the GNU toolchain see,
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    92
http://en.wikipedia.org/wiki/GNU_toolchain.  |ns3| uses gcc, 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    93
GNU binutils, and gdb.  However, we do not use the GNU build system tools, 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    94
neither make nor autotools.  We use Waf for these functions.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
Typically an |ns3| author will work in Linux or a Linux-like
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
environment.  For those running under Windows, there do exist environments 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    98
which simulate the Linux environment to various degrees.  The |ns3| 
7654
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
    99
project has in the past (but not presently) supported development in the Cygwin environment for 
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   100
these users.  See http://www.cygwin.com/ 
7654
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
   101
for details on downloading, and visit the |ns3| wiki for more information
62ecccd96cad Freshen the tutorial
Tom Henderson <tomh@tomh.org>
parents: 6754
diff changeset
   102
about Cygwin and |ns3|.  MinGW is presently not officially supported.
6754
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   103
Another alternative to Cygwin is to install a virtual machine environment
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   104
such as VMware server and install a Linux virtual machine.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   105
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   106
Socket Programming
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   107
******************
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   108
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   109
We will assume a basic facility with the Berkeley Sockets API in the examples
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   110
used in this tutorial.  If you are new to sockets, we recommend reviewing the
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   111
API and some common usage cases.  For a good overview of programming TCP/IP
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   112
sockets we recommend `TCP/IP Sockets in C, Donahoo and Calvert
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
<http://www.elsevier.com/wps/find/bookdescription.cws_home/717656/description#description>`_.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
There is an associated web site that includes source for the examples in the
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   116
book, which you can find at:
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   117
http://cs.baylor.edu/~donahoo/practical/CSockets/.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   118
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   119
If you understand the first four chapters of the book (or for those who do
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   120
not have access to a copy of the book, the echo clients and servers shown in 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   121
the website above) you will be in good shape to understand the tutorial.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   122
There is a similar book on Multicast Sockets,
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   123
`Multicast Sockets, Makofske and Almeroth
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
<http://www.elsevier.com/wps/find/bookdescription.cws_home/700736/description#description>`_.
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   125
that covers material you may need to understand if you look at the multicast 
7ff69b244b5b Move tutorial to Sphinx
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   126
examples in the distribution.