A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ctrl-headers.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 MIRKO BANCHI
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mirko Banchi <mk.banchi@gmail.com>
7 */
8
9#ifndef CTRL_HEADERS_H
10#define CTRL_HEADERS_H
11
12#include "block-ack-type.h"
13#include "wifi-phy-common.h"
14
15#include "ns3/he-ru.h"
16#include "ns3/header.h"
17#include "ns3/mac48-address.h"
18
19#include <list>
20#include <vector>
21
22namespace ns3
23{
24
25class WifiTxVector;
26enum AcIndex : uint8_t;
27
28/**
29 * \ingroup wifi
30 * \brief Headers for BlockAckRequest.
31 *
32 * 802.11n standard includes three types of BlockAck:
33 * - Basic BlockAck (unique type in 802.11e)
34 * - Compressed BlockAck
35 * - Multi-TID BlockAck
36 * For now only basic BlockAck and compressed BlockAck
37 * are supported.
38 * Basic BlockAck is also default variant.
39 */
41{
42 public:
44 ~CtrlBAckRequestHeader() override;
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50
51 TypeId GetInstanceTypeId() const override;
52 void Print(std::ostream& os) const override;
53 uint32_t GetSerializedSize() const override;
54 void Serialize(Buffer::Iterator start) const override;
56
57 /**
58 * Enable or disable HT immediate Ack.
59 *
60 * \param immediateAck enable or disable HT immediate Ack
61 */
62 void SetHtImmediateAck(bool immediateAck);
63 /**
64 * Set the BlockAckRequest type.
65 *
66 * \param type the BlockAckRequest type
67 */
68 void SetType(BlockAckReqType type);
69 /**
70 * Set Traffic ID (TID).
71 *
72 * \param tid the TID
73 */
74 void SetTidInfo(uint8_t tid);
75 /**
76 * Set the starting sequence number from the given
77 * raw sequence control field.
78 *
79 * \param seq the raw sequence control
80 */
81 void SetStartingSequence(uint16_t seq);
82
83 /**
84 * Check if the current Ack Policy is immediate.
85 *
86 * \return true if the current Ack Policy is immediate,
87 * false otherwise
88 */
89 bool MustSendHtImmediateAck() const;
90 /**
91 * Return the BlockAckRequest type.
92 *
93 * \return the type of the BlockAckRequest
94 */
96 /**
97 * Return the Traffic ID (TID).
98 *
99 * \return TID
100 */
101 uint8_t GetTidInfo() const;
102 /**
103 * Return the starting sequence number.
104 *
105 * \return the starting sequence number
106 */
107 uint16_t GetStartingSequence() const;
108 /**
109 * Check if the current Ack Policy is Basic Block Ack
110 * (i.e. not multi-TID nor compressed).
111 *
112 * \return true if the current Ack Policy is Basic Block Ack,
113 * false otherwise
114 */
115 bool IsBasic() const;
116 /**
117 * Check if the current Ack Policy is Compressed Block Ack
118 * and not multi-TID.
119 *
120 * \return true if the current Ack Policy is Compressed Block Ack,
121 * false otherwise
122 */
123 bool IsCompressed() const;
124 /**
125 * Check if the current Ack Policy is Extended Compressed Block Ack.
126 *
127 * \return true if the current Ack Policy is Extended Compressed Block Ack,
128 * false otherwise
129 */
130 bool IsExtendedCompressed() const;
131 /**
132 * Check if the current Ack Policy has Multi-TID Block Ack.
133 *
134 * \return true if the current Ack Policy has Multi-TID Block Ack,
135 * false otherwise
136 */
137 bool IsMultiTid() const;
138
139 /**
140 * Return the starting sequence control.
141 *
142 * \return the starting sequence control
143 */
144 uint16_t GetStartingSequenceControl() const;
145
146 private:
147 /**
148 * Set the starting sequence control with the given
149 * sequence control value
150 *
151 * \param seqControl the sequence control value
152 */
153 void SetStartingSequenceControl(uint16_t seqControl);
154 /**
155 * Return the Block Ack control.
156 *
157 * \return the Block Ack control
158 */
159 uint16_t GetBarControl() const;
160 /**
161 * Set the Block Ack control.
162 *
163 * \param bar the BAR control value
164 */
165 void SetBarControl(uint16_t bar);
166
167 /**
168 * The LSB bit of the BAR control field is used only for the
169 * HT (High Throughput) delayed block ack configuration.
170 * For now only non HT immediate BlockAck is implemented so this field
171 * is here only for a future implementation of HT delayed variant.
172 */
173 bool m_barAckPolicy; ///< bar ack policy
175 uint16_t m_tidInfo; ///< TID info
176 uint16_t m_startingSeq; ///< starting seq
177};
178
179/**
180 * \ingroup wifi
181 * \brief Headers for BlockAck response.
182 *
183 * 802.11n standard includes three types of BlockAck:
184 * - Basic BlockAck (unique type in 802.11e)
185 * - Compressed BlockAck
186 * - Multi-TID BlockAck
187 * For now only basic BlockAck and compressed BlockAck
188 * are supported.
189 * Basic BlockAck is also default variant.
190 */
192{
193 public:
195 ~CtrlBAckResponseHeader() override;
196 /**
197 * \brief Get the type ID.
198 * \return the object TypeId
199 */
200 static TypeId GetTypeId();
201 TypeId GetInstanceTypeId() const override;
202 void Print(std::ostream& os) const override;
203 uint32_t GetSerializedSize() const override;
204 void Serialize(Buffer::Iterator start) const override;
205 uint32_t Deserialize(Buffer::Iterator start) override;
206
207 /**
208 * Enable or disable HT immediate Ack.
209 *
210 * \param immediateAck enable or disable HT immediate Ack
211 */
212 void SetHtImmediateAck(bool immediateAck);
213 /**
214 * Set the block ack type.
215 *
216 * \param type the BA type
217 */
218 void SetType(BlockAckType type);
219 /**
220 * For Block Ack variants other than Multi-STA Block Ack, set the TID_INFO subfield
221 * of the BA Control field. For Multi-STA Block Acks, set the TID subfield of the
222 * AID TID Info subfield of the Per AID TID Info subfield identified by the given
223 * index.
224 *
225 * \param tid the traffic ID
226 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
227 */
228 void SetTidInfo(uint8_t tid, std::size_t index = 0);
229 /**
230 * For Block Ack variants other than Multi-STA Block Ack, set the starting sequence
231 * number to the given value. For Multi-STA Block Acks, set the starting sequence
232 * number in the Per AID TID Info subfield identified by the given index to the
233 * given value.
234 *
235 * \param seq the starting sequence number
236 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
237 */
238 void SetStartingSequence(uint16_t seq, std::size_t index = 0);
239
240 /**
241 * Check if the current Ack Policy is immediate.
242 *
243 * \return true if the current Ack Policy is immediate,
244 * false otherwise
245 */
246 bool MustSendHtImmediateAck() const;
247 /**
248 * Return the block ack type ID.
249 *
250 * \return type
251 */
252 BlockAckType GetType() const;
253 /**
254 * For Block Ack variants other than Multi-STA Block Ack, get the TID_INFO subfield
255 * of the BA Control field. For Multi-STA Block Acks, get the TID subfield of the
256 * AID TID Info subfield of the Per AID TID Info subfield identified by the given
257 * index.
258 *
259 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
260 * \return the Traffic ID
261 */
262 uint8_t GetTidInfo(std::size_t index = 0) const;
263 /**
264 * For Block Ack variants other than Multi-STA Block Ack, get the starting sequence
265 * number. For Multi-STA Block Acks, get the starting sequence number in the
266 * Per AID TID Info subfield identified by the given index.
267 *
268 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
269 * \return the starting sequence number
270 */
271 uint16_t GetStartingSequence(std::size_t index = 0) const;
272 /**
273 * Check if the current BA policy is Basic Block Ack.
274 *
275 * \return true if the current BA policy is Basic Block Ack,
276 * false otherwise
277 */
278 bool IsBasic() const;
279 /**
280 * Check if the current BA policy is Compressed Block Ack.
281 *
282 * \return true if the current BA policy is Compressed Block Ack,
283 * false otherwise
284 */
285 bool IsCompressed() const;
286 /**
287 * Check if the current BA policy is Extended Compressed Block Ack.
288 *
289 * \return true if the current BA policy is Extended Compressed Block Ack,
290 * false otherwise
291 */
292 bool IsExtendedCompressed() const;
293 /**
294 * Check if the current BA policy is Multi-TID Block Ack.
295 *
296 * \return true if the current BA policy is Multi-TID Block Ack,
297 * false otherwise
298 */
299 bool IsMultiTid() const;
300 /**
301 * Check if the BlockAck frame variant is Multi-STA Block Ack.
302 *
303 * \return true if the BlockAck frame variant is Multi-STA Block Ack,
304 * false otherwise
305 */
306 bool IsMultiSta() const;
307
308 /**
309 * For Multi-STA Block Acks, set the AID11 subfield of the Per AID TID Info
310 * subfield identified by the given index to the given value
311 *
312 * \param aid the AID11 value
313 * \param index the index of the Per AID TID Info subfield
314 */
315 void SetAid11(uint16_t aid, std::size_t index);
316 /**
317 * For Multi-STA Block Acks, get the AID11 subfield of the Per AID TID Info
318 * subfield identified by the given index.
319 *
320 * \param index the index of the Per AID TID Info subfield
321 * \return the AID11 subfield
322 */
323 uint16_t GetAid11(std::size_t index) const;
324 /**
325 * For Multi-STA Block Acks, set the Ack Type subfield of the Per AID TID Info
326 * subfield identified by the given index to the given value
327 *
328 * \param type the ack type value
329 * \param index the index of the Per AID TID Info subfield
330 */
331 void SetAckType(bool type, std::size_t index);
332 /**
333 * For Multi-STA Block Acks, get the Ack Type subfield of the Per AID TID Info
334 * subfield identified by the given index.
335 *
336 * \param index the index of the Per AID TID Info subfield
337 * \return the Ack Type
338 */
339 bool GetAckType(std::size_t index) const;
340 /**
341 * For Multi-STA Block Acks, set the RA subfield of the Per AID TID Info
342 * subfield (with AID11 subfield equal to 2045) identified by the given index
343 * to the given MAC address.
344 *
345 * \param ra the MAC address
346 * \param index the index of the Per AID TID Info subfield
347 */
348 void SetUnassociatedStaAddress(const Mac48Address& ra, std::size_t index);
349 /**
350 * For Multi-STA Block Acks, get the RA subfield of the Per AID TID Info
351 * subfield (with AID11 subfield equal to 2045) identified by the given index
352 * to the given MAC address.
353 *
354 * \param index the index of the Per AID TID Info subfield
355 * \return the MAC address stored in the RA subfield
356 */
357 Mac48Address GetUnassociatedStaAddress(std::size_t index) const;
358 /**
359 * For Multi-STA Block Acks, get the number of Per AID TID Info subfields
360 * included in this Block Ack.
361 *
362 * \return the number of Per AID TID Info subfields included in this Multi-STA Block Ack
363 */
364 std::size_t GetNPerAidTidInfoSubfields() const;
365 /**
366 * For Multi-STA Block Acks, get the indices of the Per AID TID Info subfields
367 * carrying the given AID in the AID11 subfield.
368 *
369 * \param aid the given AID
370 * \return a vector containing the indices of the Per AID TID Info subfields
371 * carrying the given AID in the AID11 subfield
372 */
373 std::vector<uint32_t> FindPerAidTidInfoWithAid(uint16_t aid) const;
374
375 /**
376 * Record in the bitmap that the packet with the given sequence number was
377 * received. For Multi-STA Block Acks, <i>index</i> identifies the Per AID
378 * TID Info subfield whose bitmap has to be updated.
379 *
380 * \param seq the sequence number of the received packet
381 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
382 */
383 void SetReceivedPacket(uint16_t seq, std::size_t index = 0);
384 /**
385 * Set the bitmap that the packet with the given sequence
386 * number and fragment number was received.
387 *
388 * \param seq the sequence number
389 * \param frag the fragment number
390 */
391 void SetReceivedFragment(uint16_t seq, uint8_t frag);
392 /**
393 * Check if the packet with the given sequence number was acknowledged in this
394 * BlockAck response. For Multi-STA Block Acks, <i>index</i> identifies the
395 * Per AID TID Info subfield whose bitmap has to be checked.
396 *
397 * \param seq the sequence number to be checked
398 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
399 * \return true if the packet with the given sequence number
400 * was ACKed in this BlockAck response, false otherwise
401 */
402 bool IsPacketReceived(uint16_t seq, std::size_t index = 0) const;
403 /**
404 * Check if the packet with the given sequence number
405 * and fragment number was acknowledged in this BlockAck response.
406 *
407 * \param seq the sequence number
408 * \param frag the fragment number
409 * \return true if the packet with the given sequence number
410 * and sequence number was acknowledged in this BlockAck response,
411 * false otherwise
412 */
413 bool IsFragmentReceived(uint16_t seq, uint8_t frag) const;
414
415 /**
416 * Return the value of the Starting Sequence Control subfield. For Multi-STA
417 * Block Acks, <i>index</i> identifies the Per AID TID Info subfield whose
418 * Starting Sequence Control subfield has to be returned.
419 *
420 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
421 * \return the value of the Starting Sequence Control subfield
422 */
423 uint16_t GetStartingSequenceControl(std::size_t index = 0) const;
424 /**
425 * Set the Starting Sequence Control subfield with the given sequence control
426 * value. For Multi-STA Block Acks, <i>index</i> identifies the Per AID TID Info
427 * subfield whose Starting Sequence Control subfield has to be set.
428 *
429 * \param seqControl the raw sequence control value
430 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
431 */
432 void SetStartingSequenceControl(uint16_t seqControl, std::size_t index = 0);
433 /**
434 * Return a const reference to the bitmap from the BlockAck response header.
435 * For Multi-STA Block Acks, return a const reference to the bitmap included
436 * in the Per AID TID Info subfield identified by <i>index</i>.
437 *
438 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
439 * \return a const reference to the bitmap from the BlockAck response header
440 */
441 const std::vector<uint8_t>& GetBitmap(std::size_t index = 0) const;
442
443 /**
444 * Reset the bitmap to 0. For Multi-STA Block Acks, reset the bitmap included
445 * in the Per AID TID Info subfield identified by <i>index</i>.
446 *
447 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
448 */
449 void ResetBitmap(std::size_t index = 0);
450
451 private:
452 /**
453 * Return the Block Ack control.
454 *
455 * \return the Block Ack control
456 */
457 uint16_t GetBaControl() const;
458 /**
459 * Set the Block Ack control.
460 *
461 * \param ba the BA control to set
462 */
463 void SetBaControl(uint16_t ba);
464
465 /**
466 * Serialize bitmap to the given buffer. For Multi-STA Block Acks, <i>index</i>
467 * identifies the Per AID TID Info subfield whose bitmap has to be serialized.
468 *
469 * \param start iterator pointing to the beginning of the buffer to write into.
470 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
471 * \return Buffer::Iterator to the next available buffer
472 */
473 Buffer::Iterator SerializeBitmap(Buffer::Iterator start, std::size_t index = 0) const;
474 /**
475 * Deserialize bitmap from the given buffer. For Multi-STA Block Acks, <i>index</i>
476 * identifies the Per AID TID Info subfield whose bitmap has to be deserialized.
477 *
478 * \param start iterator pointing to the beginning of the buffer to read from.
479 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
480 * \return Buffer::Iterator to the next available buffer
481 */
482 Buffer::Iterator DeserializeBitmap(Buffer::Iterator start, std::size_t index = 0);
483
484 /**
485 * This function is used to correctly index in both bitmap
486 * and compressed bitmap, one bit or one block of 16 bits respectively.
487 *
488 * for more details see 7.2.1.8 in IEEE 802.11n/D4.00
489 *
490 * \param seq the sequence number
491 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
492 *
493 * \return If we are using basic block ack, return value represents index of
494 * block of 16 bits for packet having sequence number equals to <i>seq</i>.
495 * If we are using compressed block ack, return value represents bit
496 * to set to 1 in the compressed bitmap to indicate that packet having
497 * sequence number equals to <i>seq</i> was correctly received.
498 */
499 uint16_t IndexInBitmap(uint16_t seq, std::size_t index = 0) const;
500
501 /**
502 * Check if sequence number <i>seq</i> can be acknowledged in the bitmap. For
503 * Multi-STA Block Acks, check if sequence number <i>seq</i> can be acknowledged
504 * in the bitmap included in the Per AID TID Info subfield identified by <i>index</i>.
505 *
506 * \param seq the sequence number
507 * \param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
508 * \return true if the sequence number is concerned by the bitmap
509 */
510 bool IsInBitmap(uint16_t seq, std::size_t index = 0) const;
511
512 /**
513 * The LSB bit of the BA control field is used only for the
514 * HT (High Throughput) delayed block ack configuration.
515 * For now only non HT immediate block ack is implemented so this field
516 * is here only for a future implementation of HT delayed variant.
517 */
518 bool m_baAckPolicy; ///< BA Ack Policy
519 BlockAckType m_baType; ///< BA type
520 uint16_t m_tidInfo; ///< TID info (reserved if Multi-STA Block Ack)
521
522 /**
523 * The following structure can hold the BA Information field for the Basic and
524 * Compressed variants, one instance of the {Per TID Info, Block Ack Starting
525 * Sequence Control, Block Ack Bitmap} subfields for the Multi-TID variant or
526 * one instance of the Per AID TID Info subfield for the Multi-STA variant
527 * (which includes the AID TID Info, Block Ack Starting Sequence Control and
528 * Block Ack Bitmap subfields).
529 */
531 {
532 uint16_t m_aidTidInfo; //!< Reserved for Basic and Compressed
533 //!< Per TID Info subfield for Multi-TID
534 //!< AID TID Info subfield for Multi-STA
535 uint16_t m_startingSeq; //!< Block Ack Starting Sequence Control subfield
536 std::vector<uint8_t> m_bitmap; //!< block ack bitmap
537 Mac48Address m_ra; //!< RA subfield (address of an unassociated station)
538 //!< for Multi-STA; reserved for other variants
539 };
540
541 std::vector<BaInfoInstance> m_baInfo; //!< BA Information field
542};
543
544/**
545 * \ingroup wifi
546 * The different Trigger frame types.
547 */
548enum class TriggerFrameType : uint8_t
549{
550 BASIC_TRIGGER = 0, // Basic
551 BFRP_TRIGGER = 1, // Beamforming Report Poll
552 MU_BAR_TRIGGER = 2, // Multi-User Block Ack Request
553 MU_RTS_TRIGGER = 3, // Multi-User Request To Send
554 BSRP_TRIGGER = 4, // Buffer Status Report Poll
555 GCR_MU_BAR_TRIGGER = 5, // Groupcast with Retries MU-BAR
556 BQRP_TRIGGER = 6, // Bandwidth Query Report Poll
557 NFRP_TRIGGER = 7 // NDP Feedback Report Poll
558};
559
560/**
561 * \ingroup wifi
562 * The different variants for Common Info field and User Info field of Trigger Frames.
563 */
564enum class TriggerFrameVariant : uint8_t
565{
566 HE = 0,
567 EHT
568};
569
570/**
571 * \ingroup wifi
572 * \brief User Info field of Trigger frames.
573 *
574 * Trigger frames, introduced by 802.11ax amendment (see Section 9.3.1.23 of D3.0),
575 * include one or more User Info fields, each of which carries information about the
576 * HE TB PPDU that the addressed station sends in response to the Trigger frame.
577 */
579{
580 public:
581 /**
582 * Constructor
583 *
584 * \param triggerType the Trigger frame type
585 * \param variant the Trigger Frame variant
586 */
588 /**
589 * Copy assignment operator.
590 *
591 * \param userInfo the User Info field to copy
592 * \return a reference to the copied object
593 *
594 * Checks that the given User Info fields is included in the same type
595 * of Trigger Frame.
596 */
598 /**
599 * Destructor
600 */
602 /**
603 * Print the content of this User Info field
604 *
605 * \param os output stream
606 */
607 void Print(std::ostream& os) const;
608 /**
609 * Get the expected size of this User Info field
610 *
611 * \return the expected size of this User Info field.
612 */
614 /**
615 * Serialize the User Info field to the given buffer.
616 *
617 * \param start an iterator which points to where the header should
618 * be written
619 * \return Buffer::Iterator to the next available buffer
620 */
622 /**
623 * Deserialize the User Info field from the given buffer.
624 *
625 * \param start an iterator which points to where the header should
626 * read from
627 * \return Buffer::Iterator to the next available buffer
628 */
630 /**
631 * Get the type of the Trigger Frame this User Info field belongs to.
632 *
633 * \return the type of the Trigger Frame this User Info field belongs to
634 */
636 /**
637 * \return the preamble type of the TB PPDU solicited by this User Info field.
638 */
640 /**
641 * Set the AID12 subfield, which carries the 12 LSBs of the AID of the
642 * station for which this User Info field is intended. The whole AID can
643 * be passed, since the passed value is properly masked.
644 *
645 * \param aid the value for the AID12 subfield
646 */
647 void SetAid12(uint16_t aid);
648 /**
649 * Get the value of the AID12 subfield.
650 *
651 * \return the AID12 subfield
652 */
653 uint16_t GetAid12() const;
654 /**
655 * Check if this User Info field allocates a Random Access RU for stations
656 * associated with the AP that transmitted the Trigger frame.
657 *
658 * \return true if a Random Access RU for associated stations is allocated
659 */
660 bool HasRaRuForAssociatedSta() const;
661 /**
662 * Check if this User Info field allocates a Random Access RU for stations
663 * not associated with the AP that transmitted the Trigger frame.
664 *
665 * \return true if a Random Access RU for unassociated stations is allocated
666 */
667 bool HasRaRuForUnassociatedSta() const;
668 /**
669 * Set the RU Allocation subfield according to the specified RU.
670 * This method cannot be called on MU-RTS Trigger Frames (call SetMuRtsRuAllocation instead).
671 *
672 * \param ru the RU this User Info field is allocating
673 */
675 /**
676 * Get the RU specified by the RU Allocation subfield.
677 * This method cannot be called on MU-RTS Trigger Frames (call GetMuRtsRuAllocation instead).
678 *
679 * \return the RU this User Info field is allocating
680 */
682 /**
683 * Set the RU Allocation subfield based on the given value for the B7-B1 bits.
684 * This method can only be called on MU-RTS Trigger Frames.
685 *
686 * B7–B1 of the RU Allocation subfield is set to indicate the primary 20 MHz channel
687 * as follows:
688 * - 61 if the primary 20 MHz channel is the only 20 MHz channel or the lowest frequency
689 * 20 MHz channel in the primary 40 MHz channel or primary 80 MHz channel
690 * - 62 if the primary 20 MHz channel is the second lowest frequency 20 MHz channel in the
691 * primary 40 MHz channel or primary 80 MHz channel
692 * - 63 if the primary 20 MHz channel is the third lowest frequency 20 MHz channel in the
693 * primary 80 MHz channel
694 * - 64 if the primary 20 MHz channel is the fourth lowest frequency 20 MHz channel in the
695 * primary 80 MHz channel
696 *
697 * B7–B1 of the RU Allocation subfield is set to indicate the primary 40 MHz channel
698 * as follows:
699 * - 65 if the primary 40 MHz channel is the only 40 MHz channel or the lowest frequency
700 * 40 MHz channel in the primary 80 MHz channel
701 * - 66 if the primary 40 MHz channel is the second lowest frequency 40 MHz channel in the
702 * primary 80 MHz channel
703 *
704 * B7–B1 of the RU Allocation subfield is set to 67 to indicate the primary 80 MHz channel.
705 *
706 * B7–B1 of the RU Allocation subfield is set to 68 to indicate the primary and secondary
707 * 80 MHz channel.
708 *
709 * \param value the value for B7–B1 of the RU Allocation subfield
710 */
711 void SetMuRtsRuAllocation(uint8_t value);
712 /**
713 * This method can only be called on MU-RTS Trigger Frames.
714 *
715 * \return the value of B7–B1 of the RU Allocation subfield (\see SetMuRtsRuAllocation)
716 */
717 uint8_t GetMuRtsRuAllocation() const;
718 /**
719 * Set the UL FEC Coding Type subfield, which indicates whether BCC or LDPC is used
720 *
721 * \param ldpc whether to use LDPC or not
722 */
723 void SetUlFecCodingType(bool ldpc);
724 /**
725 * Get the UL FEC Coding Type subfield, which indicates whether BCC or LDPC is used
726 *
727 * \return true if LDPC is used
728 */
729 bool GetUlFecCodingType() const;
730 /**
731 * Set the UL MCS subfield, which indicates the MCS of the solicited HE TB PPDU
732 *
733 * \param mcs the MCS index (a value between 0 and 11)
734 */
735 void SetUlMcs(uint8_t mcs);
736 /**
737 * Get the UL MCS subfield, which indicates the MCS of the solicited HE TB PPDU
738 *
739 * \return the MCS index (a value between 0 and 11)
740 */
741 uint8_t GetUlMcs() const;
742 /**
743 * Set the UL DCM subfield, which indicates whether or not DCM is used.
744 * This method can only be used with HE variant User Info field.
745 *
746 * \param dcm whether to use DCM or not
747 */
748 void SetUlDcm(bool dcm);
749 /**
750 * Get the UL DCM subfield, which indicates whether or not DCM is used
751 * This method can only be used with HE variant User Info field.
752 *
753 * \return true if DCM is used
754 */
755 bool GetUlDcm() const;
756 /**
757 * Set the SS Allocation subfield, which is present when the AID12 subfield
758 * is neither 0 nor 2045. This method must be called after setting the AID12
759 * subfield to a value other than 0 and 2045.
760 *
761 * \param startingSs the starting spatial stream (a value from 1 to 8)
762 * \param nSs the number of spatial streams (a value from 1 to 8)
763 */
764 void SetSsAllocation(uint8_t startingSs, uint8_t nSs);
765 /**
766 * Get the starting spatial stream.
767 *
768 * \return the starting spatial stream (a value between 1 and 8)
769 */
770 uint8_t GetStartingSs() const;
771 /**
772 * Get the number of spatial streams.
773 *
774 * \return the number of spatial streams (a value between 1 and 8)
775 */
776 uint8_t GetNss() const;
777 /**
778 * Set the RA-RU Information subfield, which is present when the AID12 subfield
779 * is 0 or 2045. This method must be called after setting the AID12 subfield to
780 * 0 or 2045.
781 *
782 * \param nRaRu the number (from 1 to 32) of contiguous RUs allocated for Random Access.
783 * \param moreRaRu whether RA-RUs are allocated in subsequent Trigger frames
784 */
785 void SetRaRuInformation(uint8_t nRaRu, bool moreRaRu);
786 /**
787 * Get the number of contiguous RUs for Random Access. This method can only be
788 * called if the AID12 subfield has been set to 0 or 2045
789 *
790 * \return the number of contiguous RA-RUs (a value between 1 and 32)
791 */
792 uint8_t GetNRaRus() const;
793 /**
794 * Return true if more RA-RUs are allocated in subsequent Trigger frames
795 * that are sent before the end of the current TXOP. This method can only be
796 * called if the AID12 subfield has been set to 0 or 2045
797 *
798 * \return true if more RA-RUs are allocated in subsequent Trigger frames
799 */
800 bool GetMoreRaRu() const;
801 /**
802 * Set the UL Target RSSI subfield to indicate to the station to transmit an
803 * HE TB PPDU response at its maximum transmit power for the assigned MCS
804 */
806 /**
807 * Set the UL Target RSSI subfield to indicate the expected receive signal
808 * power in dBm
809 *
810 * \param dBm the expected receive signal power (a value between -110 and -20)
811 */
812 void SetUlTargetRssi(int8_t dBm);
813 /**
814 * Return true if the UL Target RSSI subfield indicates to the station to transmit
815 * an HE TB PPDU response at its maximum transmit power for the assigned MCS
816 *
817 * \return true if the UL Target RSSI subfield indicates to the station to transmit
818 * an HE TB PPDU response at its maximum transmit power for the assigned MCS
819 */
820 bool IsUlTargetRssiMaxTxPower() const;
821 /**
822 * Get the expected receive signal power for the solicited HE TB PPDU. This
823 * method can only be called if IsUlTargetRssiMaxTxPower returns false.
824 *
825 * \return the expected receive signal power in dBm
826 */
827 int8_t GetUlTargetRssi() const;
828 /**
829 * Set the Trigger Dependent User Info subfield for Basic Trigger frames.
830 *
831 * \param spacingFactor the MPDU MU spacing factor
832 * \param tidLimit the value for the TID Aggregation Limit subfield
833 * \param prefAc the lowest AC recommended for aggregation of MPDUs
834 */
835 void SetBasicTriggerDepUserInfo(uint8_t spacingFactor, uint8_t tidLimit, AcIndex prefAc);
836 /**
837 * Get the MPDU MU spacing factor. This method can only be called if this
838 * User Info field is included in a Basic Trigger frame.
839 *
840 * \return the MPDU MU spacing factor
841 */
842 uint8_t GetMpduMuSpacingFactor() const;
843 /**
844 * Get the TID Aggregation Limit. This method can only be called if this
845 * User Info field is included in a Basic Trigger frame.
846 *
847 * \return the TID Aggregation Limit
848 */
849 uint8_t GetTidAggregationLimit() const;
850 /**
851 * Get the Preferred AC subfield. This method can only be called if this
852 * User Info field is included in a Basic Trigger frame.
853 *
854 * \return the Preferred AC subfield
855 */
856 AcIndex GetPreferredAc() const;
857 /**
858 * Set the Trigger Dependent User Info subfield for the MU-BAR variant of
859 * Trigger frames, which includes a BAR Control subfield and a BAR Information
860 * subfield. The BAR Control subfield must indicate either a Compressed
861 * BlockAckReq variant or a Multi-TID BlockAckReq variant.
862 *
863 * \param bar the BlockAckRequest header object including the BAR Control
864 * subfield and the BAR Information subfield
865 */
867 /**
868 * Get the Trigger Dependent User Info subfield for the MU-BAR variant of
869 * Trigger frames, which includes a BAR Control subfield and a BAR Information
870 * subfield. The BAR Control subfield must indicate either a Compressed
871 * BlockAckReq variant or a Multi-TID BlockAckReq variant.
872 *
873 * \return the BlockAckRequest header object including the BAR Control
874 * subfield and the BAR Information subfield
875 */
877
878 private:
879 TriggerFrameVariant m_variant; //!< User Info field variant
880
881 uint16_t m_aid12; //!< Association ID of the addressed station
882 uint8_t m_ruAllocation; //!< RU Allocation
883 bool m_ulFecCodingType; //!< UL FEC Coding Type
884 uint8_t m_ulMcs; //!< MCS to be used by the addressed station
885 bool m_ulDcm; //!< whether or not to use Dual Carrier Modulation (HE variant only)
886 bool m_ps160; //!< identifies the location of the RU (EHT variant only)
887
888 union {
889 struct
890 {
891 uint8_t startingSs; //!< Starting spatial stream
892 uint8_t nSs; //!< Number of spatial streams
893 } ssAllocation; //!< Used when AID12 is neither 0 nor 2045
894
895 struct
896 {
897 uint8_t nRaRu; //!< Number of Random Access RUs
898 bool moreRaRu; //!< More RA-RU in subsequent Trigger frames
899 } raRuInformation; //!< Used when AID12 is 0 or 2045
900 } m_bits26To31; //!< Fields occupying bits 26-31 in the User Info field
901
902 uint8_t m_ulTargetRssi; //!< Expected receive signal power
903 TriggerFrameType m_triggerType; //!< Trigger frame type
904 uint8_t m_basicTriggerDependentUserInfo; //!< Basic Trigger variant of Trigger Dependent User
905 //!< Info subfield
907 m_muBarTriggerDependentUserInfo; //!< MU-BAR variant of Trigger Dependent User Info subfield
908};
909
910/**
911 * \ingroup wifi
912 * \brief Headers for Trigger frames.
913 *
914 * 802.11ax amendment defines eight types of Trigger frames (see Section 9.3.1.23 of D3.0):
915 * - Basic
916 * - Beamforming Report Poll (BFRP)
917 * - Multi-User Block Ack Request (MU-BAR)
918 * - Multi-User Request To Send (MU-RTS)
919 * - Buffer Status Report Poll (BSRP)
920 * - Groupcast with Retries (GCR) MU-BAR
921 * - Bandwidth Query Report Poll (BQRP)
922 * - NDP Feedback Report Poll (NFRP)
923 * For now only the Basic, MU-BAR, MU-RTS, BSRP and BQRP variants are supported.
924 * Basic Trigger is also the default variant.
925 *
926 * The Padding field is optional, given that other techniques (post-EOF A-MPDU
927 * padding, aggregating other MPDUs in the A-MPDU) are available to satisfy the
928 * minimum time requirement. The size in bytes of the Padding field is configurable.
929 */
931{
932 public:
934 /**
935 * \brief Constructor
936 *
937 * Construct a Trigger Frame of the given type from the values stored in the
938 * given TX vector. In particular:
939 * - the UL Bandwidth, UL Length and GI And LTF Type subfields of the Common Info
940 * field are set based on the values stored in the TX vector;
941 * - as many User Info fields as the number of entries in the HeMuUserInfoMap
942 * of the TX vector are added to the Trigger Frame. The AID12, RU Allocation,
943 * UL MCS and SS Allocation subfields of each User Info field are set based
944 * on the values stored in the corresponding entry of the HeMuUserInfoMap.
945 *
946 * This constructor cannot be used to construct MU-RTS Trigger Frames.
947 *
948 * \param type the Trigger frame type
949 * \param txVector the TX vector used to build this Trigger Frame
950 */
951 CtrlTriggerHeader(TriggerFrameType type, const WifiTxVector& txVector);
952 ~CtrlTriggerHeader() override;
953 /**
954 * Copy assignment operator.
955 *
956 * \param trigger the Trigger frame to copy
957 * \return a reference to the copied object
958 *
959 * Ensure that the type of this Trigger Frame is set to the type of the given
960 * Trigger Frame before copying the User Info fields.
961 */
963 /**
964 * \brief Get the type ID.
965 * \return the object TypeId
966 */
967 static TypeId GetTypeId();
968 TypeId GetInstanceTypeId() const override;
969 void Print(std::ostream& os) const override;
970 uint32_t GetSerializedSize() const override;
971 void Serialize(Buffer::Iterator start) const override;
972 uint32_t Deserialize(Buffer::Iterator start) override;
973
974 /**
975 * Set the Common Info field variant.
976 *
977 * For the moment, all User Info fields are of the same variant type, hence we
978 * forbid changing the Common Info field variant type after adding User Info fields.
979 *
980 * \param variant the Common Info field variant
981 */
982 void SetVariant(TriggerFrameVariant variant);
983 /**
984 * Get the Common Info field variant.
985 *
986 * \return the Common Info field variant
987 */
989 /**
990 * Set the Trigger frame type.
991 *
992 * \param type the Trigger frame type
993 */
994 void SetType(TriggerFrameType type);
995 /**
996 * Get the Trigger Frame type.
997 *
998 * \return the Trigger Frame type
999 */
1000 TriggerFrameType GetType() const;
1001 /**
1002 * Return a string corresponding to the Trigger Frame type.
1003 *
1004 * \returns a string corresponding to the Trigger Frame type.
1005 */
1006 const char* GetTypeString() const;
1007 /**
1008 * Return a string corresponding to the given Trigger Frame type.
1009 *
1010 * \param type the Trigger Frame type
1011 * \returns a string corresponding to the Trigger Frame type.
1012 */
1013 static const char* GetTypeString(TriggerFrameType type);
1014 /**
1015 * Check if this is a Basic Trigger frame.
1016 *
1017 * \return true if this is a Basic Trigger frame,
1018 * false otherwise
1019 */
1020 bool IsBasic() const;
1021 /**
1022 * Check if this is a Beamforming Report Poll Trigger frame.
1023 *
1024 * \return true if this is a Beamforming Report Poll Trigger frame,
1025 * false otherwise
1026 */
1027 bool IsBfrp() const;
1028 /**
1029 * Check if this is a MU-BAR Trigger frame.
1030 *
1031 * \return true if this is a MU-BAR Trigger frame,
1032 * false otherwise
1033 */
1034 bool IsMuBar() const;
1035 /**
1036 * Check if this is a MU-RTS Trigger frame.
1037 *
1038 * \return true if this is a MU-RTS Trigger frame,
1039 * false otherwise
1040 */
1041 bool IsMuRts() const;
1042 /**
1043 * Check if this is a Buffer Status Report Poll Trigger frame.
1044 *
1045 * \return true if this is a Buffer Status Report Poll Trigger frame,
1046 * false otherwise
1047 */
1048 bool IsBsrp() const;
1049 /**
1050 * Check if this is a Groupcast with Retries (GCR) MU-BAR Trigger frame.
1051 *
1052 * \return true if this is a Groupcast with Retries (GCR) MU-BAR Trigger frame,
1053 * false otherwise
1054 */
1055 bool IsGcrMuBar() const;
1056 /**
1057 * Check if this is a Bandwidth Query Report Poll Trigger frame.
1058 *
1059 * \return true if this is a Bandwidth Query Report Poll Trigger frame,
1060 * false otherwise
1061 */
1062 bool IsBqrp() const;
1063 /**
1064 * Check if this is a NDP Feedback Report Poll Trigger frame.
1065 *
1066 * \return true if this is a NDP Feedback Report Poll Trigger frame,
1067 * false otherwise
1068 */
1069 bool IsNfrp() const;
1070 /**
1071 * Set the UL Length subfield of the Common Info field.
1072 *
1073 * \param len the value for the UL Length subfield
1074 */
1075 void SetUlLength(uint16_t len);
1076 /**
1077 * Get the UL Length subfield of the Common Info field.
1078 *
1079 * \return the UL Length subfield
1080 */
1081 uint16_t GetUlLength() const;
1082 /**
1083 * Get the TX vector that the station with the given STA-ID will use to send
1084 * the HE TB PPDU solicited by this Trigger Frame. Note that the TX power
1085 * level is not set by this method.
1086 *
1087 * \param staId the STA-ID of a station addressed by this Trigger Frame
1088 * \return the TX vector of the solicited HE TB PPDU
1089 */
1090 WifiTxVector GetHeTbTxVector(uint16_t staId) const;
1091 /**
1092 * Set the More TF subfield of the Common Info field.
1093 *
1094 * \param more the value for the More TF subfield
1095 */
1096 void SetMoreTF(bool more);
1097 /**
1098 * Get the More TF subfield of the Common Info field.
1099 *
1100 * \return the More TF subfield
1101 */
1102 bool GetMoreTF() const;
1103 /**
1104 * Set the CS Required subfield of the Common Info field.
1105 *
1106 * \param cs the value for the CS Required subfield
1107 */
1108 void SetCsRequired(bool cs);
1109 /**
1110 * Get the CS Required subfield of the Common Info field.
1111 *
1112 * \return the CS Required subfield
1113 */
1114 bool GetCsRequired() const;
1115 /**
1116 * Set the bandwidth of the solicited HE TB PPDU.
1117 *
1118 * \param bw bandwidth (allowed values: 20, 40, 80, 160)
1119 */
1120 void SetUlBandwidth(MHz_u bw);
1121 /**
1122 * Get the bandwidth of the solicited HE TB PPDU.
1123 *
1124 * \return the bandwidth (20, 40, 80 or 160)
1125 */
1126 MHz_u GetUlBandwidth() const;
1127 /**
1128 * Set the GI And LTF Type subfield of the Common Info field.
1129 * Allowed combinations are:
1130 * - 1x LTF + 1.6us GI
1131 * - 2x LTF + 1.6us GI
1132 * - 4x LTF + 3.2us GI
1133 *
1134 * \param guardInterval the guard interval duration
1135 * \param ltfType the HE-LTF type (1, 2 or 4)
1136 */
1137 void SetGiAndLtfType(Time guardInterval, uint8_t ltfType);
1138 /**
1139 * Get the guard interval duration of the solicited HE TB PPDU.
1140 *
1141 * \return the guard interval duration of the solicited HE TB PPDU
1142 */
1143 Time GetGuardInterval() const;
1144 /**
1145 * Get the LTF type of the solicited HE TB PPDU.
1146 *
1147 * \return the LTF type of the solicited HE TB PPDU
1148 */
1149 uint8_t GetLtfType() const;
1150 /**
1151 * Set the AP TX Power subfield of the Common Info field.
1152 *
1153 * \param power the value (from -20 to 40) for the AP TX Power (dBm)
1154 */
1155 void SetApTxPower(int8_t power);
1156 /**
1157 * Get the power value (dBm) indicated by the AP TX Power subfield of the
1158 * Common Info field.
1159 *
1160 * \return the AP TX Power (dBm) per 20 MHz
1161 */
1162 int8_t GetApTxPower() const;
1163 /**
1164 * Set the UL Spatial Reuse subfield of the Common Info field.
1165 *
1166 * \param sr the value for the UL Spatial Reuse subfield
1167 */
1168 void SetUlSpatialReuse(uint16_t sr);
1169 /**
1170 * Get the UL Spatial Reuse subfield of the Common Info field.
1171 *
1172 * \return the UL Spatial Reuse subfield
1173 */
1174 uint16_t GetUlSpatialReuse() const;
1175 /**
1176 * Set the size in bytes of the Padding field. The Padding field, if present,
1177 * shall be at least two octets in length.
1178 *
1179 * \param size the size in bytes of the Padding field
1180 */
1181 void SetPaddingSize(std::size_t size);
1182 /**
1183 * \return the size in bytes of the Padding field
1184 */
1185 std::size_t GetPaddingSize() const;
1186 /**
1187 * Get a copy of the Common Info field of this Trigger frame.
1188 * Note that the User Info fields are excluded.
1189 *
1190 * \return a Trigger frame including a copy of the Common Info field of this frame.
1191 */
1193
1194 /**
1195 * Append a new User Info field to this Trigger frame and return
1196 * a non-const reference to it. Make sure to call this method after
1197 * setting the type of the Trigger frame.
1198 *
1199 * \return a non-const reference to the newly added User Info field
1200 */
1202 /**
1203 * Append the given User Info field to this Trigger frame and return
1204 * a non-const reference to it. Make sure that the type of the given
1205 * User Info field matches the type of this Trigger Frame.
1206 *
1207 * \param userInfo the User Info field to append to this Trigger Frame
1208 * \return a non-const reference to the newly added User Info field
1209 */
1211
1212 /// User Info fields list const iterator
1213 typedef std::list<CtrlTriggerUserInfoField>::const_iterator ConstIterator;
1214
1215 /// User Info fields list iterator
1216 typedef std::list<CtrlTriggerUserInfoField>::iterator Iterator;
1217
1218 /**
1219 * \brief Get a const iterator pointing to the first User Info field in the list.
1220 *
1221 * \return a const iterator pointing to the first User Info field in the list
1222 */
1223 ConstIterator begin() const;
1224 /**
1225 * \brief Get a const iterator indicating past-the-last User Info field in the list.
1226 *
1227 * \return a const iterator indicating past-the-last User Info field in the list
1228 */
1229 ConstIterator end() const;
1230 /**
1231 * \brief Get an iterator pointing to the first User Info field in the list.
1232 *
1233 * \return an iterator pointing to the first User Info field in the list
1234 */
1235 Iterator begin();
1236 /**
1237 * \brief Get an iterator indicating past-the-last User Info field in the list.
1238 *
1239 * \return an iterator indicating past-the-last User Info field in the list
1240 */
1241 Iterator end();
1242 /**
1243 * \brief Get the number of User Info fields in this Trigger Frame.
1244 *
1245 * \return the number of User Info fields in this Trigger Frame
1246 */
1247 std::size_t GetNUserInfoFields() const;
1248 /**
1249 * Get a const iterator pointing to the first User Info field found (starting from
1250 * the one pointed to by the given iterator) whose AID12 subfield is set to
1251 * the given value.
1252 *
1253 * \param start a const iterator pointing to the User Info field to start the search from
1254 * \param aid12 the value of the AID12 subfield to match
1255 * \return a const iterator pointing to the User Info field matching the specified
1256 * criterion, if any, or an iterator indicating past-the-last User Info field.
1257 */
1258 ConstIterator FindUserInfoWithAid(ConstIterator start, uint16_t aid12) const;
1259 /**
1260 * Get a const iterator pointing to the first User Info field found whose AID12
1261 * subfield is set to the given value.
1262 *
1263 * \param aid12 the value of the AID12 subfield to match
1264 * \return a const iterator pointing to the User Info field matching the specified
1265 * criterion, if any, or an iterator indicating past-the-last User Info field.
1266 */
1267 ConstIterator FindUserInfoWithAid(uint16_t aid12) const;
1268 /**
1269 * Get a const iterator pointing to the first User Info field found (starting from
1270 * the one pointed to by the given iterator) which allocates a Random Access
1271 * RU for associated stations.
1272 *
1273 * \param start a const iterator pointing to the User Info field to start the search from
1274 * \return a const iterator pointing to the User Info field matching the specified
1275 * criterion, if any, or an iterator indicating past-the-last User Info field.
1276 */
1278 /**
1279 * Get a const iterator pointing to the first User Info field found which allocates
1280 * a Random Access RU for associated stations.
1281 *
1282 * \return a const iterator pointing to the User Info field matching the specified
1283 * criterion, if any, or an iterator indicating past-the-last User Info field.
1284 */
1286 /**
1287 * Get a const iterator pointing to the first User Info field found (starting from
1288 * the one pointed to by the given iterator) which allocates a Random Access
1289 * RU for unassociated stations.
1290 *
1291 * \param start a const iterator pointing to the User Info field to start the search from
1292 * \return a const iterator pointing to the User Info field matching the specified
1293 * criterion, if any, or an iterator indicating past-the-last User Info field.
1294 */
1296 /**
1297 * Get a const iterator pointing to the first User Info field found which allocates
1298 * a Random Access RU for unassociated stations.
1299 *
1300 * \return a const iterator pointing to the User Info field matching the specified
1301 * criterion, if any, or an iterator indicating past-the-last User Info field.
1302 */
1304 /**
1305 * Check the validity of this Trigger frame.
1306 * TODO Implement the checks listed in Section 27.5.3.2.3 of 802.11ax amendment
1307 * D3.0 (Allowed settings of the Trigger frame fields and TRS Control subfield).
1308 *
1309 * This function shall be invoked before transmitting and upon receiving
1310 * a Trigger frame.
1311 *
1312 * \return true if the Trigger frame is valid, false otherwise.
1313 */
1314 bool IsValid() const;
1315
1316 private:
1317 /**
1318 * Common Info field
1319 */
1320 TriggerFrameVariant m_variant; //!< Common Info field variant
1322 uint16_t m_ulLength; //!< Value for the L-SIG Length field
1323 bool m_moreTF; //!< True if a subsequent Trigger frame follows
1324 bool m_csRequired; //!< Carrier Sense required
1325 uint8_t m_ulBandwidth; //!< UL BW subfield
1326 uint8_t m_giAndLtfType; //!< GI And LTF Type subfield
1327 uint8_t m_apTxPower; //!< Tx Power used by AP to transmit the Trigger Frame
1328 uint16_t m_ulSpatialReuse; //!< Value for the Spatial Reuse field in HE-SIG-A
1329 std::size_t m_padding; //!< the size in bytes of the Padding field
1330
1331 /**
1332 * List of User Info fields
1333 */
1334 std::list<CtrlTriggerUserInfoField> m_userInfoFields; //!< list of User Info fields
1335};
1336
1337} // namespace ns3
1338
1339#endif /* CTRL_HEADERS_H */
iterator in a Buffer instance
Definition buffer.h:89
Headers for BlockAckRequest.
uint16_t GetStartingSequence() const
Return the starting sequence number.
uint32_t GetSerializedSize() const override
void Serialize(Buffer::Iterator start) const override
uint16_t m_startingSeq
starting seq
bool m_barAckPolicy
The LSB bit of the BAR control field is used only for the HT (High Throughput) delayed block ack conf...
uint16_t m_tidInfo
TID info.
uint8_t GetTidInfo() const
Return the Traffic ID (TID).
bool IsExtendedCompressed() const
Check if the current Ack Policy is Extended Compressed Block Ack.
void Print(std::ostream &os) const override
void SetType(BlockAckReqType type)
Set the BlockAckRequest type.
BlockAckReqType m_barType
BAR type.
void SetStartingSequenceControl(uint16_t seqControl)
Set the starting sequence control with the given sequence control value.
bool IsMultiTid() const
Check if the current Ack Policy has Multi-TID Block Ack.
BlockAckReqType GetType() const
Return the BlockAckRequest type.
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate Ack.
uint32_t Deserialize(Buffer::Iterator start) override
bool IsCompressed() const
Check if the current Ack Policy is Compressed Block Ack and not multi-TID.
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
uint16_t GetBarControl() const
Return the Block Ack control.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint16_t GetStartingSequenceControl() const
Return the starting sequence control.
void SetBarControl(uint16_t bar)
Set the Block Ack control.
bool MustSendHtImmediateAck() const
Check if the current Ack Policy is immediate.
bool IsBasic() const
Check if the current Ack Policy is Basic Block Ack (i.e.
Headers for BlockAck response.
void SetBaControl(uint16_t ba)
Set the Block Ack control.
bool IsExtendedCompressed() const
Check if the current BA policy is Extended Compressed Block Ack.
void SetStartingSequence(uint16_t seq, std::size_t index=0)
For Block Ack variants other than Multi-STA Block Ack, set the starting sequence number to the given ...
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t GetStartingSequenceControl(std::size_t index=0) const
Return the value of the Starting Sequence Control subfield.
BlockAckType m_baType
BA type.
bool IsFragmentReceived(uint16_t seq, uint8_t frag) const
Check if the packet with the given sequence number and fragment number was acknowledged in this Block...
void Serialize(Buffer::Iterator start) const override
bool IsPacketReceived(uint16_t seq, std::size_t index=0) const
Check if the packet with the given sequence number was acknowledged in this BlockAck response.
void SetStartingSequenceControl(uint16_t seqControl, std::size_t index=0)
Set the Starting Sequence Control subfield with the given sequence control value.
std::vector< uint32_t > FindPerAidTidInfoWithAid(uint16_t aid) const
For Multi-STA Block Acks, get the indices of the Per AID TID Info subfields carrying the given AID in...
Buffer::Iterator SerializeBitmap(Buffer::Iterator start, std::size_t index=0) const
Serialize bitmap to the given buffer.
std::size_t GetNPerAidTidInfoSubfields() const
For Multi-STA Block Acks, get the number of Per AID TID Info subfields included in this Block Ack.
uint16_t GetStartingSequence(std::size_t index=0) const
For Block Ack variants other than Multi-STA Block Ack, get the starting sequence number.
Mac48Address GetUnassociatedStaAddress(std::size_t index) const
For Multi-STA Block Acks, get the RA subfield of the Per AID TID Info subfield (with AID11 subfield e...
uint8_t GetTidInfo(std::size_t index=0) const
For Block Ack variants other than Multi-STA Block Ack, get the TID_INFO subfield of the BA Control fi...
bool IsBasic() const
Check if the current BA policy is Basic Block Ack.
const std::vector< uint8_t > & GetBitmap(std::size_t index=0) const
Return a const reference to the bitmap from the BlockAck response header.
bool m_baAckPolicy
The LSB bit of the BA control field is used only for the HT (High Throughput) delayed block ack confi...
bool IsCompressed() const
Check if the current BA policy is Compressed Block Ack.
void SetUnassociatedStaAddress(const Mac48Address &ra, std::size_t index)
For Multi-STA Block Acks, set the RA subfield of the Per AID TID Info subfield (with AID11 subfield e...
bool MustSendHtImmediateAck() const
Check if the current Ack Policy is immediate.
Buffer::Iterator DeserializeBitmap(Buffer::Iterator start, std::size_t index=0)
Deserialize bitmap from the given buffer.
void ResetBitmap(std::size_t index=0)
Reset the bitmap to 0.
void SetAckType(bool type, std::size_t index)
For Multi-STA Block Acks, set the Ack Type subfield of the Per AID TID Info subfield identified by th...
void SetTidInfo(uint8_t tid, std::size_t index=0)
For Block Ack variants other than Multi-STA Block Ack, set the TID_INFO subfield of the BA Control fi...
uint16_t m_tidInfo
TID info (reserved if Multi-STA Block Ack)
void Print(std::ostream &os) const override
void SetType(BlockAckType type)
Set the block ack type.
uint32_t GetSerializedSize() const override
uint16_t GetBaControl() const
Return the Block Ack control.
BlockAckType GetType() const
Return the block ack type ID.
void SetReceivedFragment(uint16_t seq, uint8_t frag)
Set the bitmap that the packet with the given sequence number and fragment number was received.
static TypeId GetTypeId()
Get the type ID.
void SetReceivedPacket(uint16_t seq, std::size_t index=0)
Record in the bitmap that the packet with the given sequence number was received.
bool IsMultiTid() const
Check if the current BA policy is Multi-TID Block Ack.
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate Ack.
std::vector< BaInfoInstance > m_baInfo
BA Information field.
void SetAid11(uint16_t aid, std::size_t index)
For Multi-STA Block Acks, set the AID11 subfield of the Per AID TID Info subfield identified by the g...
bool GetAckType(std::size_t index) const
For Multi-STA Block Acks, get the Ack Type subfield of the Per AID TID Info subfield identified by th...
uint16_t GetAid11(std::size_t index) const
For Multi-STA Block Acks, get the AID11 subfield of the Per AID TID Info subfield identified by the g...
bool IsMultiSta() const
Check if the BlockAck frame variant is Multi-STA Block Ack.
bool IsInBitmap(uint16_t seq, std::size_t index=0) const
Check if sequence number seq can be acknowledged in the bitmap.
uint16_t IndexInBitmap(uint16_t seq, std::size_t index=0) const
This function is used to correctly index in both bitmap and compressed bitmap, one bit or one block o...
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Headers for Trigger frames.
std::size_t GetPaddingSize() const
CtrlTriggerUserInfoField & AddUserInfoField()
Append a new User Info field to this Trigger frame and return a non-const reference to it.
uint32_t GetSerializedSize() const override
bool IsBasic() const
Check if this is a Basic Trigger frame.
ConstIterator FindUserInfoWithRaRuAssociated() const
Get a const iterator pointing to the first User Info field found which allocates a Random Access RU f...
void Print(std::ostream &os) const override
bool IsNfrp() const
Check if this is a NDP Feedback Report Poll Trigger frame.
void SetApTxPower(int8_t power)
Set the AP TX Power subfield of the Common Info field.
ConstIterator end() const
Get a const iterator indicating past-the-last User Info field in the list.
uint16_t GetUlSpatialReuse() const
Get the UL Spatial Reuse subfield of the Common Info field.
std::size_t m_padding
the size in bytes of the Padding field
uint8_t m_giAndLtfType
GI And LTF Type subfield.
WifiTxVector GetHeTbTxVector(uint16_t staId) const
Get the TX vector that the station with the given STA-ID will use to send the HE TB PPDU solicited by...
bool IsMuRts() const
Check if this is a MU-RTS Trigger frame.
TriggerFrameType m_triggerType
Trigger type.
void SetPaddingSize(std::size_t size)
Set the size in bytes of the Padding field.
uint32_t Deserialize(Buffer::Iterator start) override
bool IsBsrp() const
Check if this is a Buffer Status Report Poll Trigger frame.
TriggerFrameType GetType() const
Get the Trigger Frame type.
bool IsMuBar() const
Check if this is a MU-BAR Trigger frame.
ConstIterator FindUserInfoWithRaRuUnassociated() const
Get a const iterator pointing to the first User Info field found which allocates a Random Access RU f...
bool IsBfrp() const
Check if this is a Beamforming Report Poll Trigger frame.
ConstIterator begin() const
Get a const iterator pointing to the first User Info field in the list.
std::size_t GetNUserInfoFields() const
Get the number of User Info fields in this Trigger Frame.
uint8_t GetLtfType() const
Get the LTF type of the solicited HE TB PPDU.
bool GetMoreTF() const
Get the More TF subfield of the Common Info field.
std::list< CtrlTriggerUserInfoField >::const_iterator ConstIterator
User Info fields list const iterator.
bool IsBqrp() const
Check if this is a Bandwidth Query Report Poll Trigger frame.
static TypeId GetTypeId()
Get the type ID.
bool IsValid() const
Check the validity of this Trigger frame.
void SetType(TriggerFrameType type)
Set the Trigger frame type.
ConstIterator FindUserInfoWithAid(ConstIterator start, uint16_t aid12) const
Get a const iterator pointing to the first User Info field found (starting from the one pointed to by...
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetCsRequired(bool cs)
Set the CS Required subfield of the Common Info field.
const char * GetTypeString() const
Return a string corresponding to the Trigger Frame type.
uint16_t GetUlLength() const
Get the UL Length subfield of the Common Info field.
TriggerFrameVariant m_variant
Common Info field.
uint16_t m_ulLength
Value for the L-SIG Length field.
bool m_csRequired
Carrier Sense required.
MHz_u GetUlBandwidth() const
Get the bandwidth of the solicited HE TB PPDU.
TriggerFrameVariant GetVariant() const
Get the Common Info field variant.
CtrlTriggerHeader GetCommonInfoField() const
Get a copy of the Common Info field of this Trigger frame.
Time GetGuardInterval() const
Get the guard interval duration of the solicited HE TB PPDU.
std::list< CtrlTriggerUserInfoField > m_userInfoFields
List of User Info fields.
bool m_moreTF
True if a subsequent Trigger frame follows.
void SetVariant(TriggerFrameVariant variant)
Set the Common Info field variant.
void SetUlSpatialReuse(uint16_t sr)
Set the UL Spatial Reuse subfield of the Common Info field.
uint8_t m_ulBandwidth
UL BW subfield.
bool GetCsRequired() const
Get the CS Required subfield of the Common Info field.
bool IsGcrMuBar() const
Check if this is a Groupcast with Retries (GCR) MU-BAR Trigger frame.
std::list< CtrlTriggerUserInfoField >::iterator Iterator
User Info fields list iterator.
void SetGiAndLtfType(Time guardInterval, uint8_t ltfType)
Set the GI And LTF Type subfield of the Common Info field.
void SetUlLength(uint16_t len)
Set the UL Length subfield of the Common Info field.
void Serialize(Buffer::Iterator start) const override
int8_t GetApTxPower() const
Get the power value (dBm) indicated by the AP TX Power subfield of the Common Info field.
uint8_t m_apTxPower
Tx Power used by AP to transmit the Trigger Frame.
CtrlTriggerHeader & operator=(const CtrlTriggerHeader &trigger)
Copy assignment operator.
uint16_t m_ulSpatialReuse
Value for the Spatial Reuse field in HE-SIG-A.
void SetMoreTF(bool more)
Set the More TF subfield of the Common Info field.
void SetUlBandwidth(MHz_u bw)
Set the bandwidth of the solicited HE TB PPDU.
User Info field of Trigger frames.
bool GetUlFecCodingType() const
Get the UL FEC Coding Type subfield, which indicates whether BCC or LDPC is used.
bool GetUlDcm() const
Get the UL DCM subfield, which indicates whether or not DCM is used This method can only be used with...
struct ns3::CtrlTriggerUserInfoField::@69::@71 raRuInformation
Used when AID12 is 0 or 2045.
AcIndex GetPreferredAc() const
Get the Preferred AC subfield.
uint8_t GetMpduMuSpacingFactor() const
Get the MPDU MU spacing factor.
int8_t GetUlTargetRssi() const
Get the expected receive signal power for the solicited HE TB PPDU.
uint8_t startingSs
Starting spatial stream.
TriggerFrameType m_triggerType
Trigger frame type.
uint8_t GetUlMcs() const
Get the UL MCS subfield, which indicates the MCS of the solicited HE TB PPDU.
WifiPreamble GetPreambleType() const
uint32_t GetSerializedSize() const
Get the expected size of this User Info field.
void SetMuRtsRuAllocation(uint8_t value)
Set the RU Allocation subfield based on the given value for the B7-B1 bits.
CtrlTriggerUserInfoField(TriggerFrameType triggerType, TriggerFrameVariant variant)
Constructor.
void Print(std::ostream &os) const
Print the content of this User Info field.
uint8_t nRaRu
Number of Random Access RUs.
union ns3::CtrlTriggerUserInfoField::@69 m_bits26To31
Fields occupying bits 26-31 in the User Info field.
void SetAid12(uint16_t aid)
Set the AID12 subfield, which carries the 12 LSBs of the AID of the station for which this User Info ...
struct ns3::CtrlTriggerUserInfoField::@69::@70 ssAllocation
Used when AID12 is neither 0 nor 2045.
bool m_ps160
identifies the location of the RU (EHT variant only)
const CtrlBAckRequestHeader & GetMuBarTriggerDepUserInfo() const
Get the Trigger Dependent User Info subfield for the MU-BAR variant of Trigger frames,...
void SetUlFecCodingType(bool ldpc)
Set the UL FEC Coding Type subfield, which indicates whether BCC or LDPC is used.
bool HasRaRuForUnassociatedSta() const
Check if this User Info field allocates a Random Access RU for stations not associated with the AP th...
void SetUlTargetRssiMaxTxPower()
Set the UL Target RSSI subfield to indicate to the station to transmit an HE TB PPDU response at its ...
void SetUlMcs(uint8_t mcs)
Set the UL MCS subfield, which indicates the MCS of the solicited HE TB PPDU.
void SetMuBarTriggerDepUserInfo(const CtrlBAckRequestHeader &bar)
Set the Trigger Dependent User Info subfield for the MU-BAR variant of Trigger frames,...
void SetUlDcm(bool dcm)
Set the UL DCM subfield, which indicates whether or not DCM is used.
void SetSsAllocation(uint8_t startingSs, uint8_t nSs)
Set the SS Allocation subfield, which is present when the AID12 subfield is neither 0 nor 2045.
uint16_t m_aid12
Association ID of the addressed station.
uint8_t nSs
Number of spatial streams.
uint8_t m_basicTriggerDependentUserInfo
Basic Trigger variant of Trigger Dependent User Info subfield.
TriggerFrameVariant m_variant
User Info field variant.
uint8_t GetTidAggregationLimit() const
Get the TID Aggregation Limit.
uint8_t m_ulMcs
MCS to be used by the addressed station.
TriggerFrameType GetType() const
Get the type of the Trigger Frame this User Info field belongs to.
uint8_t m_ruAllocation
RU Allocation.
HeRu::RuSpec GetRuAllocation() const
Get the RU specified by the RU Allocation subfield.
uint8_t GetNss() const
Get the number of spatial streams.
bool HasRaRuForAssociatedSta() const
Check if this User Info field allocates a Random Access RU for stations associated with the AP that t...
uint8_t GetMuRtsRuAllocation() const
This method can only be called on MU-RTS Trigger Frames.
uint16_t GetAid12() const
Get the value of the AID12 subfield.
Buffer::Iterator Serialize(Buffer::Iterator start) const
Serialize the User Info field to the given buffer.
uint8_t GetNRaRus() const
Get the number of contiguous RUs for Random Access.
bool m_ulDcm
whether or not to use Dual Carrier Modulation (HE variant only)
void SetUlTargetRssi(int8_t dBm)
Set the UL Target RSSI subfield to indicate the expected receive signal power in dBm.
uint8_t GetStartingSs() const
Get the starting spatial stream.
CtrlTriggerUserInfoField & operator=(const CtrlTriggerUserInfoField &userInfo)
Copy assignment operator.
uint8_t m_ulTargetRssi
Expected receive signal power.
void SetRaRuInformation(uint8_t nRaRu, bool moreRaRu)
Set the RA-RU Information subfield, which is present when the AID12 subfield is 0 or 2045.
Buffer::Iterator Deserialize(Buffer::Iterator start)
Deserialize the User Info field from the given buffer.
bool IsUlTargetRssiMaxTxPower() const
Return true if the UL Target RSSI subfield indicates to the station to transmit an HE TB PPDU respons...
void SetRuAllocation(HeRu::RuSpec ru)
Set the RU Allocation subfield according to the specified RU.
void SetBasicTriggerDepUserInfo(uint8_t spacingFactor, uint8_t tidLimit, AcIndex prefAc)
Set the Trigger Dependent User Info subfield for Basic Trigger frames.
bool moreRaRu
More RA-RU in subsequent Trigger frames.
bool m_ulFecCodingType
UL FEC Coding Type.
CtrlBAckRequestHeader m_muBarTriggerDependentUserInfo
MU-BAR variant of Trigger Dependent User Info subfield.
bool GetMoreRaRu() const
Return true if more RA-RUs are allocated in subsequent Trigger frames that are sent before the end of...
RU Specification.
Definition he-ru.h:57
Protocol header serialization and deserialization.
Definition header.h:33
an EUI-48 address
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
TriggerFrameVariant
The different variants for Common Info field and User Info field of Trigger Frames.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition qos-utils.h:62
TriggerFrameType
The different Trigger frame types.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The different BlockAckRequest variants.
The different BlockAck variants.
The following structure can hold the BA Information field for the Basic and Compressed variants,...
Mac48Address m_ra
RA subfield (address of an unassociated station) for Multi-STA; reserved for other variants.
uint16_t m_startingSeq
Block Ack Starting Sequence Control subfield.
std::vector< uint8_t > m_bitmap
block ack bitmap
uint16_t m_aidTidInfo
Reserved for Basic and Compressed Per TID Info subfield for Multi-TID AID TID Info subfield for Multi...
Declaration of the following enums: