37.4 Loss Detection--The Class SRMinfo

A very small encapsulating class, entirely in C++, tracks a number of assorted state information. Each member of the group, $n_i$, uses one SRMinfo block for every other member of the group.

An SRMinfo object about group member $n_j$ at $n_i$, contains information about the session messages received by $n_i$ from $n_j$. $n_i$ can use this information to compute its distance to $n_j$.

If $n_j$ sends is active in sending data traffic, then the SRMinfo object will also contain information about the received data, including a bit vector indicating all packets received from $n_j$.

The agent keeps a list of SRMinfo objects, one per group member, in its member variable, sip_. Its method, [int sender]get_state will return the object corresponding to that sender, possibly creating that object, if it did not already exist. The SRMinfo../ns-2/srm-state.h has two methods to access and set the bit vector, , rX [int id]ifReceived & indicates whether the particular message from the appropriate sender, with id id was received at $n_i$,
[int id]setReceived & to set the bit to indicate that the particular message from the appropriate sender, with id id was received at $n_i$. The session message variables to access timing information are public; no encapsulating methods are provided. These are:

        int     lsess_;                   /* # of last session msg received /
        int     sendTime_;                /* Time sess. msg. # sent /
        int     recvTime_;                /* Time sess. msg. # received /
        double  distance_;

        /* Data messages */
        int     ldata_;                   /* # of last data msg sent /

Tom Henderson 2011-11-05