[ndnSIM] SINR packet tag in ndnSIM 2.5

Thiago Teixeira tteixeira at umass.edu
Thu Aug 16 15:35:58 PDT 2018


Hi Spyros. Hi Junxiao.

We solved the issue (thanks to Raj) by encoding the NDNLP packet into a NFD packet in the receiveFromNetDevice method, as follows:

void
NetDeviceTransport::receiveFromNetDevice(<args>){

   // Read SINR value from NS-3 packet tag
   double sinrValue = 0;
   ns3::SnrTag tag;
   if(p->PeekPacketTag(tag)){
      sinrValue = tag.Get();
   }

  Ptr<ns3::Packet> packet = p->Copy();
  BlockHeader header;
  packet->RemoveHeader(header);

  auto nfdPacket = Packet(std::move(header.getBlock()));

  // If SINR tag is present, add as a LP tag
  ::ndn::lp::Packet lpPacket = ::ndn::lp::Packet(nfdPacket.packet);
  if (sinrValue){
    lpPacket.set<lp::SinrTagField>(sinrValue);
  }
  else{
    lpPacket.set<lp::SinrTagField>(0);
  }

  //this->receive(std::move(nfdPacket));
  this->receive(std::move(Packet(lpPacket.wireEncode())));
}


Thanks for your assistance!


From: Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu>
Sent: Monday, August 13, 2018 4:31 PM
To: Thiago Teixeira <tteixeira at umass.edu>
Cc: NdnSIM <ndnSIM at lists.cs.ucla.edu>; Junxiao Shi <shijunxiao at email.arizona.edu>; Rajvardhan Deshmukh <rdeshmukh at umass.edu>
Subject: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi Thiago,

did you guys also do something like that:

https://github.com/named-data-ndnSIM/NFD/blob/0a30676920b9d3f2b2c8bc68e583befc415210cc/daemon/face/generic-link-service.cpp#L136

Other than that, if the geo-tag works for you, then why not following this logic (do not remember how different or similar it is to the the general way of encoding/decoding NDNLP tags)?

Thanks,

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

On Aug 13, 2018, at 9:31 AM, Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>> wrote:

Hi all,

I wonder if you had a chance to look into this issue.
Recapping, we

  *   created a SINR tag (NS-3) in the wifi-phy.cc<http://wifi-phy.cc/>
  *   created a new TLV and tag (NDNLP) to carry that value
  *   modified the encoding according to the post<https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/> Junxiao shared
  *   read the SINR value in the NDN net-device (thus, the NS-3 tag works) and attach the NDNLP tag to the newly created NFD packet
  *   read the SINR tag (NDNLP) that is attached to the NFD packet in the forwarding strategy, but the value is zero

I was looking at the geo-tag<https://github.com/4th-ndn-hackathon/ndnSIM-Mobile-Simulation-Package/commit/c59de9d958ad0aed7bcb37bdc57a46ebe1752b6f> from the 4th Hackathon, and that tag survives this encoding/decoding process. Is this a way worth pursuing?


Thanks,
TT


From: Thiago Teixeira
Sent: Tuesday, August 7, 2018 7:24 AM
To: NdnSIM <ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>>
Cc: 'Spyridon (Spyros) Mastorakis' <mastorakis at cs.ucla.edu<mailto:mastorakis at cs.ucla.edu>>; Junxiao Shi <shijunxiao at email.arizona.edu<mailto:shijunxiao at email.arizona.edu>>
Subject: FW: [ndnSIM] SINR packet tag in ndnSIM 2.5

Just including the mailing list

From: Rajvardhan Deshmukh <rdeshmukh at umass.edu<mailto:rdeshmukh at umass.edu>>
Sent: Monday, August 6, 2018 4:14 PM
To: Junxiao Shi <shijunxiao at email.arizona.edu<mailto:shijunxiao at email.arizona.edu>>
Cc: Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
Subject: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi Junxiao,

The error was solved using your suggestion (using the set method).
But when we try to access this tag in the forwarding strategy, we still get null value:

Code Snippet #1: (to access tag in forwarding strategy)

 double sinr = 0.0;
 auto sinrTag = interest.getTag<lp::SinrTag>();
 if (sinrTag != nullptr) {
   sinr =*sinrTag;
 }

Output for Snippet #1:

 sinrTag is nullptr
--------------------------------------------------------------
Code Snippet #2: (to set tag in ndn-net-device-transport.cpp<https://github.com/named-data-ndnSIM/ndnSIM/blob/65c490630e1a2e9cdebaf505de8729838c000821/model/ndn-net-device-transport.cpp#L119>)

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

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

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

Can you help us set the value for SinrTagField in the ndn-net-device-transport.cpp?

Thanks,
Raj

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


More information about the ndnSIM mailing list