[ndnSIM] [EXT]Re: Adding new field in Interest Packet.

Prajjwal Singh csb17053 at tezu.ac.in
Tue May 4 19:19:31 PDT 2021


Thanks to Junxiao and DJEMAA ,
Junxiao's suggestion is possibly the best, I tried and tested it and it
works very well.

I also tried the method provided in the aforesaid link
<https://www.programmersought.com/article/14675398024/>, and it works!
I had committed a few mistakes that led me into other results.
(Like:
Messing up wire en/decode methods.
And although I did tweak the consumer.cpp's sendPacket() method
(for initializing the field (whose value was added through SetAttribute
feature of helpers))
but I noticed later that ndn-consumer-zipf-mandelbrot.cpp overrides this
function and that was
creating all the confusion.)

For future reference if anyone struggles with this problem following are
the best ways:

   - Easiest is to (like Junxiao said)  put the field in Name or
   application parameter.
   - The tag method also works perfectly but it is too much efforts (Check
   this link <https://lo.calho.st/posts/ndnsim-custom-fields/>)
   - The proper method provided here
   <https://www.programmersought.com/article/14675398024/> also works
   perfectly (and is less hassle than tag method)

Thanking all of you again
Prajjwal Singh

On Wed, 5 May 2021, 06:28 Junxiao Shi, <shijunxiao at email.arizona.edu> wrote:

> Hi DJEMAA
>
>
> If the packet length doesn't matter in your configuration, I advise you to
>> add a Tag instead of a new Field to your packet, since according to ndnSIM
>> design, the tag resides only in the memory.
>> Also, a Tag can be easily managed directly in the NFD machinery
>> (forwarder class), contrary to a new field in either Interest or Data
>> packets which are generally static objects.
>>
>
> ndnSIM doesn't support ns3::Tag (the kind described in ns-3 model library
> https://www.nsnam.org/docs/release/3.33/models/html/packets.html#adding-and-removing-tags
> ).
> Subclasses of ndn::Tag are completely different from ns3::Tag. This
> includes the HopCountTag. They must be encoded into the packet buffer to
> have any effect.
>
>
>>> The main problem is that if i have the following topology
>>> A--B--C--D
>>> (Where A is the Consumer and D is the Producer, and B and C are routers)
>>> Then by the solution given in the above link the custom field set in A's
>>> generated Interest packet is reset to default value by B when it forwards
>>> the interest to C.
>>> How can I make it carry the value intended by A?
>>>
>>
> A *forwarded* Interest is actually a different packet from the original:
> Name, CanBePrefix, MustBeFresh, ApplicationParameters are copied over,
> InterestLifetime, Nonce, HopLimit are modified, and other fields may be
> discarded.
>
> As I said previously, it's best to include the information as part of the
> Name or ApplicationParameters, which is supported universally.
>
> While NDN protocol allows having unrecognized non-critical fields in the
> Interest packet, the protocol is vague on whether and what to preserve
> during forwarding.
> So far, as long as Name, CanBePrefix, MustBeFresh, ApplicationParameters,
> and any fields that appear after ApplicationParameters are preserved, the
> forwarder implementation would be interoperable.
>
> Yours, Junxiao
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20210505/1f479e3d/attachment.html>


More information about the ndnSIM mailing list