[ndnSIM] Fwd: FW: SINR packet tag in ndnSIM 2.5

Rajvardhan Deshmukh rdeshmukh at umass.edu
Tue Jul 24 11:32:02 PDT 2018


Hi Spyros,

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

1) As i was going through the links [1] 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
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. 
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] 
> SENT: Monday, July 23, 2018 9:43 PM
> TO: Thiago Teixeira <tteixeira at umass.edu>
> CC: ndnsim <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>
> wrote: 
> 
> Hi Spyros,
> 
> We intend to access the SINR/SNR in the forwarding strategy.
> 
> 1) As i was going through the links [1] 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 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. 
> 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] 
> SENT: Monday, July 23, 2018 9:43 PM
> TO: Thiago Teixeira <tteixeira at umass.edu>
> CC: ndnsim <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>
> wrote: 
> 
> Hi all, 
> 
> We added a SINR packet tag in the src/wifi/model/wifi-phy.cc [1 [2]]
> 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 [2 [3]]. 
> 
> 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
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim [3 [4]] 
> 
> 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 [1 [2]]
> 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 [2 [3]]. 
> 
> 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
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim [3 [4]]

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 

Links:
------
[1]
https://github.com/named-data-ndnSIM/NFD/commit/3bebd1190b1c45f8acaa0fe1d3a3100651a062e4#diff-bcc8f3e64bcd66371436f906a83e51b5
[2]
https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/wifi-phy.cc#L2541
[3]
https://github.com/named-data-ndnSIM/ns-3-dev/blob/ndnSIM-v2.5/src/wifi/model/snr-tag.cc
[4] 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/20180724/e027d622/attachment-0001.html>


More information about the ndnSIM mailing list