[ndnSIM] How to get instant link load

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue May 28 23:21:53 PDT 2013


Can you define "instant" load more specifically?  You can't have "instant" load, since it would be either 100% (packet "on the line") or 0% (nothing is on the line).

In any case, to implement this, you could extend forwarding strategy to keep track of amount of sent/received data on each face.  Here is some example (though not exactly what you're looking for) https://github.com/cawka/ndnSIM-ddos-interest-flooding/blob/master/extensions/stats.h how it can be implemented.  In the example, the forwarding strategy extension keeps track of number of forwarded interests and number of unsatisfied.  You can overload different methods (InInterest, InData, DidSendOutInterest, DidSendOutData) and get amount of sent/received data instead.

After you have this module implemented, you can create a policy to control how DATA packets are cached.  Currently, there are a number of policies available, including LRU, LFU, Random, Persistent, and some other.  It is not the case with all policies that all passing by DATA packets will be cached.  For example, with Random policy, there is always a chance that new item will be rejected.  In your case, you would need to write a policy, that on every insert consults "stats" module and applies probabilistic decision whether to cache item or not.

Here is just a little bit background that could be useful to understand content store (I made this example before for FIB, but it is good for Content Store as well):


Content Store (as well as FIB and PIT) is organized using the underlying data structure that is a complex tree.  Each node of the tree corresponds to a name component, and connection to child nodes is implemented as a hash array.   If you want, you can check more details by looking into the source code in https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/trie.h. 

An example

Let say, Content Store has cached DATA packets with the following names:


The structure that will be created would look like

(root) --- a (*) ----- b (*)
 \          \
  \           \------ d (*)
    \----- b ----- a (*)
              \---- b (*)

The nodes with (*) mean that at this level there is a payload (valid CS entry), which can be returned during the lookup process.

Children on each level are stored in a hash-based container.

In addition to this trie structure, each inserted item is also subject to a policy:  every time an item is inserted, looked up, modified, or deleted, a policy is getting notified and can do some action, e.g., remove item, promote item, or do something else.  Here are links to existing policy implementations:
LRU: https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/lru-policy.h
LFU: https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/lfu-policy.h
Random: https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/random-policy.h
Persistent: https://github.com/NDN-Routing/ndnSIM/blob/master/utils/trie/persistent-policy.h



On May 28, 2013, at 6:49 PM, 陈胜蓝 <blindeafer at 163.com> wrote:

> Hi all,
> I have an idea about cache scheme.In this scheme,I want to get the instant incoming link load everytime a contentobject come into a node and the outgoing link load(s) according to PIT entry if the contentobject is matched in PIT.What function I could modify and how can I write function to realize this idea?
> BTW,I wonder if a node will cache every contentobject when it comes in?What class and member function a node implement to cache a contentobject?
> Best regards.
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

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

More information about the ndnSIM mailing list