wifi: Limit the delay among TB PPDUs to the duration of training fields

This commit is contained in:
Stefano Avallone
2022-06-22 11:08:08 +02:00
parent 71760590d9
commit e55628fc38
2 changed files with 19 additions and 9 deletions

View File

@@ -53,15 +53,16 @@ HeConfiguration::GetTypeId (void)
&HeConfiguration::SetBssColor),
MakeUintegerChecker<uint8_t> ())
.AddAttribute ("MaxTbPpduDelay",
"Specify the maximum delay with which a TB PPDU can be received "
"after the reception of the first TB PPDU. If the delay is higher "
"than this value, the TB PPDU is dropped and considered interference. "
"A zero value indicates no delay limit. This attribute is only "
"valid for APs.",
"If positive, the value of this attribute specifies the maximum "
"delay with which a TB PPDU can be received after the reception of "
"the first TB PPDU. If the delay is higher than this value, the "
"TB PPDU is dropped and considered interference. The maximum delay "
"is anyway capped at the duration of the training fields in the PPDU. "
"This attribute is only valid for APs.",
TimeValue (Seconds (0)),
MakeTimeAccessor (&HeConfiguration::GetMaxTbPpduDelay,
&HeConfiguration::SetMaxTbPpduDelay),
MakeTimeChecker ())
MakeTimeChecker (Seconds (0)))
.AddAttribute ("MpduBufferSize",
"The MPDU buffer size for receiving A-MPDUs",
UintegerValue (64),

View File

@@ -452,10 +452,19 @@ HePhy::DoGetEvent (Ptr<const WifiPpdu> ppdu, RxPowerWattPerChannelBand& rxPowers
auto heConfiguration = m_wifiPhy->GetDevice ()->GetHeConfiguration ();
NS_ASSERT (heConfiguration);
Time maxDelay = heConfiguration->GetMaxTbPpduDelay ();
// DoStartReceivePayload(), which is called when we start receiving the Data field,
// computes the max offset among TB PPDUs based on the begin OFDMA payload RX events,
// which are scheduled by StartReceivePreamble() when starting the reception of the
// OFDMA portion. Therefore, the maximum delay cannot exceed the duration of the
// training fields that are between the start of the OFDMA portion and the start
// of the Data field.
Time maxDelay = GetDuration (WIFI_PPDU_FIELD_TRAINING, txVector);
if (heConfiguration->GetMaxTbPpduDelay ().IsStrictlyPositive ())
{
maxDelay = Min (maxDelay, heConfiguration->GetMaxTbPpduDelay ());
}
if (maxDelay.IsStrictlyPositive ()
&& Simulator::Now () - event->GetStartTime () > maxDelay)
if (Simulator::Now () - event->GetStartTime () > maxDelay)
{
// This HE TB PPDU arrived too late to be decoded properly. The HE TB PPDU
// is dropped and added as interference