[ndnSIM] Question about ndnSIM for Data Freshness function.

Prasertsak U. gniliamg at gmail.com
Thu Dec 13 18:32:04 PST 2012


Dear Alex,

Thank you very much for your help.
It works both the compiling and freshness functionality.

Regards,
Prasertsak.


On Fri, Dec 14, 2012 at 3:02 AM, Alex Afanasyev <
alexander.afanasyev at ucla.edu> wrote:

> Hi Prasertsak,
>
> Thanks for the reporting this bug, which didn't express itself for some
> reason with my compiler.
>
> I just pushed the fix on github (commit 6978611...), so now the code
> should compile (I have tested with on my Ubuntu with the latest boost
> libraries installed from the source).
>
> ---
> Alex
>
> On Dec 13, 2012, at 12:43 AM, Prasertsak U. <gniliamg at gmail.com> wrote:
>
> > Dear Alex,
> >
> > After I compile from the last update about freshness functionality. I
> found some errors from a new entry as below: ( start from re-cloning the
> source code)
> >
> > In file included from
> ../src/ndnSIM/model/cs/content-store-with-freshness.h:27,
> >                  from
> ../src/ndnSIM/model/cs/content-store-with-freshness.cc:21:
> > ../src/ndnSIM/model/cs/../../utils/trie/freshness-policy.h:87: error:
> declaration of ‘typedef struct
> ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base, Container, Hook>
> ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base, Container,
> Hook>::type::policy’
> > ../src/ndnSIM/model/cs/../../utils/trie/freshness-policy.h:57: error:
> changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base, Container, Hook>’
> > In file included from
> ../src/ndnSIM/model/cs/content-store-with-freshness.cc:23:
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:85: error:
> declaration of ‘typedef struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container,
> Hook>::type::policy’
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:55: error:
> changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>’
> > [1793/1884] cxx: src/ndnSIM/model/ndn-l3-protocol.cc ->
> build/src/ndnSIM/model/ndn-l3-protocol.cc.1.o
> > In file included from ../src/ndnSIM/model/cs/content-store-impl.cc:23:
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:85: error:
> declaration of ‘typedef struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container,
> Hook>::type::policy’
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:55: error:
> changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>’
> > [1794/1884] cxx: src/ndnSIM/utils/tracers/ndn-l3-tracer.cc ->
> build/src/ndnSIM/utils/tracers/ndn-l3-tracer.cc.1.o
> > [1795/1884] cxx:
> src/ndnSIM/examples/ndn-simple-with-content-freshness.cc ->
> build/src/ndnSIM/examples/ndn-simple-with-content-freshness.cc.3.o
> > In file included from ../src/ndnSIM/model/pit/ndn-pit-impl.cc:29:
> > ../src/ndnSIM/model/pit/../../utils/trie/random-policy.h:85: error:
> declaration of ‘typedef struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container,
> Hook>::type::policy’
> > ../src/ndnSIM/model/pit/../../utils/trie/random-policy.h:55: error:
> changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>’
> > In file included from
> ../src/ndnSIM/model/cs/content-store-with-stats.h:27,
> >                  from
> ../src/ndnSIM/model/cs/content-store-with-stats.cc:21:
> > ../src/ndnSIM/model/cs/../../utils/trie/lifetime-stats-policy.h:75:
> error: declaration of ‘typedef struct
> ns3::ndn::ndnSIM::lifetime_stats_policy_traits::policy<Base, Container,
> Hook> ns3::ndn::ndnSIM::lifetime_stats_policy_traits::policy<Base,
> Container, Hook>::type::policy’
> > ../src/ndnSIM/model/cs/../../utils/trie/lifetime-stats-policy.h:57:
> error: changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::lifetime_stats_policy_traits::policy<Base, Container,
> Hook>’
> > In file included from
> ../src/ndnSIM/model/cs/content-store-with-stats.cc:23:
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:85: error:
> declaration of ‘typedef struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container,
> Hook>::type::policy’
> > ../src/ndnSIM/model/cs/../../utils/trie/random-policy.h:55: error:
> changes meaning of ‘policy’ from ‘struct
> ns3::ndn::ndnSIM::random_policy_traits::policy<Base, Container, Hook>’
> >
> > Thanks in advance!
> >
> > Regards,
> > Prasertsak.
> >
> >
> > On Thu, Dec 13, 2012 at 1:29 PM, Prasertsak U. <gniliamg at gmail.com>
> wrote:
> > Thank you so much for all your help and suggestion.
> >
> > Regards,
> > Prasertsak.
> >
> >
> > On Thu, Dec 13, 2012 at 10:24 AM, Alex Afanasyev <
> alexander.afanasyev at ucla.edu> wrote:
> > Hi Prasertsak,
> >
> > I decided to spend a little bit time today to implement functionality
> that you were missing.
> >
> > As of the latest commit on github
> (71278d4c6011bf4f961fa79d12a2c39f3fbfdd3c) you can use the following
> content store realizations that fully support Freshness in ContentObjects
> > - ns3::ndn::cs::Freshness::Lru
> > - ns3::ndn::cs::Freshness::Random
> > - ns3::ndn::cs::Freshness::Fifo
> >
> > (Small disclaimer. I haven't had time to thoroughly test them yet. Basic
> tests working, but if you encounter a bug, please let me know.)
> >
> > I also updated documentation on the website, adding an example how to
> use new realizations:
> http://ndnsim.net/helpers.html#content-store-respecting-freshness-field-of-contentobjects
> >
> > Sincerely,
> > Alex
> >
> > On Dec 11, 2012, at 12:44 PM, Alex Afanasyev <
> alexander.afanasyev at ucla.edu> wrote:
> >
> > > Dear Prasertsak,
> > >
> > > Though it is possible to specify the freshness parameter in the
> ContentObject packet, ndnSIM does not yet have support for actually
> enforcing it.  Generally, as such a "cache" is just a temporary short-term
> buffer, it does not really matter.  You as a producer don't really have a
> control for how long routers would store your data, similarly how you don't
> have control for how long packets will be in routers interface queues.
> > >
> > > Actually, Content Store name for the cache in ndnSIM is a little bit
> misleading, and we are planning to rename it to PacketBuffer in near future.
> > >
> > > It should be pretty straightforward to add freshness functionality
> (similar how it is implemented in ndn-pit-impl.h/cc, but unfortunately I
> will be only available in a week or so to work on this.
> > >
> > > Sincerely,
> > > Alex
> > >
> > >
> > > On Dec 11, 2012, at 5:55 AM, Prasertsak U. <gniliamg at gmail.com> wrote:
> > >
> > >> Dear cawka (Alex Afanasyev),
> > >>
> > >> I'm Prasertsak from Thailand. I'm not a native speaker in English.
> I'd apologize if my English made you confuse.
> > >>
> > >> Now, I'm using the ndnSIM to simulate the CCN network in my research.
> However, I have a problem about "SetFreshness" function on the provider
> side. The data freshness seems to be not working, but I'm not sure because
> of the less experience about this tool.
> > >>
> > >> This is my simple environment for testing the data freshness:
> > >>
> > >> Consumer <------------> intermediate node <-----------------> provider
> > >>
> > >> I try to send the same prefix (i.e., "/data/10") to the provider and
> capture the interest packet at the provider node. Hence, the interest
> packet is replied by the provider application with freshness attributes.
> (Some parts of the code are shown below)
> > >>
> > >> ndn::ContentObjectHeader data;
> > >> data.SetName (Create<ndn::NameComponents> (interest->GetName()));
> > >> data.SetFreshness(Seconds(1.0));
> > >> data.SetTimestamp(Simulator::Now().GetSeconds());
> > >>
> > >> At the consumer side, the consumer application tries to send the same
> prefix (i.e., "/data/10") again, but the interest doesn't send through the
> provider after the second time. The response packet came from the cache
> only. In my opinion, the interest packet should send through the provider
> when the data in the cache is expired (by SetFreshness() function ... Is
> correct?).
> > >>
> > >> My question is
> > >>      • Have the ndnSIM supported the data freshness?
> > >>      • How to use the data freshness of the ndnSIM? (If the data
> freshness had already supported.)
> > >> Thank you very much.
> > >>
> > >> Regards,
> > >> Prasertsak U.
> > >>
> > >>
> > >
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20121214/8a83bc2e/attachment.html>


More information about the ndnSIM mailing list