A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
txop.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
20#include "txop.h"
21
23#include "mac-tx-middle.h"
25#include "wifi-mac-queue.h"
26#include "wifi-mac-trailer.h"
27#include "wifi-mac.h"
28
29#include "ns3/attribute-container.h"
30#include "ns3/log.h"
31#include "ns3/pointer.h"
32#include "ns3/random-variable-stream.h"
33#include "ns3/simulator.h"
34#include "ns3/socket.h"
35
36#undef NS_LOG_APPEND_CONTEXT
37#define NS_LOG_APPEND_CONTEXT \
38 if (m_mac) \
39 { \
40 std::clog << "[mac=" << m_mac->GetAddress() << "] "; \
41 }
42
43namespace ns3
44{
45
47
49
50TypeId
52{
53 static TypeId tid =
54 TypeId("ns3::Txop")
56 .SetGroupName("Wifi")
57 .AddConstructor<Txop>()
58 .AddAttribute("MinCw",
59 "The minimum value of the contention window (just for the first link, "
60 "in case of 11be multi-link devices).",
61 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
62 UintegerValue(15),
64 (uint32_t(Txop::*)() const) & Txop::GetMinCw),
65 MakeUintegerChecker<uint32_t>())
66 .AddAttribute(
67 "MinCws",
68 "The minimum values of the contention window for all the links",
69 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
71 MakeAttributeContainerAccessor<UintegerValue>(&Txop::SetMinCws, &Txop::GetMinCws),
72 MakeAttributeContainerChecker<UintegerValue>(MakeUintegerChecker<uint32_t>()))
73 .AddAttribute("MaxCw",
74 "The maximum value of the contention window (just for the first link, "
75 "in case of 11be multi-link devices).",
76 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
77 UintegerValue(1023),
79 (uint32_t(Txop::*)() const) & Txop::GetMaxCw),
80 MakeUintegerChecker<uint32_t>())
81 .AddAttribute(
82 "MaxCws",
83 "The maximum values of the contention window for all the links",
84 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
86 MakeAttributeContainerAccessor<UintegerValue>(&Txop::SetMaxCws, &Txop::GetMaxCws),
87 MakeAttributeContainerChecker<UintegerValue>(MakeUintegerChecker<uint32_t>()))
88 .AddAttribute(
89 "Aifsn",
90 "The AIFSN: the default value conforms to non-QOS (just for the first link, "
91 "in case of 11be multi-link devices).",
92 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
94 MakeUintegerAccessor((void(Txop::*)(uint8_t)) & Txop::SetAifsn,
95 (uint8_t(Txop::*)() const) & Txop::GetAifsn),
96 MakeUintegerChecker<uint8_t>())
97 .AddAttribute(
98 "Aifsns",
99 "The values of AIFSN for all the links",
100 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
102 MakeAttributeContainerAccessor<UintegerValue>(&Txop::SetAifsns, &Txop::GetAifsns),
103 MakeAttributeContainerChecker<UintegerValue>(MakeUintegerChecker<uint8_t>()))
104 .AddAttribute("TxopLimit",
105 "The TXOP limit: the default value conforms to non-QoS "
106 "(just for the first link, in case of 11be multi-link devices).",
107 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
110 (Time(Txop::*)() const) & Txop::GetTxopLimit),
112 .AddAttribute("TxopLimits",
113 "The values of TXOP limit for all the links",
114 TypeId::ATTR_GET | TypeId::ATTR_SET, // do not set at construction time
116 MakeAttributeContainerAccessor<TimeValue>(&Txop::SetTxopLimits,
118 MakeAttributeContainerChecker<TimeValue>(MakeTimeChecker()))
119 .AddAttribute("Queue",
120 "The WifiMacQueue object",
121 PointerValue(),
123 MakePointerChecker<WifiMacQueue>())
124 .AddTraceSource("BackoffTrace",
125 "Trace source for backoff values",
127 "ns3::Txop::BackoffValueTracedCallback")
128 .AddTraceSource("CwTrace",
129 "Trace source for contention window values",
131 "ns3::Txop::CwValueTracedCallback");
132 return tid;
133}
134
137{
138}
139
141 : m_queue(queue)
142{
143 NS_LOG_FUNCTION(this);
144 m_rng = CreateObject<UniformRandomVariable>();
145}
146
148{
149 NS_LOG_FUNCTION(this);
150}
151
152void
154{
155 NS_LOG_FUNCTION(this);
156 m_queue = nullptr;
157 m_mac = nullptr;
158 m_rng = nullptr;
159 m_txMiddle = nullptr;
160 m_links.clear();
161}
162
163std::unique_ptr<Txop::LinkEntity>
165{
166 return std::make_unique<LinkEntity>();
167}
168
170Txop::GetLink(uint8_t linkId) const
171{
172 NS_ASSERT(linkId < m_links.size());
173 NS_ASSERT(m_links.at(linkId)); // check that the pointer owns an object
174 return *m_links.at(linkId);
175}
176
177uint8_t
179{
180 return m_links.size();
181}
182
183void
185{
186 NS_LOG_FUNCTION(this);
187 m_txMiddle = txMiddle;
188}
189
190void
192{
193 NS_LOG_FUNCTION(this << mac);
194 m_mac = mac;
195 m_links.resize(m_mac->GetNLinks());
196 uint8_t linkId = 0;
197 for (auto& link : m_links)
198 {
199 link = CreateLinkEntity();
200 link->id = linkId++;
201 }
202}
203
204void
206{
207 NS_LOG_FUNCTION(this << &callback);
208 m_droppedMpduCallback = callback;
209 m_queue->TraceConnectWithoutContext("DropBeforeEnqueue",
211 m_queue->TraceConnectWithoutContext("Expired",
213}
214
217{
218 NS_LOG_FUNCTION(this);
219 return m_queue;
220}
221
222void
224{
225 SetMinCw(minCw, 0);
226}
227
228void
229Txop::SetMinCws(std::vector<uint32_t> minCws)
230{
231 NS_ABORT_IF(minCws.size() != m_links.size());
232 for (std::size_t linkId = 0; linkId < minCws.size(); linkId++)
233 {
234 SetMinCw(minCws[linkId], linkId);
235 }
236}
237
238void
239Txop::SetMinCw(uint32_t minCw, uint8_t linkId)
240{
241 NS_LOG_FUNCTION(this << minCw << +linkId);
242 auto& link = GetLink(linkId);
243 bool changed = (link.cwMin != minCw);
244 link.cwMin = minCw;
245 if (changed)
246 {
247 ResetCw(linkId);
248 }
249}
250
251void
253{
254 SetMaxCw(maxCw, 0);
255}
256
257void
258Txop::SetMaxCws(std::vector<uint32_t> maxCws)
259{
260 NS_ABORT_IF(maxCws.size() != m_links.size());
261 for (std::size_t linkId = 0; linkId < maxCws.size(); linkId++)
262 {
263 SetMaxCw(maxCws[linkId], linkId);
264 }
265}
266
267void
268Txop::SetMaxCw(uint32_t maxCw, uint8_t linkId)
269{
270 NS_LOG_FUNCTION(this << maxCw << +linkId);
271 auto& link = GetLink(linkId);
272 bool changed = (link.cwMax != maxCw);
273 link.cwMax = maxCw;
274 if (changed)
275 {
276 ResetCw(linkId);
277 }
278}
279
281Txop::GetCw(uint8_t linkId) const
282{
283 return GetLink(linkId).cw;
284}
285
286void
287Txop::ResetCw(uint8_t linkId)
288{
289 NS_LOG_FUNCTION(this);
290 auto& link = GetLink(linkId);
291 link.cw = GetMinCw(linkId);
292 m_cwTrace(link.cw, linkId);
293}
294
295void
296Txop::UpdateFailedCw(uint8_t linkId)
297{
298 NS_LOG_FUNCTION(this);
299 auto& link = GetLink(linkId);
300 // see 802.11-2012, section 9.19.2.5
301 link.cw = std::min(2 * (link.cw + 1) - 1, GetMaxCw(linkId));
302 // if the MU EDCA timer is running, CW cannot be less than MU CW min
303 link.cw = std::max(link.cw, GetMinCw(linkId));
304 m_cwTrace(link.cw, linkId);
305}
306
308Txop::GetBackoffSlots(uint8_t linkId) const
309{
310 return GetLink(linkId).backoffSlots;
311}
312
313Time
314Txop::GetBackoffStart(uint8_t linkId) const
315{
316 return GetLink(linkId).backoffStart;
317}
318
319void
320Txop::UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId)
321{
322 NS_LOG_FUNCTION(this << nSlots << backoffUpdateBound << +linkId);
323 auto& link = GetLink(linkId);
324
325 link.backoffSlots -= nSlots;
326 link.backoffStart = backoffUpdateBound;
327 NS_LOG_DEBUG("update slots=" << nSlots << " slots, backoff=" << link.backoffSlots);
328}
329
330void
331Txop::StartBackoffNow(uint32_t nSlots, uint8_t linkId)
332{
333 NS_LOG_FUNCTION(this << nSlots << +linkId);
334 auto& link = GetLink(linkId);
335
336 if (link.backoffSlots != 0)
337 {
338 NS_LOG_DEBUG("reset backoff from " << link.backoffSlots << " to " << nSlots << " slots");
339 }
340 else
341 {
342 NS_LOG_DEBUG("start backoff=" << nSlots << " slots");
343 }
344 link.backoffSlots = nSlots;
345 link.backoffStart = Simulator::Now();
346}
347
348void
349Txop::SetAifsn(uint8_t aifsn)
350{
351 SetAifsn(aifsn, 0);
352}
353
354void
355Txop::SetAifsns(std::vector<uint8_t> aifsns)
356{
357 NS_ABORT_IF(aifsns.size() != m_links.size());
358 for (std::size_t linkId = 0; linkId < aifsns.size(); linkId++)
359 {
360 SetAifsn(aifsns[linkId], linkId);
361 }
362}
363
364void
365Txop::SetAifsn(uint8_t aifsn, uint8_t linkId)
366{
367 NS_LOG_FUNCTION(this << +aifsn << +linkId);
368 GetLink(linkId).aifsn = aifsn;
369}
370
371void
373{
374 SetTxopLimit(txopLimit, 0);
375}
376
377void
378Txop::SetTxopLimits(const std::vector<Time>& txopLimits)
379{
380 NS_ABORT_MSG_IF(txopLimits.size() != m_links.size(),
381 "The size of the given vector (" << txopLimits.size()
382 << ") does not match the number of links ("
383 << m_links.size() << ")");
384 for (std::size_t linkId = 0; linkId < txopLimits.size(); linkId++)
385 {
386 SetTxopLimit(txopLimits[linkId], linkId);
387 }
388}
389
390void
391Txop::SetTxopLimit(Time txopLimit, uint8_t linkId)
392{
393 NS_LOG_FUNCTION(this << txopLimit << +linkId);
394 NS_ASSERT_MSG((txopLimit.GetMicroSeconds() % 32 == 0),
395 "The TXOP limit must be expressed in multiple of 32 microseconds!");
396 GetLink(linkId).txopLimit = txopLimit;
397}
398
401{
402 return GetMinCw(0);
403}
404
405std::vector<uint32_t>
407{
408 std::vector<uint32_t> ret;
409 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
410 {
411 ret.push_back(GetMinCw(linkId));
412 }
413 return ret;
414}
415
417Txop::GetMinCw(uint8_t linkId) const
418{
419 return GetLink(linkId).cwMin;
420}
421
424{
425 return GetMaxCw(0);
426}
427
428std::vector<uint32_t>
430{
431 std::vector<uint32_t> ret;
432 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
433 {
434 ret.push_back(GetMaxCw(linkId));
435 }
436 return ret;
437}
438
440Txop::GetMaxCw(uint8_t linkId) const
441{
442 return GetLink(linkId).cwMax;
443}
444
445uint8_t
447{
448 return GetAifsn(0);
449}
450
451std::vector<uint8_t>
453{
454 std::vector<uint8_t> ret;
455 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
456 {
457 ret.push_back(GetAifsn(linkId));
458 }
459 return ret;
460}
461
462uint8_t
463Txop::GetAifsn(uint8_t linkId) const
464{
465 return GetLink(linkId).aifsn;
466}
467
468Time
470{
471 return GetTxopLimit(0);
472}
473
474std::vector<Time>
476{
477 std::vector<Time> ret;
478 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
479 {
480 ret.push_back(GetTxopLimit(linkId));
481 }
482 return ret;
483}
484
485Time
486Txop::GetTxopLimit(uint8_t linkId) const
487{
488 return GetLink(linkId).txopLimit;
489}
490
491bool
493{
494 m_queue->WipeAllExpiredMpdus();
495 bool ret = static_cast<bool>(m_queue->Peek(linkId));
496 NS_LOG_FUNCTION(this << +linkId << ret);
497 return ret;
498}
499
500void
502{
503 NS_LOG_FUNCTION(this << packet << &hdr);
504 // remove the priority tag attached, if any
505 SocketPriorityTag priorityTag;
506 packet->RemovePacketTag(priorityTag);
507 Queue(Create<WifiMpdu>(packet, hdr));
508}
509
510void
512{
513 NS_LOG_FUNCTION(this << *mpdu);
514 const auto linkIds = m_mac->GetMacQueueScheduler()->GetLinkIds(m_queue->GetAc(), mpdu);
515 for (const auto linkId : linkIds)
516 {
518 {
519 GenerateBackoff(linkId);
520 }
521 }
522 m_queue->Enqueue(mpdu);
523 for (const auto linkId : linkIds)
524 {
525 StartAccessIfNeeded(linkId);
526 }
527}
528
529int64_t
530Txop::AssignStreams(int64_t stream)
531{
532 NS_LOG_FUNCTION(this << stream);
533 m_rng->SetStream(stream);
534 return 1;
535}
536
537void
539{
540 NS_LOG_FUNCTION(this << +linkId);
541 if (HasFramesToTransmit(linkId) && GetLink(linkId).access == NOT_REQUESTED)
542 {
544 }
545}
546
547void
549{
550 NS_LOG_FUNCTION(this);
551 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
552 {
553 ResetCw(linkId);
554 GenerateBackoff(linkId);
555 }
556}
557
559Txop::GetAccessStatus(uint8_t linkId) const
560{
561 return GetLink(linkId).access;
562}
563
564void
566{
567 NS_LOG_FUNCTION(this << +linkId);
568 GetLink(linkId).access = REQUESTED;
569}
570
571void
572Txop::NotifyChannelAccessed(uint8_t linkId, Time txopDuration)
573{
574 NS_LOG_FUNCTION(this << +linkId << txopDuration);
575 GetLink(linkId).access = GRANTED;
576}
577
578void
580{
581 NS_LOG_FUNCTION(this << +linkId);
582 GetLink(linkId).access = NOT_REQUESTED;
583 GenerateBackoff(linkId);
584 if (HasFramesToTransmit(linkId))
585 {
587 }
588}
589
590void
591Txop::RequestAccess(uint8_t linkId)
592{
593 NS_LOG_FUNCTION(this << +linkId);
594 if (GetLink(linkId).access == NOT_REQUESTED)
595 {
597 }
598}
599
600void
602{
603 NS_LOG_FUNCTION(this << +linkId);
604 uint32_t backoff = m_rng->GetInteger(0, GetCw(linkId));
605 m_backoffTrace(backoff, linkId);
606 StartBackoffNow(backoff, linkId);
607}
608
609void
610Txop::NotifySleep(uint8_t linkId)
611{
612 NS_LOG_FUNCTION(this << +linkId);
613}
614
615void
617{
618 NS_LOG_FUNCTION(this);
619 m_queue->Flush();
620}
621
622void
623Txop::NotifyWakeUp(uint8_t linkId)
624{
625 NS_LOG_FUNCTION(this << +linkId);
626 StartAccessIfNeeded(linkId);
627}
628
629void
631{
632 NS_LOG_FUNCTION(this);
633 for (std::size_t linkId = 0; linkId < m_links.size(); linkId++)
634 {
635 StartAccessIfNeeded(linkId);
636 }
637}
638
639bool
641{
642 return false;
643}
644
645} // namespace ns3
A container for one type of attribute.
auto Bind(BoundArgs &&... bargs)
Bind a variable number of arguments.
Definition: callback.h:555
void RequestAccess(Ptr< Txop > txop)
bool NeedBackoffUponAccess(Ptr< Txop > txop)
Determine if a new backoff needs to be generated when a packet is queued for transmission.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Template class for packet Queues.
Definition: queue.h:267
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
Definition: simulator.h:606
indicates whether the socket has a priority set.
Definition: socket.h:1316
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:412
AttributeValue implementation for Time.
Definition: nstime.h:1423
Handle packet fragmentation and retransmissions for data and management frames.
Definition: txop.h:71
virtual void StartAccessIfNeeded(uint8_t linkId)
Request access from Txop on the given link if needed.
Definition: txop.cc:538
Ptr< WifiMac > m_mac
the wifi MAC
Definition: txop.h:517
Time GetTxopLimit() const
Return the TXOP limit.
Definition: txop.cc:469
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
Definition: txop.cc:164
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: txop.cc:530
virtual ChannelAccessStatus GetAccessStatus(uint8_t linkId) const
Definition: txop.cc:559
Ptr< WifiMacQueue > m_queue
the wifi MAC queue
Definition: txop.h:515
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the Txop has frames to transmit over the given link.
Definition: txop.cc:492
virtual void NotifyOff()
When off operation occurs, the queue gets cleaned up.
Definition: txop.cc:616
Ptr< UniformRandomVariable > m_rng
the random stream
Definition: txop.h:518
CwValueTracedCallback m_cwTrace
CW trace value.
Definition: txop.h:526
void DoDispose() override
Destructor implementation.
Definition: txop.cc:153
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Definition: txop.cc:252
uint32_t GetMinCw() const
Return the minimum contention window size.
Definition: txop.cc:400
ChannelAccessStatus
Enumeration for channel access status.
Definition: txop.h:99
@ GRANTED
Definition: txop.h:102
@ NOT_REQUESTED
Definition: txop.h:100
@ REQUESTED
Definition: txop.h:101
virtual void NotifyOn()
When on operation occurs, channel access will be started.
Definition: txop.cc:630
void UpdateFailedCw(uint8_t linkId)
Update the value of the CW variable for the given link to take into account a transmission failure.
Definition: txop.cc:296
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
Definition: txop.cc:216
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
Definition: txop.cc:191
virtual void NotifyWakeUp(uint8_t linkId)
When wake up operation occurs on a link, channel access on that link will be restarted.
Definition: txop.cc:623
virtual void NotifyChannelReleased(uint8_t linkId)
Called by the FrameExchangeManager to notify the completion of the transmissions.
Definition: txop.cc:579
std::vector< uint32_t > GetMaxCws() const
Return the maximum contention window size for each link.
Definition: txop.cc:429
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
Definition: txop.cc:372
void ResetCw(uint8_t linkId)
Update the value of the CW variable for the given link to take into account a transmission success or...
Definition: txop.cc:287
Txop()
Definition: txop.cc:135
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition: txop.cc:170
virtual bool IsQosTxop() const
Check for QoS TXOP.
Definition: txop.cc:640
std::vector< uint32_t > GetMinCws() const
Return the minimum contention window size for each link.
Definition: txop.cc:406
std::vector< uint8_t > GetAifsns() const
Return the number of slots that make up an AIFS for each link.
Definition: txop.cc:452
void UpdateBackoffSlotsNow(uint32_t nSlots, Time backoffUpdateBound, uint8_t linkId)
Update backoff slots for the given link that nSlots has passed.
Definition: txop.cc:320
Time GetBackoffStart(uint8_t linkId) const
Return the time when the backoff procedure started on the given link.
Definition: txop.cc:314
void SetMaxCws(std::vector< uint32_t > maxCws)
Set the maximum contention window size for each link.
Definition: txop.cc:258
void SetTxopLimits(const std::vector< Time > &txopLimits)
Set the TXOP limit for each link.
Definition: txop.cc:378
DroppedMpdu m_droppedMpduCallback
the dropped MPDU callback
Definition: txop.h:514
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
Definition: txop.cc:184
std::vector< std::unique_ptr< LinkEntity > > m_links
vector of LinkEntity objects
Definition: txop.h:536
std::vector< Time > GetTxopLimits() const
Return the TXOP limit for each link.
Definition: txop.cc:475
static TypeId GetTypeId()
Get the type ID.
Definition: txop.cc:51
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
Definition: txop.cc:349
uint32_t GetCw(uint8_t linkId) const
Get the current value of the CW variable for the given link.
Definition: txop.cc:281
void SetMinCws(std::vector< uint32_t > minCws)
Set the minimum contention window size for each link.
Definition: txop.cc:229
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
Definition: txop.cc:205
virtual void GenerateBackoff(uint8_t linkId)
Generate a new backoff for the given link now.
Definition: txop.cc:601
BackoffValueTracedCallback m_backoffTrace
backoff trace value
Definition: txop.h:525
virtual void NotifyAccessRequested(uint8_t linkId)
Notify that access request has been received for the given link.
Definition: txop.cc:565
void SetAifsns(std::vector< uint8_t > aifsns)
Set the number of slots that make up an AIFS for each link.
Definition: txop.cc:355
Ptr< MacTxMiddle > m_txMiddle
the MacTxMiddle
Definition: txop.h:516
~Txop() override
Definition: txop.cc:147
void StartBackoffNow(uint32_t nSlots, uint8_t linkId)
Definition: txop.cc:331
virtual void NotifyChannelAccessed(uint8_t linkId, Time txopDuration=Seconds(0))
Called by the FrameExchangeManager to notify that channel access has been granted on the given link f...
Definition: txop.cc:572
void RequestAccess(uint8_t linkId)
Request access to the ChannelAccessManager associated with the given link.
Definition: txop.cc:591
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
Definition: txop.cc:223
uint8_t GetAifsn() const
Return the number of slots that make up an AIFS.
Definition: txop.cc:446
uint32_t GetBackoffSlots(uint8_t linkId) const
Return the current number of backoff slots on the given link.
Definition: txop.cc:308
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
Definition: txop.cc:501
virtual void NotifySleep(uint8_t linkId)
Notify that the given link switched to sleep mode.
Definition: txop.cc:610
uint32_t GetMaxCw() const
Return the maximum contention window size.
Definition: txop.cc:423
uint8_t GetNLinks() const
Get the number of links.
Definition: txop.cc:178
void DoInitialize() override
Initialize() implementation.
Definition: txop.cc:548
a unique identifier for an interface.
Definition: type-id.h:59
@ ATTR_GET
The attribute can be read.
Definition: type-id.h:64
@ ATTR_SET
The attribute can be written.
Definition: type-id.h:65
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:936
Hold an unsigned integer type.
Definition: uinteger.h:45
uint32_t GetInteger(uint32_t min, uint32_t max)
Get the next random value drawn from the distribution.
Implements the IEEE 802.11 MAC header.
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
Definition: wifi-mac.cc:574
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Definition: wifi-mac.cc:930
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
Definition: wifi-mac.cc:870
This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" pa...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Definition: pointer.h:227
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition: nstime.h:1444
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1424
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:76
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition: object.h:579
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1348
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
@ WIFI_MAC_DROP_FAILED_ENQUEUE
Definition: wifi-mac.h:76
@ WIFI_MAC_DROP_EXPIRED_LIFETIME
Definition: wifi-mac.h:77
@ AC_BE_NQOS
Non-QoS.
Definition: qos-utils.h:82
Every class exported by the ns3 library is enclosed in the ns3 namespace.