[ndnSIM] Adding custom field to data packet

Kamrul Morshed shohanmk at yahoo.com
Wed Mar 18 04:39:16 PDT 2020


You can find Travis Mick's post on customizing NDN packets here:Adding custom fields to packets in ndnSIM 2.3 without forking the entire repository.

| 
| 
| 
 | 
Adding custom fields to packets in ndnSIM 2.3 without forking the entire...

The recommended way to build something on top of ndnSIM is to fork its scenario template repository and work ins...
 |

 |

 |


I am sharing some of the similar modifications from Chinese portal which may need to be translated into English for better understanding.
https://blog.csdn.net/m0_37313170/article/details/87904701
[ndnSIM]在兴趣包或数据包中加入自定义字段_网络_aladeen的博客-CSDN博客

| 
| 
| 
 | 
[ndnSIM]在兴趣包或数据包中加入自定义字段_网络_aladeen的博客-CSDN博客

先贴一个国外大神用的加Tag的方法: Adding custom fields to packets网络
 |

 |

 |




Kamrul MorshedMS Student
 

    On Wednesday, March 18, 2020, 7:07:27 PM GMT+8, Lynch Christopher <chlynch at tcd.ie> wrote:  
 
 Hi all,
I'm aware that this has been asked many times before but I can't seem to figure out where I'm going wrong. I want to add a custom field to the data packet class to indicate whether a packet has been pushed.
I have performed the following steps
1. Add pushed member variable to data class with getter and setter methods2. Add pushed member variable to meta-info class with getter and setter methods3. Add new type to tlv.hpp for pushedData field.3. Edit wireEncode and wireDecode functions in meta-info class to include encoding and decoding for new custom field. In this case, I use the prependEmptyBlock function from the blockHelper class.
My changes compile and run fine, but the freshnessPeriod field of the data packet class is now incorrect after decoding. values range anywhere between 0 to 5205428264770612480. Here are some debug lines.
"+24.571161426s 46 ndn.Producer:OnInterest(): [DEBUG] data freshness=1000 milliseconds""+24.572752627s 0 RepeatingConsumer:OnData(): [DEBUG] << D: /cam freshness=3856880632320 milliseconds""+24.738112185s 3 RepeatingConsumer:OnData(): [DEBUG] << D: /cam freshness=5205428264770612480 milliseconds"

Here are links to the relevant changes if interested:https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/encoding/tlv.hpp#L88
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L229
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L226
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.hpp#L225
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L66-L72
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L162-L165
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225
https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225

I've come across these threads when searching for answers:https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005579.html
https://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-July/002044.html
https://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-November/004277.html
https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005577.html

I would note that https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/ does not exist anymore.
Any help is greatly appreciated.
Thanks,Chris
_______________________________________________
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/20200318/c090a532/attachment-0001.html>


More information about the ndnSIM mailing list