<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 24, 2016, at 1:04 PM, Ravi Kumar Singh <<a href="mailto:rk8000@g.rit.edu" class="">rk8000@g.rit.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><span style="font-size:12.8px" class="">Hi Lixia / Team,</span><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I would like to create a custom cache replacement policy. I went through the LruPolicy class and I can see that it contains methods like evictEntries, insertToQueue, etc. However, it is not clear, when, how these methods are called. </div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I believe in order to achieve what I want to, I would have to create a similar class. Am I on the right path here? Some starting point documentation of how the flow is would be really helpful.</div></div></div></blockquote><div><br class=""></div>I must admit that I dont know the code details. So we need Alex or Spyros to help out here.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 20, 2016 at 3:14 AM, Ravi Kumar Singh <span dir="ltr" class=""><<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Thanks Lixia/Spyridon! I will implement this and will let you the results! Thank you so much again!</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 20, 2016 at 1:03 AM, Lixia Zhang <span dir="ltr" class=""><<a href="mailto:lixia@cs.ucla.edu" target="_blank" class="">lixia@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Apr 18, 2016, at 10:40 AM, Spyridon (Spyros) Mastorakis <<a href="mailto:mastorakis@cs.ucla.edu" target="_blank" class="">mastorakis@cs.ucla.edu</a>> wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class="">Hi Ravi,<div class=""><br class=""></div><div class="">that looks right to me.</div><div class=""><br class=""></div><div class="">There is also something else that you need to do:</div><div class=""><br class=""></div><div class="">your consumer application should express Interests with the “mustBeFresh” selector set in order to retrieve only “fresh” data:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/interest.hpp#L417-L423" target="_blank" class="">https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/interest.hpp#L417-L423</a></div><div class=""><br class=""></div><div class="">To this end you should do something like that:</div><div class=""><br class=""></div><div class="">Interest i(name);</div><div class="">i.setMustBeFresh(true);</div><div class="">...</div><div class="">…</div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">m_face-></span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap" class="">onReceiveInterest</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)" class="">(*interest);</span></div><div class=""><br class=""></div><div class="">Hope that this helps.</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span style="float:none;display:inline!important" class="">Spyridon (Spyros) Mastorakis</span><br class=""><span style="float:none;display:inline!important" class="">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span style="float:none;display:inline!important" class="">Internet Research Laboratory</span><br class=""><span style="float:none;display:inline!important" class="">Computer Science Department</span><br class=""><span style="float:none;display:inline!important" class="">UCLA</span></div></div></div></div></div></div></div></blockquote><div class=""><br class=""></div></span>copied the list here.</div><div class="">Ravi, hopefully your issue was resolved?</div><div class=""><div class=""><div class=""><br class=""><br class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 17, 2016, at 11:54 PM, Ravi Kumar Singh <<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="">Hi Lixia,</div><div class=""><br class=""></div>No, I am not aware where we need to set this <span style="font-size:12.8px" class="">"must be fresh". I just followed the below link:</span><div class=""><span style="font-size:12.8px" class=""><br class=""></span><div class=""><span style="font-size:12.8px" class=""><a href="https://github.com/cawka/ndnSIM-examples/blob/master/examples/ndn-simple-with-content-freshness.cc" target="_blank" class="">https://github.com/cawka/ndnSIM-examples/blob/master/examples/ndn-simple-with-content-freshness.cc</a></span><br class=""></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">and changed like below:</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">ccnxHelper.</span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">SetContentStore</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""> (</span><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><span class="">"</span>ns3::ndn::cs::Freshness::Lru<span class="">"</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">,</span><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><span class="">"</span>MaxSize<span class="">"</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">, </span><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><span class="">"</span>2<span class="">"</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">);</span><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">and </span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">producerHelper.</span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">SetAttribute</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""> (</span><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><span class="">"</span>Freshness<span class="">"</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">, </span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">TimeValue</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""> (</span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">Seconds</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""> (</span><span style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">2.0</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">)));</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class=""><br class=""></span></div><div class=""><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap" class="">Please let me know where exactly we have to set </span><span style="font-size:12.8px" class="">"must be fresh" or anything we need to do?</span></div></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Thanks and Regards,</span></div><div class=""><span style="font-size:12.8px" class="">Ravi Kumar Singh</span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Apr 17, 2016 at 11:25 PM, Lixia Zhang <span dir="ltr" class=""><<a href="mailto:lixia@cs.ucla.edu" target="_blank" class="">lixia@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Apr 17, 2016, at 12:27 PM, Ravi Kumar Singh <<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><font face="verdana, sans-serif" class="">Hi Alex/Lixia/Team,</font><div class=""><font face="verdana, sans-serif" class=""><br class=""></font></div><div class=""><font face="verdana, sans-serif" class="">Thank you so much for the help! Now, I am trying to use the </font><span style="font-family:monospace;font-size:13.9333px;background-color:rgb(236,240,243)" class="">ns3::ndn::cs::Freshness::Lru</span><span style="font-family:verdana,sans-serif" class="">   feature to use the freshness. But it seems its not giving desired results. Even after the freshness has expired the next interest is being served from the Cache server and not from the Origin Server. And as per the policy(</span><span style="font-family:monospace;font-size:13.9333px;background-color:rgb(236,240,243)" class="">ns3::ndn::cs::Freshness::Lru)</span><span style="font-family:verdana,sans-serif" class="">,it</span><span style="font-family:verdana,sans-serif;line-height:19.0667px;text-align:justify" class=""> cache Data packets only for the time indicated by FreshnessPeriod.</span></div></div></div></blockquote><div class=""><br class=""></div></span>did you set "must be fresh" in your interests packets?</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><span style="font-family:verdana,sans-serif;line-height:19.0667px;text-align:justify" class="">Thanks and Regards,</span></div><div class=""><span style="font-family:verdana,sans-serif;line-height:19.0667px;text-align:justify" class="">Ravi Singh</span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 13, 2016 at 9:41 PM, Alex Afanasyev <span dir="ltr" class=""><<a href="mailto:aa@cs.ucla.edu" target="_blank" class="">aa@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Apr 12, 2016, at 11:13 PM, Ravi Kumar Singh <<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Forgot to include team.<div class=""><br class=""><div class="gmail_quote">---------- Forwarded message ----------<br class="">From: <b class="gmail_sendername">Ravi Kumar Singh</b> <span dir="ltr" class=""><<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>></span><br class="">Date: Wed, Apr 13, 2016 at 2:11 AM<br class="">Subject: Re: [ndnSIM] Seeking help regarding ndnsim; intreset with different sequence number<br class="">To: Lixia Zhang <<a href="mailto:lixia@cs.ucla.edu" target="_blank" class="">lixia@cs.ucla.edu</a>><br class=""><br class=""><br class=""><div dir="ltr" class="">Thanks Lixia! I will try setting <span style="font-size:12.8px" class=""> up a second consumer to request the same data. </span><div class=""><span style="font-size:12.8px" class="">But, in our experiment, we need to see what happens when the same consumer requests the same interest multiple times. I tried writing my own implementation of a consumer, but still only the first interest is working well and rest all interest are <b class="">not even</b> forwarding from the consumer(same) itself. </span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Following is a log of its operation ( with my own implemention of one consumer sending three same interest):</span><br style="font-size:12.8px" class=""><br style="font-size:12.8px" class=""><font face="monospace, monospace" style="font-size:12.8px" class="">1: 1s 0 CustomApp:SendInterest(): [DEBUG] Sending Interest packet for /root/%FE%00?ndn.InterestLifetime=1000&ndn.Nonce=4231791817<br class="">2: 1s 0 CustomApp:SendInterest(): [DEBUG] Sending Interest packet for /root/%FE%00?ndn.InterestLifetime=1000&ndn.Nonce=<a href="tel:2837832477" value="+12837832477" target="_blank" class="">2837832477</a><br class="">3: 1s 0 CustomApp:SendInterest(): [DEBUG] Sending Interest packet for /root/%FE%00?ndn.InterestLifetime=1000&ndn.Nonce=2794407255<br class="">4: 1.01002s 1 ndn.cs.Lru:Lookup(0x1493c10, /root/%FE%00)<br class="">5: 1.02004s 2 ndn.Producer:OnInterest(0x14fce90, 0x1528ae8)<br class="">6: 1.02004s 2 ndn.Producer:OnInterest(): [INFO ] node(2) responding with Data: /root/%FE%00<br class="">7: 1.03089s 1 ndn.cs.Lru:Add(0x1493c10, /root/%FE%00)<br class="">8: 1.04174s 0 CustomApp:OnData(): [DEBUG] Receiving Data packet for /root/%FE%00</font><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><font face="monospace, monospace" style="font-size:12.8px" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" style="font-size:12.8px" class="">As, you can see from the log, only first interest is working file and rest 2 interest are <b class="">not even</b> forwarding from the consumer itself.</font></div></div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Hi Ravi,</div><div class=""><br class=""></div><div class="">What you see is correct and intentional behavior of an NDN router.  You're trying to send 3 interests for the same data at the exactly the same time.  As a result, these 3 interests will be aggregated into one and only one will be sent further. Also, given that the same app (though the same face) is sending those interests, only one data is returned back.</div><div class=""><br class=""></div><div class="">Depending on what specific effect you want to observe, you may want to spread out sending interests in time and/or request from different simulated nodes (different app instances).</div><div class=""><br class=""></div><div class="">---</div><div class="">Alex</div><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="gmail_quote"><div dir="ltr" class=""><div class=""><font face="monospace, monospace" style="font-size:12.8px" class="">Please suggest!</font></div><div class=""><font face="monospace, monospace" style="font-size:12.8px" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" style="font-size:12.8px" class="">Regards,</font></div><div class=""><font face="monospace, monospace" style="font-size:12.8px" class="">Ravi</font></div></div><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Apr 13, 2016 at 12:31 AM, Lixia Zhang <span dir="ltr" class=""><<a href="mailto:lixia@cs.ucla.edu" target="_blank" class="">lixia@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 12, 2016, at 9:20 PM, Ravi Kumar Singh <<a href="mailto:rk8000@g.rit.edu" target="_blank" class="">rk8000@g.rit.edu</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><span style="font-size:12.8px" class="">Hi Team,</span><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">I am a Graduate student of Rochester Institue of Technology, New York. Currently, I am working on a research paper based on NDN along with my Prof.</div><div style="font-size:12.8px" class="">Currently, we want to simulate the NDN with your software NDNSIM. We want to simulate the scenario where the consumer is sending the same interest (same sequence number) multiple times to the producer so that the cache Server would serve the interest as it would have the content in its cache instead of serving the request from the producer.</div><div style="font-size:12.8px" class="">We tried googling but couldn't found any relevant link for this scenario.</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Requesting you to please help us on how we can simulate the scenario where the consumer is sending the same interest(same sequence number) instead of the incremental sequence number (default behaviour).</div></div></div></blockquote><br class=""></div></span><div class="">it seems to me easier to set up a second consumer to request the same data, rather than forcing the same consumer to send repeated interest.</div></div></blockquote></div></div></div></div></div></div></div></div></blockquote></span></div><br class=""></div></blockquote></div><br class=""></div></div></div>
_______________________________________________<br class="">ndnSIM mailing list<br class=""><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank" class="">ndnSIM@lists.cs.ucla.edu</a><br class=""><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank" class="">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></div></div></blockquote><br class=""></div></div></div></div></div><br class=""></div></div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>