A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
block-ack-agreement.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 MIRKO BANCHI
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 * Author: Mirko Banchi <mk.banchi@gmail.com>
18 */
19
20#ifndef BLOCK_ACK_AGREEMENT_H
21#define BLOCK_ACK_AGREEMENT_H
22
23#include "block-ack-type.h"
24
25#include "ns3/event-id.h"
26#include "ns3/mac48-address.h"
27
28namespace ns3
29{
30/**
31 * \brief Maintains information for a block ack agreement.
32 * \ingroup wifi
33 */
35{
37
38 public:
39 /**
40 * Constructor for BlockAckAgreement with given peer and TID.
41 *
42 * \param peer the peer station
43 * \param tid the TID
44 */
45 BlockAckAgreement(Mac48Address peer, uint8_t tid);
46 virtual ~BlockAckAgreement();
47 /**
48 * Set buffer size.
49 *
50 * \param bufferSize the buffer size (in number of MPDUs)
51 */
52 void SetBufferSize(uint16_t bufferSize);
53 /**
54 * Set timeout.
55 *
56 * \param timeout the timeout value
57 */
58 void SetTimeout(uint16_t timeout);
59 /**
60 * Set starting sequence number.
61 *
62 * \param seq the starting sequence number
63 */
64 void SetStartingSequence(uint16_t seq);
65 /**
66 * Set starting sequence control.
67 *
68 * \param seq the starting sequence control
69 */
70 void SetStartingSequenceControl(uint16_t seq);
71 /**
72 * Set block ack policy to immediate Ack.
73 */
75 /**
76 * Set block ack policy to delayed Ack.
77 */
78 void SetDelayedBlockAck();
79 /**
80 * Enable or disable A-MSDU support.
81 *
82 * \param supported enable or disable A-MSDU support
83 */
84 void SetAmsduSupport(bool supported);
85 /**
86 * Return the Traffic ID (TID).
87 *
88 * \return TID
89 */
90 uint8_t GetTid() const;
91 /**
92 * Return the peer address.
93 *
94 * \return the peer MAC address
95 */
96 Mac48Address GetPeer() const;
97 /**
98 * Return the buffer size.
99 *
100 * \return the buffer size (in number of MPDUs)
101 */
102 uint16_t GetBufferSize() const;
103 /**
104 * Return the timeout.
105 *
106 * \return the timeout
107 */
108 uint16_t GetTimeout() const;
109 /**
110 * Return the starting sequence number.
111 *
112 * \return starting sequence number
113 */
114 virtual uint16_t GetStartingSequence() const;
115 /**
116 * Return the starting sequence control
117 *
118 * \return starting sequence control
119 */
120 uint16_t GetStartingSequenceControl() const;
121 /**
122 * Return the last sequence number covered by the ack window
123 *
124 * \return ending sequence number
125 */
126 uint16_t GetWinEnd() const;
127 /**
128 * Check whether the current ack policy is immediate BlockAck.
129 *
130 * \return true if the current ack policy is immediate BlockAck,
131 * false otherwise
132 */
133 bool IsImmediateBlockAck() const;
134 /**
135 * Check whether A-MSDU is supported
136 *
137 * \return true if A-MSDU is supported,
138 * false otherwise
139 */
140 bool IsAmsduSupported() const;
141 /**
142 * Enable or disable HT support.
143 *
144 * \param htSupported enable or disable HT support
145 */
146 void SetHtSupported(bool htSupported);
147 /**
148 * Check whether HT is supported
149 *
150 * \return true if HT is supported,
151 * false otherwise
152 */
153 bool IsHtSupported() const;
154 /**
155 * Get the type of the Block Acks sent by the recipient of this agreement.
156 *
157 * \return the type of the Block Acks sent by the recipient of this agreement
158 */
160 /**
161 * Get the type of the Block Ack Requests sent by the originator of this agreement.
162 *
163 * \return the type of the Block Ack Requests sent by the originator of this agreement
164 */
166 /**
167 * Get the distance between the given starting sequence number and the
168 * given sequence number.
169 *
170 * \param seqNumber the given sequence number
171 * \param startingSeqNumber the given starting sequence number
172 * \return the distance of the given sequence number from the given starting sequence number
173 */
174 static std::size_t GetDistance(uint16_t seqNumber, uint16_t startingSeqNumber);
175
176 protected:
177 Mac48Address m_peer; //!< Peer address
178 uint8_t m_amsduSupported; //!< Flag whether MSDU aggregation is supported
179 uint8_t m_blockAckPolicy; //!< Type of block ack: immediate or delayed
180 uint8_t m_tid; //!< Traffic ID
181 uint16_t m_bufferSize; //!< Buffer size
182 uint16_t m_timeout; //!< Timeout
183 uint16_t m_startingSeq; //!< Starting sequence control
184 uint16_t m_winEnd; //!< Ending sequence number
185 uint8_t m_htSupported; //!< Flag whether HT is supported
186 mutable EventId m_inactivityEvent; //!< inactivity event
187};
188
189} // namespace ns3
190
191#endif /* BLOCK_ACK_AGREEMENT_H */
Maintains information for a block ack agreement.
uint16_t GetTimeout() const
Return the timeout.
bool IsHtSupported() const
Check whether HT is supported.
Mac48Address m_peer
Peer address.
void SetImmediateBlockAck()
Set block ack policy to immediate Ack.
uint16_t m_winEnd
Ending sequence number.
void SetStartingSequence(uint16_t seq)
Set starting sequence number.
uint8_t m_htSupported
Flag whether HT is supported.
virtual uint16_t GetStartingSequence() const
Return the starting sequence number.
void SetStartingSequenceControl(uint16_t seq)
Set starting sequence control.
BlockAckType GetBlockAckType() const
Get the type of the Block Acks sent by the recipient of this agreement.
EventId m_inactivityEvent
inactivity event
BlockAckReqType GetBlockAckReqType() const
Get the type of the Block Ack Requests sent by the originator of this agreement.
void SetBufferSize(uint16_t bufferSize)
Set buffer size.
uint8_t m_blockAckPolicy
Type of block ack: immediate or delayed.
void SetDelayedBlockAck()
Set block ack policy to delayed Ack.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint16_t GetWinEnd() const
Return the last sequence number covered by the ack window.
uint8_t m_tid
Traffic ID.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t m_startingSeq
Starting sequence control.
uint16_t m_bufferSize
Buffer size.
void SetTimeout(uint16_t timeout)
Set timeout.
bool IsImmediateBlockAck() const
Check whether the current ack policy is immediate BlockAck.
uint8_t m_amsduSupported
Flag whether MSDU aggregation is supported.
static std::size_t GetDistance(uint16_t seqNumber, uint16_t startingSeqNumber)
Get the distance between the given starting sequence number and the given sequence number.
uint16_t GetStartingSequenceControl() const
Return the starting sequence control.
uint16_t GetBufferSize() const
Return the buffer size.
void SetHtSupported(bool htSupported)
Enable or disable HT support.
bool IsAmsduSupported() const
Check whether A-MSDU is supported.
Mac48Address GetPeer() const
Return the peer address.
An identifier for simulation events.
Definition: event-id.h:55
HtFrameExchangeManager handles the frame exchange sequences for HT stations.
an EUI-48 address
Definition: mac48-address.h:46
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout
The different BlockAckRequest variants.
The different BlockAck variants.