[ndnSIM] Unusual behavior of Random Replacement Policy

Saran Tarnoi sarantarnoi at gmail.com
Mon Nov 3 01:23:56 PST 2014

Hello Alex and All,

I have experienced a few unusual things about the random replacement policy
in ndnSIM.

First, the "insert" function in random-policy.h usually returns False. This
is because the condition "MemberHookLess<Container>() (*item,
*policy_container::begin ())" is usually False, which I really have no idea
what is going on there. This issue effectively prevents the items in the
cache from being replaced by coming ones for some reasons.

I fixed the issue by modifying the feasible value of u_rand. That is,
"u_rand (0, std::numeric_limits<uint32_t>::max ())" is substituted with
"u_rand (0, 1)". Then, the insert function no longer returns False. But I
am not sure if this is a correct way to do. Does the approach break the
rule of the random replacement policy?

Second, using the approach, I experimented with two nodes, cache size is
two while the item population is three. It appeared that the two nodes
always replaced the same item. For example, if nodeA replaced item1, nodeB
also replaced item1. Consequently, the two caches stored exactly the same
set of cached items at the same time. This would not happen if the two
nodes independently chose an item to be replaced. This made me think I
might solve the issue incorrectly or do not understand something.

Please confirm the issue and give me some pieces of advice.
Thank you so much for your time.

Saran Tarnoi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20141103/8d4d57a2/attachment.html>

More information about the ndnSIM mailing list