|
Architecture:Both NS-2 and RT-Sim are discrete event simulation engines with their own simulation
framework. The Co-Simulator
is designed by keeping the NS-2 event scheduler as the main engine, and RT-Sim engine as its subengine. There is a special event in NS-2
that takes care of
processing all events of RT-Sim that happen at a single point in time.
- The cosimulator engine is modeled as an application sitting on top of an agent (in NS-2, modeling protocols and end to end network connections);
- The usual NS-2 execution flow is unchanged extending the API available from the TCL interpreted front-end;
- Existing libraries are re-used.
|
 |
To allow the user to model exchange of data packets through the network, at cpu level new tasks abstracting networking activities have been added.
Suppose the user needs to model a task that periodically wakes up, performs some computation and then sends
out a set of data. The user will only need to create a periodic real-time Sender task with a delay instruction that models the time spent in
the initial
computation, and a send instruction that models the transmission of data to the Agent. The task is subject to the scheduling algorithm in
the node, so it may be
delayed by other tasks. The actual sending of the data is done only when the corresponding send instruction is executed.
 |
The figure at the left describes the sequence of actions triggered by the send procedure in RTNS. This procedure, in charge of generating, packing, and injecting data frames into the network, does the following:
- Activate a process to schedule a transmission
- Schedule the process according to a selected policy
- Processor executes the “Send” concurrently with computational tasks
- Execution takes the time needed by the instructions (i.e. time needed to build a packet up)
- RT-App notifies the Agent on Instruction Done (i.e. Packet ready to be sent)
- Agent triggers bottom Layers to inject the packet into the network
- Data Frames are injected into the network
N.B. Steps 1,2,3,5,6 consume NS-2 time.
|
|
|