[ndnSIM] calculating cache hit ratio

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu Sep 10 14:53:43 PDT 2015


Hi,

the straightforward way to increase hit rate is to request the same data as many times as possible and the corresponding interests hit a cache that has the requested data.

In general, the replacement policy should make a difference when cache evictions take place. In order to do that, a cache has to be full, while more data needs to be stored in it. If a cache has such a great size, so that no evictions need to take place, the replacement policy should not make any difference.

--
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
PhD Computer Science
UCLA


> On Sep 10, 2015, at 11:11 AM, Shahrear Tanzil <tanzil.eee at gmail.com> wrote:
> 
> Hi Spyridon,
> 
> Thank you for the reply. 
> 
> I am using "ndn-tree-cs-tracers" example. In this example cache hit ratio=(10/20)*100=50% for the root node (.txt file is attached here) for all  cache replacement policy e.g., "Lfu", "Lru", and "Fifo". I also change content store maximum size of the root node e.g.,  "Config::Set("/NodeList/6/$ns3::ndn::ContentStore/MaxSize", UintegerValue(200))" as well as maximum CS sizes of packets e.g.,  ndnHelper.SetOldContentStore("ns3::ndn::cs::Fifo", "MaxSize","100"). 
> 
> Still I am getting maximum 50% cache hit ratio. I want to increase the cache hit ratio by tweaking parameters. 
> 
> Please help me.  
> 
> Thank you in advanced and apology if I made wrong interpretation. 
> 
> Regards,
> Tanzil
> 
> On Wed, Sep 9, 2015 at 11:36 AM, Shahrear Tanzil <tanzil.eee at gmail.com> wrote:
> Hi Spyridon,
> 
> Thank you for the reply. 
> 
> I am using "ndn-tree-cs-tracers" example. In this example cache hit ratio=(10/20)*100=50% for the root node (.txt file is attached here) for  all  cache replacement policy e.g., "Lfu", "Lru", and "Fifo".  
> 
> I would link to know, how to increase the cache hit ratio by increasing content store maximum size i.e., "Config::Set("/NodeList/6/$ns3::ndn::ContentStore/MaxSize", UintegerValue(200))" ,  and for different maximum CS sizes of packets e.g.,  ndnHelper.SetOldContentStore("ns3::ndn::cs::Fifo", "MaxSize","100"), since I am getting same result for different size. 
> 
> Thank you in advanced and apology if I made wrong interpretation. 
> 
> 
> On Fri, Sep 4, 2015 at 5:13 PM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu> wrote:
> Hi,
> 
> first of all, you need to run an example that uses the CsTracer. After the execution of such an example, a .txt file would be generated (typically with the name “cs-trace.txt”). This file contains the number of CacheHits and CacheMisses for each node with respect to the simulation time. To compute the cache hit ratio of your simulation, you need to use the following formula:
> 
> Cache hit ratio (%) = (Total number of cache hits / (Total number of cache hits + Total number of cache misses)) * 100
> 
> --
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> PhD Computer Science
> UCLA
> 
> > On Sep 4, 2015, at 4:46 PM, Shahrear Tanzil <tanzil.eee at gmail.com> wrote:
> >
> > Hi,
> >
> > I am a new user of ndnSIM. I would like to compare cache hit ratio for different cache replacement policies for variable cache size. Can you please let me know how to calculate cache hit ratio using CsTracer (following examples ndn-tree-cs-tracers and ndn-simple-with-different-sizes-content-store).
> >
> > Thank you in advanced.
> 





More information about the ndnSIM mailing list