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