[ndnSIM] Question of PIT lifetime

Alex Afanasyev alexander.afanasyev at ucla.edu
Wed Apr 17 20:06:04 PDT 2013


Hi Xee,

It really depends on what you want to do with interest lifetime.  If you want to adjust interest lifetime based on some data plane performance characteristics (e.g., RTT), then it probably be a good idea to write a separate consumer applications (or modify the existing one).   If you want to adjust lifetime periodically, you can do something like this:

void
ChangeLifeTime (Ptr<Application> app, Time newLifeTime)
{
    app->SetAttribute ("LifeTime", TimeValue (newLifeTime));
}

...

ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr")
...
consumerHelper.SetAttribute ("LifeTime", StringValue ("2s"));

ApplicationContainer apps = consumerHelper.Install (appNode);

...
Simulator::Schedule (Seconds (10.0), ChangeLifeTime, apps.Get (0), Seconds (2.0));


---
Alex


On Apr 17, 2013, at 7:12 PM, "Xee" <1839750381 at qq.com> wrote:

> Hi Alex
> 
> Let say I have this code, but I want to update dynamically change the lifetime for PIT during simulation runtime. How can I arithmetically change or insert the value of 2s in line number 2.
> 
> 1.  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
> 2.  consumerHelper.SetAttribute ("LifeTime", StringValue ("2s"));
> 
> rgd
> -Xee
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim





More information about the ndnSIM mailing list