[ndnSIM] SINR packet tag in ndnSIM 2.5

Rajvardhan Deshmukh rdeshmukh at umass.edu
Fri Aug 3 11:38:00 PDT 2018


Hi Junxiao and Spyros, 

We went and implemented the steps specified in the link [1] and it
compiled fine. But, when we run it, we get an error in the
NetDeviceTransport::receiveFromNetDevice after the nfdPacket is created
in L133 [2]. 

Code Snippet: 

BlockHeader header; 
packet->RemoveHeader(header); 
auto nfdPacket = Packet(std::move(header.getBlock())); 

::ndn::lp::Packet lpPacket = ::ndn::lp::Packet(nfdPacket.packet);
if (sinrValue){
  lpPacket.add<lp::SinrTagField>(sinrValue);
} 

this->receive(std::move(nfdPacket));
-----------------------------------------------------------------------------

Error: (gdb trace attached) 

terminate called after throwing an instance of
'boost::exception_detail::clone_impl<boost::exception_detail:
:error_info_injector<std::length_error> >'
  what():  Field cannot be repeated 
----------------------------------------------------------------------------


We intend to get the sinr of the incoming packet to the forwarding
strategy of the same node (not propagate it to further nodes). 
Can you help us store the sinrvalue in the nfdPacket as a ndn Tag? I
think we are missing some steps after lpPacket. 

Thank you for the help. 

Raj 
On 2018-08-02 17:26, Junxiao Shi wrote: 

> Hi Thiago
> 
> See
> https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/
> Pay attention to the two sections about LinkService. Your tag got lost
> in that component.
> 
> Yours, Junxiao
> 
> On Thu, Aug 2, 2018 at 17:00 Thiago Teixeira <tteixeira at umass.edu>
> wrote:
> 
>> Hi Spyros,
>> 
>> Thanks for your comments. We are able to read the tag in the
>> net-device as expected.
>> 
>> We then added a new NDNLP field and TLV to pass this value and later
>> be able to read it in the strategy. More specifically, we added the
>> following code in NetDeviceTransport::receiveFromNetDevice after the
>> nfdPacket is created in L133 [1].
>> 
>> ::ndn::lp::Packet lpPacket = ::ndn::lp::Packet(nfdPacket.packet);
>> 
>> if (sinrValue){
>> 
>> lpPacket.add<lp::SinrTagField>(sinrValue);
>> 
>> }
>> 
>> In our strategy, we are reading the tag in the afterReceiveInterest
>> like this:
>> 
>> auto sinrTag = interest.getTag<lp::SinrTag>();
>> 
>> if (sinrTag != nullptr) {
>> 
>> sinr = *sinrTag;
>> 
>> }
>> 
>> Though the value of sinr is always zero. Our suspicion is that the
>> lpPacket is not being added to the nfdPacket when receive is called
>> (below).
>> 
>> this->receive(std::move(nfdPacket));
>> 
>> We couldn't find any topic or article related to this issue. Do
>> you know how can we accomplish this?
>> 
>> Cheers
> 
> Links:
> ------
> [1]
> https://github.com/named-data-ndnSIM/ndnSIM/blob/master/model/ndn-net-device-transport.cpp#L133
 

Links:
------
[1]
https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/
[2]
https://github.com/named-data-ndnSIM/ndnSIM/blob/master/model/ndn-net-device-transport.cpp#L133
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180803/7b67b218/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: error.txt
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180803/7b67b218/attachment-0001.txt>


More information about the ndnSIM mailing list