[Ns-developers] Ns-3 Wsn GSoc 2012

Vedran Miletić rivanvx at gmail.com
Sun Mar 25 06:20:27 PDT 2012

I will let Tommaso comment on the energy part, since I'm not much into
it. Regarding starting and stopping objects, the way I see it is this:
there are at least three layers regarding start/stop stuff: object
state, listener stuff and starter/stopper object. I will explain all
of them briefly.

Object state is simply an additional variable (enum/bool m_state) that
says if object is up or down. That's the easy part; the hard part is
adjusting the already existing models to it, i.e. you don't want
models to "work" when m_state is false or STATE_DOWN. To be more
precise and more specific, take any NetDevice: you would need to
modify it's Send() and SendOut() methods to check m_state and send if
it's 1, drop the packet otherwise. Similar for any Channel,
Application etc.

The next part is related to object hierarchy and which object stopping
impacts which other object. To be more precise and specific, let's
take an example of Node stopping: you want it to stop it's
Applications and NetDevices. To do so, you need to somehow register
all Applications and NetDevices (and perhaps some other Objects, i.e.
internet stack at that node) with the Node and make them all stop when
Node does, and make them all start when Node does.

The third part, perhaps the easiest, is the one that deals with
starting and stopping the objects at various simulation times. The way
I see it, it should attach itself in a way similar to
PropagationLossModel and PropagationDelayModel, but I'm open to better
ideas. This is where energy model stuff fits: it can be one model that
starts and stops other objects. But there can also be a generic
FailureModel of some sort (I plan to do some experimentation in this
direction soon).


More information about the Ns-developers mailing list