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