next up previous contents index
Next: 3.2 NetDevice and Channel Up: 3. Key simulation objects Previous: 3. Key simulation objects   Contents   Index


3.1 Node

A Node is an abstract base class in ns-3. It contains only a few objects: a unique integer ID, a system ID (for distributed simulation), a list of NetDevices, and a list of Applications. Figure 3.1 depicts this high-level view.

fig:node
Figure 3.1: High-level node architecture.
node

Users can create their own Node subclasses, and ns-3 will provide a few. Currently, class InternetNode is provided, which implements a rudimentary UDP/IPv4 stack.

The design tries to avoid putting too many dependencies on the base class Node, Application, or NetDevice for the following:

The design therefore uses the design pattern of software encapsulation to allow Applications and NetDevices to talk to implementation- independent interfaces (that can be queried via QueryInterface- see section 2.3) of the underlying TCP/IP implementations.

For instance, we expect to support a native ns-3 version of TCP/IP as well as ported Linux or FreeBSD stacks. These implementation details can be hidden behind an IPv4 interface object that is queried by the application or scenario developer. If users want to experiment with non-IP stacks, they can do so without having IP dependencies on the NetDevices, Channels, and Applications. This is why the Stack objects in Figure 3.1 are illustrated with dotted lines; these may be built quite differently for different Node subclasses. We try to provide an interface to the NetDevice corresponding to the device-independent sublayer in Linux, and model the interface on the top of the stacks using typical Unix-like abstractions found in (C-based) sockets API and other system calls such as found in libc or other utilities.


next up previous contents index
Next: 3.2 NetDevice and Channel Up: 3. Key simulation objects Previous: 3. Key simulation objects   Contents   Index
Tom Henderson 2007-08-15