37.6 Session Objects

Session objects, like the loss recovery objectsSectionsec:recovery, are derived from the base SRM. Unlike the loss recovery objects though, the agent only creates one session object for the lifetime of the agent. The constructor invokes the base class constructor as before; it then sets its instance variable sessionDelay_. The agent creates the session object when it []starts. At that time, it also invokes SRM/session::schedule../ns-2/srm.tclSRM/session::schedule, to send a session message after sessionDelay_ seconds.

When the object sends a session message, it will schedule to send the next one after some interval. It will also update its statistics. []send-session../ns-2/srm.tclSRM/session::send-session writes out the trace entry ``S SESSION''.

The class overrides the []evTrace routine that writes out the trace entries. SRM/session::evTrace../ns-2/srm.tclSRM/sesion::evTrace disable writing out the trace entry for session messages.

Two types of session message scheduling strategies are currently available: The function in the base class schedules sending session messages at fixed intervals of sessionDelay_ jittered around a small value to avoid synchronization among all the agents at all the nodes. SRM/session/logScaled schedules sending messages at intervals of sessionDelay times $\log_2$(groupSize_) so that the frequency of session messages is inversely proportional to the size of the group.

The base class that sends messages at fixed intervals is the default sessionFunction_ for the agent.

Tom Henderson 2011-11-05