diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index 1a645db79..c601c14eb 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -545,7 +545,14 @@ Txop::Queue(Ptr mpdu) m_queue->Enqueue(mpdu); for (const auto linkId : linkIds) { - StartAccessIfNeeded(linkId); + // schedule a call to StartAccessIfNeeded() to request channel access after that all the + // packets of a burst have been enqueued, instead of requesting channel access right after + // the first packet. The call to StartAccessIfNeeded() is scheduled only after the first + // packet + if (auto& event = GetLink(linkId).accessRequest.event; !event.IsRunning()) + { + event = Simulator::ScheduleNow(&Txop::StartAccessIfNeeded, this, linkId); + } } } diff --git a/src/wifi/model/txop.h b/src/wifi/model/txop.h index 189d2d545..84a341fc8 100644 --- a/src/wifi/model/txop.h +++ b/src/wifi/model/txop.h @@ -509,6 +509,12 @@ class Txop : public Object uint8_t aifsn{0}; //!< the AIFSN Time txopLimit{0}; //!< the TXOP limit time ChannelAccessStatus access{NOT_REQUESTED}; //!< channel access status + + mutable class + { + friend void Txop::Queue(Ptr); + EventId event; + } accessRequest; //!< access request event, to be used by Txop::Queue() only }; /**