2008-12-04 18:55:04 -08:00
|
|
|
@node Emulation
|
|
|
|
|
@chapter Emulation
|
|
|
|
|
|
2008-12-04 20:19:11 -08:00
|
|
|
ns-3 has been designed for integration into testbed and virtual machine
|
2008-12-05 16:49:05 -08:00
|
|
|
environments. We have addressed this need by providing two kinds of
|
2009-04-25 14:56:52 -07:00
|
|
|
net devices. The first kind, which we call an @code{Emu} @code{NetDevice}
|
2008-12-05 16:49:05 -08:00
|
|
|
allows ns-3 simulations to send data on a ``real'' network. The second kind,
|
|
|
|
|
called a @code{Tap} @code{NetDevice} allows a ``real'' host to participate
|
|
|
|
|
in an ns-3 simulation as if it were one of the simulated nodes. An ns-3
|
|
|
|
|
simulation may be constructed with any combination of simulated, @code{Emu},
|
|
|
|
|
or @code{Tap} devices.
|
|
|
|
|
|
|
|
|
|
One of the use-cases we want to support is that of a testbed. A concrete
|
|
|
|
|
example of an environment of this kind is the ORBIT testbed. ORBIT is a
|
|
|
|
|
laboratory emulator/field trial network arranged as a two dimensional grid of
|
|
|
|
|
400 802.11 radio nodes. We integrate with ORBIT by using their ``imaging''
|
|
|
|
|
process to load and run ns-3 simulations on the ORBIT array. We use our
|
|
|
|
|
@code{Emu} @code{NetDevice}s to drive the hardware in the testbed and we can
|
|
|
|
|
accumulate results either using the ns-3 tracing and logging functions, or the
|
|
|
|
|
native ORBIT data gathering techniques. See @uref{http://www.orbit-lab.org/}
|
|
|
|
|
for details on the ORBIT testbed.
|
|
|
|
|
|
|
|
|
|
A simulation of this kind is shown in the following figure:
|
2008-12-04 18:55:04 -08:00
|
|
|
|
|
|
|
|
@float Figure,fig:testbed
|
2009-10-18 22:11:29 -07:00
|
|
|
@caption{Example Implementation of Testbed Emulation.}
|
2008-12-05 16:49:05 -08:00
|
|
|
@center @image{figures/testbed, 5in}
|
2008-12-04 18:55:04 -08:00
|
|
|
@end float
|
|
|
|
|
|
2008-12-05 16:49:05 -08:00
|
|
|
You can see that there are separate hosts, each running a subset of a ``global''
|
2008-12-04 20:19:11 -08:00
|
|
|
simulation. Instead of an ns-3 channel connecting the hosts, we use real
|
|
|
|
|
hardware provided by the testbed. This allows ns-3 applications and protocol
|
|
|
|
|
stacks attached to a simulation node to communicate over real hardware.
|
|
|
|
|
|
2008-12-05 16:49:05 -08:00
|
|
|
We expect the primary use for this configuration will be to generate repeatable
|
|
|
|
|
experimental results in a real-world network environment that includes all of
|
2009-09-04 17:23:34 -07:00
|
|
|
the ns-3 tracing, logging, visualization and statistics gathering tools.
|
2008-12-04 20:19:11 -08:00
|
|
|
|
2008-12-05 16:49:05 -08:00
|
|
|
In what can be viewed as essentially an inverse configuration, we allow ``real''
|
|
|
|
|
machines running native applications and protocol stacks to integrate with
|
|
|
|
|
an ns-3 simulation. This allows for the simulation of large networks connected
|
|
|
|
|
to a real mahince, and also enables virtualization. A simulation of this kind
|
|
|
|
|
is shown in the following figure:
|
2008-12-04 20:19:11 -08:00
|
|
|
|
2008-12-04 18:55:04 -08:00
|
|
|
@float Figure,fig:emulated-channel
|
|
|
|
|
@caption{Implementation overview of emulated channel.}
|
2009-10-18 22:11:29 -07:00
|
|
|
@image{figures/emulated-channel, 6in}
|
2008-12-04 18:55:04 -08:00
|
|
|
@end float
|
|
|
|
|
|
2008-12-05 16:49:05 -08:00
|
|
|
Here, you will see that there is a single host with a number of virtual machines
|
|
|
|
|
running on it. An ns-3 simulation is shown running in the virtual machine shown
|
|
|
|
|
in the center of the figure. This simulation has a number of nodes with associated
|
|
|
|
|
ns-3 applications and protocol stacks that are talking to an ns-3 channel through
|
|
|
|
|
native simulated ns-3 net devices.
|
2008-12-04 20:19:11 -08:00
|
|
|
|
|
|
|
|
There are also two virtual machines shown at the far left and far right of the
|
2008-12-05 16:49:05 -08:00
|
|
|
figure. These VMs are running native (Linux) applications and protocol stacks.
|
|
|
|
|
The VM is connected into the simulation by a Linux Tap net device. The user-mode
|
|
|
|
|
handler for the Tap device is instantiated in the simulation and attached to a
|
|
|
|
|
proxy node that represents the native VM in the simulation. These handlers allow
|
|
|
|
|
the Tap devices on the native VMs to behave as if they were ns-3 net devices in
|
|
|
|
|
the simulation VM. This, in turn, allows the native software and protocol suites
|
|
|
|
|
in the native VMs to believe that they are connected to the simulated ns-3
|
|
|
|
|
channel.
|
2008-12-04 20:19:11 -08:00
|
|
|
|
|
|
|
|
We expect the typical use case for this environment will be to analyze the
|
|
|
|
|
behavior of native applications and protocol suites in the presence of large
|
2008-12-05 16:49:05 -08:00
|
|
|
simulated ns-3 networks.
|
2008-12-04 20:19:11 -08:00
|
|
|
|