diff --git a/CHANGES.html b/CHANGES.html
index 43a102c5b..460f84440 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -74,6 +74,7 @@ allows to request an acknowledgment after a configurable number of MPDUs have be
transmitted.
The MaxSize attribute is removed from the QueueBase base class and moved to subclasses. A new MaxSize attribute is therefore added to the DropTailQueue class, while the MaxQueueSize attribute of the WifiMacQueue class is renamed as MaxSize for API consistency.
The applications have now a "EnableE2EStats" attribute.
+Added a new trace source PhyRxPayloadBegin in WifiPhy for tracing begin of PSDU reception.
Changes to existing API:
diff --git a/src/wifi/doc/source/wifi-design.rst b/src/wifi/doc/source/wifi-design.rst
index 89b93b8ce..46a11cffe 100644
--- a/src/wifi/doc/source/wifi-design.rst
+++ b/src/wifi/doc/source/wifi-design.rst
@@ -339,7 +339,9 @@ packet to schedule this. The second event to schedule is
have been received and the payload is about to start.
The next event at ``StartReceivePayload ()`` checks, using the interference
-helper and error model, whether the header was successfully decoded.
+helper and error model, whether the header was successfully decoded, and if so,
+a ``PhyRxPayloadBegin`` callback (equivalent to the PHY-RXSTART primitive)
+is triggered.
The PHY header is often transmitted
at a lower modulation rate than is the payload. The portion of the packet
corresponding to the PHY header is evaluated for probability of error
diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc
index 45f1b86b8..a395d556e 100644
--- a/src/wifi/model/wifi-phy.cc
+++ b/src/wifi/model/wifi-phy.cc
@@ -353,6 +353,11 @@ WifiPhy::GetTypeId (void)
"by the device",
MakeTraceSourceAccessor (&WifiPhy::m_phyRxBeginTrace),
"ns3::Packet::TracedCallback")
+ .AddTraceSource ("PhyRxPayloadBegin",
+ "Trace source indicating the reception of the "
+ "payload of a PPDU has begun",
+ MakeTraceSourceAccessor (&WifiPhy::m_phyRxPayloadBeginTrace),
+ "ns3::WifiPhy::PhyRxPayloadBeginTracedCallback")
.AddTraceSource ("PhyRxEnd",
"Trace source indicating a packet "
"has been completely received from the channel medium "
@@ -2894,7 +2899,8 @@ WifiPhy::StartReceivePayload (Ptr event)
{
m_state->SwitchToRx (payloadDuration);
m_endRxEvent = Simulator::Schedule (payloadDuration, &WifiPhy::EndReceive, this, event);
- NS_LOG_DEBUG ("Receiving payload");
+ NS_LOG_DEBUG ("Receiving PSDU");
+ m_phyRxPayloadBeginTrace (txVector, payloadDuration); //this callback (equivalent to PHY-RXSTART primitive) is triggered only if headers have been correctly decoded and that the mode within is supported
if (txMode.GetModulationClass () == WIFI_MOD_CLASS_HE)
{
HePreambleParameters params;
diff --git a/src/wifi/model/wifi-phy.h b/src/wifi/model/wifi-phy.h
index 6a86af62f..8f29f5303 100644
--- a/src/wifi/model/wifi-phy.h
+++ b/src/wifi/model/wifi-phy.h
@@ -1312,6 +1312,14 @@ public:
*/
typedef void (* EndOfHePreambleCallback)(HePreambleParameters params);
+ /**
+ * TracedCallback signature for start of PSDU reception events.
+ *
+ * \param txVector the TXVECTOR decoded from the PHY header
+ * \param psduDuration the duration of the PSDU
+ */
+ typedef void (* PhyRxPayloadBeginTracedCallback)(WifiTxVector txVector, Time psduDuration);
+
/**
* Assign a fixed random variable stream number to the random variables
* used by this model. Return the number of streams (possibly zero) that
@@ -1865,6 +1873,22 @@ private:
*/
TracedCallback > m_phyRxBeginTrace;
+ /**
+ * The trace source fired when the reception of the PHY payload (PSDU) begins.
+ *
+ * This traced callback models the behavior of the PHY-RXSTART
+ * primitive which is launched upon correct decoding of
+ * the PHY header and support of modes within.
+ * We thus assume that it is sent just before starting
+ * the decoding of the payload, since it's there that
+ * support of the header's content is checked. In addition,
+ * it's also at that point that the correct decoding of
+ * HT-SIG, VHT-SIGs, and HE-SIGs are checked.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback m_phyRxPayloadBeginTrace;
+
/**
* The trace source fired when a packet ends the reception process from
* the medium.