[ndnSIM] How to use ndnSIM helpers to specify custom field in interest packet.

Ygor Amaral ygor.amaral at gmail.com
Thu Apr 8 15:24:08 PDT 2021


Prajjwal, it depends on what you need to do.

I think you should create a new ns-3/ndn application (e.g:
ns3::ndn::CustomConsumerCbr). Since it is the application that will create
the interest packets.

It is common to use ndn::AppHelper to instantiate applications. If you need
to pass any value to your new application, no problem, ndn::AppHelper
supports this (SetAttribute).

Regards,
Ygor Amaral

On Thu, Apr 8, 2021 at 12:38 AM Prajjwal Singh <csb17053 at tezu.ac.in> wrote:

> Thanks Ygor.
> I have a scenario which uses consumerCbr for consumer nodes.
> Will I have to write custom scenarios to specify the new interest fields?
>
> On Thu, Apr 8, 2021 at 5:27 AM Ygor Amaral <ygor.amaral at gmail.com> wrote:
>
>> Hi Prajjwal,
>>
>> I do not know if I fully understood your question.
>>
>> ndnSIM has no helpers for creating new interest packet fields.
>>
>> You need to change the Interest class (ndn-cxx library) to add new fields.
>>
>> Path:
>>      - ndnSIM/ns-3/src/ndnSIM/ndn-cxx/ndn-cxx/interest.cpp
>>      - ndnSIM/ns-3/src/ndnSIM/ndn-cxx/ndn-cxx/interest.hpp
>>
>> When creating a new interest packet, you will set the value of the new
>> field, similar to how it is done with the other fields. For example:
>>
>> ...
>> shared_ptr<Interest> interest = make_shared<Interest>();
>> interest->setOldField(value1);
>> interest->setNewField(value2);
>> ...
>> send(*interest);
>> ...
>>
>> Regards,
>> Ygor Amaral
>>
>> On Tue, Apr 6, 2021 at 3:26 AM Prajjwal Singh <csb17053 at tezu.ac.in>
>> wrote:
>>
>>> Hello all,
>>> After adding a custom field, say Priority, to the interest packet, how
>>> can I make use of ndnSIM helpers to specify this Priority field in the
>>> interest packets, while installing and specifying prefix to consumer nodes
>>> in the simulating examples?
>>>
>>> Thanks in advance,
>>> Prajjwal Singh
>>>
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20210408/eee39be5/attachment.html>


More information about the ndnSIM mailing list