[ndnSIM] SINR packet tag in ndnSIM 2.5

Thiago Teixeira tteixeira at umass.edu
Thu Aug 2 13:59:56 PDT 2018


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<https://github.com/named-data-ndnSIM/ndnSIM/blob/master/model/ndn-net-device-transport.cpp#L133>.

::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


From: Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu>
Sent: Saturday, July 28, 2018 11:17 PM
To: Thiago Teixeira <tteixeira at umass.edu>
Cc: Rajvardhan Deshmukh <rdeshmukh at umass.edu>; NdnSIM <ndnSIM at lists.cs.ucla.edu>
Subject: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi Thiago,

that might require some hacking.

I think that this might be the right place to start:

https://github.com/named-data-ndnSIM/ndnSIM/blob/master/model/ndn-net-device-transport.cpp#L119

In ndnSIM, each simulated node receives NS-3 packets from others and the NDN packets are encapsulated into NS-3 packets. The above method is called when an NS-3 packet is received by a node and extracts the NDN packet from the NS-3 packet. I would guess that the tag you are talking about might be attached to the received NS-3 packet. If my intuition is right, you should be able to extract it in this method and store it for later or pass it to the strategy.

Hope this helps,

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

On Jul 27, 2018, at 12:21 PM, Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>> wrote:

Hi Spyros,

Thanks for your email. In summary, we added a SINR packet tag on the node’s WiFi interface, which we want to read the value in the strategy layer. The issue is that we could not find a method to read the SINR tag in the strategy. We are able to create and use other using the NDNLP (as your commits show). The problem is that the SINR tag is a NS-3 tag (not ndnlp).
And yes, we are not using sockets whatsoever.

Regarding your last sentence, do you have any documentation or examples on how to make sure the NS-3 tag is preserved in the NDN packet?

I tried this in the strategy,
    std::shared_ptr<ns3::SnrTag> tag;
    auto sinrTag = interest. template getTag <ns3::ndn::Ns3PacketTag> ();
    bool hasTag = sinrTag.getPacket().PeekPacketTag(tag);

but I get,
    error: ‘class std::shared_ptr<ns3::ndn::Ns3PacketTag>’ has no member named ‘getPacket’


Thanks for your help,

Thiago


From: Spyridon (Spyros) Mastorakis [mailto:mastorakis at cs.ucla.edu]
Sent: Friday, July 27, 2018 2:20 PM
To: Rajvardhan Deshmukh <rdeshmukh at umass.edu<mailto:rdeshmukh at umass.edu>>
Cc: NdnSIM <ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>>; Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
Subject: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi,

I am not sure I understand what you are trying to do.

It seems to me that you are using sockets and some TCP application, but you are trying to use NDN?

If you want to use an NS-3 tag, you will have to make sure that when you try to get the NDN packet out of the NS-3 packet, you have to preserve the tag.

Thanks,

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

On Jul 24, 2018, at 11:32 AM, Rajvardhan Deshmukh <rdeshmukh at umass.edu<mailto:rdeshmukh at umass.edu>> wrote:

Hi Spyros,

We intend to access the SINR/SNR in the forwarding strategy.

1) As i was going through the links<https://github.com/named-data-ndnSIM/NFD/commit/3bebd1190b1c45f8acaa0fe1d3a3100651a062e4#diff-bcc8f3e64bcd66371436f906a83e51b5> Spyros sent, i noticed that they use an interest or data object with API setTag. But we don't have access to those objects in the PHY (wifi) layer. So i'm not sure as to which object i should use the SetTag API. Should we pursue this line of thoughts?

We also looked at ns3 related posts.
2) So, we looked at ns3 related posts, which suggest that we need to attach the SNR value to the Packet in the PHY layer.
We added a SINR packet tag in the src/wifi/model/wifi-phy.cc<http://wifi-phy.cc/> EndReceive() method using the following snippet:

  SnrTag tag;

  tag.Set(signalNoise.signal - signalNoise.noise);

  if (! packet->PeekPacketTag (tag)){

     packet->AddPacketTag (tag);

  }

The implementation of the SINR packet tag is available at src/wifi/model/snr-tag.cc<http://snr-tag.cc/>.
But we get an error during reading this Tag in the forwarding strategy:


ns3::Ptr<ns3::Socket>m_socket=node->GetObject<ns3::Socket>(); //(line of concern)
ns3::Ptr<ns3::Packet>packet=m_socket->Recv();
ns3::SnrTag tag;
if(packet->PeekPacketTag(tag)){
        NS_LOG_DEBUG ("Received Packet with SRN = " << tag.Get());

std::cout<< "\nSNR:"<< tag.Get()<< std::endl;

}
Note: I think we get to get the right socket (check line of concern) using something similar to what they do in the application layer in ns3 (GetObject<OnOffApplication> ()->GetSocket ())

Can you assist please? Let me know if you need more info.

Thanks,
Raj
-------------------------------------------------------------------
FROM: Spyridon (Spyros) Mastorakis [mailto:mastorakis at cs.ucla.edu<mailto:mastorakis at cs.ucla.edu>]
SENT: Monday, July 23, 2018 9:43 PM
TO: Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
CC: ndnsim <ndnsim at lists.cs.ucla.edu<mailto:ndnsim at lists.cs.ucla.edu>>
SUBJECT: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi Thiago,

I think we have converted our NS-3 tags to NDN Link Protocol (LP) tags.
For more details, take a look at these commits (HopCount tag):

https://github.com/named-data-ndnSIM/NFD/commit/3bebd1190b1c45f8acaa0fe1d3a3100651a062e4


