A Discrete-Event Network Simulator
API
wifi-phy-header.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 Sébastien Deronne
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19  */
20 
21 #include "wifi-phy-header.h"
22 
23 namespace ns3 {
24 
25 NS_OBJECT_ENSURE_REGISTERED (DsssSigHeader);
26 
28  : m_rate (0b00001010),
29  m_length (0)
30 {
31 }
32 
34 {
35 }
36 
37 TypeId
39 {
40  static TypeId tid = TypeId ("ns3::DsssSigHeader")
41  .SetParent<Header> ()
42  .SetGroupName ("Wifi")
43  .AddConstructor<DsssSigHeader> ()
44  ;
45  return tid;
46 }
47 
48 TypeId
50 {
51  return GetTypeId ();
52 }
53 
54 void
55 DsssSigHeader::Print (std::ostream &os) const
56 {
57  os << "SIGNAL=" << GetRate ()
58  << " LENGTH=" << m_length;
59 }
60 
61 uint32_t
63 {
64  return 6;
65 }
66 
67 void
68 DsssSigHeader::SetRate (uint64_t rate)
69 {
70  /* Here is the binary representation for a given rate:
71  * 1 Mbit/s: 00001010
72  * 2 Mbit/s: 00010100
73  * 5.5 Mbit/s: 00110111
74  * 11 Mbit/s: 01101110
75  */
76  switch (rate)
77  {
78  case 1000000:
79  m_rate = 0b00001010;
80  break;
81  case 2000000:
82  m_rate = 0b00010100;
83  break;
84  case 5500000:
85  m_rate = 0b00110111;
86  break;
87  case 11000000:
88  m_rate = 0b01101110;
89  break;
90  default:
91  NS_ASSERT_MSG (false, "Invalid rate");
92  break;
93  }
94 }
95 
96 uint64_t
98 {
99  uint64_t rate = 0;
100  switch (m_rate)
101  {
102  case 0b00001010:
103  rate = 1000000;
104  break;
105  case 0b00010100:
106  rate = 2000000;
107  break;
108  case 0b00110111:
109  rate = 5500000;
110  break;
111  case 0b01101110:
112  rate = 11000000;
113  break;
114  default:
115  NS_ASSERT_MSG (false, "Invalid rate");
116  break;
117  }
118  return rate;
119 }
120 
121 void
122 DsssSigHeader::SetLength (uint16_t length)
123 {
124  m_length = length;
125 }
126 
127 uint16_t
129 {
130  return m_length;
131 }
132 
133 void
135 {
136  start.WriteU8 (m_rate);
137  start.WriteU8 (0); /* SERVICE */
138  start.WriteU16 (m_length);
139  start.WriteU16 (0); /* CRC */
140 }
141 
142 uint32_t
144 {
146  m_rate = i.ReadU8 ();
147  i.ReadU8 (); /* SERVICE */
148  m_length = i.ReadU16 ();
149  i.ReadU16 (); /* CRC */
150  return i.GetDistanceFrom (start);
151 }
152 
154 
156  : m_rate (0b1101),
157  m_length (0)
158 {
159 }
160 
162 {
163 }
164 
165 TypeId
167 {
168  static TypeId tid = TypeId ("ns3::LSigHeader")
169  .SetParent<Header> ()
170  .SetGroupName ("Wifi")
171  .AddConstructor<LSigHeader> ()
172  ;
173  return tid;
174 }
175 
176 TypeId
178 {
179  return GetTypeId ();
180 }
181 
182 void
183 LSigHeader::Print (std::ostream &os) const
184 {
185  os << "SIGNAL=" << GetRate ()
186  << " LENGTH=" << m_length;
187 }
188 
189 uint32_t
191 {
192  return 3;
193 }
194 
195 void
196 LSigHeader::SetRate (uint64_t rate, uint16_t channelWidth)
197 {
198  if (channelWidth == 5)
199  {
200  rate *= 4; //corresponding 20 MHz rate if 5 MHz is used
201  }
202  else if (channelWidth == 10)
203  {
204  rate *= 2; //corresponding 20 MHz rate if 10 MHz is used
205  }
206  /* Here is the binary representation for a given rate:
207  * 6 Mbit/s: 1101
208  * 9 Mbit/s: 1111
209  * 12 Mbit/s: 0101
210  * 18 Mbit/s: 0111
211  * 24 Mbit/s: 1001
212  * 36 Mbit/s: 1011
213  * 48 Mbit/s: 0001
214  * 54 Mbit/s: 0011
215  */
216  switch (rate)
217  {
218  case 6000000:
219  m_rate = 0b1101;
220  break;
221  case 9000000:
222  m_rate = 0b1111;
223  break;
224  case 12000000:
225  m_rate = 0b0101;
226  break;
227  case 18000000:
228  m_rate = 0b0111;
229  break;
230  case 24000000:
231  m_rate = 0b1001;
232  break;
233  case 36000000:
234  m_rate = 0b1011;
235  break;
236  case 48000000:
237  m_rate = 0b0001;
238  break;
239  case 54000000:
240  m_rate = 0b0011;
241  break;
242  default:
243  NS_ASSERT_MSG (false, "Invalid rate");
244  break;
245  }
246 }
247 
248 uint64_t
249 LSigHeader::GetRate (uint16_t channelWidth) const
250 {
251  uint64_t rate = 0;
252  switch (m_rate)
253  {
254  case 0b1101:
255  rate = 6000000;
256  break;
257  case 0b1111:
258  rate = 9000000;
259  break;
260  case 0b0101:
261  rate = 12000000;
262  break;
263  case 0b0111:
264  rate = 18000000;
265  break;
266  case 0b1001:
267  rate = 24000000;
268  break;
269  case 0b1011:
270  rate = 36000000;
271  break;
272  case 0b0001:
273  rate = 48000000;
274  break;
275  case 0b0011:
276  rate = 54000000;
277  break;
278  default:
279  NS_ASSERT_MSG (false, "Invalid rate");
280  break;
281  }
282  if (channelWidth == 5)
283  {
284  rate /= 4; //compute corresponding 5 MHz rate
285  }
286  else if (channelWidth == 10)
287  {
288  rate /= 2; //compute corresponding 10 MHz rate
289  }
290  return rate;
291 }
292 
293 void
294 LSigHeader::SetLength (uint16_t length)
295 {
296  NS_ASSERT_MSG (length < 4096, "Invalid length");
297  m_length = length;
298 }
299 
300 uint16_t
302 {
303  return m_length;
304 }
305 
306 void
308 {
309  uint8_t byte = 0;
310  uint16_t bytes = 0;
311 
312  byte |= m_rate;
313  byte |= (m_length & 0x07) << 5;
314  start.WriteU8 (byte);
315 
316  bytes |= (m_length & 0x0ff8) >> 3;
317  start.WriteU16 (bytes);
318 }
319 
320 uint32_t
322 {
324 
325  uint8_t byte = i.ReadU8 ();
326  m_rate = byte & 0x0f;
327  m_length = (byte >> 5) & 0x07;
328 
329  uint16_t bytes = i.ReadU16 ();
330  m_length |= (bytes << 3) & 0x0ff8;
331 
332  return i.GetDistanceFrom (start);
333 }
334 
336 
338  : m_mcs (0),
339  m_cbw20_40 (0),
340  m_htLength (0),
341  m_aggregation (0),
342  m_sgi (0)
343 {
344 }
345 
347 {
348 }
349 
350 TypeId
352 {
353  static TypeId tid = TypeId ("ns3::HtSigHeader")
354  .SetParent<Header> ()
355  .SetGroupName ("Wifi")
356  .AddConstructor<HtSigHeader> ()
357  ;
358  return tid;
359 }
360 
361 TypeId
363 {
364  return GetTypeId ();
365 }
366 
367 void
368 HtSigHeader::Print (std::ostream &os) const
369 {
370  os << "MCS=" << +m_mcs
371  << " HT_LENGTH=" << m_htLength
372  << " CHANNEL_WIDTH=" << GetChannelWidth ()
373  << " SGI=" << +m_sgi
374  << " AGGREGATION=" << +m_aggregation;
375 }
376 
377 uint32_t
379 {
380  return 6;
381 }
382 
383 void
384 HtSigHeader::SetMcs (uint8_t mcs)
385 {
386  NS_ASSERT (mcs <= 31);
387  m_mcs = mcs;
388 }
389 
390 uint8_t
392 {
393  return m_mcs;
394 }
395 
396 void
397 HtSigHeader::SetChannelWidth (uint16_t channelWidth)
398 {
399  m_cbw20_40 = (channelWidth > 20) ? 1 : 0;
400 }
401 
402 uint16_t
404 {
405  return m_cbw20_40 ? 40 : 20;
406 }
407 
408 void
409 HtSigHeader::SetHtLength (uint16_t length)
410 {
411  m_htLength = length;
412 }
413 
414 uint16_t
416 {
417  return m_htLength;
418 }
419 
420 void
421 HtSigHeader::SetAggregation (bool aggregation)
422 {
423  m_aggregation = aggregation ? 1 : 0;
424 }
425 
426 bool
428 {
429  return m_aggregation ? true : false;
430 }
431 
432 void
434 {
435  m_sgi = sgi ? 1 : 0;
436 }
437 
438 bool
440 {
441  return m_sgi ? true : false;
442 }
443 
444 void
446 {
447  uint8_t byte = m_mcs;
448  byte |= ((m_cbw20_40 & 0x01) << 7);
449  start.WriteU8 (byte);
450  start.WriteU16 (m_htLength);
451  byte = (0x01 << 2); //Set Reserved bit #2 to 1
452  byte |= ((m_aggregation & 0x01) << 3);
453  byte |= ((m_sgi & 0x01) << 7);
454  start.WriteU8 (byte);
455  start.WriteU16 (0);
456 }
457 
458 uint32_t
460 {
462  uint8_t byte = i.ReadU8 ();
463  m_mcs = byte & 0x7f;
464  m_cbw20_40 = ((byte >> 7) & 0x01);
465  m_htLength = i.ReadU16 ();
466  byte = i.ReadU8 ();
467  m_aggregation = ((byte >> 3) & 0x01);
468  m_sgi = ((byte >> 7) & 0x01);
469  i.ReadU16 ();
470  return i.GetDistanceFrom (start);
471 }
472 
474 
476  : m_bw (0),
477  m_nsts (0),
478  m_sgi (0),
479  m_sgi_disambiguation (0),
480  m_suMcs (0),
481  m_mu (false)
482 {
483 }
484 
486 {
487 }
488 
489 TypeId
491 {
492  static TypeId tid = TypeId ("ns3::VhtSigHeader")
493  .SetParent<Header> ()
494  .SetGroupName ("Wifi")
495  .AddConstructor<VhtSigHeader> ()
496  ;
497  return tid;
498 }
499 
500 TypeId
502 {
503  return GetTypeId ();
504 }
505 
506 void
507 VhtSigHeader::Print (std::ostream &os) const
508 {
509  os << "SU_MCS=" << +m_suMcs
510  << " CHANNEL_WIDTH=" << GetChannelWidth ()
511  << " SGI=" << +m_sgi
512  << " NSTS=" << +m_nsts
513  << " MU=" << +m_mu;
514 }
515 
516 uint32_t
518 {
519  uint32_t size = 0;
520  size += 3; //VHT-SIG-A1
521  size += 3; //VHT-SIG-A2
522  if (m_mu)
523  {
524  size += 4; //VHT-SIG-B
525  }
526  return size;
527 }
528 
529 void
531 {
532  m_mu = mu;
533 }
534 
535 void
536 VhtSigHeader::SetChannelWidth (uint16_t channelWidth)
537 {
538  if (channelWidth == 160)
539  {
540  m_bw = 3;
541  }
542  else if (channelWidth == 80)
543  {
544  m_bw = 2;
545  }
546  else if (channelWidth == 40)
547  {
548  m_bw = 1;
549  }
550  else
551  {
552  m_bw = 0;
553  }
554 }
555 
556 uint16_t
558 {
559  if (m_bw == 3)
560  {
561  return 160;
562  }
563  else if (m_bw == 2)
564  {
565  return 80;
566  }
567  else if (m_bw == 1)
568  {
569  return 40;
570  }
571  else
572  {
573  return 20;
574  }
575 }
576 
577 void
578 VhtSigHeader::SetNStreams (uint8_t nStreams)
579 {
580  NS_ASSERT (nStreams <= 8);
581  m_nsts = (nStreams - 1);
582 }
583 
584 uint8_t
586 {
587  return (m_nsts + 1);
588 }
589 
590 void
592 {
593  m_sgi = sgi ? 1 : 0;
594 }
595 
596 bool
598 {
599  return m_sgi ? true : false;
600 }
601 
602 void
604 {
605  m_sgi_disambiguation = disambiguation ? 1 : 0;
606 }
607 
608 bool
610 {
611  return m_sgi_disambiguation ? true : false;
612 }
613 
614 void
616 {
617  NS_ASSERT (mcs <= 9);
618  m_suMcs = mcs;
619 }
620 
621 uint8_t
623 {
624  return m_suMcs;
625 }
626 
627 void
629 {
630  //VHT-SIG-A1
631  uint8_t byte = m_bw;
632  byte |= (0x01 << 2); //Set Reserved bit #2 to 1
633  start.WriteU8 (byte);
634  uint16_t bytes = (m_nsts & 0x07) << 2;
635  bytes |= (0x01 << (23 - 8)); //Set Reserved bit #23 to 1
636  start.WriteU16 (bytes);
637 
638  //VHT-SIG-A2
639  byte = m_sgi & 0x01;
640  byte |= ((m_sgi_disambiguation & 0x01) << 1);
641  byte |= ((m_suMcs & 0x0f) << 4);
642  start.WriteU8 (byte);
643  bytes = (0x01 << (9 - 8)); //Set Reserved bit #9 to 1
644  start.WriteU16 (bytes);
645 
646  if (m_mu)
647  {
648  //VHT-SIG-B
649  start.WriteU32 (0);
650  }
651 }
652 
653 uint32_t
655 {
657 
658  //VHT-SIG-A1
659  uint8_t byte = i.ReadU8 ();
660  m_bw = byte & 0x03;
661  uint16_t bytes = i.ReadU16 ();
662  m_nsts = ((bytes >> 2) & 0x07);
663 
664  //VHT-SIG-A2
665  byte = i.ReadU8 ();
666  m_sgi = byte & 0x01;
667  m_sgi_disambiguation = ((byte >> 1) & 0x01);
668  m_suMcs = ((byte >> 4) & 0x0f);
669  i.ReadU16 ();
670 
671  if (m_mu)
672  {
673  //VHT-SIG-B
674  i.ReadU32 ();
675  }
676 
677  return i.GetDistanceFrom (start);
678 }
679 
680 
682 
684  : m_format (1),
685  m_bssColor (0),
686  m_ul_dl (0),
687  m_mcs (0),
688  m_spatialReuse (0),
689  m_bandwidth (0),
690  m_gi_ltf_size (0),
691  m_nsts (0),
692  m_mu (false)
693 {
694 }
695 
697 {
698 }
699 
700 TypeId
702 {
703  static TypeId tid = TypeId ("ns3::HeSigHeader")
704  .SetParent<Header> ()
705  .SetGroupName ("Wifi")
706  .AddConstructor<HeSigHeader> ()
707  ;
708  return tid;
709 }
710 
711 TypeId
713 {
714  return GetTypeId ();
715 }
716 
717 void
718 HeSigHeader::Print (std::ostream &os) const
719 {
720  os << "MCS=" << +m_mcs
721  << " CHANNEL_WIDTH=" << GetChannelWidth ()
722  << " GI=" << GetGuardInterval ()
723  << " NSTS=" << +m_nsts
724  << " BSSColor=" << +m_bssColor
725  << " MU=" << +m_mu;
726 }
727 
728 uint32_t
730 {
731  uint32_t size = 0;
732  size += 4; //HE-SIG-A1
733  size += 4; //HE-SIG-A2
734  if (m_mu)
735  {
736  size += 1; //HE-SIG-B
737  }
738  return size;
739 }
740 
741 void
743 {
744  m_mu = mu;
745 }
746 
747 void
748 HeSigHeader::SetMcs (uint8_t mcs)
749 {
750  NS_ASSERT (mcs <= 11);
751  m_mcs = mcs;
752 }
753 
754 uint8_t
756 {
757  return m_mcs;
758 }
759 
760 void
761 HeSigHeader::SetBssColor (uint8_t bssColor)
762 {
763  NS_ASSERT (bssColor < 64);
764  m_bssColor = bssColor;
765 }
766 
767 uint8_t
769 {
770  return m_bssColor;
771 }
772 
773 void
774 HeSigHeader::SetChannelWidth (uint16_t channelWidth)
775 {
776  if (channelWidth == 160)
777  {
778  m_bandwidth = 3;
779  }
780  else if (channelWidth == 80)
781  {
782  m_bandwidth = 2;
783  }
784  else if (channelWidth == 40)
785  {
786  m_bandwidth = 1;
787  }
788  else
789  {
790  m_bandwidth = 0;
791  }
792 }
793 
794 uint16_t
796 {
797  if (m_bandwidth == 3)
798  {
799  return 160;
800  }
801  else if (m_bandwidth == 2)
802  {
803  return 80;
804  }
805  else if (m_bandwidth == 1)
806  {
807  return 40;
808  }
809  else
810  {
811  return 20;
812  }
813 }
814 
815 void
816 HeSigHeader::SetGuardIntervalAndLtfSize (uint16_t gi, uint8_t ltf)
817 {
818  if (gi == 800 && ltf == 1)
819  {
820  m_gi_ltf_size = 0;
821  }
822  else if (gi == 800 && ltf == 2)
823  {
824  m_gi_ltf_size = 1;
825  }
826  else if (gi == 1600 && ltf == 2)
827  {
828  m_gi_ltf_size = 2;
829  }
830  else
831  {
832  m_gi_ltf_size = 3;
833  }
834 }
835 
836 uint16_t
838 {
839  if (m_gi_ltf_size == 3)
840  {
841  //we currently do not consider DCM nor STBC fields
842  return 3200;
843  }
844  else if (m_gi_ltf_size == 2)
845  {
846  return 1600;
847  }
848  else
849  {
850  return 800;
851  }
852 }
853 
854 void
855 HeSigHeader::SetNStreams (uint8_t nStreams)
856 {
857  NS_ASSERT (nStreams <= 8);
858  m_nsts = (nStreams - 1);
859 }
860 
861 uint8_t
863 {
864  return (m_nsts + 1);
865 }
866 
867 void
869 {
870  //HE-SIG-A1
871  uint8_t byte = m_format & 0x01;
872  byte |= ((m_ul_dl & 0x01) << 2);
873  byte |= ((m_mcs & 0x0f) << 3);
874  start.WriteU8 (byte);
875  uint16_t bytes = (m_bssColor & 0x3f);
876  bytes |= (0x01 << 6); //Reserved set to 1
877  bytes |= ((m_spatialReuse & 0x0f) << 7);
878  bytes |= ((m_bandwidth & 0x03) << 11);
879  bytes |= ((m_gi_ltf_size & 0x03) << 13);
880  bytes |= ((m_nsts & 0x01) << 15);
881  start.WriteU16 (bytes);
882  start.WriteU8 ((m_nsts >> 1) & 0x03);
883 
884  //HE-SIG-A2
885  uint32_t sigA2 = 0;
886  sigA2 |= (0x01 << 14); //Set Reserved bit #14 to 1
887  start.WriteU32 (sigA2);
888 
889  if (m_mu)
890  {
891  //HE-SIG-B
892  start.WriteU8 (0);
893  }
894 }
895 
896 uint32_t
898 {
900 
901  //HE-SIG-A1
902  uint8_t byte = i.ReadU8 ();
903  m_format = (byte & 0x01);
904  m_ul_dl = ((byte >> 2) & 0x01);
905  m_mcs = ((byte >> 3) & 0x0f);
906  uint16_t bytes = i.ReadU16 ();
907  m_bssColor = (bytes & 0x3f);
908  m_spatialReuse = ((bytes >> 7) & 0x0f);
909  m_bandwidth = ((bytes >> 11) & 0x03);
910  m_gi_ltf_size = ((bytes >> 13) & 0x03);
911  m_nsts = ((bytes >> 15) & 0x01);
912  byte = i.ReadU8 ();
913  m_nsts |= (byte & 0x03) << 1;
914 
915  //HE-SIG-A2
916  i.ReadU32 ();
917 
918  if (m_mu)
919  {
920  //HE-SIG-B
921  i.ReadU8 ();
922  }
923 
924  return i.GetDistanceFrom (start);
925 }
926 
927 } //namespace ns3
uint16_t ReadU16(void)
Definition: buffer.h:1029
Protocol header serialization and deserialization.
Definition: header.h:42
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
void Print(std::ostream &os) const
void Print(std::ostream &os) const
uint8_t m_bandwidth
Bandwidth field.
uint8_t m_sgi
Short Guard Interval.
uint32_t ReadU32(void)
Definition: buffer.cc:972
uint8_t m_spatialReuse
Spatial Reuse field.
uint8_t m_cbw20_40
CBW 20/40.
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
uint16_t m_htLength
HT length.
uint8_t m_format
Format bit.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of VHT-SIG-A1 (in MHz).
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
uint8_t m_ul_dl
UL/DL bit.
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
uint8_t m_mcs
MCS field.
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
def start()
Definition: core.py:1858
static TypeId GetTypeId(void)
Get the type ID.
Implements the IEEE 802.11ac PHY header (VHT-SIG-A1/A2/B).
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
void Print(std::ostream &os) const
void Serialize(Buffer::Iterator start) const
uint8_t m_gi_ltf_size
GI+LTF Size field.
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void SetShortGuardIntervalDisambiguation(bool disambiguation)
Fill the short GI NSYM disambiguation field of VHT-SIG-A2.
void SetRate(uint64_t rate, uint16_t channelWidth=20)
Fill the RATE field of L-SIG (in bit/s).
uint8_t m_nsts
NSTS.
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
void SetRate(uint64_t rate)
Fill the RATE field of L-SIG (in bit/s).
STL namespace.
uint8_t m_nsts
NSTS.
uint32_t Deserialize(Buffer::Iterator start)
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
uint16_t GetLength(void) const
Return the LENGTH field of L-SIG (in bytes).
uint16_t m_length
LENGTH field.
uint32_t Deserialize(Buffer::Iterator start)
iterator in a Buffer instance
Definition: buffer.h:98
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint32_t GetDistanceFrom(Iterator const &o) const
Definition: buffer.cc:783
static TypeId GetTypeId(void)
Get the type ID.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const
uint32_t GetSerializedSize(void) const
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
uint8_t m_rate
RATE field.
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of VHT-SIG-A1.
void Print(std::ostream &os) const
uint32_t GetSerializedSize(void) const
void SetSuMcs(uint8_t mcs)
Fill the SU VHT MCS field of VHT-SIG-A2.
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
uint32_t GetSerializedSize(void) const
bool GetShortGuardInterval(void) const
Return the short guard interval field of HT-SIG.
uint16_t GetLength(void) const
Return the LENGTH field of L-SIG (in bytes).
Implements the IEEE 802.11 OFDM and ERP OFDM L-SIG PHY header.
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
uint8_t GetNStreams(void) const
Return the number of streams.
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
uint8_t GetNStreams(void) const
Return the number of streams.
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
void Serialize(Buffer::Iterator start) const
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
uint16_t m_length
LENGTH field.
uint8_t m_rate
RATE field.
static TypeId GetTypeId(void)
Get the type ID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Print(std::ostream &os) const
uint32_t Deserialize(Buffer::Iterator start)
uint32_t Deserialize(Buffer::Iterator start)
bool GetAggregation(void) const
Return the aggregation field of HT-SIG.
uint8_t m_sgi_disambiguation
Short GI NSYM Disambiguation.
void Serialize(Buffer::Iterator start) const
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
uint8_t m_suMcs
SU VHT MCS.
uint8_t m_sgi
Short GI.
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
uint64_t GetRate(void) const
Return the RATE field of L-SIG (in bit/s).
void Serialize(Buffer::Iterator start) const
Implements the IEEE 802.11n PHY header (HT-SIG1/2).
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
static TypeId GetTypeId(void)
Get the type ID.
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
uint8_t GetSuMcs(void) const
Return the SU VHT MCS field of VHT-SIG-A2.
bool GetShortGuardInterval(void) const
Return the short GI field of VHT-SIG-A2.
Implements the IEEE 802.11ax HE-SIG PHY header (HE-SIG-A1/A2/B)
Implements the IEEE 802.11 DSSS SIG PHY header.
uint16_t GetHtLength(void) const
Return the HT length field of HT-SIG (in bytes).
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint8_t ReadU8(void)
Definition: buffer.h:1021
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of VHT-SIG-A2.
uint32_t Deserialize(Buffer::Iterator start)
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
uint32_t GetSerializedSize(void) const
uint64_t GetRate(uint16_t channelWidth=20) const
Return the RATE field of L-SIG (in bit/s).
uint8_t m_mcs
Modulation and Coding Scheme index.
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
static TypeId GetTypeId(void)
Get the type ID.
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
uint32_t GetSerializedSize(void) const
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
uint8_t m_aggregation
Aggregation.
bool GetShortGuardIntervalDisambiguation(void) const
Return the short GI NSYM disambiguation field of VHT-SIG-A2.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint8_t m_bssColor
BSS color field.