[ndnSIM] Modifying Interest and Data packets

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Sat Mar 11 16:44:58 PST 2017


Hi,

please take a look at the following commits that I have done something similar:

https://github.com/named-data-ndnSIM/ndn-cxx/commit/e53204419c51356dab70e0e5450ff5dcf587827a
https://github.com/named-data-ndnSIM/NFD/commit/d0abae38024a6aecf6f956f4bbea36f4a9ff6d6f

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA

> On Mar 10, 2017, at 8:36 PM, John Scott <scott1091 at yahoo.com> wrote:
> 
> Hi Spyros,
> 
> After reading a few threads in this mailing list, I think the packet tag can be used to do what I want. I have a Consumer/Producer applications, followed by a new forwarding strategy.
> The examples of packet tagging vary, however.  My Consumer SendPacket() looks like this:
> 
> #include <tag-host.hpp>
> #include <ndn-cxx/lp/tags.hpp>
> #include "utils/ndn-ns3-packet-tag.hpp"
> 
> // ...
> void
> NewConsumer::SendPacket()
> {
>   // ...
>   shared_ptr<Interest> interest = make_shared<Interest>();
>   interest->setNonce(m_rand->GetValue(0, std::numeric_limits<uint32_t>::max()));
>   interest->setName(*nameWithSequence);
>   time::milliseconds interestLifeTime(m_interestLifeTime.GetMilliSeconds());
>   interest->setInterestLifetime(interestLifeTime);
> 
>   interest->setTag(??);
> // ...
> }
> 
> The API defines a tag as `void ndn::TagHost::setTag shared_ptr< T >  tag) const`. How can I create a TagHost?
> 
> Thank you
> 
> 
> 
> On Wednesday, March 8, 2017 4:25 PM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu> wrote:
> 
> 
> Hi,
> 
> I do not see how you could achieve that by modifying the packet format…
> 
> I would suggest you modify NFD directly or write your own application that will be running on each node and implement the required logic.
> 
> Thanks,
> 
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> Internet Research Laboratory
> Computer Science Department
> UCLA
> 
>> On Mar 8, 2017, at 1:00 PM, John Scott <scott1091 at yahoo.com <mailto:scott1091 at yahoo.com>> wrote:
>> 
>> Hi Spyros,
>> 
>> The title of the email is misleading, sorry. What I want to accomplish is the following:
>> 
>> At t=0s, Consumer node sends out an Interest with the prefix /name/segment_1. The application itself adds to the Interest /timestamp_1/some_other_field_1
>> At t=2s, the Consumer nodes sends out another Interest with the prefix /name/segment_2/timestamp_2/some_other_field_2
>> And so on.
>> 
>> The Producer node then interprets the Interest name, parses, and reply with the Data packet /name/segment_1/timestamp_3/some_other_field_3.
>> 
>> So a node can decide to drop a packet if (currentTime - timestamp_n) > threshold, for instance.
>> 
>> Can this be accomplish by modifying the Interest/Data packet in the ndn-cxx library or by using Interest filters and selectors?
>> 
>> Thank you
>> 
>> 
>> 
>> 
>> 
>> 
>> On Tuesday, March 7, 2017 6:53 PM, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu <mailto:mastorakis at cs.ucla.edu>> wrote:
>> 
>> 
>> Hi,
>> 
>> take a look at the ndn-cxx library used by ndnSIM:
>> 
>> https://github.com/named-data-ndnSIM/ndn-cxx <https://github.com/named-data-ndnSIM/ndn-cxx>
>> 
>> Modify the data and interest classes to add the fields that you want:
>> 
>> https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/data.cpp <https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/data.cpp>
>> https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/interest.cpp <https://github.com/named-data-ndnSIM/ndn-cxx/blob/ndn-cxx-0.3.4-ndnSIM/src/interest.cpp>
>> 
>> Make sure that you also modify the way that you encode and decode an NDN packet to/from its wire format (methods wireEncode and wireDecode).
>> 
>> Hope that this helps,
>> 
>> Spyridon (Spyros) Mastorakis
>> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
>> Internet Research Laboratory
>> Computer Science Department
>> UCLA
>> 
>>> On Mar 7, 2017, at 12:26 PM, John Scott <scott1091 at yahoo.com <mailto:scott1091 at yahoo.com>> wrote:
>>> 
>>> Hi,
>>> 
>>> I would like to add extra information in the Interest and Data packets so that intermediate nodes can make forwarding decisions; however, I did not find this option in the ndnSIM.
>>> Could you please point me to some references?
>>> 
>>> Thank you
>>> 
>> 
>> 
>> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170311/e32e8ccd/attachment.html>


More information about the ndnSIM mailing list