[ndnSIM] Strategy specific info

Muktadir R Chowdhury (mrchwdhr) mrchwdhr at memphis.edu
Mon Jan 6 09:07:58 PST 2020


Hi,
I have written a strategy which needs to have states that are specific to the strategy, not to the namespace.

(1)  Lets say I have the following strategy:

NFD_REGISTER_STRATEGY(CustomStrategy);

class CustomStrategy : Strategy {

void
afterReceiveInterest() {
 cout << "v=" <<v << endl;
 v ++;
}

private:
 int v = 0;
}

I want the variable "v" to be Strategy specific.

(2) I set CustomStrategy for two prefixes, lets say "/a" and '/b".

(3) I send two interests under "/a", lets say "/a/1" and "/a/2". The value of "v" should be 2.
    v=0 and v=1 should be printed.

(4) Now I send one interest under "/b" ("/b/1"). I was expecting it to print v=2. But it printed v=0.

I guess the reason is , for two different namespace ("/a" and "/b"), two different instances of CustomStrategy is created. I have also tried adding this Strategy specific info in the Measurement Table, like it is done in ASF strategy<https://github.com/named-data/NFD/blob/master/daemon/fw/asf-measurements.hpp> But find out for different namespace, measurement entries are different. Can anyone give me suggestions what can I do here?

Muktadir Chowdhury
University of Memphis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200106/a91e5cac/attachment.html>


More information about the ndnSIM mailing list