https://github.com/named-data-ndnSIM/ndn-cxx/commit/e1ae096efd8ad503ce7dbd616ee174afaed6c66b


Thanks,

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



On Jul 23, 2018, at 2:52 PM, Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
wrote:
Hi Spyros,

We intend to access the SINR/SNR in the forwarding strategy.

1) As i was going through the links<https://github.com/named-data-ndnSIM/NFD/commit/3bebd1190b1c45f8acaa0fe1d3a3100651a062e4#diff-bcc8f3e64bcd66371436f906a83e51b5> Spyros sent, i noticed that they use an interest or data object with API setTag. But we don't have access to those objects in the PHY (wifi) layer. So i'm not sure as to which object i should use the SetTag API.



2) So, we looked at ns3 related posts, which suggest that we need to attach the SNR value to the Packet in the PHY layer.
We added a SINR packet tag in the src/wifi/model/wifi-phy.cc<http://wifi-phy.cc/> EndReceive() method using the following snippet:

  SnrTag tag;

  tag.Set(signalNoise.signal - signalNoise.noise);

  if (! packet->PeekPacketTag (tag)){

     packet->AddPacketTag (tag);

  }

The implementation of the SINR packet tag is available at src/wifi/model/snr-tag.cc<http://snr-tag.cc/>.
But we get an error during reading this Tag in the forwarding strategy:


ns3::Ptr<ns3::Socket>m_socket=node->GetObject<ns3::Socket>();
ns3::Ptr<ns3::Packet>packet=m_socket->Recv();
ns3::SnrTag tag;
if(packet->PeekPacketTag(tag)){
        NS_LOG_DEBUG ("Received Packet with SRN = " << tag.Get());

std::cout<< "\nSNR:"<< tag.Get()<< std::endl;

}
Note: I think we get to get the right socket using something similar to what they do in the application layer in ns3 (GetObject<OnOffApplication> ()->GetSocket ())

Can you assist please?

Thanks,
Raj
-------------------------------------------------------------------
FROM: Spyridon (Spyros) Mastorakis [mailto:mastorakis at cs.ucla.edu<mailto:mastorakis at cs.ucla.edu>]
SENT: Monday, July 23, 2018 9:43 PM
TO: Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
CC: ndnsim <ndnsim at lists.cs.ucla.edu<mailto:ndnsim at lists.cs.ucla.edu>>
SUBJECT: Re: [ndnSIM] SINR packet tag in ndnSIM 2.5

Hi Thiago,

I think we have converted our NS-3 tags to NDN Link Protocol (LP) tags.
For more details, take a look at these commits (HopCount tag):

https://github.com/named-data-ndnSIM/NFD/commit/3bebd1190b1c45f8acaa0fe1d3a3100651a062e4


https://github.com/named-data-ndnSIM/ndn-cxx/commit/e1ae096efd8ad503ce7dbd616ee174afaed6c66b


Thanks,

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



On Jul 23, 2018, at 2:52 PM, Thiago Teixeira <tteixeira at umass.edu<mailto:tteixeira at umass.edu>>
wrote:

Hi all,

We added a SINR packet tag in the src/wifi/model/wifi-phy.cc<http://wifi-phy.cc/> [1<https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/wifi-phy.cc#L2541>]
EndReceive() method using the following snippet:

SnrTag tag;

tag.Set(signalNoise.signal - signalNoise.noise);

if (! packet->PeekPacketTag (tag)){

packet->AddPacketTag (tag);

}

The implementation of the SINR packet tag is available at
src/wifi/model/snr-tag.cc<http://snr-tag.cc/> [2<https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/snr-tag.cc>].

We would like to get the value of the tag in the forwarding strategy.
Before ndnSIM 2.3, we could just use something like this:

SnrTag tag;

Ptr<Packet> payload = ConstCast<Packet>(interest->GetPayload());

payload->PeekPacketTag (tag);

but in ndnSIM 2.5 we could not find an equivalent method. I think we
need to convert the SINR tag to type ns3::ndn::ns3PacketTag, is that
correct?

Can you assist please?

Thanks,

Thiago

_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim [3<http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>]



Links:
------
[1] https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/wifi-phy.cc#L2541
[2] https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/snr-tag.cc
[3] http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim


Hi all,

We added a SINR packet tag in the src/wifi/model/wifi-phy.cc<http://wifi-phy.cc/> [1<https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/wifi-phy.cc#L2541>]
EndReceive() method using the following snippet:

SnrTag tag;

tag.Set(signalNoise.signal - signalNoise.noise);

if (! packet->PeekPacketTag (tag)){

packet->AddPacketTag (tag);

}

The implementation of the SINR packet tag is available at
src/wifi/model/snr-tag.cc<http://snr-tag.cc/> [2<https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/snr-tag.cc>].

We would like to get the value of the tag in the forwarding strategy.
Before ndnSIM 2.3, we could just use something like this:

SnrTag tag;

Ptr<Packet> payload = ConstCast<Packet>(interest->GetPayload());

payload->PeekPacketTag (tag);

but in ndnSIM 2.5 we could not find an equivalent method. I think we
need to convert the SINR tag to type ns3::ndn::ns3PacketTag, is that
correct?

Can you assist please?

Thanks,

Thiago

_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim [3<http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim>]



Links:
------
[1] https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/wifi-phy.cc#L2541
[2] https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/snr-tag.cc
[3] 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/20180802/0b869971/attachment-0001.html>


More information about the ndnSIM mailing list