[ndnSIM] Question about extending forwarding strategy in ndnSIM
Alex Afanasyev
alexander.afanasyev at ucla.edu
Wed Feb 27 12:46:28 PST 2013
Hi Yifeng,
Yes. The default limit (as specified in model/fw/per-out-face-limits.h) is ns3::ndn::Limits::Window (utils/ndn-limits-window.h|cc).
And another yes, as I tried to emphasize in doxygen documentation (http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_limits_window.html#a6b7b961168019a655db8c3b5664e51b6), interpretation of values used by (Get|Set)CurrentLimit is implementation-specific. In window case, the value is the window.
Sincerely,
Alex
ps
Would you mind keeping mailing list in CC? Thanks.
On Feb 26, 2013, at 10:35 AM, Yifeng Li <yifengl at email.arizona.edu> wrote:
> Hello Alex,
>
> Thanks for your help. Just to clarify some things on limits, the default is windows, which is the implementation in ndn-limits-window.cc under utils? So if I do something like: Ptr<Limits> faceLimits = inFace->GetObject<Limits> ();
> faceLimtis->GetCurrentLimit();
>
> it would be a window size rather than a rate right?
>
> Thanks for your help,
> Yifeng
>
>
>
> On Wed, Feb 20, 2013 at 10:40 AM, Alex Afanasyev <alexander.afanasyev at ucla.edu> wrote:
> Hi Yifeng,
>
> PerOutFaceLimits is a templated class and you can define (almost) any Parent class that PerOutFaceLimits is extending. Examples of these are in model/fw/per-out-face-limits.cc file:
>
> template class PerOutFaceLimits<BestRoute>;
> typedef PerOutFaceLimits<BestRoute> PerOutFaceLimitsBestRoute;
> NS_OBJECT_ENSURE_REGISTERED (PerOutFaceLimitsBestRoute);
>
>
> If you want to extend the limits class, you have several options. You can do it in a templated way:
>
> template<class Parent>
> class Extension : public PerOutFaceLimits<Parent>
> ...
>
> or you if you know what is the base strategy you want to use with limiting, you can just specialize your extension:
>
> class Extension : public PerOutFaceLimits<BestRoute>
> ...
>
>
> If the parent class that you're using is inherited from Nacks class (most of the strategies do: http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_forwarding_strategy.html), then you can directly override any method defined in Nacks class in your extension. That is, in one extension class you can combine modifications for limits and nacks.
>
> ---
> Alex
>
> On Feb 20, 2013, at 6:19 AM, Yifeng Li <yifengl at email.arizona.edu> wrote:
>
>> Hello Alex,
>>
>> I noticed per-out-face-limits extend Parent, where is Parent defined? I also, if I extend per out face limits, do I also have to extend Nacks as well? There seems to be inheritance conflicts if I extend both.
>>
>> Thanks for your help,
>> Yifeng
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130227/c426ee8d/attachment.html>
More information about the ndnSIM
mailing list