NotifyRXDrop in TX and RX states

45 views
Skip to first unread message

amritha rajagopal

unread,
May 7, 2019, 1:56:43 AM5/7/19
to ns-3-reviews
Hi all ,

The following code snippet is a part of wifi-phy.cc .
Both in RX and TX states the simulator is triggering NotifyRxDrop. Kindly explain the logic, if this is not a bug.


case WifiPhyState::RX:
      NS_ASSERT (m_currentEvent != 0);
      if (m_frameCaptureModel != 0
          && m_frameCaptureModel->CaptureNewFrame (m_currentEvent, event))
        {
          AbortCurrentReception ();
          NS_LOG_DEBUG ("Switch to new packet");
          StartRx (packet, txVector, mpdutype, rxPowerW, rxDuration, event);
        }
      else
        {
          NS_LOG_DEBUG ("drop packet because already in Rx (power=" <<
                        rxPowerW << "W)");
          NotifyRxDrop (packet);
          if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
            {
              //that packet will be noise _after_ the reception of the
              //currently-received packet.
              MaybeCcaBusyDuration ();
              return;
            }
        }
      break;

    case WifiPhyState::TX:
      NS_LOG_DEBUG ("drop packet because already in Tx (power=" <<
                    rxPowerW << "W)");
      NotifyRxDrop (packet);
      if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
        {
          //that packet will be noise _after_ the transmission of the
          //currently-transmitted packet.
          MaybeCcaBusyDuration ();
          return;
        }
      break;




Thanks and regards,
Amritha


Harshal Dev

unread,
Aug 4, 2021, 11:19:57 AM8/4/21
to ns-3-reviews
Hi, so basically the code is correct. What it is doing is checking the current state of the PHY layer when a packet reception is triggered for every device on the channel. If the PHY layer of your device is either already transmitting or receiving a transmission when the channel tells it that another packet has arrived, obviously the PHY layer will drop the packet.
Reply all
Reply to author
Forward
0 new messages