A Discrete-Event Network Simulator
API
mac-messages.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008,2009 INRIA, UDcast
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Authors: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19  * <amine.ismail@UDcast.com>
20  */
21 
22 /*
23  *This file does not contain all MAC messages, the rest of MAC messages have
24  *This been categorized as DL and UL messages and are placed in
25  *This dl-mac-messages.h and ul-mac-messages.h files.
26  */
27 
28 #ifndef MANAGEMENT_MESSAGE_TYPE_H
29 #define MANAGEMENT_MESSAGE_TYPE_H
30 
31 #include "ns3/header.h"
32 
33 #include <stdint.h>
34 
35 namespace ns3
36 {
37 
44 {
45  public:
48  {
60  };
61 
68  ManagementMessageType(uint8_t type);
69  ~ManagementMessageType() override;
74  void SetType(uint8_t type);
79  uint8_t GetType() const;
80 
82  std::string GetName() const;
87  static TypeId GetTypeId();
88  TypeId GetInstanceTypeId() const override;
89  void Print(std::ostream& os) const override;
90  uint32_t GetSerializedSize() const override;
91  void Serialize(Buffer::Iterator start) const override;
92  uint32_t Deserialize(Buffer::Iterator start) override;
93 
94  private:
95  uint8_t m_type;
96 };
97 
98 } // namespace ns3
99 
100 #endif /* MANAGEMENT_MESSAGE_TYPE_H */
101 
102 // ---------------------------------------------------------------------
103 
104 #ifndef RNG_RSP_H
105 #define RNG_RSP_H
106 
107 #include "cid.h"
108 #include "service-flow.h"
109 
110 #include "ns3/header.h"
111 #include "ns3/mac48-address.h"
112 
113 #include <stdint.h>
114 
115 namespace ns3
116 {
117 
124 class RngRsp : public Header
125 {
126  public:
127  RngRsp();
128  ~RngRsp() override;
134  void SetTimingAdjust(uint32_t timingAdjust);
142  void SetPowerLevelAdjust(uint8_t powerLevelAdjust);
149  void SetOffsetFreqAdjust(uint32_t offsetFreqAdjust);
154  void SetRangStatus(uint8_t rangStatus);
160  void SetDlFreqOverride(uint32_t dlFreqOverride);
165  void SetUlChnlIdOverride(uint8_t ulChnlIdOverride);
170  void SetDlOperBurstProfile(uint16_t dlOperBurstProfile);
175  void SetMacAddress(Mac48Address macAddress);
176 
181  void SetBasicCid(Cid basicCid);
186  void SetPrimaryCid(Cid primaryCid);
187 
192  void SetAasBdcastPermission(uint8_t aasBdcastPermission);
197  void SetFrameNumber(uint32_t frameNumber);
202  void SetInitRangOppNumber(uint8_t initRangOppNumber);
207  void SetRangSubchnl(uint8_t rangSubchnl);
212  uint32_t GetTimingAdjust() const;
219  uint8_t GetPowerLevelAdjust() const;
225  uint32_t GetOffsetFreqAdjust() const;
229  uint8_t GetRangStatus() const;
234  uint32_t GetDlFreqOverride() const;
238  uint8_t GetUlChnlIdOverride() const;
243  uint16_t GetDlOperBurstProfile() const;
247  Mac48Address GetMacAddress() const;
251  Cid GetBasicCid() const;
255  Cid GetPrimaryCid() const;
259  uint8_t GetAasBdcastPermission() const;
263  uint32_t GetFrameNumber() const;
267  uint8_t GetInitRangOppNumber() const;
271  uint8_t GetRangSubchnl() const;
272 
276  std::string GetName() const;
281  static TypeId GetTypeId();
282  TypeId GetInstanceTypeId() const override;
283  void Print(std::ostream& os) const override;
284  uint32_t GetSerializedSize() const override;
285  void Serialize(Buffer::Iterator start) const override;
286  uint32_t Deserialize(Buffer::Iterator start) override;
287 
288  private:
289  uint8_t m_reserved;
290 
291  // TLV Encoded Information
292 
297  uint32_t m_timingAdjust;
298 
306 
313 
317  uint8_t m_rangStatus;
318 
321 
327 
335 
340 
345  uint32_t m_frameNumber;
346 
352 
357  uint8_t m_rangSubchnl;
358 };
359 
360 } // namespace ns3
361 
362 #endif /* RNG_RSP_H */
363 
364 // ---------------------------------------------------------------------
365 
366 #ifndef DSA_REQ_H
367 #define DSA_REQ_H
368 
369 #include "cid.h"
370 #include "service-flow.h"
371 
372 #include "ns3/buffer.h"
373 #include "ns3/header.h"
374 
375 #include <stdint.h>
376 
377 namespace ns3
378 {
385 class DsaReq : public Header
386 {
387  public:
388  DsaReq();
389  ~DsaReq() override;
395  DsaReq(ServiceFlow sf);
400  void SetTransactionId(uint16_t transactionId);
405  void SetSfid(uint32_t sfid);
410  void SetCid(Cid cid);
415  void SetServiceFlow(ServiceFlow sf);
419  ServiceFlow GetServiceFlow() const;
423  uint16_t GetTransactionId() const;
427  uint32_t GetSfid() const;
431  Cid GetCid() const;
435  std::string GetName() const;
440  static TypeId GetTypeId();
441  TypeId GetInstanceTypeId() const override;
442  void Print(std::ostream& os) const override;
443  uint32_t GetSerializedSize() const override;
444  void Serialize(Buffer::Iterator start) const override;
445  uint32_t Deserialize(Buffer::Iterator start) override;
446 
447  private:
448  uint16_t m_transactionId;
449  // TLV Encoded Information
450  uint32_t m_sfid;
453 };
454 
455 } // namespace ns3
456 
457 #endif /* DSA_REQ_H */
458 
459 // ---------------------------------------------------------------------
460 
461 #ifndef DSA_RSP_H
462 #define DSA_RSP_H
463 
464 #include "cid.h"
465 
466 #include "ns3/buffer.h"
467 #include "ns3/header.h"
468 
469 #include <stdint.h>
470 
471 namespace ns3
472 {
473 
489 class DsaRsp : public Header
490 {
491  public:
492  DsaRsp();
493  ~DsaRsp() override;
494 
499  void SetTransactionId(uint16_t transactionId);
503  uint16_t GetTransactionId() const;
504 
509  void SetConfirmationCode(uint16_t confirmationCode);
513  uint16_t GetConfirmationCode() const;
518  void SetSfid(uint32_t sfid);
522  uint32_t GetSfid() const;
527  void SetCid(Cid cid);
531  Cid GetCid() const;
536  void SetServiceFlow(ServiceFlow sf);
540  ServiceFlow GetServiceFlow() const;
541 
545  std::string GetName() const;
550  static TypeId GetTypeId();
551  TypeId GetInstanceTypeId() const override;
552  void Print(std::ostream& os) const override;
553  uint32_t GetSerializedSize() const override;
554  void Serialize(Buffer::Iterator start) const override;
555  uint32_t Deserialize(Buffer::Iterator start) override;
556 
557  private:
558  uint16_t m_transactionId;
560  // TLV Encoded Information
562  uint32_t m_sfid;
564 };
565 
566 } // namespace ns3
567 
568 #endif /* DSA_RSP_H */
569 
570 // ---------------------------------------------------------------------
571 
572 #ifndef DSA_ACK_H
573 #define DSA_ACK_H
574 
575 #include "ns3/buffer.h"
576 #include "ns3/header.h"
577 
578 #include <stdint.h>
579 
580 namespace ns3
581 {
582 
589 class DsaAck : public Header
590 {
591  public:
592  DsaAck();
593  ~DsaAck() override;
594 
599  void SetTransactionId(uint16_t transactionId);
604  uint16_t GetTransactionId() const;
605 
610  void SetConfirmationCode(uint16_t confirmationCode);
615  uint16_t GetConfirmationCode() const;
616 
621  std::string GetName() const;
626  static TypeId GetTypeId();
627  TypeId GetInstanceTypeId() const override;
628  void Print(std::ostream& os) const override;
629  uint32_t GetSerializedSize() const override;
630  void Serialize(Buffer::Iterator start) const override;
631  uint32_t Deserialize(Buffer::Iterator start) override;
632 
633  private:
634  uint16_t m_transactionId;
636 };
637 
638 } // namespace ns3
639 
640 #endif /* DSA_ACK_H */
641 
642 // ---------------------------------------------------------------------
643 
644 #ifndef RNG_REQ_H
645 #define RNG_REQ_H
646 
647 #include "service-flow.h"
648 
649 #include "ns3/header.h"
650 #include "ns3/mac48-address.h"
651 
652 #include <stdint.h>
653 
654 namespace ns3
655 {
656 
663 class RngReq : public Header
664 {
665  public:
666  RngReq();
667  ~RngReq() override;
668 
673  void SetReqDlBurstProfile(uint8_t reqDlBurstProfile);
678  void SetMacAddress(Mac48Address macAddress);
683  void SetRangingAnomalies(uint8_t rangingAnomalies);
684 
689  uint8_t GetReqDlBurstProfile() const;
694  Mac48Address GetMacAddress() const;
699  uint8_t GetRangingAnomalies() const;
700 
705  std::string GetName() const;
710  static TypeId GetTypeId();
711  TypeId GetInstanceTypeId() const override;
712  void Print(std::ostream& os) const override;
714  void PrintDebug() const;
715  uint32_t GetSerializedSize() const override;
716  void Serialize(Buffer::Iterator start) const override;
717  uint32_t Deserialize(Buffer::Iterator start) override;
718 
719  private:
720  uint8_t m_reserved;
721 
722  // TLV Encoded Information
726 };
727 
728 } // namespace ns3
729 
730 #endif /* RNG_REQ_H */
iterator in a Buffer instance
Definition: buffer.h:100
Cid class.
Definition: cid.h:37
This class implements the DSA-ACK message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:590
void SetConfirmationCode(uint16_t confirmationCode)
Set confirmation code field.
void SetTransactionId(uint16_t transactionId)
Set transaction ID field.
static TypeId GetTypeId()
Get the type ID.
uint16_t m_transactionId
transaction ID
Definition: mac-messages.h:634
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint16_t GetTransactionId() const
Get transaction ID field.
uint16_t GetConfirmationCode() const
Get confirmation code field.
void Print(std::ostream &os) const override
~DsaAck() override
std::string GetName() const
Get name field.
uint8_t m_confirmationCode
confirmation code
Definition: mac-messages.h:635
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:386
Cid GetCid() const
~DsaReq() override
uint32_t GetSfid() const
void SetTransactionId(uint16_t transactionId)
set the transaction ID
ServiceFlow GetServiceFlow() const
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Cid m_cid
CID.
Definition: mac-messages.h:451
std::string GetName() const
void Print(std::ostream &os) const override
uint16_t GetTransactionId() const
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
ServiceFlow m_serviceFlow
service flow
Definition: mac-messages.h:452
void Serialize(Buffer::Iterator start) const override
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
uint32_t m_sfid
SFID.
Definition: mac-messages.h:450
void SetSfid(uint32_t sfid)
set the service flow identifier
void SetCid(Cid cid)
set the connection identifier
uint16_t m_transactionId
transaction ID
Definition: mac-messages.h:448
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:490
void SetConfirmationCode(uint16_t confirmationCode)
set the confirmation code
static TypeId GetTypeId()
Get the type ID.
uint32_t m_sfid
SFID.
Definition: mac-messages.h:562
uint32_t GetSerializedSize() const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
~DsaRsp() override
Cid GetCid() const
ServiceFlow m_serviceFlow
service flow
Definition: mac-messages.h:561
ServiceFlow GetServiceFlow() const
std::string GetName() const
void Serialize(Buffer::Iterator start) const override
void SetSfid(uint32_t sfid)
set the service flow identifier
uint16_t GetTransactionId() const
uint16_t m_transactionId
transaction ID
Definition: mac-messages.h:558
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
uint32_t GetSfid() const
void SetTransactionId(uint16_t transactionId)
set the transaction ID
Cid m_cid
CID.
Definition: mac-messages.h:563
uint16_t GetConfirmationCode() const
uint8_t m_confirmationCode
confirmation code
Definition: mac-messages.h:559
void Print(std::ostream &os) const override
void SetCid(Cid cid)
set the connection identifier
Protocol header serialization and deserialization.
Definition: header.h:44
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
an EUI-48 address
Definition: mac48-address.h:46
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43.
Definition: mac-messages.h:44
static TypeId GetTypeId()
Get the type ID.
Definition: mac-messages.cc:70
MessageType
Message type enumeration.
Definition: mac-messages.h:48
uint32_t GetSerializedSize() const override
Definition: mac-messages.cc:92
void Print(std::ostream &os) const override
Definition: mac-messages.cc:86
std::string GetName() const
Definition: mac-messages.cc:64
void Serialize(Buffer::Iterator start) const override
Definition: mac-messages.cc:98
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mac-messages.cc:80
uint8_t GetType() const
Get type field.
Definition: mac-messages.cc:58
void SetType(uint8_t type)
Set type field.
Definition: mac-messages.cc:52
This class implements the ranging request message described by "IEEE Standard for Local and metropoli...
Definition: mac-messages.h:664
uint8_t m_rangingAnomalies
ranging anomalies
Definition: mac-messages.h:725
~RngReq() override
void SetReqDlBurstProfile(uint8_t reqDlBurstProfile)
Set request DL burst profile field.
void Serialize(Buffer::Iterator start) const override
uint8_t GetReqDlBurstProfile() const
Get request DL burst profile field.
void SetRangingAnomalies(uint8_t rangingAnomalies)
Set ranging anomalies field.
uint8_t m_reserved
changed as per the amendment 802.16e-2005
Definition: mac-messages.h:720
void SetMacAddress(Mac48Address macAddress)
Set MAC address field.
uint32_t GetSerializedSize() const override
uint8_t GetRangingAnomalies() const
Get ranging anomalies field.
std::string GetName() const
Get name field.
uint8_t m_reqDlBurstProfile
request DL burst profile
Definition: mac-messages.h:723
void PrintDebug() const
Print debug function.
void Print(std::ostream &os) const override
Mac48Address GetMacAddress() const
Get MAC address field.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Get the type ID.
Mac48Address m_macAddress
MAC address.
Definition: mac-messages.h:724
This class implements the ranging response message described by "IEEE Standard for Local and metropol...
Definition: mac-messages.h:125
void SetMacAddress(Mac48Address macAddress)
set the MAC address
Mac48Address m_macAddress
MAC address.
Definition: mac-messages.h:336
uint16_t m_dlOperBurstProfile
This parameter is sent in response to the RNG-REQ Requested Downlink Burst Profile parameter.
Definition: mac-messages.h:334
Mac48Address GetMacAddress() const
uint32_t GetTimingAdjust() const
Cid m_primaryCid
primary CID
Definition: mac-messages.h:338
void SetUlChnlIdOverride(uint8_t ulChnlIdOverride)
set the identifier of the uplink channel with which the SS is to redo initial ranging
Cid GetPrimaryCid() const
uint8_t GetRangSubchnl() const
void Print(std::ostream &os) const override
uint32_t GetSerializedSize() const override
uint8_t m_aasBdcastPermission
AAS broadcast permission.
Definition: mac-messages.h:339
uint8_t m_rangStatus
range status.
Definition: mac-messages.h:317
void SetBasicCid(Cid basicCid)
set basic CID.
uint8_t GetPowerLevelAdjust() const
uint32_t m_dlFreqOverride
Center frequency, in kHz, of new downlink channel where the SS should redo initial ranging.
Definition: mac-messages.h:320
uint8_t GetRangStatus() const
uint32_t GetOffsetFreqAdjust() const
void Serialize(Buffer::Iterator start) const override
void SetAasBdcastPermission(uint8_t aasBdcastPermission)
set AAS broadcast permission.
void SetDlOperBurstProfile(uint16_t dlOperBurstProfile)
set the DL oper burst profile
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint16_t GetDlOperBurstProfile() const
void SetPrimaryCid(Cid primaryCid)
set primary CID.
uint8_t m_initRangOppNumber
Initial Ranging opportunity (1–255) in which the associated RNG_REQ message was detected by the BS.
Definition: mac-messages.h:351
uint8_t GetUlChnlIdOverride() const
void SetRangSubchnl(uint8_t rangSubchnl)
set range sub channel.
~RngRsp() override
uint8_t m_rangSubchnl
Used to indicate the OFDM subchannel reference that was used to transmit the initial ranging message ...
Definition: mac-messages.h:357
uint32_t GetDlFreqOverride() const
void SetPowerLevelAdjust(uint8_t powerLevelAdjust)
set the relative change in transmission power level that the SS should make in order that transmissio...
void SetInitRangOppNumber(uint8_t initRangOppNumber)
set initial range opp number.
void SetTimingAdjust(uint32_t timingAdjust)
set the Tx timing offset adjustment (signed 32-bit).
uint8_t m_ulChnlIdOverride
Licensed bands: The identifier of the uplink channel with which the SS is to redo initial ranging (no...
Definition: mac-messages.h:326
uint8_t m_powerLevelAdjust
Specifies the relative change in transmission power level that the SS is to make in order that transm...
Definition: mac-messages.h:305
void SetFrameNumber(uint32_t frameNumber)
set frame number.
Cid GetBasicCid() const
void SetDlFreqOverride(uint32_t dlFreqOverride)
set the Center frequency, in kHz, of new downlink channel where the SS should redo initial ranging.
std::string GetName() const
void SetOffsetFreqAdjust(uint32_t offsetFreqAdjust)
set the relative change in transmission frequency that the SS should take in order to better match th...
uint32_t GetFrameNumber() const
uint8_t m_reserved
changed as per the amendment 802.16e-2005
Definition: mac-messages.h:289
uint32_t m_offsetFreqAdjust
Specifies the relative change in transmission frequency that the SS is to make in order to better mat...
Definition: mac-messages.h:312
Cid m_basicCid
basic CID
Definition: mac-messages.h:337
void SetRangStatus(uint8_t rangStatus)
set the range status.
uint32_t m_timingAdjust
Tx timing offset adjustment (signed 32-bit).
Definition: mac-messages.h:297
uint8_t GetInitRangOppNumber() const
uint32_t m_frameNumber
Frame number where the associated RNG_REQ message was detected by the BS.
Definition: mac-messages.h:345
uint8_t GetAasBdcastPermission() const
static TypeId GetTypeId()
Register this type.
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.