doc/manual/source/organization.rst
author Tom Henderson <tomh@tomh.org>
Wed, 27 Jan 2016 22:29:00 -0800
changeset 11680 8ec1579db3a0
parent 9957 1a4d84a85bad
permissions -rw-r--r--
fix typos in attribute section of manual
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
.. include:: replace.txt
9957
1a4d84a85bad Manual and Tutorial syntax coloring
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 7145
diff changeset
     2
.. highlight:: cpp
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
Organization
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
------------
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
     8
This chapter describes the overall |ns3| software organization and the
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
corresponding organization of this manual.
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
|ns3| is a discrete-event network simulator in which the simulation core
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
and models are implemented in C++. |ns3| is built as a library which may be
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
statically or dynamically linked to a C++ main program that defines the
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
simulation topology and starts the simulator. |ns3| also exports nearly all
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
of its API to Python, allowing Python programs to import an "ns3" module in
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    16
much the same way as the |ns3| library is linked by executables in C++.  
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
.. _software-organization:
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
.. figure:: figures/software-organization.*
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
   
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
   Software organization of |ns3|
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
The source code for |ns3| is mostly organized in the ``src`` directory and
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
can be described by the diagram in :ref:`software-organization`. We will
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
work our way from the bottom up; in general, modules only have dependencies
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
on modules beneath them in the figure.
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    29
We first describe the core of the simulator; those components that are 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    30
common across all protocol, hardware, and environmental models. 
7145
a925e518220b Rescan wifi's bindings and fix some paths in the documentation
Mitch Watrous <watrous@u.washington.edu>
parents: 6766
diff changeset
    31
The simulation core is implemented in ``src/core``. Packets are 
a925e518220b Rescan wifi's bindings and fix some paths in the documentation
Mitch Watrous <watrous@u.washington.edu>
parents: 6766
diff changeset
    32
fundamental objects in a network simulator
a925e518220b Rescan wifi's bindings and fix some paths in the documentation
Mitch Watrous <watrous@u.washington.edu>
parents: 6766
diff changeset
    33
and are implemented in ``src/network``. These two simulation modules by
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
themselves are intended to comprise a generic simulation core that can be
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
used by different kinds of networks, not just Internet-based networks.  The
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
above modules of |ns3| are independent of specific network and device
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    37
models, which are covered in subsequent parts of this manual.
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    39
In addition to the above |ns3| core, we introduce, also in the initial 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    40
portion of the manual, two other modules that supplement the core C++-based 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    41
API.  |ns3| programs may access
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
all of the API directly or may make use of a so-called *helper API* that
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
provides convenient wrappers or encapsulation of low-level API calls. The
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
fact that |ns3| programs can be written to two APIs (or a combination
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    45
thereof) is a fundamental aspect of the simulator.
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    46
We also describe how Python is supported in |ns3| before moving onto
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    47
specific models of relevance to network simulation.
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
The remainder of the manual is focused on documenting the models and
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    50
supporting capabilities.  The next part focuses on two fundamental objects in
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
|ns3|:  the ``Node`` and ``NetDevice``. Two special NetDevice types are
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
designed to support network emulation use cases, and emulation is described
6766
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    53
next.  The following chapter is devoted to Internet-related models, 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    54
including the
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    55
sockets API used by Internet applications. The next chapter covers 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    56
applications, and the following chapter describes additional support for 
4caf532b12c3 formatting cleanup
Tom Henderson <tomh@tomh.org>
parents: 6742
diff changeset
    57
simulation, such as animators and statistics.
6742
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    59
The project maintains a separate manual devoted to testing and validation
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    60
of |ns3| code (see the `ns-3 Testing and Validation manual
a1759a95842c convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    61
<http://www.nsnam.org/tutorials.html>`_).