src/wifi/model/ctrl-headers.h
changeset 7139 79dd02ed46ec
parent 6852 8f1a53d3f6ca
child 7141 072fb225b714
equal deleted inserted replaced
7138:90f585e0fcea 7139:79dd02ed46ec
    22 
    22 
    23 #include "ns3/header.h"
    23 #include "ns3/header.h"
    24 
    24 
    25 namespace ns3 {
    25 namespace ns3 {
    26 
    26 
    27 /** Headers for Block ack request and response.
    27 enum BlockAckType
       
    28 {
       
    29   BASIC_BLOCK_ACK,
       
    30   COMPRESSED_BLOCK_ACK,
       
    31   MULTI_TID_BLOCK_ACK
       
    32 };
       
    33 
       
    34 /**
       
    35  * \ingroup wifi
       
    36  * \brief Headers for Block ack request.
       
    37  *
    28  *  802.11n standard includes three types of block ack:
    38  *  802.11n standard includes three types of block ack:
    29  *    - Basic block ack (unique type in 802.11e)
    39  *    - Basic block ack (unique type in 802.11e)
    30  *    - Compressed block ack
    40  *    - Compressed block ack
    31  *    - Multi-TID block ack
    41  *    - Multi-TID block ack
    32  *  For now only basic block ack and compressed block ack 
    42  *  For now only basic block ack and compressed block ack 
    33  *  are supported.
    43  *  are supported.
    34  *  Basic block ack is also default variant.
    44  *  Basic block ack is also default variant.
    35  */
    45  */
    36 enum BlockAckType
       
    37 {
       
    38   BASIC_BLOCK_ACK,
       
    39   COMPRESSED_BLOCK_ACK,
       
    40   MULTI_TID_BLOCK_ACK
       
    41 };
       
    42 
       
    43 class CtrlBAckRequestHeader : public Header {
    46 class CtrlBAckRequestHeader : public Header {
    44 public:
    47 public:
    45   CtrlBAckRequestHeader ();
    48   CtrlBAckRequestHeader ();
    46   ~CtrlBAckRequestHeader ();
    49   ~CtrlBAckRequestHeader ();
    47   static TypeId GetTypeId (void);
    50   static TypeId GetTypeId (void);
    82   bool m_compressed;
    85   bool m_compressed;
    83   uint16_t m_tidInfo;
    86   uint16_t m_tidInfo;
    84   uint16_t m_startingSeq;
    87   uint16_t m_startingSeq;
    85 };
    88 };
    86 
    89 
       
    90 /**
       
    91  * \ingroup wifi
       
    92  * \brief Headers for Block ack response.
       
    93  *
       
    94  *  802.11n standard includes three types of block ack:
       
    95  *    - Basic block ack (unique type in 802.11e)
       
    96  *    - Compressed block ack
       
    97  *    - Multi-TID block ack
       
    98  *  For now only basic block ack and compressed block ack 
       
    99  *  are supported.
       
   100  *  Basic block ack is also default variant.
       
   101  */
    87 class CtrlBAckResponseHeader : public Header {
   102 class CtrlBAckResponseHeader : public Header {
    88 public:
   103 public:
    89   CtrlBAckResponseHeader ();
   104   CtrlBAckResponseHeader ();
    90   ~CtrlBAckResponseHeader ();
   105   ~CtrlBAckResponseHeader ();
    91   static TypeId GetTypeId (void);
   106   static TypeId GetTypeId (void);
   128   Buffer::Iterator DeserializeBitmap (Buffer::Iterator start);
   143   Buffer::Iterator DeserializeBitmap (Buffer::Iterator start);
   129 
   144 
   130   /**
   145   /**
   131    * This function is used to correctly index in both bitmap
   146    * This function is used to correctly index in both bitmap
   132    * and compressed bitmap, one bit or one block of 16 bits respectively.
   147    * and compressed bitmap, one bit or one block of 16 bits respectively.
   133    * If we are using basic block ack, return value represents index of 
   148    *
       
   149    * for more details see 7.2.1.8 in IEEE 802.11n/D4.00
       
   150    *
       
   151    * \param seq the sequence number
       
   152    * 
       
   153    * \return If we are using basic block ack, return value represents index of 
   134    * block of 16 bits for packet having sequence number equals to <i>seq</i>.
   154    * block of 16 bits for packet having sequence number equals to <i>seq</i>.
   135    * If we are using compressed block ack, return value represents bit 
   155    * If we are using compressed block ack, return value represents bit 
   136    * to set to 1 in the compressed bitmap to indicate that packet having 
   156    * to set to 1 in the compressed bitmap to indicate that packet having 
   137    * sequence number equals to <i>seq</i> was correctly received.
   157    * sequence number equals to <i>seq</i> was correctly received.
   138    *
       
   139    * for more details see 7.2.1.8 in IEEE 802.11n/D4.00
       
   140    */
   158    */
   141   uint8_t IndexInBitmap (uint16_t seq) const;
   159   uint8_t IndexInBitmap (uint16_t seq) const;
       
   160 
   142   /**
   161   /**
   143    * Checks if sequence number <i>seq</i> can be acknowledged in the bitmap.
   162    * Checks if sequence number <i>seq</i> can be acknowledged in the bitmap.
       
   163    * 
       
   164    * \param seq the sequence number
       
   165    * 
       
   166    * \return 
   144    */
   167    */
   145   bool IsInBitmap (uint16_t seq) const;
   168   bool IsInBitmap (uint16_t seq) const;
   146 
   169 
   147   /**
   170   /**
   148    * The lsb bit of the BA control field is used only for the
   171    * The lsb bit of the BA control field is used only for the