author | Mitch Watrous <watrous@u.washington.edu> |
Mon, 09 May 2011 18:04:52 -0700 | |
changeset 7145 | a925e518220b |
parent 6766 | 4caf532b12c3 |
child 9957 | 1a4d84a85bad |
permissions | -rw-r--r-- |
6742
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
.. include:: replace.txt |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
|
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 |
Organization |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
------------ |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
|
6766 | 7 |
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
|
8 |
corresponding organization of this manual. |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
|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
|
11 |
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
|
12 |
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
|
13 |
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
|
14 |
of its API to Python, allowing Python programs to import an "ns3" module in |
6766 | 15 |
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
|
16 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
.. _software-organization: |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
.. figure:: figures/software-organization.* |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
Software organization of |ns3| |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
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
|
24 |
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
|
25 |
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
|
26 |
on modules beneath them in the figure. |
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
6766 | 28 |
We first describe the core of the simulator; those components that are |
29 |
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
|
30 |
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
|
31 |
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
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
above modules of |ns3| are independent of specific network and device |
6766 | 36 |
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
|
37 |
|
6766 | 38 |
In addition to the above |ns3| core, we introduce, also in the initial |
39 |
portion of the manual, two other modules that supplement the core C++-based |
|
40 |
API. |ns3| programs may access |
|
6742
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
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
|
42 |
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
|
43 |
fact that |ns3| programs can be written to two APIs (or a combination |
6766 | 44 |
thereof) is a fundamental aspect of the simulator. |
45 |
We also describe how Python is supported in |ns3| before moving onto |
|
46 |
specific models of relevance to network simulation. |
|
6742
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
The remainder of the manual is focused on documenting the models and |
6766 | 49 |
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
|
50 |
|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
|
51 |
designed to support network emulation use cases, and emulation is described |
6766 | 52 |
next. The following chapter is devoted to Internet-related models, |
53 |
including the |
|
54 |
sockets API used by Internet applications. The next chapter covers |
|
55 |
applications, and the following chapter describes additional support for |
|
56 |
simulation, such as animators and statistics. |
|
6742
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
57 |
|
a1759a95842c
convert manual to sphinx format
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
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
|
59 |
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
|
60 |
<http://www.nsnam.org/tutorials.html>`_). |