12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

same packet. <strong>The</strong> repair objet does not use the ignore_ variable th<strong>at</strong> request objects use. <strong>The</strong> trace entries written by repairobjects are marginally different; they are “P NACK from 〈requester〉”, “P RTIMER <strong>at</strong> 〈fireTime〉”, “P SENDREP”, “P REPAIRIGNORES 〈holddown〉”.Apart from these differences, the calling sequence for events in a repair object is similar to th<strong>at</strong> of a request object.Mechanisms for St<strong>at</strong>istics <strong>The</strong> agent, in concert with the request <strong>and</strong> repair objects, collect st<strong>at</strong>istics about their respo<strong>ns</strong>eto d<strong>at</strong>a loss [11]. Each call to the agent request{} procedure marks a new period. At the start of a new period,mark-period{} computes the moving average of the number of duplic<strong>at</strong>es in the last period. Whenever the agent receivesa first round request from another agent, <strong>and</strong> it had sent a request in th<strong>at</strong> round, then it co<strong>ns</strong>iders the request as a duplic<strong>at</strong>e request,<strong>and</strong> increments the appropri<strong>at</strong>e counters. A request object does not co<strong>ns</strong>ider duplic<strong>at</strong>e requests if it did not itself send arequest in the first round. If the agent has a repair object pending, then it does not co<strong>ns</strong>ider the arrival of duplic<strong>at</strong>e requests forth<strong>at</strong> packet. <strong>The</strong> object methods SRM/request::dup-request?{} <strong>and</strong> SRM/repair::dup-request?{} encodethese policies, <strong>and</strong> return 0 or 1 as required.A request object also computes the elapsed time between when the loss is detected to when it receives the first request. <strong>The</strong>agent computes a moving average of this elapsed time. <strong>The</strong> object computes the elapsed time (or delay) when it cancels itsscheduled event for the first round. <strong>The</strong> object invokes Agent/SRM::upd<strong>at</strong>e-ave to compute the moving average of the delay.<strong>The</strong> agent keeps similar st<strong>at</strong>istics of the duplic<strong>at</strong>e repairs, <strong>and</strong> the repair delay.<strong>The</strong> agent stores the number of rounds taken for one loss recovery, to e<strong>ns</strong>ure th<strong>at</strong> subsequent loss recovery phases for th<strong>at</strong>packet th<strong>at</strong> are not definitely not due to d<strong>at</strong>a loss do not account for these st<strong>at</strong>istics. <strong>The</strong> agent stores the number of routestaken for a phase in the array old_. When a new loss recovery object is i<strong>ns</strong>tanti<strong>at</strong>ed, the object will use the agent’s i<strong>ns</strong>tanceprocedure round?{} to determine the number of rounds in a previous loss recovery phase for th<strong>at</strong> packet.36.6 Session ObjectsSession objects, like the loss recovery objects (Section 36.5), are derived from the base class SRM Unlike the loss recoveryobjects though, the agent only cre<strong>at</strong>es one session object for the lifetime of the agent. <strong>The</strong> co<strong>ns</strong>tructor invokes the baseclass co<strong>ns</strong>tructor as before; it then sets its i<strong>ns</strong>tance variable sessionDelay_. <strong>The</strong> agent cre<strong>at</strong>es the session object when itstart{}s. At th<strong>at</strong> time, it also invokes SRM/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 upd<strong>at</strong>e itsst<strong>at</strong>istics. send-session{} writes out the trace entry “S SESSION”.<strong>The</strong> class overrides the evTrace{} routine th<strong>at</strong> writes out the trace entries. SRM/session::evTrace disable writing out thetrace entry for session messages.Two types of session message scheduling str<strong>at</strong>egies are currently available: <strong>The</strong> function in the base class schedules sendingsession messages <strong>at</strong> fixed intervals of sessionDelay_ jittered around a small value to avoid synchroniz<strong>at</strong>ion among all theagents <strong>at</strong> all the nodes. class SRM/session/logScaledchedules sending messages <strong>at</strong> intervals of sessionDelaytimes log 2 (groupSize_) so th<strong>at</strong> the frequency of session messages is inversely proportional to the size of the group.<strong>The</strong> base class th<strong>at</strong> sends messages <strong>at</strong> fixed intervals is the default sessionFunction_ for the agent.318

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!