[ndnSIM] Modifying Interest and Data packets

John Scott scott1091 at yahoo.com
Fri Mar 10 20:36:31 PST 2017


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/
Internet Research Laboratory
Computer Science Department
UCLA

On Mar 8, 2017, at 1:00 PM, John Scott <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> wrote:
 

 Hi,
take a look at the ndn-cxx library used by ndnSIM:
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.cpphttps://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/
Internet Research Laboratory
Computer Science Department
UCLA

On Mar 7, 2017, at 12:26 PM, John Scott <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/e07160d3/attachment-0001.html>


More information about the ndnSIM mailing list