38.5.0.0.1 Request Mechanisms

SRM agents detect loss when they receive a message, and infer the loss based on the sequence number on the message received. Since packet reception is handled entirely by the compiled object, loss detection occurs in the C++ methods. Loss recovery, however, is handled entirely by instance procedures of the corresponding interpreted object in OTcl.

When any of the methods detects new losses, it invokes []Agent/SRM::request../ns-2/srm.tclAgent/SRM::request with a list of the message sequence numbers that are missing. []request will create a new requestFunction_ object for each message that is missing. The agent stores the object handle in its array of pending_ objects. The key to the array is the message identifier sender:msgid.

When the scheduled timer fires, the routine []send-request../ns-2/srm.tclSRM/request::send-request sends the appropriate message. It invokes ``$agent_ send request args'' to send the request. Note that []send is an instproc-like, executed by the []command method of the compiled object. However, it is possible to overload the instproc-like with a specific instance procedure []send for specific configurations. As an example, recall that the file tcl/mcast/srm-nam.tcl overloads the []send command to set the flowid based on type of message that is sent. []send-request updates the statistics, and writes the trace entry ``Q SENDNACK''.

When the agent receives a control message for a packet for which a pending object exists, the agent will hand the message off to the object for processing.

When the loss recovery phase is completed by the object, []Agent/SRM::clear../ns-2/srm.tclAgent/SRM::clear will remove the object from its array of pending_ objects, and place it in its list of done_ objects. Periodically, the agent will cleanup and delete the done_ objects.

Tom Henderson 2014-12-17