[ndnSIM] How to obtain content diversity of network?

Alex Afanasyev alexander.afanasyev at ucla.edu
Fri Aug 30 09:50:52 PDT 2013


Getting the number of cached Data packets can be done something like this (I'm copying a part of examples/ndn-simple-with-cs-lfu.cc):

  uint64_t csCount = 0;
  for (NodeList::Iterator node = NodeList::Begin ();
       node != NodeList::End ();
       node ++)
    {
      Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore> ();
      csCount += cs->GetSize ();
    }

The total number of content in the network is something that is known just to you in your simulation scenario, so you can manually pre-calculate the value based on simulation setup.  (In general, number of content in the network is virtually unlimited.)

---
Alex

On Aug 27, 2013, at 8:34 PM, 陈胜蓝 <blindeafer at 163.com> wrote:

> Hi All,
> I would like to obtain an average content diversity of network, I think it would be number of content cached in network divided by total number of content,how could I obtain the value from simulation,would you please give me some hints?
> 
> 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/20130830/695fa3ef/attachment.html>


More information about the ndnSIM mailing list