[ndnSIM] Strategy specific info

Junxiao Shi shijunxiao at email.arizona.edu
Tue Jan 7 10:58:16 PST 2020


Hi Muktadir

Strategy is stateless. It can only attach measurements on namespaces under
its control.
See Section 3.3 of original NDN paper
https://named-data.net/publications/networkingnamedcontent/ for rationale
of this design decision.
Thus, what you desire cannot be supported.

Yours, Junxiao

On Mon, Jan 6, 2020, 12:08 Muktadir R Chowdhury (mrchwdhr) <
mrchwdhr at memphis.edu> wrote:

> 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/20200107/c919bd5f/attachment.html>


More information about the ndnSIM mailing list