diff --git a/src/wifi/model/gcr-manager.cc b/src/wifi/model/gcr-manager.cc index 8a73a6fc3..bb2cd447c 100644 --- a/src/wifi/model/gcr-manager.cc +++ b/src/wifi/model/gcr-manager.cc @@ -143,6 +143,29 @@ GcrManager::GetGcrConcealmentAddress() const return m_gcrConcealmentAddress; } +bool +GcrManager::UseConcealment(const WifiMacHeader& header) const +{ + NS_ASSERT_MSG(header.IsQosData() && IsGroupcast(header.GetAddr1()), + "GCR service is only for QoS groupcast data frames"); + NS_ASSERT_MSG(m_retransmissionPolicy != GroupAddressRetransmissionPolicy::NO_ACK_NO_RETRY, + "GCR service is not enabled"); + NS_ASSERT_MSG(!m_staMembers.empty(), "GCR service should not be used"); + + // Only GCR capable STAs, hence concealment is always used + if (m_nonGcrStas.empty()) + { + return true; + } + // If A-MSDU is used, that means previous transmission was already concealed + if (header.IsQosAmsdu()) + { + return true; + } + // Otherwise, use concealment except for the first transmission (hence when it is a retry) + return header.IsRetry(); +} + bool GcrManager::KeepGroupcastQueued(Ptr mpdu) { diff --git a/src/wifi/model/gcr-manager.h b/src/wifi/model/gcr-manager.h index 4b9d4ccd7..1dcd7bc15 100644 --- a/src/wifi/model/gcr-manager.h +++ b/src/wifi/model/gcr-manager.h @@ -92,6 +92,15 @@ class GcrManager : public Object */ const Mac48Address& GetGcrConcealmentAddress() const; + /** + * Indicate whether a group addressed packet should be transmitted to the GCR concealment + * address. + * + * @param header the header of the groupcast packet + * @return whether GCR concealment should be used + */ + bool UseConcealment(const WifiMacHeader& header) const; + /** * This function indicates whether a groupcast MPDU should be kept for next retransmission. *