Next: 4.2 Schedulers and Events
Up: 4. The Class Simulator
Previous: 4. The Class Simulator
4.1 Simulator Initialization
When a new simulation object is created in tcl,
the initialization procedure../ns-2/ns-lib.hSimulator::init
performs the following operations:
The packet format initialization sets up field offsets within packets
used by the entire simulation. It is described in more detail
in the following chapter on packetsChapterchap:pformat.
The scheduler runs the simulation in an event-driven manner and may
be replaced by alternative schedulers which provide somewhat
different semantics (see the following section for more detail).
The null agent is created with the following call:
- initialize the packet format (calls create_packetformat)
- create a scheduler (defaults to a calendar scheduler)
- create a ``null agent'' (a discard sink used in various places)
set nullAgent_ [new Agent/Null]
This agent is generally useful as a sink for dropped packets or
as a destination for packets that are not counted or recorded.