Hello! I'm trying to get SNR as an input metric for a VANET protocol in ns3 3.26.
As I see, the SNR tag is calculated using two components, signalNoise.signal minus signalNoise.noise.
The fact is that as I see in the debugging output, the only component that varies from different scenarios (adding more nodes in range of each other, modifying distances between them...) is signalNoise.signal.
SignalNoise.noise always remains the same;I don't know if this is a normal fact... ¿Does anyone know what could be happening?
NotifyRxEnd (packet);
SignalNoiseDbm signalNoise;
* signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
* changed to
* signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) + 30;
*/
signalNoise.signal = RatioToDb (event->GetRxPowerW ()) + 30;
signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) + 30;
MpduInfo aMpdu;
aMpdu.type = mpdutype;
aMpdu.mpduRefNumber = m_rxMpduReferenceNumber;
NotifyMonitorSniffRx (packet, GetFrequency (), event->GetTxVector (), aMpdu, signalNoise);
// ********** SNR TAG *********** //
SnrTag tag;
tag.Set(signalNoise.signal - signalNoise.noise);
if (!packet->PeekPacketTag (tag))
{
packet->AddPacketTag (tag);
NS_LOG_UNCOND("Add SNR Tag with value :" << tag.Get() << " signal was " << signalNoise.signal << " noise was " << signalNoise.noise);
}
// ********* SNR TAG *********** //
m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector ());