View | Details | Raw Unified | Return to bug 938
Collapse All | Expand All

(-)a/src/wifi/model/aarf-wifi-manager.cc (+8 lines)
 Lines 31-36    Link Here 
31
31
32
namespace ns3 {
32
namespace ns3 {
33
33
34
/**
35
 * \brief hold per-remote-station state for AARF Wifi manager.
36
 *
37
 * This struct extends from WifiRemoteStation struct to hold additional
38
 * information required by the AARF Wifi manager
39
 */
34
struct AarfWifiRemoteStation : public WifiRemoteStation
40
struct AarfWifiRemoteStation : public WifiRemoteStation
35
{
41
{
36
  uint32_t m_timer;
42
  uint32_t m_timer;
 Lines 123-128    Link Here 
123
 * is the initial transmission of a packet or the retransmission of a packet.
129
 * is the initial transmission of a packet or the retransmission of a packet.
124
 * The fundamental reason for this is that there is a backoff between each data
130
 * The fundamental reason for this is that there is a backoff between each data
125
 * transmission, be it an initial transmission or a retransmission.
131
 * transmission, be it an initial transmission or a retransmission.
132
 *
133
 * \param st the station that we failed to send DATA
126
 */
134
 */
127
void
135
void
128
AarfWifiManager::DoReportDataFailed (WifiRemoteStation *st)
136
AarfWifiManager::DoReportDataFailed (WifiRemoteStation *st)
(-)a/src/wifi/model/aarfcd-wifi-manager.cc (-9 / +7 lines)
 Lines 34-39    Link Here 
34
34
35
namespace ns3 {
35
namespace ns3 {
36
36
37
/**
38
 * \brief hold per-remote-station state for AARF-CD Wifi manager.
39
 *
40
 * This struct extends from WifiRemoteStation struct to hold additional
41
 * information required by the AARF-CD Wifi manager
42
 */
37
struct AarfcdWifiRemoteStation : public WifiRemoteStation
43
struct AarfcdWifiRemoteStation : public WifiRemoteStation
38
{
44
{
39
  uint32_t m_timer;
45
  uint32_t m_timer;
 Lines 149-163    Link Here 
149
{
155
{
150
  NS_LOG_FUNCTION (this << station);
156
  NS_LOG_FUNCTION (this << station);
151
}
157
}
152
/**
158
153
 * It is important to realize that "recovery" mode starts after failure of
154
 * the first transmission after a rate increase and ends at the first successful
155
 * transmission. Specifically, recovery mode transcends retransmissions boundaries.
156
 * Fundamentally, ARF handles each data transmission independently, whether it
157
 * is the initial transmission of a packet or the retransmission of a packet.
158
 * The fundamental reason for this is that there is a backoff between each data
159
 * transmission, be it an initial transmission or a retransmission.
160
 */
161
void
159
void
162
AarfcdWifiManager::DoReportDataFailed (WifiRemoteStation *st)
160
AarfcdWifiManager::DoReportDataFailed (WifiRemoteStation *st)
163
{
161
{
(-)a/src/wifi/model/aarfcd-wifi-manager.h (+37 lines)
 Lines 47-53    Link Here 
47
  virtual WifiRemoteStation * DoCreateStation (void) const;
47
  virtual WifiRemoteStation * DoCreateStation (void) const;
48
  virtual void DoReportRxOk (WifiRemoteStation *station,
48
  virtual void DoReportRxOk (WifiRemoteStation *station,
49
                             double rxSnr, WifiMode txMode);
49
                             double rxSnr, WifiMode txMode);
50
50
  virtual void DoReportRtsFailed (WifiRemoteStation *station);
51
  virtual void DoReportRtsFailed (WifiRemoteStation *station);
52
  /**
53
   * It is important to realize that "recovery" mode starts after failure of
54
   * the first transmission after a rate increase and ends at the first successful
55
   * transmission. Specifically, recovery mode transcends retransmissions boundaries.
56
   * Fundamentally, ARF handles each data transmission independently, whether it
57
   * is the initial transmission of a packet or the retransmission of a packet.
58
   * The fundamental reason for this is that there is a backoff between each data
59
   * transmission, be it an initial transmission or a retransmission.
60
   *
61
   * \param station the station that we failed to send DATA
62
   */
51
  virtual void DoReportDataFailed (WifiRemoteStation *station);
63
  virtual void DoReportDataFailed (WifiRemoteStation *station);
52
  virtual void DoReportRtsOk (WifiRemoteStation *station,
64
  virtual void DoReportRtsOk (WifiRemoteStation *station,
53
                              double ctsSnr, WifiMode ctsMode, double rtsSnr);
65
                              double ctsSnr, WifiMode ctsMode, double rtsSnr);
 Lines 61-70    Link Here 
61
                          Ptr<const Packet> packet, bool normally);
73
                          Ptr<const Packet> packet, bool normally);
62
  virtual bool IsLowLatency (void) const;
74
  virtual bool IsLowLatency (void) const;
63
75
76
  /**
77
   * Check if the use of RTS for the given station can be turned off.
78
   *
79
   * \param station the station that we are checking
80
   */
64
  void CheckRts (AarfcdWifiRemoteStation *station);
81
  void CheckRts (AarfcdWifiRemoteStation *station);
82
  /**
83
   * Increase the RTS window size of the given station.
84
   *
85
   * \param station the station to increase RTS window
86
   */
65
  void IncreaseRtsWnd (AarfcdWifiRemoteStation *station);
87
  void IncreaseRtsWnd (AarfcdWifiRemoteStation *station);
88
  /**
89
   * Reset the RTS window of the given station.
90
   *
91
   * \param station the station to reset RTS window
92
   */
66
  void ResetRtsWnd (AarfcdWifiRemoteStation *station);
93
  void ResetRtsWnd (AarfcdWifiRemoteStation *station);
94
  /**
95
   * Turn off RTS for the given station.
96
   *
97
   * \param station the station to turn RTS off
98
   */
67
  void TurnOffRts (AarfcdWifiRemoteStation *station);
99
  void TurnOffRts (AarfcdWifiRemoteStation *station);
100
  /**
101
   * Turn on RTS for the given station.
102
   *
103
   * \param station the station to turn RTS on
104
   */
68
  void TurnOnRts (AarfcdWifiRemoteStation *station);
105
  void TurnOnRts (AarfcdWifiRemoteStation *station);
69
106
70
  // aarf fields below
107
  // aarf fields below
(-)a/src/wifi/model/amrr-wifi-manager.cc (+6 lines)
 Lines 30-35    Link Here 
30
30
31
namespace ns3 {
31
namespace ns3 {
32
32
33
/**
34
 * \brief hold per-remote-station state for AMRR Wifi manager.
35
 *
36
 * This struct extends from WifiRemoteStation struct to hold additional
37
 * information required by the AMRR Wifi manager
38
 */
33
struct AmrrWifiRemoteStation : public WifiRemoteStation
39
struct AmrrWifiRemoteStation : public WifiRemoteStation
34
{
40
{
35
  Time m_nextModeUpdate;
41
  Time m_nextModeUpdate;
(-)a/src/wifi/model/arf-wifi-manager.cc (+8 lines)
 Lines 30-35    Link Here 
30
30
31
namespace ns3 {
31
namespace ns3 {
32
32
33
/**
34
 * \brief hold per-remote-station state for ARF Wifi manager.
35
 *
36
 * This struct extends from WifiRemoteStation struct to hold additional
37
 * information required by the ARF Wifi manager
38
 */
33
struct ArfWifiRemoteStation : public WifiRemoteStation
39
struct ArfWifiRemoteStation : public WifiRemoteStation
34
{
40
{
35
  uint32_t m_timer;
41
  uint32_t m_timer;
 Lines 105-110    Link Here 
105
 * is the initial transmission of a packet or the retransmission of a packet.
111
 * is the initial transmission of a packet or the retransmission of a packet.
106
 * The fundamental reason for this is that there is a backoff between each data
112
 * The fundamental reason for this is that there is a backoff between each data
107
 * transmission, be it an initial transmission or a retransmission.
113
 * transmission, be it an initial transmission or a retransmission.
114
 *
115
 * \param st the station that we failed to send DATA
108
 */
116
 */
109
void
117
void
110
ArfWifiManager::DoReportDataFailed (WifiRemoteStation *st)
118
ArfWifiManager::DoReportDataFailed (WifiRemoteStation *st)
(-)a/src/wifi/model/block-ack-agreement.h (+74 lines)
 Lines 33-54    Link Here 
33
  friend class MacLow;
33
  friend class MacLow;
34
public:
34
public:
35
  BlockAckAgreement ();
35
  BlockAckAgreement ();
36
  /**
37
   * Constructor for BlockAckAgreement with given peer and TID.
38
   *
39
   * \param peer
40
   * \param tid
41
   */
36
  BlockAckAgreement (Mac48Address peer, uint8_t tid);
42
  BlockAckAgreement (Mac48Address peer, uint8_t tid);
37
  ~BlockAckAgreement ();
43
  ~BlockAckAgreement ();
44
  /**
45
   * Set buffer size.
46
   *
47
   * \param bufferSize
48
   */
38
  void SetBufferSize (uint16_t bufferSize);
49
  void SetBufferSize (uint16_t bufferSize);
50
  /**
51
   * Set timeout.
52
   *
53
   * \param timeout
54
   */
39
  void SetTimeout (uint16_t timeout);
55
  void SetTimeout (uint16_t timeout);
56
  /**
57
   * Set starting sequence number.
58
   *
59
   * \param seq the starting sequence number
60
   */
40
  void SetStartingSequence (uint16_t seq);
61
  void SetStartingSequence (uint16_t seq);
62
  /**
63
   * Set Block ACK policy to immediate ACK.
64
   */
41
  void SetImmediateBlockAck (void);
65
  void SetImmediateBlockAck (void);
66
  /**
67
   * Set Block ACK policy to delayed ACK.
68
   */
42
  void SetDelayedBlockAck (void);
69
  void SetDelayedBlockAck (void);
70
  /**
71
   * Enable or disable A-MSDU support.
72
   *
73
   * \param supported enable or disable A-MSDU support
74
   */
43
  void SetAmsduSupport (bool supported);
75
  void SetAmsduSupport (bool supported);
44
76
77
  /**
78
   * Return the Traffic ID (TID).
79
   *
80
   * \return TID
81
   */
45
  uint8_t GetTid (void) const;
82
  uint8_t GetTid (void) const;
83
  /**
84
   * Return the peer address.
85
   *
86
   * \return Mac48Address
87
   */
46
  Mac48Address GetPeer (void) const;
88
  Mac48Address GetPeer (void) const;
89
  /**
90
   * Return the buffer size.
91
   *
92
   * \return buffer size
93
   */
47
  uint16_t GetBufferSize (void) const;
94
  uint16_t GetBufferSize (void) const;
95
  /**
96
   * Return the timeout.
97
   *
98
   * \return timeout
99
   */
48
  uint16_t GetTimeout (void) const;
100
  uint16_t GetTimeout (void) const;
101
  /**
102
   * Return the starting squence number.
103
   *
104
   * \return starting sequence number
105
   */
49
  uint16_t GetStartingSequence (void) const;
106
  uint16_t GetStartingSequence (void) const;
107
  /**
108
   * Return the starting squence control
109
   *
110
   * \return starting sequence control
111
   */
50
  uint16_t GetStartingSequenceControl (void) const;
112
  uint16_t GetStartingSequenceControl (void) const;
113
  /**
114
   * Check whether the current ACK policy is immediate block ACK.
115
   *
116
   * \return true if the current ACK policy is immediate block ACK,
117
   *         false otherwise
118
   */
51
  bool IsImmediateBlockAck (void) const;
119
  bool IsImmediateBlockAck (void) const;
120
  /**
121
   * Check whether A-MSDU is supported
122
   *
123
   * \return true if A-MSDU is supported,
124
   *         false otherwise
125
   */
52
  bool IsAmsduSupported (void) const;
126
  bool IsAmsduSupported (void) const;
53
127
54
protected:
128
protected:
(-)a/src/wifi/model/block-ack-manager.h (-1 / +58 lines)
 Lines 47-52    Link Here 
47
struct Bar
47
struct Bar
48
{
48
{
49
  Bar ();
49
  Bar ();
50
  /**
51
   * Construct Block ACK request for a given packet,
52
   * receiver address, Traffic ID, and ACK policy.
53
   *
54
   * \param packet
55
   * \param recipient
56
   * \param tid
57
   * \param immediate
58
   */
50
  Bar (Ptr<const Packet> packet,
59
  Bar (Ptr<const Packet> packet,
51
       Mac48Address recipient,
60
       Mac48Address recipient,
52
       uint8_t tid,
61
       uint8_t tid,
 Lines 73-78    Link Here 
73
  /**
82
  /**
74
   * \param recipient Address of peer station involved in block ack mechanism.
83
   * \param recipient Address of peer station involved in block ack mechanism.
75
   * \param tid Traffic ID.
84
   * \param tid Traffic ID.
85
   * \return true  if a block ack agreement exists, false otherwise
76
   *
86
   *
77
   * Checks if a block ack agreement exists with station addressed by
87
   * Checks if a block ack agreement exists with station addressed by
78
   * <i>recipient</i> for tid <i>tid</i>.
88
   * <i>recipient</i> for tid <i>tid</i>.
 Lines 82-88    Link Here 
82
   * \param recipient Address of peer station involved in block ack mechanism.
92
   * \param recipient Address of peer station involved in block ack mechanism.
83
   * \param tid Traffic ID.
93
   * \param tid Traffic ID.
84
   * \param state The state for block ack agreement
94
   * \param state The state for block ack agreement
85
95
   * \return true if a block ack agreement exists, false otherwise
96
   *
86
   * Checks if a block ack agreement with a state equals to <i>state</i> exists with
97
   * Checks if a block ack agreement with a state equals to <i>state</i> exists with
87
   * station addressed by <i>recipient</i> for tid <i>tid</i>.
98
   * station addressed by <i>recipient</i> for tid <i>tid</i>.
88
   */
99
   */
 Lines 122-127    Link Here 
122
  void StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp);
133
  void StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp);
123
  /**
134
  /**
124
   * \param hdr 802.11 header of returned packet (if exists).
135
   * \param hdr 802.11 header of returned packet (if exists).
136
   * \return the packet
125
   *
137
   *
126
   * This methods returns a packet (if exists) indicated as not received in
138
   * This methods returns a packet (if exists) indicated as not received in
127
   * corresponding block ack bitmap.
139
   * corresponding block ack bitmap.
 Lines 131-136    Link Here 
131
  /**
143
  /**
132
   * Returns true if there are packets that need of retransmission or at least a
144
   * Returns true if there are packets that need of retransmission or at least a
133
   * BAR is scheduled. Returns false otherwise.
145
   * BAR is scheduled. Returns false otherwise.
146
   *
147
   * \return true if there are packets that need of retransmission or at least a
148
   *         BAR is scheduled, false otherwise
134
   */
149
   */
135
  bool HasPackets (void) const;
150
  bool HasPackets (void) const;
136
  /**
151
  /**
 Lines 146-151    Link Here 
146
  /**
161
  /**
147
   * \param recipient Address of peer station involved in block ack mechanism.
162
   * \param recipient Address of peer station involved in block ack mechanism.
148
   * \param tid Traffic ID.
163
   * \param tid Traffic ID.
164
   * \return the number of packets buffered for a specified agreement
149
   *
165
   *
150
   * Returns number of packets buffered for a specified agreement. This methods doesn't return
166
   * Returns number of packets buffered for a specified agreement. This methods doesn't return
151
   * number of buffered MPDUs but number of buffered MSDUs.
167
   * number of buffered MPDUs but number of buffered MSDUs.
 Lines 154-159    Link Here 
154
  /**
170
  /**
155
   * \param recipient Address of peer station involved in block ack mechanism.
171
   * \param recipient Address of peer station involved in block ack mechanism.
156
   * \param tid Traffic ID.
172
   * \param tid Traffic ID.
173
   * \return the number of packets for a specific agreement that need retransmission
157
   *
174
   *
158
   * Returns number of packets for a specific agreement that need retransmission.
175
   * Returns number of packets for a specific agreement that need retransmission.
159
   * This method doesn't return number of MPDUs that need retransmission but number of MSDUs.
176
   * This method doesn't return number of MPDUs that need retransmission but number of MSDUs.
 Lines 216-227    Link Here 
216
  /**
233
  /**
217
   * \param sequenceNumber Sequence number of the packet which fragment is
234
   * \param sequenceNumber Sequence number of the packet which fragment is
218
   * part of.
235
   * part of.
236
   * \return true if another fragment with the given sequence number is scheduled
237
   * for retransmission.
219
   *
238
   *
220
   * Returns true if another fragment with sequence number <i>sequenceNumber</i> is scheduled
239
   * Returns true if another fragment with sequence number <i>sequenceNumber</i> is scheduled
221
   * for retransmission.
240
   * for retransmission.
222
   */
241
   */
223
  bool HasOtherFragments (uint16_t sequenceNumber) const;
242
  bool HasOtherFragments (uint16_t sequenceNumber) const;
224
  /**
243
  /**
244
   * \return the size of the next packet that needs retransmission
245
   *
225
   * Returns size of the next packet that needs retransmission.
246
   * Returns size of the next packet that needs retransmission.
226
   */
247
   */
227
  uint32_t GetNextPacketSize (void) const;
248
  uint32_t GetNextPacketSize (void) const;
 Lines 238-243    Link Here 
238
  void SetBlockDestinationCallback (Callback<void, Mac48Address, uint8_t> callback);
259
  void SetBlockDestinationCallback (Callback<void, Mac48Address, uint8_t> callback);
239
  void SetUnblockDestinationCallback (Callback<void, Mac48Address, uint8_t> callback);
260
  void SetUnblockDestinationCallback (Callback<void, Mac48Address, uint8_t> callback);
240
  /**
261
  /**
262
   * \param recipient
263
   * \param tid
264
   * \param startingSeq
265
   * \return true if there are packets in the queue that could be sent under block ACK,
266
   *         false otherwise
267
   *
241
   * Checks if there are in the queue other packets that could be send under block ack.
268
   * Checks if there are in the queue other packets that could be send under block ack.
242
   * If yes adds these packets in current block ack exchange.
269
   * If yes adds these packets in current block ack exchange.
243
   * However, number of packets exchanged in the current block ack, will not exceed
270
   * However, number of packets exchanged in the current block ack, will not exceed
 Lines 245-250    Link Here 
245
   */
272
   */
246
  bool SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq);
273
  bool SwitchToBlockAckIfNeeded (Mac48Address recipient, uint8_t tid, uint16_t startingSeq);
247
  /**
274
  /**
275
   * \param recipient
276
   * \param tid
277
   * \return the sequence number of the next retry packet for a specific agreement
278
   *
248
   * Returns the sequence number of the next retry packet for a specific agreement.
279
   * Returns the sequence number of the next retry packet for a specific agreement.
249
   * If there are no packets that need retransmission for the specified agreement or
280
   * If there are no packets that need retransmission for the specified agreement or
250
   * the agreement doesn't exist the function returns 4096;
281
   * the agreement doesn't exist the function returns 4096;
 Lines 252-257    Link Here 
252
  uint16_t GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const;
283
  uint16_t GetSeqNumOfNextRetryPacket (Mac48Address recipient, uint8_t tid) const;
253
private:
284
private:
254
  /**
285
  /**
286
   * \param recipient
287
   * \param tid
288
   * \return a packet
289
   *
255
   * Checks if all packets, for which a block ack agreement was established or refreshed,
290
   * Checks if all packets, for which a block ack agreement was established or refreshed,
256
   * have been transmitted. If yes, adds a pair in m_bAckReqs to indicate that
291
   * have been transmitted. If yes, adds a pair in m_bAckReqs to indicate that
257
   * at next channel access a block ack request (for established agreement
292
   * at next channel access a block ack request (for established agreement
 Lines 265-281    Link Here 
265
  void InactivityTimeout (Mac48Address, uint8_t);
300
  void InactivityTimeout (Mac48Address, uint8_t);
266
301
267
  struct Item;
302
  struct Item;
303
  /**
304
   * typedef for a list of Item struct.
305
   */
268
  typedef std::list<Item> PacketQueue;
306
  typedef std::list<Item> PacketQueue;
307
  /**
308
   * typedef for an iterator for PacketQueue.
309
   */
269
  typedef std::list<Item>::iterator PacketQueueI;
310
  typedef std::list<Item>::iterator PacketQueueI;
311
  /**
312
   * typedef for a const iterator for PacketQueue.
313
   */
270
  typedef std::list<Item>::const_iterator PacketQueueCI;
314
  typedef std::list<Item>::const_iterator PacketQueueCI;
271
315
316
  /**
317
   * typedef for a map between MAC address and block ACK agreement.
318
   */
272
  typedef std::map<std::pair<Mac48Address, uint8_t>,
319
  typedef std::map<std::pair<Mac48Address, uint8_t>,
273
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> > Agreements;
320
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> > Agreements;
321
  /**
322
   * typedef for an iterator for Agreements.
323
   */
274
  typedef std::map<std::pair<Mac48Address, uint8_t>,
324
  typedef std::map<std::pair<Mac48Address, uint8_t>,
275
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> >::iterator AgreementsI;
325
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> >::iterator AgreementsI;
326
  /**
327
   * typedef for a const iterator for Agreements.
328
   */
276
  typedef std::map<std::pair<Mac48Address, uint8_t>,
329
  typedef std::map<std::pair<Mac48Address, uint8_t>,
277
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> >::const_iterator AgreementsCI;
330
                   std::pair<OriginatorBlockAckAgreement, PacketQueue> >::const_iterator AgreementsCI;
278
331
332
  /**
333
   * A struct for packet, Wifi header, and timestamp.
334
   * Used in queue by block ACK manager.
335
   */
279
  struct Item
336
  struct Item
280
  {
337
  {
281
    Item ();
338
    Item ();
(-)a/src/wifi/model/capability-information.h (-1 / +60 lines)
 Lines 28-52    Link Here 
28
/**
28
/**
29
 * \ingroup wifi
29
 * \ingroup wifi
30
 *
30
 *
31
 *
31
 * Capability information
32
 */
32
 */
33
class CapabilityInformation
33
class CapabilityInformation
34
{
34
{
35
public:
35
public:
36
  CapabilityInformation ();
36
  CapabilityInformation ();
37
37
38
  /**
39
   * Set the Extended Service Set (ESS) bit
40
   * in the capability information field.
41
   */
38
  void SetEss (void);
42
  void SetEss (void);
43
  /**
44
   * Set the Independent BSS (IBSS) bit
45
   * in the capability information field.
46
   */
39
  void SetIbss (void);
47
  void SetIbss (void);
40
48
49
  /**
50
   * Check if the Extended Service Set (ESS) bit
51
   * in the capability information field is set to 1.
52
   *
53
   * \return ESS bit in the capability information
54
   *         field is set to 1
55
   */
41
  bool IsEss (void) const;
56
  bool IsEss (void) const;
57
  /**
58
   * Check if the Independent BSS (IBSS) bit
59
   * in the capability information field is set to 1.
60
   *
61
   * \return IBSS bit in the capability information
62
   *         field is set to 1
63
   */
42
  bool IsIbss (void) const;
64
  bool IsIbss (void) const;
43
65
66
  /**
67
   * Return the serialized size of capability 
68
   * information.
69
   *
70
   * \return the serialized size
71
   */
44
  uint32_t GetSerializedSize (void) const;
72
  uint32_t GetSerializedSize (void) const;
73
  /**
74
   * Serialize capability information to the given buffer.
75
   *
76
   * \param start an iterator to a buffer
77
   * \return an iterator to a buffer after capability information
78
   *         was serialized
79
   */
45
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
80
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
81
  /**
82
   * Deserialize capability information from the given buffer.
83
   *
84
   * \param start an iterator to a buffer
85
   * \return an iterator to a buffer after capability information
86
   *         was deserialized
87
   */
46
  Buffer::Iterator Deserialize (Buffer::Iterator start);
88
  Buffer::Iterator Deserialize (Buffer::Iterator start);
47
private:
89
private:
90
  /**
91
   * Check if bit n is set to 1.
92
   *
93
   * \param n the bit position
94
   * \return true if bit n is set to 1,
95
   *         false otherwise
96
   */
48
  bool Is (uint8_t n) const;
97
  bool Is (uint8_t n) const;
98
  /**
99
   * Set bit n to 1.
100
   *
101
   * \param n the bit position
102
   */
49
  void Set (uint8_t n);
103
  void Set (uint8_t n);
104
  /**
105
   * Set bit n to 0.
106
   *
107
   * \param n the bit position
108
   */
50
  void Clear (uint8_t n);
109
  void Clear (uint8_t n);
51
  uint16_t m_capability;
110
  uint16_t m_capability;
52
};
111
};
(-)a/src/wifi/model/cara-wifi-manager.cc (+6 lines)
 Lines 32-37    Link Here 
32
32
33
namespace ns3 {
33
namespace ns3 {
34
34
35
/**
36
 * \brief hold per-remote-station state for CARA Wifi manager.
37
 *
38
 * This struct extends from WifiRemoteStation struct to hold additional
39
 * information required by the CARA Wifi manager
40
 */
35
struct CaraWifiRemoteStation : public WifiRemoteStation
41
struct CaraWifiRemoteStation : public WifiRemoteStation
36
{
42
{
37
  uint32_t m_timer;
43
  uint32_t m_timer;
(-)a/src/wifi/model/dca-txop.cc (+8 lines)
 Lines 69-77    Link Here 
69
  DcaTxop *m_txop;
69
  DcaTxop *m_txop;
70
};
70
};
71
71
72
/**
73
 * Listener for MacLow events. Forwards to DcaTxop.
74
 */
72
class DcaTxop::TransmissionListener : public MacLowTransmissionListener
75
class DcaTxop::TransmissionListener : public MacLowTransmissionListener
73
{
76
{
74
public:
77
public:
78
  /**
79
   * Create a TransmissionListener for the given DcaTxop.
80
   *
81
   * \param txop
82
   */
75
  TransmissionListener (DcaTxop * txop)
83
  TransmissionListener (DcaTxop * txop)
76
    : MacLowTransmissionListener (),
84
    : MacLowTransmissionListener (),
77
      m_txop (txop) {
85
      m_txop (txop) {
(-)a/src/wifi/model/dca-txop.h (-3 / +84 lines)
 Lines 75-82    Link Here 
75
  DcaTxop ();
75
  DcaTxop ();
76
  ~DcaTxop ();
76
  ~DcaTxop ();
77
77
78
  /**
79
   * Set MacLow associated with this DcaTxop.
80
   *
81
   * \param low MacLow
82
   */
78
  void SetLow (Ptr<MacLow> low);
83
  void SetLow (Ptr<MacLow> low);
84
  /**
85
   * Set DcfManager this DcaTxop is associated to.
86
   *
87
   * \param manager DcfManager
88
   */
79
  void SetManager (DcfManager *manager);
89
  void SetManager (DcfManager *manager);
90
  /**
91
   * Set WifiRemoteStationsManager this DcaTxop is associated to.
92
   *
93
   * \param remoteManager WifiRemoteStationManager
94
   */
80
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> remoteManager);
95
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> remoteManager);
81
96
82
  /**
97
  /**
 Lines 90-95    Link Here 
90
   */
105
   */
91
  void SetTxFailedCallback (TxFailed callback);
106
  void SetTxFailedCallback (TxFailed callback);
92
107
108
  /**
109
   * Return the packet queue associated with this DcaTxop.
110
   *
111
   * \return WifiMacQueue
112
   */
93
  Ptr<WifiMacQueue > GetQueue () const;
113
  Ptr<WifiMacQueue > GetQueue () const;
94
  virtual void SetMinCw (uint32_t minCw);
114
  virtual void SetMinCw (uint32_t minCw);
95
  virtual void SetMaxCw (uint32_t maxCw);
115
  virtual void SetMaxCw (uint32_t maxCw);
 Lines 129-134    Link Here 
129
  DcaTxop (const DcaTxop &o);
149
  DcaTxop (const DcaTxop &o);
130
150
131
  // Inherited from ns3::Object
151
  // Inherited from ns3::Object
152
  /**
153
   * Return the MacLow associated with this DcaTxop.
154
   *
155
   * \return MacLow
156
   */
132
  Ptr<MacLow> Low (void);
157
  Ptr<MacLow> Low (void);
133
  void DoInitialize ();
158
  void DoInitialize ();
134
  /* dcf notifications forwarded here */
159
  /* dcf notifications forwarded here */
 Lines 137-152    Link Here 
137
  void NotifyInternalCollision (void);
162
  void NotifyInternalCollision (void);
138
  void NotifyCollision (void);
163
  void NotifyCollision (void);
139
  /**
164
  /**
140
  * When a channel switching occurs, enqueued packets are removed.
165
   * When a channel switching occurs, enqueued packets are removed.
141
  */
166
   */
142
  void NotifyChannelSwitching (void);
167
  void NotifyChannelSwitching (void);
143
  /* event handlers */
168
169
  /* Event handlers */
170
  /**
171
   * Event handler when a CTS is received.
172
   *
173
   * \param snr
174
   * \param txMode
175
   */
144
  void GotCts (double snr, WifiMode txMode);
176
  void GotCts (double snr, WifiMode txMode);
177
  /**
178
   * Event handler when a CTS timeout has occurred.
179
   */
145
  void MissedCts (void);
180
  void MissedCts (void);
181
  /**
182
   * Event handler when an ACK is received.
183
   *
184
   * \param snr
185
   * \param txMode
186
   */
146
  void GotAck (double snr, WifiMode txMode);
187
  void GotAck (double snr, WifiMode txMode);
188
  /**
189
   * Event handler when an ACK is received.
190
   */
147
  void MissedAck (void);
191
  void MissedAck (void);
148
  void StartNext (void);
192
  void StartNext (void);
149
  void Cancel (void);
193
  void Cancel (void);
194
  /**
195
   * Event handler when a transmission that
196
   * does not require an ACK has completed.
197
   */
150
  void EndTxNoAck (void);
198
  void EndTxNoAck (void);
151
199
152
  void RestartAccessIfNeeded (void);
200
  void RestartAccessIfNeeded (void);
 Lines 155-165    Link Here 
155
  bool NeedRtsRetransmission (void);
203
  bool NeedRtsRetransmission (void);
156
  bool NeedDataRetransmission (void);
204
  bool NeedDataRetransmission (void);
157
  bool NeedFragmentation (void);
205
  bool NeedFragmentation (void);
206
  /**
207
   * Calculate the size of the next fragment.
208
   *
209
   * \return the size of the next fragment
210
   */
158
  uint32_t GetNextFragmentSize (void);
211
  uint32_t GetNextFragmentSize (void);
212
  /**
213
   * Calculate the size of the current fragment.
214
   *
215
   * \return the size of the current fragment
216
   */
159
  uint32_t GetFragmentSize (void);
217
  uint32_t GetFragmentSize (void);
218
  /**
219
   * Calculate the offset for the current fragment.
220
   *
221
   * \return the offset for the current fragment
222
   */
160
  uint32_t GetFragmentOffset (void);
223
  uint32_t GetFragmentOffset (void);
224
  /**
225
   * Check if the curren fragment is the last fragment.
226
   *
227
   * \return true if the curren fragment is the last fragment,
228
   *         false otherwise
229
   */
161
  bool IsLastFragment (void);
230
  bool IsLastFragment (void);
231
  /**
232
   * Continue to the next fragment. This method simply
233
   * increments the internal variable that keep track
234
   * of the current fragment number.
235
   */
162
  void NextFragment (void);
236
  void NextFragment (void);
237
  /**
238
   * Get the next fragment from the packet with
239
   * appropriate Wifi header for the fragment.
240
   *
241
   * \param hdr
242
   * \return the fragment with the current fragment number
243
   */
163
  Ptr<Packet> GetFragmentPacket (WifiMacHeader *hdr);
244
  Ptr<Packet> GetFragmentPacket (WifiMacHeader *hdr);
164
  virtual void DoDispose (void);
245
  virtual void DoDispose (void);
165
246
(-)a/src/wifi/model/dcf-manager.cc (-8 / +16 lines)
 Lines 163-175    Link Here 
163
}
163
}
164
164
165
165
166
/***************************************************************
166
/**
167
 *         Listener for Nav events. Forwards to DcfManager
167
 * Listener for NAV events. Forwards to DcfManager
168
 ***************************************************************/
168
 */
169
170
class LowDcfListener : public ns3::MacLowDcfListener
169
class LowDcfListener : public ns3::MacLowDcfListener
171
{
170
{
172
public:
171
public:
172
  /**
173
   * Create a LowDcfListener for the given DcfManager.
174
   *
175
   * \param dcf
176
   */
173
  LowDcfListener (ns3::DcfManager *dcf)
177
  LowDcfListener (ns3::DcfManager *dcf)
174
    : m_dcf (dcf)
178
    : m_dcf (dcf)
175
  {
179
  {
 Lines 205-217    Link Here 
205
  ns3::DcfManager *m_dcf;
209
  ns3::DcfManager *m_dcf;
206
};
210
};
207
211
208
/***************************************************************
212
/**
209
 *         Listener for PHY events. Forwards to DcfManager
213
 * Listener for PHY events. Forwards to DcfManager
210
 ***************************************************************/
214
 */
211
212
class PhyListener : public ns3::WifiPhyListener
215
class PhyListener : public ns3::WifiPhyListener
213
{
216
{
214
public:
217
public:
218
  /**
219
   * Create a PhyListener for the given DcfManager.
220
   *
221
   * \param dcf
222
   */
215
  PhyListener (ns3::DcfManager *dcf)
223
  PhyListener (ns3::DcfManager *dcf)
216
    : m_dcf (dcf)
224
    : m_dcf (dcf)
217
  {
225
  {
(-)a/src/wifi/model/dcf-manager.h (+72 lines)
 Lines 57-66    Link Here 
57
   * Calling this method after DcfManager::Add has been called is not recommended.
57
   * Calling this method after DcfManager::Add has been called is not recommended.
58
   */
58
   */
59
  void SetAifsn (uint32_t aifsn);
59
  void SetAifsn (uint32_t aifsn);
60
  /**
61
   * Set the minimum congestion window size.
62
   *
63
   * \param minCw the minimum congestion window size
64
   */
60
  void SetCwMin (uint32_t minCw);
65
  void SetCwMin (uint32_t minCw);
66
  /**
67
   * Set the maximum congestion window size.
68
   *
69
   * \param maxCw the maximum congestion window size
70
   */
61
  void SetCwMax (uint32_t maxCw);
71
  void SetCwMax (uint32_t maxCw);
72
  /**
73
   * Return the number of slots that make up an AIFS.
74
   *
75
   * \return the number of slots that make up an AIFS
76
   */
62
  uint32_t GetAifsn (void) const;
77
  uint32_t GetAifsn (void) const;
78
  /**
79
   * Return the minimum congestion window size.
80
   *
81
   * \return the minimum congestion window size
82
   */
63
  uint32_t GetCwMin (void) const;
83
  uint32_t GetCwMin (void) const;
84
  /**
85
   * Return the maximum congestion window size.
86
   *
87
   * \return the maximum congestion window size
88
   */
64
  uint32_t GetCwMax (void) const;
89
  uint32_t GetCwMax (void) const;
65
  /**
90
  /**
66
   * Update the value of the CW variable to take into account
91
   * Update the value of the CW variable to take into account
 Lines 286-295    Link Here 
286
  void NotifyCtsTimeoutResetNow ();
311
  void NotifyCtsTimeoutResetNow ();
287
private:
312
private:
288
  void UpdateBackoff (void);
313
  void UpdateBackoff (void);
314
  /**
315
   * Return the most recent time.
316
   *
317
   * \param a
318
   * \param b
319
   * \return the most recent time
320
   */
289
  Time MostRecent (Time a, Time b) const;
321
  Time MostRecent (Time a, Time b) const;
322
  /**
323
   * Return the most recent time.
324
   *
325
   * \param a
326
   * \param b
327
   * \param c
328
   * \return the most recent time
329
   */
290
  Time MostRecent (Time a, Time b, Time c) const;
330
  Time MostRecent (Time a, Time b, Time c) const;
331
  /**
332
   * Return the most recent time.
333
   *
334
   * \param a
335
   * \param b
336
   * \param c
337
   * \param d
338
   * \return the most recent time
339
   */
291
  Time MostRecent (Time a, Time b, Time c, Time d) const;
340
  Time MostRecent (Time a, Time b, Time c, Time d) const;
341
  /**
342
   * Return the most recent time.
343
   *
344
   * \param a
345
   * \param b
346
   * \param c
347
   * \param d
348
   * \param e
349
   * \param f
350
   * \return the most recent time
351
   */
292
  Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const;
352
  Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f) const;
353
  /**
354
   * Return the most recent time.
355
   *
356
   * \param a
357
   * \param b
358
   * \param c
359
   * \param d
360
   * \param e
361
   * \param f
362
   * \param g
363
   * \return the most recent time
364
   */
293
  Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f, Time g) const;
365
  Time MostRecent (Time a, Time b, Time c, Time d, Time e, Time f, Time g) const;
294
  /**
366
  /**
295
   * Access will never be granted to the medium _before_
367
   * Access will never be granted to the medium _before_
(-)a/src/wifi/model/dcf.h (+31 lines)
 Lines 34-44    Link Here 
34
public:
34
public:
35
  static TypeId GetTypeId (void);
35
  static TypeId GetTypeId (void);
36
36
37
  /**
38
   * Set the minimum congestion window size.
39
   *
40
   * \param minCw the minimum congestion window size
41
   */
37
  virtual void SetMinCw (uint32_t minCw) = 0;
42
  virtual void SetMinCw (uint32_t minCw) = 0;
43
  /**
44
   * Set the maximum congestion window size.
45
   *
46
   * \param maxCw the maximum congestion window size
47
   */
38
  virtual void SetMaxCw (uint32_t maxCw) = 0;
48
  virtual void SetMaxCw (uint32_t maxCw) = 0;
49
  /**
50
   * \param aifsn the number of slots which make up an AIFS for a specific DCF.
51
   *        a DIFS corresponds to an AIFSN = 2.
52
   *
53
   * Calling this method after DcfManager::Add has been called is not recommended.
54
   */
39
  virtual void SetAifsn (uint32_t aifsn) = 0;
55
  virtual void SetAifsn (uint32_t aifsn) = 0;
56
  /**
57
   * Return the minimum congestion window size.
58
   *
59
   * \return the minimum congestion window size
60
   */
40
  virtual uint32_t GetMinCw (void) const = 0;
61
  virtual uint32_t GetMinCw (void) const = 0;
62
  /**
63
   * Return the maximum congestion window size.
64
   *
65
   * \return the maximum congestion window size
66
   */
41
  virtual uint32_t GetMaxCw (void) const = 0;
67
  virtual uint32_t GetMaxCw (void) const = 0;
68
  /**
69
   * Return the number of slots that make up an AIFS.
70
   *
71
   * \return the number of slots that make up an AIFS
72
   */
42
  virtual uint32_t GetAifsn (void) const = 0;
73
  virtual uint32_t GetAifsn (void) const = 0;
43
};
74
};
44
75
(-)a/src/wifi/model/edca-txop-n.h (-3 / +123 lines)
 Lines 88-102    Link Here 
88
  virtual ~EdcaTxopN ();
88
  virtual ~EdcaTxopN ();
89
  void DoDispose ();
89
  void DoDispose ();
90
90
91
  /**
92
   * Set MacLow associated with this EdcaTxopN.
93
   *
94
   * \param low MacLow
95
   */
91
  void SetLow (Ptr<MacLow> low);
96
  void SetLow (Ptr<MacLow> low);
92
  void SetTxMiddle (MacTxMiddle *txMiddle);
97
  void SetTxMiddle (MacTxMiddle *txMiddle);
98
  /**
99
   * Set DcfManager this EdcaTxopN is associated to.
100
   *
101
   * \param manager DcfManager
102
   */
93
  void SetManager (DcfManager *manager);
103
  void SetManager (DcfManager *manager);
94
  void SetTxOkCallback (TxOk callback);
104
  void SetTxOkCallback (TxOk callback);
95
  void SetTxFailedCallback (TxFailed callback);
105
  void SetTxFailedCallback (TxFailed callback);
106
  /**
107
   * Set WifiRemoteStationsManager this EdcaTxopN is associated to.
108
   *
109
   * \param remoteManager WifiRemoteStationManager
110
   */
96
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> remoteManager);
111
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> remoteManager);
97
  void SetTypeOfStation (enum TypeOfStation type);
112
  void SetTypeOfStation (enum TypeOfStation type);
98
  enum TypeOfStation GetTypeOfStation (void) const;
113
  enum TypeOfStation GetTypeOfStation (void) const;
99
114
115
  /**
116
   * Return the packet queue associated with this EdcaTxopN.
117
   *
118
   * \return WifiMacQueue
119
   */
100
  Ptr<WifiMacQueue > GetQueue () const;
120
  Ptr<WifiMacQueue > GetQueue () const;
101
  virtual void SetMinCw (uint32_t minCw);
121
  virtual void SetMinCw (uint32_t minCw);
102
  virtual void SetMaxCw (uint32_t maxCw);
122
  virtual void SetMaxCw (uint32_t maxCw);
 Lines 105-110    Link Here 
105
  virtual uint32_t GetMaxCw (void) const;
125
  virtual uint32_t GetMaxCw (void) const;
106
  virtual uint32_t GetAifsn (void) const;
126
  virtual uint32_t GetAifsn (void) const;
107
127
128
  /**
129
   * Return the MacLow associated with this EdcaTxopN.
130
   *
131
   * \return MacLow
132
   */
108
  Ptr<MacLow> Low (void);
133
  Ptr<MacLow> Low (void);
109
  Ptr<MsduAggregator> GetMsduAggregator (void) const;
134
  Ptr<MsduAggregator> GetMsduAggregator (void) const;
110
135
 Lines 114-134    Link Here 
114
  void NotifyInternalCollision (void);
139
  void NotifyInternalCollision (void);
115
  void NotifyCollision (void);
140
  void NotifyCollision (void);
116
  /**
141
  /**
117
  * When a channel switching occurs, enqueued packets are removed.
142
   * When a channel switching occurs, enqueued packets are removed.
118
  */
143
   */
119
  void NotifyChannelSwitching (void);
144
  void NotifyChannelSwitching (void);
120
145
121
  /*event handlers*/
146
  /* Event handlers */
147
  /**
148
   * Event handler when a CTS is received.
149
   *
150
   * \param snr
151
   * \param txMode
152
   */
122
  void GotCts (double snr, WifiMode txMode);
153
  void GotCts (double snr, WifiMode txMode);
154
  /**
155
   * Event handler when a CTS timeout has occurred.
156
   */
123
  void MissedCts (void);
157
  void MissedCts (void);
158
  /**
159
   * Event handler when an ACK is received.
160
   *
161
   * \param snr
162
   * \param txMode
163
   */
124
  void GotAck (double snr, WifiMode txMode);
164
  void GotAck (double snr, WifiMode txMode);
165
  /**
166
   * Event handler when a Block ACK is received.
167
   *
168
   * \param blockAck
169
   * \param recipient
170
   */
125
  void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient);
171
  void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient);
172
  /**
173
   * Event handler when a Block ACK timeout has occurred.
174
   */
126
  void MissedBlockAck (void);
175
  void MissedBlockAck (void);
127
  void GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient);
176
  void GotAddBaResponse (const MgtAddBaResponseHeader *respHdr, Mac48Address recipient);
128
  void GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient);
177
  void GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient);
178
  /**
179
   * Event handler when an ACK is received.
180
   */
129
  void MissedAck (void);
181
  void MissedAck (void);
130
  void StartNext (void);
182
  void StartNext (void);
131
  void Cancel (void);
183
  void Cancel (void);
184
  /**
185
   * Event handler when a transmission that
186
   * does not require an ACK has completed.
187
   */
132
  void EndTxNoAck (void);
188
  void EndTxNoAck (void);
133
189
134
  void RestartAccessIfNeeded (void);
190
  void RestartAccessIfNeeded (void);
 Lines 137-155    Link Here 
137
  bool NeedRtsRetransmission (void);
193
  bool NeedRtsRetransmission (void);
138
  bool NeedDataRetransmission (void);
194
  bool NeedDataRetransmission (void);
139
  bool NeedFragmentation (void) const;
195
  bool NeedFragmentation (void) const;
196
  /**
197
   * Calculate the size of the next fragment.
198
   *
199
   * \return the size of the next fragment
200
   */
140
  uint32_t GetNextFragmentSize (void);
201
  uint32_t GetNextFragmentSize (void);
202
  /**
203
   * Calculate the size of the current fragment.
204
   *
205
   * \return the size of the current fragment
206
   */
141
  uint32_t GetFragmentSize (void);
207
  uint32_t GetFragmentSize (void);
208
  /**
209
   * Calculate the offset for the current fragment.
210
   *
211
   * \return the offset for the current fragment
212
   */
142
  uint32_t GetFragmentOffset (void);
213
  uint32_t GetFragmentOffset (void);
214
  /**
215
   * Check if the curren fragment is the last fragment.
216
   *
217
   * \return true if the curren fragment is the last fragment,
218
   *         false otherwise
219
   */
143
  bool IsLastFragment (void) const;
220
  bool IsLastFragment (void) const;
221
  /**
222
   * Continue to the next fragment. This method simply
223
   * increments the internal variable that keep track
224
   * of the current fragment number.
225
   */
144
  void NextFragment (void);
226
  void NextFragment (void);
227
  /**
228
   * Get the next fragment from the packet with
229
   * appropriate Wifi header for the fragment.
230
   *
231
   * \param hdr
232
   * \return the fragment with the current fragment number
233
   */
145
  Ptr<Packet> GetFragmentPacket (WifiMacHeader *hdr);
234
  Ptr<Packet> GetFragmentPacket (WifiMacHeader *hdr);
146
235
147
  void SetAccessCategory (enum AcIndex ac);
236
  void SetAccessCategory (enum AcIndex ac);
237
  /**
238
   * \param packet packet to send
239
   * \param hdr header of packet to send.
240
   *
241
   * Store the packet in the internal queue until it
242
   * can be sent safely.
243
   */
148
  void Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
244
  void Queue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
149
  void SetMsduAggregator (Ptr<MsduAggregator> aggr);
245
  void SetMsduAggregator (Ptr<MsduAggregator> aggr);
246
  /**
247
   * \param packet packet to send
248
   * \param hdr header of packet to send.
249
   *
250
   * Store the packet in the front of the internal queue until it
251
   * can be sent safely.
252
   */
150
  void PushFront (Ptr<const Packet> packet, const WifiMacHeader &hdr);
253
  void PushFront (Ptr<const Packet> packet, const WifiMacHeader &hdr);
254
  /**
255
   * Complete block ACK configuration.
256
   */
151
  void CompleteConfig (void);
257
  void CompleteConfig (void);
258
  /**
259
   * Set threshold for block ACK mechanism. If number of packets in the
260
   * queue reaches the threshold, block ACK mechanism is used.
261
   *
262
   * \param threshold
263
   */
152
  void SetBlockAckThreshold (uint8_t threshold);
264
  void SetBlockAckThreshold (uint8_t threshold);
265
  /**
266
   * Return the current threshold for block ACK mechanism.
267
   *
268
   * \return the current threshold for block ACK mechanism
269
   */
153
  uint8_t GetBlockAckThreshold (void) const;
270
  uint8_t GetBlockAckThreshold (void) const;
154
  void SetBlockAckInactivityTimeout (uint16_t timeout);
271
  void SetBlockAckInactivityTimeout (uint16_t timeout);
155
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
272
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
 Lines 174-179    Link Here 
174
   * If aggregating sta is an AP
291
   * If aggregating sta is an AP
175
   *   SA = Address3
292
   *   SA = Address3
176
   *   DA = Address1
293
   *   DA = Address1
294
   *
295
   * \param hdr
296
   * \return Mac48Address
177
   */
297
   */
178
  Mac48Address MapSrcAddressForAggregation (const WifiMacHeader &hdr);
298
  Mac48Address MapSrcAddressForAggregation (const WifiMacHeader &hdr);
179
  Mac48Address MapDestAddressForAggregation (const WifiMacHeader &hdr);
299
  Mac48Address MapDestAddressForAggregation (const WifiMacHeader &hdr);
(-)a/src/wifi/model/error-rate-model.h (+1 lines)
 Lines 55-60    Link Here 
55
   * \param mode the Wi-Fi mode the chunk is sent
55
   * \param mode the Wi-Fi mode the chunk is sent
56
   * \param snr the SNR of the chunk
56
   * \param snr the SNR of the chunk
57
   * \param nbits the number of bits in this chunk
57
   * \param nbits the number of bits in this chunk
58
   * \return probability of successfully receiving the chunk
58
   */
59
   */
59
  virtual double GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const = 0;
60
  virtual double GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const = 0;
60
};
61
};
(-)a/src/wifi/model/ht-capabilities.h (-1 / +11 lines)
 Lines 72-84    Link Here 
72
  void SerializeInformationField (Buffer::Iterator start) const;
72
  void SerializeInformationField (Buffer::Iterator start) const;
73
  uint8_t DeserializeInformationField (Buffer::Iterator start,
73
  uint8_t DeserializeInformationField (Buffer::Iterator start,
74
                                       uint8_t length);
74
                                       uint8_t length);
75
 /*
75
  /**
76
   * This information element is a bit special in that it is only
76
   * This information element is a bit special in that it is only
77
   * included if the STA is an HT STA. To support this we
77
   * included if the STA is an HT STA. To support this we
78
   * override the Serialize and GetSerializedSize methods of
78
   * override the Serialize and GetSerializedSize methods of
79
   * WifiInformationElement.
79
   * WifiInformationElement.
80
   *
81
   * \param start
82
   * \return an iterator
80
   */
83
   */
81
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
84
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
85
  /**
86
   * Return the serialized size of this HT capability 
87
   * information element.
88
   * 
89
   * \return the serialized size of this HT capability 
90
   * information element
91
   */
82
  uint16_t GetSerializedSize () const;
92
  uint16_t GetSerializedSize () const;
83
 
93
 
84
private:
94
private:
(-)a/src/wifi/model/ideal-wifi-manager.cc (+6 lines)
 Lines 27-32    Link Here 
27
27
28
namespace ns3 {
28
namespace ns3 {
29
29
30
/**
31
 * \brief hold per-remote-station state for Ideal Wifi manager.
32
 *
33
 * This struct extends from WifiRemoteStation struct to hold additional
34
 * information required by the Ideal Wifi manager
35
 */
30
struct IdealWifiRemoteStation : public WifiRemoteStation
36
struct IdealWifiRemoteStation : public WifiRemoteStation
31
{
37
{
32
  double m_lastSnr;
38
  double m_lastSnr;
(-)a/src/wifi/model/mac-low.cc (-5 / +8 lines)
 Lines 243-256    Link Here 
243
}
243
}
244
244
245
245
246
/***************************************************************
246
/**
247
 *         Listener for PHY events. Forwards to MacLow
247
 * Listener for PHY events. Forwards to MacLow
248
 ***************************************************************/
248
 */
249
250
251
class PhyMacLowListener : public ns3::WifiPhyListener
249
class PhyMacLowListener : public ns3::WifiPhyListener
252
{
250
{
253
public:
251
public:
252
  /**
253
   * Create a PhyMacLowListener for the given MacLow.
254
   *
255
   * \param macLow
256
   */
254
  PhyMacLowListener (ns3::MacLow *macLow)
257
  PhyMacLowListener (ns3::MacLow *macLow)
255
    : m_macLow (macLow)
258
    : m_macLow (macLow)
256
  {
259
  {
(-)a/src/wifi/model/mac-low.h (-4 / +438 lines)
 Lines 150-165    Link Here 
150
  MacLowDcfListener ();
150
  MacLowDcfListener ();
151
  virtual ~MacLowDcfListener ();
151
  virtual ~MacLowDcfListener ();
152
  /**
152
  /**
153
   * Norify that NAV has started for the given duration.
154
   *
153
   * \param duration duration of NAV timer
155
   * \param duration duration of NAV timer
154
   */
156
   */
155
  virtual void NavStart (Time duration) = 0;
157
  virtual void NavStart (Time duration) = 0;
156
  /**
158
  /**
159
   * Notify that NAV has resetted.
160
   *
157
   * \param duration duration of NAV timer
161
   * \param duration duration of NAV timer
158
   */
162
   */
159
  virtual void NavReset (Time duration) = 0;
163
  virtual void NavReset (Time duration) = 0;
164
  /**
165
   * Notify that ACK timeout has started for a given duration.
166
   *
167
   * \param duration duration of ACK timeout
168
   */
160
  virtual void AckTimeoutStart (Time duration) = 0;
169
  virtual void AckTimeoutStart (Time duration) = 0;
170
  /**
171
   * Notify that ACK timeout has resetted.
172
   */
161
  virtual void AckTimeoutReset () = 0;
173
  virtual void AckTimeoutReset () = 0;
174
  /**
175
   * Notify that CTS timeout has started for a given duration.
176
   *
177
   * \param duration duration of CTS timeout
178
   */
162
  virtual void CtsTimeoutStart (Time duration) = 0;
179
  virtual void CtsTimeoutStart (Time duration) = 0;
180
  /**
181
   * Notify that CTS timeout has resetted.
182
   */
163
  virtual void CtsTimeoutReset () = 0;
183
  virtual void CtsTimeoutReset () = 0;
164
};
184
};
165
185
 Lines 180-185    Link Here 
180
   * agreement. Timer is reset when a frame with ack policy block ack
200
   * agreement. Timer is reset when a frame with ack policy block ack
181
   * or a block ack request are received. When this timer reaches zero
201
   * or a block ack request are received. When this timer reaches zero
182
   * this method is called and a delba frame is scheduled for transmission.
202
   * this method is called and a delba frame is scheduled for transmission.
203
   *
204
   * \param originator MAC address of the data originator
205
   * \param tid
183
   */
206
   */
184
  virtual void BlockAckInactivityTimeout (Mac48Address originator, uint8_t tid) = 0;
207
  virtual void BlockAckInactivityTimeout (Mac48Address originator, uint8_t tid) = 0;
185
};
208
};
 Lines 385-415    Link Here 
385
  MacLow ();
408
  MacLow ();
386
  virtual ~MacLow ();
409
  virtual ~MacLow ();
387
410
411
  /**
412
   * Set up WifiPhy associated with this MacLow.
413
   *
414
   * \param phy WifiPhy associated with this MacLow
415
   */
388
  void SetPhy (Ptr<WifiPhy> phy);
416
  void SetPhy (Ptr<WifiPhy> phy);
417
  /**
418
   * Set up WifiRemoteStationManager associated with this MacLow.
419
   *
420
   * \param manager WifiRemoteStationManager associated with this MacLow
421
   */
389
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager);
422
  void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager);
390
423
424
  /**
425
   * Set MAC address of this MacLow.
426
   *
427
   * \param ad Mac48Address of this MacLow
428
   */
391
  void SetAddress (Mac48Address ad);
429
  void SetAddress (Mac48Address ad);
430
  /**
431
   * Set ACK timeout of this MacLow.
432
   *
433
   * \param ackTimeout ACK timeout of this MacLow
434
   */
392
  void SetAckTimeout (Time ackTimeout);
435
  void SetAckTimeout (Time ackTimeout);
436
  /**
437
   * Set Basic Block ACK timeout of this MacLow.
438
   *
439
   * \param blockAckTimeout Basic Block ACK timeout of this MacLow
440
   */
393
  void SetBasicBlockAckTimeout (Time blockAckTimeout);
441
  void SetBasicBlockAckTimeout (Time blockAckTimeout);
442
  /**
443
   * Set Compressed Block ACK timeout of this MacLow.
444
   *
445
   * \param blockAckTimeout Compressed Block ACK timeout of this MacLow
446
   */
394
  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
447
  void SetCompressedBlockAckTimeout (Time blockAckTimeout);
448
  /**
449
   * Enable or disable CTS-to-self capability.
450
   *
451
   * \param enable Enable or disable CTS-to-self capability
452
   */
395
  void SetCtsToSelfSupported (bool enable);
453
  void SetCtsToSelfSupported (bool enable);
454
  /**
455
   * Set CTS timeout of this MacLow.
456
   *
457
   * \param ctsTimeout CTS timeout of this MacLow
458
   */
396
  void SetCtsTimeout (Time ctsTimeout);
459
  void SetCtsTimeout (Time ctsTimeout);
460
  /**
461
   * Set Short Interframe Space (SIFS) of this MacLow.
462
   *
463
   * \param sifs SIFS of this MacLow
464
   */
397
  void SetSifs (Time sifs);
465
  void SetSifs (Time sifs);
466
  /**
467
   * Set Reduced Interframe Space (RIFS) of this MacLow.
468
   *
469
   * \param rifs RIFS of this MacLow
470
   */
398
  void SetRifs (Time rifs);
471
  void SetRifs (Time rifs);
472
  /**
473
   * Set slot duration of this MacLow.
474
   *
475
   * \param slotTime slot duration of this MacLow
476
   */
399
  void SetSlotTime (Time slotTime);
477
  void SetSlotTime (Time slotTime);
478
  /**
479
   * Set PCF Interframe Space (PIFS) of this MacLow.
480
   *
481
   * \param pifs PIFS of this MacLow
482
   */
400
  void SetPifs (Time pifs);
483
  void SetPifs (Time pifs);
484
  /**
485
   * Set the Basic Service Set Identification.
486
   *
487
   * \param ad the BSSID
488
   */
401
  void SetBssid (Mac48Address ad);
489
  void SetBssid (Mac48Address ad);
490
  /**
491
   * Enable promiscuous mode.
492
   */
402
  void SetPromisc (void);
493
  void SetPromisc (void);
494
  /**
495
   * Return whether CTS-to-self capability is supported.
496
   *
497
   * \return true if CTS-to-self is supported, false otherwise
498
   */
403
  bool GetCtsToSelfSupported () const;
499
  bool GetCtsToSelfSupported () const;
500
  /**
501
   * Return the MAC address of this MacLow.
502
   *
503
   * \return Mac48Address of this MacLow
504
   */
404
  Mac48Address GetAddress (void) const;
505
  Mac48Address GetAddress (void) const;
506
  /**
507
   * Return ACK timeout of this MacLow.
508
   *
509
   * \return ACK timeout
510
   */
405
  Time GetAckTimeout (void) const;
511
  Time GetAckTimeout (void) const;
512
  /**
513
   * Return Basic Block ACK timeout of this MacLow.
514
   *
515
   * \return Basic Block ACK timeout
516
   */
406
  Time GetBasicBlockAckTimeout () const;
517
  Time GetBasicBlockAckTimeout () const;
518
  /**
519
   * Return Compressed Block ACK timeout of this MacLow.
520
   *
521
   * \return Compressed Block ACK timeout
522
   */
407
  Time GetCompressedBlockAckTimeout () const;
523
  Time GetCompressedBlockAckTimeout () const;
524
  /**
525
   * Return CTS timeout of this MacLow.
526
   *
527
   * \return CTS timeout
528
   */
408
  Time GetCtsTimeout (void) const;
529
  Time GetCtsTimeout (void) const;
530
  /**
531
   * Return Short Interframe Space (SIFS) of this MacLow.
532
   *
533
   * \return SIFS
534
   */
409
  Time GetSifs (void) const;
535
  Time GetSifs (void) const;
536
  /**
537
   * Return slot duration of this MacLow.
538
   *
539
   * \return slot duration
540
   */
410
  Time GetSlotTime (void) const;
541
  Time GetSlotTime (void) const;
542
  /**
543
   * Return PCF Interframe Space (PIFS) of this MacLow.
544
   *
545
   * \return PIFS
546
   */
411
  Time GetPifs (void) const;
547
  Time GetPifs (void) const;
548
  /**
549
   * Return Reduced Interframe Space (RIFS) of this MacLow.
550
   *
551
   * \return RIFS
552
   */
412
  Time GetRifs (void) const;
553
  Time GetRifs (void) const;
554
  /**
555
   * Return the Basic Service Set Identification.
556
   *
557
   * \return BSSID
558
   */
413
  Mac48Address GetBssid (void) const;
559
  Mac48Address GetBssid (void) const;
414
560
415
  /**
561
  /**
 Lines 429-434    Link Here 
429
   * \param packet to send (does not include the 802.11 MAC header and checksum)
575
   * \param packet to send (does not include the 802.11 MAC header and checksum)
430
   * \param hdr header associated to the packet to send.
576
   * \param hdr header associated to the packet to send.
431
   * \param parameters transmission parameters of packet.
577
   * \param parameters transmission parameters of packet.
578
   * \return the transmission time that includes the time for the next packet transmission
432
   *
579
   *
433
   * This transmission time includes the time required for
580
   * This transmission time includes the time required for
434
   * the next packet transmission if one was selected.
581
   * the next packet transmission if one was selected.
 Lines 513-573    Link Here 
513
   */
660
   */
514
  void RegisterBlockAckListenerForAc (enum AcIndex ac, MacLowBlockAckEventListener *listener);
661
  void RegisterBlockAckListenerForAc (enum AcIndex ac, MacLowBlockAckEventListener *listener);
515
private:
662
private:
663
  /**
664
   * Cancel all scheduled events. Called before beginning a transmission
665
   * or switching channel.
666
   */
516
  void CancelAllEvents (void);
667
  void CancelAllEvents (void);
668
  /**
669
   * Return the total ACK size (including FCS trailer).
670
   *
671
   * \return the total ACK size
672
   */
517
  uint32_t GetAckSize (void) const;
673
  uint32_t GetAckSize (void) const;
674
  /**
675
   * Return the total Block ACK size (including FCS trailer).
676
   *
677
   * \param type the Block ACK type
678
   * \return the total Block ACK size
679
   */
518
  uint32_t GetBlockAckSize (enum BlockAckType type) const;
680
  uint32_t GetBlockAckSize (enum BlockAckType type) const;
681
  /**
682
   * Return the total RTS size (including FCS trailer).
683
   *
684
   * \return the total RTS size
685
   */
519
  uint32_t GetRtsSize (void) const;
686
  uint32_t GetRtsSize (void) const;
687
  /**
688
   * Return the total CTS size (including FCS trailer).
689
   *
690
   * \return the total CTS size
691
   */
520
  uint32_t GetCtsSize (void) const;
692
  uint32_t GetCtsSize (void) const;
693
  /**
694
   * Return the total size of the packet after WifiMacHeader and FCS trailer
695
   * have been added.
696
   *
697
   * \param packet the packet to be encapsulated with WifiMacHeader and FCS trailer
698
   * \param hdr the WifiMacHeader
699
   * \return the total packet size
700
   */
521
  uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
701
  uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
702
  /**
703
   * Forward the packet down to WifiPhy for transmission.
704
   *
705
   * \param packet
706
   * \param hdr
707
   * \param txVector
708
   * \param preamble
709
   */
522
  void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr,
710
  void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr,
523
                    WifiTxVector txVector, WifiPreamble preamble);
711
                    WifiTxVector txVector, WifiPreamble preamble);
712
  /**
713
   * Return a TXVECTOR for the RTS frame given the destination.
714
   * The function consults WifiRemoteStationManager, which controls the rate
715
   * to different destinations.
716
   *
717
   * \param packet the packet being asked for RTS TXVECTOR
718
   * \param hdr the WifiMacHeader
719
   * \return TXVECTOR for the RTS of the given packet
720
   */
524
  WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
721
  WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
722
  /**
723
   * Return a TXVECTOR for the DATA frame given the destination.
724
   * The function consults WifiRemoteStationManager, which controls the rate
725
   * to different destinations.
726
   *
727
   * \param packet the packet being asked for TXVECTOR
728
   * \param hdr the WifiMacHeader
729
   * \return TXVECTOR for the given packet
730
   */
525
  WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
731
  WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
732
  /**
733
   * Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS
734
   * used by the sender.
735
   * The function consults WifiRemoteStationManager, which controls the rate
736
   * to different destinations.
737
   *
738
   * \param to the MAC address of the CTS receiver
739
   * \param rtsTxMode the mode of the RTS used by the sender
740
   * \return TXVECTOR for the CTS
741
   */
526
  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
742
  WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const;
743
  /**
744
   * Return a TXVECTOR for the ACK frame given the destination and the mode of the DATA
745
   * used by the sender.
746
   * The function consults WifiRemoteStationManager, which controls the rate
747
   * to different destinations.
748
   *
749
   * \param to the MAC address of the ACK receiver
750
   * \param dataTxMode the mode of the DATA used by the sender
751
   * \return TXVECTOR for the ACK
752
   */
527
  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
753
  WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
754
  /**
755
   * Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA
756
   * used by the sender.
757
   * The function consults WifiRemoteStationManager, which controls the rate
758
   * to different destinations.
759
   *
760
   * \param to the MAC address of the Block ACK receiver
761
   * \param dataTxMode the mode of the DATA used by the sender
762
   * \return TXVECTOR for the Block ACK
763
   */
528
  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
764
  WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const;
529
765
766
  /**
767
   * Return a TXVECTOR for the CTS-to-self frame.
768
   * The function consults WifiRemoteStationManager, which controls the rate
769
   * to different destinations.
770
   *
771
   * \param packet the packet that requires CTS-to-self
772
   * \param hdr the Wifi header of the packet
773
   * \return TXVECTOR for the CTS-to-self operation
774
   */
530
  WifiTxVector GetCtsToSelfTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
775
  WifiTxVector GetCtsToSelfTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const;
531
776
777
  /**
778
   * Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS
779
   * used by the sender.
780
   * The function consults WifiRemoteStationManager, which controls the rate
781
   * to different destinations.
782
   *
783
   * \param to the MAC address of the CTS receiver
784
   * \param rtsTxMode the mode of the RTS used by the sender
785
   * \return TXVECTOR for the CTS
786
   */
532
  WifiTxVector GetCtsTxVectorForRts (Mac48Address to, WifiMode rtsTxMode) const;
787
  WifiTxVector GetCtsTxVectorForRts (Mac48Address to, WifiMode rtsTxMode) const;
788
  /**
789
   * Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA
790
   * used by the sender.
791
   * The function consults WifiRemoteStationManager, which controls the rate
792
   * to different destinations.
793
   *
794
   * \param to the MAC address of the Block ACK receiver
795
   * \param dataTxMode the mode of the DATA used by the sender
796
   * \return TXVECTOR for the Block ACK
797
   */
533
  WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const;
798
  WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const;
534
799
800
  /**
801
   * Return the time required to transmit the CTS (including preamble and FCS).
802
   *
803
   * \param ctsTxVector
804
   * \return the time required to transmit the CTS (including preamble and FCS)
805
   */
535
  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
806
  Time GetCtsDuration (WifiTxVector ctsTxVector) const;
807
  /**
808
   * Return the time required to transmit the CTS to the specified address
809
   * given the TXVECTOR of the RTS (including preamble and FCS).
810
   *
811
   * \param to
812
   * \param rtsTxVector
813
   * \return the time required to transmit the CTS (including preamble and FCS)
814
   */
536
  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
815
  Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const;
816
  /**
817
   * Return the time required to transmit the ACK (including preamble and FCS).
818
   *
819
   * \param ackTxVector
820
   * \return the time required to transmit the ACK (including preamble and FCS)
821
   */
537
  Time GetAckDuration (WifiTxVector ackTxVector) const;
822
  Time GetAckDuration (WifiTxVector ackTxVector) const;
823
  /**
824
   * Return the time required to transmit the ACK to the specified address
825
   * given the TXVECTOR of the DATA (including preamble and FCS).
826
   *
827
   * \param to
828
   * \param dataTxVector
829
   * \return the time required to transmit the ACK (including preamble and FCS)
830
   */
538
  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
831
  Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const;
539
  Time GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const;
832
  Time GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const;
540
833
834
  /**
835
   * Check if CTS-to-self mechanism should be used for the current packet.
836
   *
837
   * \return true if CTS-to-self mechanism should be used for the current packet,
838
   *         false otherwise
839
   */
541
  bool NeedCtsToSelf (void);
840
  bool NeedCtsToSelf (void);
542
  
841
  
543
  Time CalculateOverallTxTime (Ptr<const Packet> packet,
842
  Time CalculateOverallTxTime (Ptr<const Packet> packet,
544
                               const WifiMacHeader* hdr,
843
                               const WifiMacHeader* hdr,
545
                               const MacLowTransmissionParameters &params) const;
844
                               const MacLowTransmissionParameters &params) const;
546
  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble);
845
  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble);
846
  /**
847
   * Reset NAV with the given duration.
848
   *
849
   * \param duration
850
   */
547
  void DoNavResetNow (Time duration);
851
  void DoNavResetNow (Time duration);
852
  /**
853
   * Start NAV with the given duration.
854
   *
855
   * \param duration
856
   * \return true if NAV is resetted
857
   */
548
  bool DoNavStartNow (Time duration);
858
  bool DoNavStartNow (Time duration);
859
  /**
860
   * Check if NAV is zero.
861
   *
862
   * \return true if NAV is zero,
863
   *         false otherwise
864
   */
549
  bool IsNavZero (void) const;
865
  bool IsNavZero (void) const;
866
  /**
867
   * Notify DcfManager (via DcfListener) that
868
   * ACK timer should be started for the given
869
   * duration.
870
   *
871
   * \param duration
872
   */
550
  void NotifyAckTimeoutStartNow (Time duration);
873
  void NotifyAckTimeoutStartNow (Time duration);
874
  /**
875
   * Notify DcfManager (via DcfListener) that
876
   * ACK timer should be resetted.
877
   */
551
  void NotifyAckTimeoutResetNow ();
878
  void NotifyAckTimeoutResetNow ();
879
  /**
880
   * Notify DcfManager (via DcfListener) that
881
   * CTS timer should be started for the given
882
   * duration.
883
   *
884
   * \param duration
885
   */
552
  void NotifyCtsTimeoutStartNow (Time duration);
886
  void NotifyCtsTimeoutStartNow (Time duration);
887
  /**
888
   * Notify DcfManager (via DcfListener) that
889
   * CTS timer should be resetted.
890
   */
553
  void NotifyCtsTimeoutResetNow ();
891
  void NotifyCtsTimeoutResetNow ();
554
892
893
  /**
894
   * Reset NAV after CTS was missed when the NAV was
895
   * setted with RTS.
896
   *
897
   * \param rtsEndRxTime
898
   */
555
  void NavCounterResetCtsMissed (Time rtsEndRxTime);
899
  void NavCounterResetCtsMissed (Time rtsEndRxTime);
900
901
  /* Event handlers */
902
  /**
903
   * Event handler when normal ACK timeout occurs.
904
   */
556
  void NormalAckTimeout (void);
905
  void NormalAckTimeout (void);
906
  /**
907
   * Event handler when fast ACK timeout occurs (idle).
908
   */
557
  void FastAckTimeout (void);
909
  void FastAckTimeout (void);
910
  /**
911
   * Event handler when super fast ACK timeout occurs.
912
   */
558
  void SuperFastAckTimeout (void);
913
  void SuperFastAckTimeout (void);
914
  /**
915
   * Event handler when fast ACK timeout occurs (busy).
916
   */
559
  void FastAckFailedTimeout (void);
917
  void FastAckFailedTimeout (void);
918
  /**
919
   * Event handler when block ACK timeout occurs.
920
   */
560
  void BlockAckTimeout (void);
921
  void BlockAckTimeout (void);
922
  /**
923
   * Event handler when CTS timeout occurs.
924
   */
561
  void CtsTimeout (void);
925
  void CtsTimeout (void);
926
  /**
927
   * Send CTS for a CTS-to-self mechanism.
928
   */
562
  void SendCtsToSelf (void);
929
  void SendCtsToSelf (void);
930
  /**
931
   * Send CTS after receiving RTS.
932
   *
933
   * \param source
934
   * \param duration
935
   * \param txMode
936
   * \param rtsSnr
937
   */
563
  void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
938
  void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
564
  void SendAckAfterData (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
939
  /**
940
   * Send ACK after receiving DATA.
941
   *
942
   * \param source
943
   * \param duration
944
   * \param dataTxMode
945
   * \param dataSnr
946
   */
947
  void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr);
948
  /**
949
   * Send DATA after receiving CTS.
950
   *
951
   * \param source
952
   * \param duration
953
   * \param txMode
954
   */
565
  void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode);
955
  void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode);
956
  /**
957
   * Event handler that is usually scheduled to fired at the appropriate time
958
   * after completing transmissions.
959
   */
566
  void WaitSifsAfterEndTx (void);
960
  void WaitSifsAfterEndTx (void);
961
  /**
962
   * A transmission that does not require an ACK has completed.
963
   */
567
  void EndTxNoAck (void);
964
  void EndTxNoAck (void);
568
965
966
  /**
967
   * Send RTS to begin RTS-CTS-DATA-ACK transaction.
968
   */
569
  void SendRtsForPacket (void);
969
  void SendRtsForPacket (void);
970
  /**
971
   * Send DATA packet, which can be DATA-ACK or
972
   * RTS-CTS-DATA-ACK transaction.
973
   */
570
  void SendDataPacket (void);
974
  void SendDataPacket (void);
975
  /**
976
   * Start a DATA timer by scheduling appropriate
977
   * ACK timeout.
978
   *
979
   * \param dataTxVector
980
   */
571
  void StartDataTxTimers (WifiTxVector dataTxVector);
981
  void StartDataTxTimers (WifiTxVector dataTxVector);
572
  virtual void DoDispose (void);
982
  virtual void DoDispose (void);
573
  /**
983
  /**
 Lines 599-629    Link Here 
599
   * circularly modulo 2^12.
1009
   * circularly modulo 2^12.
600
   */
1010
   */
601
  bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr);
1011
  bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr);
602
  /*
1012
  /**
603
   * Invoked after that a block ack request has been received. Looks for corresponding
1013
   * Invoked after that a block ack request has been received. Looks for corresponding
604
   * block ack agreement and creates block ack bitmap on a received packets basis.
1014
   * block ack agreement and creates block ack bitmap on a received packets basis.
1015
   *
1016
   * \param reqHdr
1017
   * \param originator
1018
   * \param duration
1019
   * \param blockAckReqTxMode
605
   */
1020
   */
606
  void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac48Address originator,
1021
  void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac48Address originator,
607
                                         Time duration, WifiMode blockAckReqTxMode);
1022
                                         Time duration, WifiMode blockAckReqTxMode);
608
  /*
1023
  /**
609
   * This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission.
1024
   * This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission.
1025
   *
1026
   * \param blockAck
1027
   * \param originator
1028
   * \param immediate
1029
   * \param duration
1030
   * \param blockAckReqTxMode
610
   */
1031
   */
611
  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
1032
  void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate,
612
                             Time duration, WifiMode blockAckReqTxMode);
1033
                             Time duration, WifiMode blockAckReqTxMode);
613
  /*
1034
  /**
614
   * Every time that a block ack request or a packet with ack policy equals to <i>block ack</i>
1035
   * Every time that a block ack request or a packet with ack policy equals to <i>block ack</i>
615
   * are received, if a relative block ack agreement exists and the value of inactivity timeout
1036
   * are received, if a relative block ack agreement exists and the value of inactivity timeout
616
   * is not 0, the timer is reset.
1037
   * is not 0, the timer is reset.
617
   * see section 11.5.3 in IEEE802.11e for more details.
1038
   * see section 11.5.3 in IEEE802.11e for more details.
1039
   *
1040
   * \param agreement
618
   */
1041
   */
619
  void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement);
1042
  void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement);
620
1043
1044
  /**
1045
   * Set up WifiPhy listener for this MacLow.
1046
   *
1047
   * \param phy the WifiPhy this MacLow is connected to
1048
   */
621
  void SetupPhyMacLowListener (Ptr<WifiPhy> phy);
1049
  void SetupPhyMacLowListener (Ptr<WifiPhy> phy);
622
1050
623
  Ptr<WifiPhy> m_phy;
1051
  Ptr<WifiPhy> m_phy;
624
  Ptr<WifiRemoteStationManager> m_stationManager;
1052
  Ptr<WifiRemoteStationManager> m_stationManager;
625
  MacLowRxCallback m_rxCallback;
1053
  MacLowRxCallback m_rxCallback;
1054
  /**
1055
   * typedef for an iterator for a list of MacLowDcfListener.
1056
   */
626
  typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI;
1057
  typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI;
1058
  /**
1059
   * typedef for a list of MacLowDcfListener.
1060
   */
627
  typedef std::vector<MacLowDcfListener *> DcfListeners;
1061
  typedef std::vector<MacLowDcfListener *> DcfListeners;
628
  DcfListeners m_dcfListeners;
1062
  DcfListeners m_dcfListeners;
629
1063
(-)a/src/wifi/model/mgt-headers.h (-2 / +239 lines)
 Lines 43-55    Link Here 
43
  MgtAssocRequestHeader ();
43
  MgtAssocRequestHeader ();
44
  ~MgtAssocRequestHeader ();
44
  ~MgtAssocRequestHeader ();
45
45
46
  /**
47
   * Set the Service Set Identifier (SSID).
48
   *
49
   * \param ssid SSID
50
   */
46
  void SetSsid (Ssid ssid);
51
  void SetSsid (Ssid ssid);
52
  /**
53
   * Set the supported rates.
54
   *
55
   * \param rates the supported rates
56
   */
47
  void SetSupportedRates (SupportedRates rates);
57
  void SetSupportedRates (SupportedRates rates);
48
  void SetListenInterval (uint16_t interval);
58
  void SetListenInterval (uint16_t interval);
59
  /**
60
   * Set the HT capabilities.
61
   *
62
   * \param htcapabilities HT capabilities
63
   */
49
  void SetHtCapabilities(HtCapabilities htcapabilities);
64
  void SetHtCapabilities(HtCapabilities htcapabilities);
50
  
65
  
66
  /**
67
   * Return the HT capabilities.
68
   *
69
   * \return HT capabilities
70
   */
51
  HtCapabilities GetHtCapabilities (void) const;
71
  HtCapabilities GetHtCapabilities (void) const;
72
  /**
73
   * Return the Service Set Identifier (SSID).
74
   *
75
   * \return SSID
76
   */
52
  Ssid GetSsid (void) const;
77
  Ssid GetSsid (void) const;
78
  /**
79
   * Return the supported rates.
80
   *
81
   * \return the supported rates
82
   */
53
  SupportedRates GetSupportedRates (void) const;
83
  SupportedRates GetSupportedRates (void) const;
54
  uint16_t GetListenInterval (void) const;
84
  uint16_t GetListenInterval (void) const;
55
85
 Lines 79-90    Link Here 
79
  MgtAssocResponseHeader ();
109
  MgtAssocResponseHeader ();
80
  ~MgtAssocResponseHeader ();
110
  ~MgtAssocResponseHeader ();
81
111
112
  /**
113
   * Return the status code.
114
   *
115
   * \return the status code
116
   */
82
  StatusCode GetStatusCode (void);
117
  StatusCode GetStatusCode (void);
118
  /**
119
   * Return the supported rates.
120
   *
121
   * \return the supported rates
122
   */
83
  SupportedRates GetSupportedRates (void);
123
  SupportedRates GetSupportedRates (void);
124
  /**
125
   * Return the HT capabilities.
126
   *
127
   * \return HT capabilities
128
   */
84
  HtCapabilities GetHtCapabilities (void) const;
129
  HtCapabilities GetHtCapabilities (void) const;
85
130
131
  /**
132
   * Set the HT capabilities.
133
   *
134
   * \param htcapabilities HT capabilities
135
   */
86
  void SetHtCapabilities(HtCapabilities htcapabilities);
136
  void SetHtCapabilities(HtCapabilities htcapabilities);
137
  /**
138
   * Set the supported rates.
139
   *
140
   * \param rates the supported rates
141
   */
87
  void SetSupportedRates (SupportedRates rates);
142
  void SetSupportedRates (SupportedRates rates);
143
  /**
144
   * Set the status code.
145
   *
146
   * \param code the status code
147
   */
88
  void SetStatusCode (StatusCode code);
148
  void SetStatusCode (StatusCode code);
89
149
90
  static TypeId GetTypeId (void);
150
  static TypeId GetTypeId (void);
 Lines 112-123    Link Here 
112
public:
172
public:
113
  ~MgtProbeRequestHeader ();
173
  ~MgtProbeRequestHeader ();
114
174
175
  /**
176
   * Set the Service Set Identifier (SSID).
177
   *
178
   * \param ssid SSID
179
   */
115
  void SetSsid (Ssid ssid);
180
  void SetSsid (Ssid ssid);
181
  /**
182
   * Set the supported rates.
183
   *
184
   * \param rates the supported rates
185
   */
116
  void SetSupportedRates (SupportedRates rates);
186
  void SetSupportedRates (SupportedRates rates);
187
  /**
188
   * Return the Service Set Identifier (SSID).
189
   *
190
   * \return SSID
191
   */
117
  Ssid GetSsid (void) const;
192
  Ssid GetSsid (void) const;
193
  /**
194
   * Return the supported rates.
195
   *
196
   * \return the supported rates
197
   */
118
  SupportedRates GetSupportedRates (void) const;
198
  SupportedRates GetSupportedRates (void) const;
119
 HtCapabilities GetHtCapabilities (void) const;
199
  /**
200
   * Return the HT capabilities.
201
   *
202
   * \return HT capabilities
203
   */
204
  HtCapabilities GetHtCapabilities (void) const;
120
205
206
  /**
207
   * Set the HT capabilities.
208
   *
209
   * \param htcapabilities HT capabilities
210
   */
121
  void SetHtCapabilities(HtCapabilities htcapabilities);
211
  void SetHtCapabilities(HtCapabilities htcapabilities);
122
  static TypeId GetTypeId (void);
212
  static TypeId GetTypeId (void);
123
  virtual TypeId GetInstanceTypeId (void) const;
213
  virtual TypeId GetInstanceTypeId (void) const;
 Lines 142-156    Link Here 
142
  MgtProbeResponseHeader ();
232
  MgtProbeResponseHeader ();
143
  ~MgtProbeResponseHeader ();
233
  ~MgtProbeResponseHeader ();
144
234
235
  /**
236
   * Return the Service Set Identifier (SSID).
237
   *
238
   * \return SSID
239
   */
145
  Ssid GetSsid (void) const;
240
  Ssid GetSsid (void) const;
241
  /**
242
   * Return the beacon interval in microseconds unit.
243
   *
244
   * \return beacon interval in microseconds unit
245
   */
146
  uint64_t GetBeaconIntervalUs (void) const;
246
  uint64_t GetBeaconIntervalUs (void) const;
247
  /**
248
   * Return the supported rates.
249
   *
250
   * \return the supported rates
251
   */
147
  SupportedRates GetSupportedRates (void) const;
252
  SupportedRates GetSupportedRates (void) const;
148
 HtCapabilities GetHtCapabilities (void) const;
253
  /**
254
   * Return the HT capabilities.
255
   *
256
   * \return HT capabilities
257
   */
258
  HtCapabilities GetHtCapabilities (void) const;
149
259
260
  /**
261
   * Set the HT capabilities.
262
   *
263
   * \param htcapabilities HT capabilities
264
   */
150
  void SetHtCapabilities(HtCapabilities htcapabilities);
265
  void SetHtCapabilities(HtCapabilities htcapabilities);
266
  /**
267
   * Set the Service Set Identifier (SSID).
268
   *
269
   * \param ssid SSID
270
   */
151
  void SetSsid (Ssid ssid);
271
  void SetSsid (Ssid ssid);
272
  /**
273
   * Set the beacon interval in microseconds unit.
274
   *
275
   * \param us beacon interval in microseconds unit
276
   */
152
  void SetBeaconIntervalUs (uint64_t us);
277
  void SetBeaconIntervalUs (uint64_t us);
278
  /**
279
   * Set the supported rates.
280
   *
281
   * \param rates the supported rates
282
   */
153
  void SetSupportedRates (SupportedRates rates);
283
  void SetSupportedRates (SupportedRates rates);
284
  /**
285
   * Return the time stamp.
286
   *
287
   * \return time stamp
288
   */
154
  uint64_t GetTimestamp ();
289
  uint64_t GetTimestamp ();
155
  static TypeId GetTypeId (void);
290
  static TypeId GetTypeId (void);
156
  virtual TypeId GetInstanceTypeId (void) const;
291
  virtual TypeId GetInstanceTypeId (void) const;
 Lines 285-303    Link Here 
285
  virtual void Serialize (Buffer::Iterator start) const;
420
  virtual void Serialize (Buffer::Iterator start) const;
286
  virtual uint32_t Deserialize (Buffer::Iterator start);
421
  virtual uint32_t Deserialize (Buffer::Iterator start);
287
422
423
  /**
424
   * Enable delayed Block ACK.
425
   */
288
  void SetDelayedBlockAck ();
426
  void SetDelayedBlockAck ();
427
  /**
428
   * Enable immediate Block ACK
429
   */
289
  void SetImmediateBlockAck ();
430
  void SetImmediateBlockAck ();
431
  /**
432
   * Set Traffic ID (TID).
433
   *
434
   * \param tid traffic ID
435
   */
290
  void SetTid (uint8_t tid);
436
  void SetTid (uint8_t tid);
437
  /**
438
   * Set timeout.
439
   *
440
   * \param timeout timeout
441
   */
291
  void SetTimeout (uint16_t timeout);
442
  void SetTimeout (uint16_t timeout);
292
  void SetBufferSize (uint16_t size);
443
  void SetBufferSize (uint16_t size);
293
  void SetStartingSequence (uint16_t seq);
444
  void SetStartingSequence (uint16_t seq);
445
  /**
446
   * Enable or disable A-MSDU support.
447
   *
448
   * supported enable or disable A-MSDU support
449
   */
294
  void SetAmsduSupport (bool supported);
450
  void SetAmsduSupport (bool supported);
295
451
296
  uint16_t GetStartingSequence (void) const;
452
  uint16_t GetStartingSequence (void) const;
453
  /**
454
   * Return the Traffic ID (TID).
455
   *
456
   * \return TID
457
   */
297
  uint8_t GetTid (void) const;
458
  uint8_t GetTid (void) const;
459
  /**
460
   * Return whether the Block ACK policy is immediate Block ACK.
461
   *
462
   * \return true if immediate Block ACK is being used, false otherwise
463
   */
298
  bool IsImmediateBlockAck (void) const;
464
  bool IsImmediateBlockAck (void) const;
465
  /**
466
   * Return the timeout.
467
   *
468
   * \return timeout
469
   */
299
  uint16_t GetTimeout (void) const;
470
  uint16_t GetTimeout (void) const;
300
  uint16_t GetBufferSize (void) const;
471
  uint16_t GetBufferSize (void) const;
472
  /**
473
   * Return whether A-MSDU capability is supported.
474
   *
475
   * \return true is A-MSDU is supported, false otherwise
476
   */
301
  bool IsAmsduSupported (void) const;
477
  bool IsAmsduSupported (void) const;
302
478
303
private:
479
private:
 Lines 332-350    Link Here 
332
  virtual void Serialize (Buffer::Iterator start) const;
508
  virtual void Serialize (Buffer::Iterator start) const;
333
  virtual uint32_t Deserialize (Buffer::Iterator start);
509
  virtual uint32_t Deserialize (Buffer::Iterator start);
334
510
511
  /**
512
   * Enable delayed Block ACK.
513
   */
335
  void SetDelayedBlockAck ();
514
  void SetDelayedBlockAck ();
515
  /**
516
   * Enable immediate Block ACK
517
   */
336
  void SetImmediateBlockAck ();
518
  void SetImmediateBlockAck ();
519
  /**
520
   * Set Traffic ID (TID).
521
   *
522
   * \param tid traffic ID
523
   */
337
  void SetTid (uint8_t tid);
524
  void SetTid (uint8_t tid);
525
  /**
526
   * Set timeout.
527
   *
528
   * \param timeout timeout
529
   */
338
  void SetTimeout (uint16_t timeout);
530
  void SetTimeout (uint16_t timeout);
339
  void SetBufferSize (uint16_t size);
531
  void SetBufferSize (uint16_t size);
532
  /**
533
   * Set the status code.
534
   *
535
   * \param code the status code
536
   */
340
  void SetStatusCode (StatusCode code);
537
  void SetStatusCode (StatusCode code);
538
  /**
539
   * Enable or disable A-MSDU support.
540
   *
541
   * supported enable or disable A-MSDU support
542
   */
341
  void SetAmsduSupport (bool supported);
543
  void SetAmsduSupport (bool supported);
342
544
545
  /**
546
   * Return the status code.
547
   *
548
   * \return the status code
549
   */
343
  StatusCode GetStatusCode (void) const;
550
  StatusCode GetStatusCode (void) const;
551
  /**
552
   * Return the Traffic ID (TID).
553
   *
554
   * \return TID
555
   */
344
  uint8_t GetTid (void) const;
556
  uint8_t GetTid (void) const;
557
  /**
558
   * Return whether the Block ACK policy is immediate Block ACK.
559
   *
560
   * \return true if immediate Block ACK is being used, false otherwise
561
   */
345
  bool IsImmediateBlockAck (void) const;
562
  bool IsImmediateBlockAck (void) const;
563
  /**
564
   * Return the timeout.
565
   *
566
   * \return timeout
567
   */
346
  uint16_t GetTimeout (void) const;
568
  uint16_t GetTimeout (void) const;
347
  uint16_t GetBufferSize (void) const;
569
  uint16_t GetBufferSize (void) const;
570
  /**
571
   * Return whether A-MSDU capability is supported.
572
   *
573
   * \return true is A-MSDU is supported, false otherwise
574
   */
348
  bool IsAmsduSupported (void) const;
575
  bool IsAmsduSupported (void) const;
349
576
350
private:
577
private:
 Lines 378-384    Link Here 
378
  virtual uint32_t Deserialize (Buffer::Iterator start);
605
  virtual uint32_t Deserialize (Buffer::Iterator start);
379
606
380
  bool IsByOriginator (void) const;
607
  bool IsByOriginator (void) const;
608
  /**
609
   * Return the Traffic ID (TID).
610
   *
611
   * \return TID
612
   */
381
  uint8_t GetTid (void) const;
613
  uint8_t GetTid (void) const;
614
  /**
615
   * Set Traffic ID (TID).
616
   *
617
   * \param tid traffic ID
618
   */
382
  void SetTid (uint8_t);
619
  void SetTid (uint8_t);
383
  void SetByOriginator (void);
620
  void SetByOriginator (void);
384
  void SetByRecipient (void);
621
  void SetByRecipient (void);
(-)a/src/wifi/model/msdu-standard-aggregator.h (-3 / +8 lines)
 Lines 40-45    Link Here 
40
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible,
40
   * \param aggregatedPacket Packet that will contain <i>packet</i>, if aggregation is possible,
41
   * \param src Source address of <i>packet</i>.
41
   * \param src Source address of <i>packet</i>.
42
   * \param dest Destination address of <i>packet</i>.
42
   * \param dest Destination address of <i>packet</i>.
43
   * \return true if the packet can be aggregated, false otherwise
43
   *
44
   *
44
   * This method performs an MSDU aggregation.
45
   * This method performs an MSDU aggregation.
45
   * Returns true if <i>packet</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
46
   * Returns true if <i>packet</i> can be aggregated to <i>aggregatedPacket</i>, false otherwise.
 Lines 47-55    Link Here 
47
  virtual bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
48
  virtual bool Aggregate (Ptr<const Packet> packet, Ptr<Packet> aggregatedPacket,
48
                          Mac48Address src, Mac48Address dest);
49
                          Mac48Address src, Mac48Address dest);
49
private:
50
private:
50
  /*  Calculates how much padding must be added to the end of aggregated packet,
51
  /** 
51
      after that a new packet is added.
52
   * Calculates how much padding must be added to the end of aggregated packet,
52
      Each A-MSDU subframe is padded so that its length is multiple of 4 octets.
53
   * after that a new packet is added.
54
   * Each A-MSDU subframe is padded so that its length is multiple of 4 octets.
55
   *
56
   * \param packet
57
   * \return the number of octets required for padding
53
   */
58
   */
54
  uint32_t CalculatePadding (Ptr<const Packet> packet);
59
  uint32_t CalculatePadding (Ptr<const Packet> packet);
55
60
(-)a/src/wifi/model/nist-error-rate-model.h (+7 lines)
 Lines 45-50    Link Here 
45
  virtual double GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const;
45
  virtual double GetChunkSuccessRate (WifiMode mode, double snr, uint32_t nbits) const;
46
46
47
private:
47
private:
48
  /**
49
   * Return the coded BER for the given p and b.
50
   *
51
   * \param p
52
   * \param bValue
53
   * \return BER
54
   */
48
  double CalculatePe (double p, uint32_t bValue) const;
55
  double CalculatePe (double p, uint32_t bValue) const;
49
  /**
56
  /**
50
   * Return BER of BPSK at the given SNR.
57
   * Return BER of BPSK at the given SNR.
(-)a/src/wifi/model/onoe-wifi-manager.cc (+6 lines)
 Lines 29-34    Link Here 
29
29
30
namespace ns3 {
30
namespace ns3 {
31
31
32
/**
33
 * \brief hold per-remote-station state for ONOE Wifi manager.
34
 *
35
 * This struct extends from WifiRemoteStation struct to hold additional
36
 * information required by the ONOE Wifi manager
37
 */
32
struct OnoeWifiRemoteStation : public WifiRemoteStation
38
struct OnoeWifiRemoteStation : public WifiRemoteStation
33
{
39
{
34
  Time m_nextModeUpdate;
40
  Time m_nextModeUpdate;
(-)a/src/wifi/model/originator-block-ack-agreement.h (+3 lines)
 Lines 105-110    Link Here 
105
  /**
105
  /**
106
   * Returns true if all packets for which a block ack was negotiated have been transmitted so
106
   * Returns true if all packets for which a block ack was negotiated have been transmitted so
107
   * a block ack request is needed in order to acknowledge them.
107
   * a block ack request is needed in order to acknowledge them.
108
   *
109
   * \return  true if all packets for which a block ack was negotiated have been transmitted,
110
   * false otherwise
108
   */
111
   */
109
  bool IsBlockAckRequestNeeded (void) const;
112
  bool IsBlockAckRequestNeeded (void) const;
110
  void CompleteExchange (void);
113
  void CompleteExchange (void);
(-)a/src/wifi/model/qos-utils.h (-1 / +4 lines)
 Lines 54-59    Link Here 
54
 * For more details see table 9-1 of IEEE802.11 standard.
54
 * For more details see table 9-1 of IEEE802.11 standard.
55
 *
55
 *
56
 * \param tid the Traffic ID to be mapped to Access class
56
 * \param tid the Traffic ID to be mapped to Access class
57
 * \return the access class for the given TID
57
 */
58
 */
58
AcIndex QosUtilsMapTidToAc (uint8_t tid);
59
AcIndex QosUtilsMapTidToAc (uint8_t tid);
59
60
 Lines 74-81    Link Here 
74
 * When an BAR is received from originator station, completed "old"
75
 * When an BAR is received from originator station, completed "old"
75
 * (see section 9.10.3 in IEEE802.11e) packets must be forwarded up before "new" packets.
76
 * (see section 9.10.3 in IEEE802.11e) packets must be forwarded up before "new" packets.
76
 *
77
 *
77
 * \param seqConrol the sequence control field
78
 * \param seqControl the sequence control field
78
 * \param endSequence
79
 * \param endSequence
80
 * \return a unique integer for the given sequence control and end sequence
79
 */
81
 */
80
uint32_t QosUtilsMapSeqControlToUniqueInteger (uint16_t seqControl, uint16_t endSequence);
82
uint32_t QosUtilsMapSeqControlToUniqueInteger (uint16_t seqControl, uint16_t endSequence);
81
83
 Lines 113-118    Link Here 
113
 *
115
 *
114
 * \param startingSeq the starting sequence number
116
 * \param startingSeq the starting sequence number
115
 * \param seqNumber the sequence number to be checked
117
 * \param seqNumber the sequence number to be checked
118
 * \return true if the packet is old, false otherwise
116
 */
119
 */
117
bool QosUtilsIsOldPacket (uint16_t startingSeq, uint16_t seqNumber);
120
bool QosUtilsIsOldPacket (uint16_t startingSeq, uint16_t seqNumber);
118
121
(-)a/src/wifi/model/rraa-wifi-manager.cc (+6 lines)
 Lines 32-37    Link Here 
32
32
33
namespace ns3 {
33
namespace ns3 {
34
34
35
/**
36
 * \brief hold per-remote-station state for RRAA Wifi manager.
37
 *
38
 * This struct extends from WifiRemoteStation struct to hold additional
39
 * information required by the RRAA Wifi manager
40
 */
35
struct RraaWifiRemoteStation : public WifiRemoteStation
41
struct RraaWifiRemoteStation : public WifiRemoteStation
36
{
42
{
37
  uint32_t m_counter;
43
  uint32_t m_counter;
(-)a/src/wifi/model/ssid.h (+29 lines)
 Lines 37-48    Link Here 
37
public:
37
public:
38
  // broadcast ssid
38
  // broadcast ssid
39
  Ssid ();
39
  Ssid ();
40
  /**
41
   * Create SSID from a given string
42
   *
43
   * \param s SSID in string
44
   */
40
  Ssid (std::string s);
45
  Ssid (std::string s);
46
  /**
47
   * Create SSID from a given array of char and given length.
48
   *
49
   * \param ssid
50
   * \param length
51
   */
41
  Ssid (char const ssid[32], uint8_t length);
52
  Ssid (char const ssid[32], uint8_t length);
42
53
54
  /**
55
   * Check if the two SSIDs are equal.
56
   *
57
   * \param o SSID to compare to
58
   * \return true if the two SSIDs are equal,
59
   *         false otherwise
60
   */
43
  bool IsEqual (const Ssid& o) const;
61
  bool IsEqual (const Ssid& o) const;
62
  /**
63
   * Check if the SSID is broadcast.
64
   *
65
   * \return true if the SSID is broadcast,
66
   *         false otherwise
67
   */
44
  bool IsBroadcast (void) const;
68
  bool IsBroadcast (void) const;
45
69
70
  /**
71
   * Peek the SSID.
72
   *
73
   * \return a pointer to SSID string
74
   */
46
  char* PeekString (void) const;
75
  char* PeekString (void) const;
47
76
48
  WifiInformationElementId ElementId () const;
77
  WifiInformationElementId ElementId () const;
(-)a/src/wifi/model/status-code.h (+34 lines)
 Lines 30-42    Link Here 
30
{
30
{
31
public:
31
public:
32
  StatusCode ();
32
  StatusCode ();
33
  /**
34
   * Set success bit to 0 (success).
35
   */
33
  void SetSuccess (void);
36
  void SetSuccess (void);
37
  /**
38
   * Set success bit to 1 (failure.
39
   */
34
  void SetFailure (void);
40
  void SetFailure (void);
35
41
42
  /**
43
   * Return whether the status code is success.
44
   *
45
   * \return true if success, false otherwise
46
   */
36
  bool IsSuccess (void) const;
47
  bool IsSuccess (void) const;
37
48
49
  /**
50
   * \returns the expected size of the status code.
51
   *
52
   * This method should return the number of bytes which are needed to store
53
   * the status code data by Serialize.
54
   */
38
  uint32_t GetSerializedSize (void) const;
55
  uint32_t GetSerializedSize (void) const;
56
  /**
57
   * \param start an iterator which points to where the status code should
58
   *        be written.
59
   * \return Buffer::Iterator
60
   *
61
   * This method is used to store a status code into the byte buffer.
62
   * The data written is expected to match bit-for-bit the representation of this
63
   * header in a real network.
64
   */
39
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
65
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
66
  /**
67
   * \param start an iterator which points to where the status code should be read.
68
   * \returns the number of bytes read.
69
   *
70
   * This method is used to re-create a status code from the byte buffer. 
71
   * The data read is expected to match bit-for-bit the representation of this
72
   * header in real networks.
73
   */
40
  Buffer::Iterator Deserialize (Buffer::Iterator start);
74
  Buffer::Iterator Deserialize (Buffer::Iterator start);
41
private:
75
private:
42
  uint16_t m_code;
76
  uint16_t m_code;
(-)a/src/wifi/model/supported-rates.h (-1 / +50 lines)
 Lines 53-58    Link Here 
53
{
53
{
54
public:
54
public:
55
  ExtendedSupportedRatesIE ();
55
  ExtendedSupportedRatesIE ();
56
  /**
57
   * Create an extended supported rates information element
58
   * from the given rates.
59
   *
60
   * \param rates
61
   */
56
  ExtendedSupportedRatesIE (SupportedRates *rates);
62
  ExtendedSupportedRatesIE (SupportedRates *rates);
57
63
58
  WifiInformationElementId ElementId () const;
64
  WifiInformationElementId ElementId () const;
 Lines 61-73    Link Here 
61
  uint8_t DeserializeInformationField (Buffer::Iterator start,
67
  uint8_t DeserializeInformationField (Buffer::Iterator start,
62
                                       uint8_t length);
68
                                       uint8_t length);
63
69
64
  /*
70
  /**
65
   * This information element is a bit special in that it is only
71
   * This information element is a bit special in that it is only
66
   * included if there are more than 8 rates. To support this we
72
   * included if there are more than 8 rates. To support this we
67
   * override the Serialize and GetSerializedSize methods of
73
   * override the Serialize and GetSerializedSize methods of
68
   * WifiInformationElement.
74
   * WifiInformationElement.
75
   *
76
   * \param start
77
   * \return an iterator
69
   */
78
   */
70
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
79
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
80
  /**
81
   * Return the serialized size of this supported rates 
82
   * information element.
83
   * 
84
   * \return the serialized size of this supported rates 
85
   * information element
86
   */
71
  uint16_t GetSerializedSize () const;
87
  uint16_t GetSerializedSize () const;
72
private:
88
private:
73
  /**
89
  /**
 Lines 94-106    Link Here 
94
public:
110
public:
95
  SupportedRates ();
111
  SupportedRates ();
96
112
113
  /**
114
   * Add the given rate to the supported rates.
115
   *
116
   * \param bs the rate to be added
117
   */
97
  void AddSupportedRate (uint32_t bs);
118
  void AddSupportedRate (uint32_t bs);
119
  /**
120
   * Set the given rate to basic rates.
121
   *
122
   * \param bs the rate to be set
123
   */
98
  void SetBasicRate (uint32_t bs);
124
  void SetBasicRate (uint32_t bs);
99
125
126
  /**
127
   * Check if the given rate is supported.
128
   *
129
   * \param bs the rate to be checked
130
   * \return true if the rate is supported, false otherwise
131
   */
100
  bool IsSupportedRate (uint32_t bs) const;
132
  bool IsSupportedRate (uint32_t bs) const;
133
  /**
134
   * Check if the given rate is a basic rate.
135
   *
136
   * \param bs the rate to be checked
137
   * \return true if the rate is a basic rate, false otherwise
138
   */
101
  bool IsBasicRate (uint32_t bs) const;
139
  bool IsBasicRate (uint32_t bs) const;
102
140
141
  /**
142
   * Return the number of supported rates.
143
   *
144
   * \return the number of supported rates
145
   */
103
  uint8_t GetNRates (void) const;
146
  uint8_t GetNRates (void) const;
147
  /**
148
   * Return the rate at the given index.
149
   *
150
   * \param i the given index
151
   * \return the rate
152
   */
104
  uint32_t GetRate (uint8_t i) const;
153
  uint32_t GetRate (uint8_t i) const;
105
154
106
  WifiInformationElementId ElementId () const;
155
  WifiInformationElementId ElementId () const;
(-)a/src/wifi/model/wifi-information-element-vector.h (-3 / +2 lines)
 Lines 45-52    Link Here 
45
public:
45
public:
46
  WifiInformationElementVector ();
46
  WifiInformationElementVector ();
47
  ~WifiInformationElementVector ();
47
  ~WifiInformationElementVector ();
48
  ///\name Inherited from Header
48
49
  // \{
50
  static TypeId GetTypeId ();
49
  static TypeId GetTypeId ();
51
  TypeId GetInstanceTypeId () const;
50
  TypeId GetInstanceTypeId () const;
52
  virtual uint32_t GetSerializedSize () const;
51
  virtual uint32_t GetSerializedSize () const;
 Lines 59-65    Link Here 
59
   */
58
   */
60
  virtual uint32_t Deserialize (Buffer::Iterator start);
59
  virtual uint32_t Deserialize (Buffer::Iterator start);
61
  virtual void Print (std::ostream &os) const;
60
  virtual void Print (std::ostream &os) const;
62
  //\}
61
63
  /**
62
  /**
64
   * \brief Needed when you try to deserialize a lonely IE inside other header
63
   * \brief Needed when you try to deserialize a lonely IE inside other header
65
   * \param start is the start of the buffer
64
   * \param start is the start of the buffer
(-)a/src/wifi/model/wifi-information-element.h (-23 / +73 lines)
 Lines 131-178    Link Here 
131
{
131
{
132
public:
132
public:
133
  virtual ~WifiInformationElement ();
133
  virtual ~WifiInformationElement ();
134
  /// Serialize entire IE including Element ID and length fields
134
  /**
135
   * Serialize entire IE including Element ID and length fields
136
   *
137
   * \param i an iterator which points to where the IE should
138
   *        be written.
139
   * \return an iterator
140
   */
135
  Buffer::Iterator Serialize (Buffer::Iterator i) const;
141
  Buffer::Iterator Serialize (Buffer::Iterator i) const;
136
  /// Deserialize entire IE, which must be present. The iterator
142
  /**
137
  /// passed in must be pointing at the Element ID (i.e., the very
143
   * Deserialize entire IE, which must be present. The iterator
138
  /// first octet) of the correct type of information element,
144
   * passed in must be pointing at the Element ID (i.e., the very
139
  /// otherwise this method will generate a fatal error.
145
   * first octet) of the correct type of information element,
146
   * otherwise this method will generate a fatal error.
147
   *
148
   * \param i an iterator which points to where the IE should be read.
149
   * \return an iterator
150
   */
140
  Buffer::Iterator Deserialize (Buffer::Iterator i);
151
  Buffer::Iterator Deserialize (Buffer::Iterator i);
141
  /// Deserialize entire IE if it is present. The iterator passed in
152
  /**
142
  /// must be pointing at the Element ID of an information element. If
153
   * Deserialize entire IE if it is present. The iterator passed in
143
  /// the Element ID is not the one that the given class is interested
154
   * must be pointing at the Element ID of an information element. If
144
  /// in then it will return the same iterator.
155
   * the Element ID is not the one that the given class is interested
156
   * in then it will return the same iterator.
157
   *
158
   * \param i an iterator which points to where the IE should be read.
159
   * \return an iterator
160
   */
145
  Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i);
161
  Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i);
146
  /// Get the size of the serialized IE including Element ID and
162
  /**
147
  /// length fields.
163
   * Get the size of the serialized IE including Element ID and
164
   * length fields.
165
   *
166
   * \return the size of the serialized IE
167
   */
148
  uint16_t GetSerializedSize () const;
168
  uint16_t GetSerializedSize () const;
149
169
150
  ///\name Each subclass must implement
170
  ///\name Each subclass must implement
151
  //\{
171
  //\{
152
  /// Own unique Element ID
172
  /// Own unique Element ID
153
  virtual WifiInformationElementId ElementId () const = 0;
173
  virtual WifiInformationElementId ElementId () const = 0;
154
  /// Length of serialized information (i.e., the length of the body
174
  /**
155
  /// of the IE, not including the Element ID and length octets. This
175
   * Length of serialized information (i.e., the length of the body
156
  /// is the value that will appear in the second octet of the entire
176
   * of the IE, not including the Element ID and length octets. This
157
  /// IE - the length field)
177
   * is the value that will appear in the second octet of the entire
178
   * IE - the length field)
179
   *
180
   * \return the length of serialized information
181
   */
158
  virtual uint8_t GetInformationFieldSize () const = 0;
182
  virtual uint8_t GetInformationFieldSize () const = 0;
159
  /// Serialize information (i.e., the body of the IE, not including
183
  /**
160
  /// the Element ID and length octets)
184
   * Serialize information (i.e., the body of the IE, not including
185
   * the Element ID and length octets)
186
   *
187
   * \param start an iterator which points to where the information should
188
   *        be written.
189
   */
161
  virtual void SerializeInformationField (Buffer::Iterator start) const = 0;
190
  virtual void SerializeInformationField (Buffer::Iterator start) const = 0;
162
  /// Deserialize information (i.e., the body of the IE, not including
191
  /**
163
  /// the Element ID and length octets)
192
   * Deserialize information (i.e., the body of the IE, not including
193
   * the Element ID and length octets)
194
   *
195
   * \param start an iterator which points to where the information should
196
   *        be written.
197
   * \param length
198
   * \return the number of bytes read
199
   */
164
  virtual uint8_t DeserializeInformationField (Buffer::Iterator start,
200
  virtual uint8_t DeserializeInformationField (Buffer::Iterator start,
165
                                               uint8_t length) = 0;
201
                                               uint8_t length) = 0;
166
  //\}
202
  //\}
167
203
168
  /// In addition, a subclass may optionally override the following...
204
  /// In addition, a subclass may optionally override the following...
169
  //\{
205
  //\{
170
  /// Generate human-readable form of IE
206
  /**
207
   * Generate human-readable form of IE
208
   *
209
   * \param os output stream
210
   */
171
  virtual void Print (std::ostream &os) const;
211
  virtual void Print (std::ostream &os) const;
172
  /// Compare information elements using Element ID
212
  /**
213
   * Compare information elements using Element ID
214
   *
215
   * \param a another information element to compare with
216
   * \return true if the Element ID is less than the other IE Element ID,
217
   *         false otherwise
218
   */
173
  virtual bool operator< (WifiInformationElement const & a) const;
219
  virtual bool operator< (WifiInformationElement const & a) const;
174
  /// Compare two IEs for equality by ID & Length, and then through
220
  /**
175
  /// memcmp of serialised version
221
   * Compare two IEs for equality by ID & Length, and then through
222
   * memcmp of serialised version
223
   *
224
   * \return true if the two IEs are equal, false otherwise
225
   */
176
  virtual bool operator== (WifiInformationElement const & a) const;
226
  virtual bool operator== (WifiInformationElement const & a) const;
177
  //\}
227
  //\}
178
};
228
};
(-)a/src/wifi/model/wifi-mac-header.h (-1 / +55 lines)
 Lines 29-34    Link Here 
29
29
30
namespace ns3 {
30
namespace ns3 {
31
31
32
/**
33
 * Combination of valid MAC header type/subtype.
34
 */
32
enum WifiMacType
35
enum WifiMacType
33
{
36
{
34
  WIFI_MAC_CTL_RTS = 0,
37
  WIFI_MAC_CTL_RTS = 0,
 Lines 77-82    Link Here 
77
class WifiMacHeader : public Header
80
class WifiMacHeader : public Header
78
{
81
{
79
public:
82
public:
83
  /**
84
   * ACK policy for QoS frames.
85
   */
80
  enum QosAckPolicy
86
  enum QosAckPolicy
81
  {
87
  {
82
    NORMAL_ACK = 0,
88
    NORMAL_ACK = 0,
 Lines 85-90    Link Here 
85
    BLOCK_ACK = 3,
91
    BLOCK_ACK = 3,
86
  };
92
  };
87
93
94
  /**
95
   * Address types.
96
   */
88
  enum AddressType
97
  enum AddressType
89
  {
98
  {
90
    ADDR1,
99
    ADDR1,
 Lines 140-145    Link Here 
140
   * Set Type/Subtype values for a Block Ack header.
149
   * Set Type/Subtype values for a Block Ack header.
141
   */
150
   */
142
  void SetBlockAck (void);
151
  void SetBlockAck (void);
152
  /**
153
   * Set Type/Subtype values for a multihop action header.
154
   */
143
  void SetMultihopAction ();
155
  void SetMultihopAction ();
144
  /**
156
  /**
145
   * Set the From DS bit in the Frame Control field.
157
   * Set the From DS bit in the Frame Control field.
 Lines 251-258    Link Here 
251
  void SetQosNoEosp ();
263
  void SetQosNoEosp ();
252
  /**
264
  /**
253
   * Set the QoS ACK policy in the QoS control field.
265
   * Set the QoS ACK policy in the QoS control field.
266
   *
267
   * \param policy
254
   */
268
   */
255
  void SetQosAckPolicy (enum QosAckPolicy);
269
  void SetQosAckPolicy (enum QosAckPolicy policy);
256
  /**
270
  /**
257
   * Set the QoS ACK policy in the QoS control field to normal ACK.
271
   * Set the QoS ACK policy in the QoS control field to normal ACK.
258
   */
272
   */
 Lines 265-274    Link Here 
265
   * Set the QoS ACK policy in the QoS control field to no ACK.
279
   * Set the QoS ACK policy in the QoS control field to no ACK.
266
   */
280
   */
267
  void SetQosNoAck (void);
281
  void SetQosNoAck (void);
282
  /**
283
   * Set that A-MSDU is present.
284
   */
268
  void SetQosAmsdu (void);
285
  void SetQosAmsdu (void);
286
  /**
287
   * Set that A-MSDU is not present.
288
   */
269
  void SetQosNoAmsdu (void);
289
  void SetQosNoAmsdu (void);
290
  /**
291
   * Set TXOP limit in the QoS control field.
292
   *
293
   * \param txop
294
   */
270
  void SetQosTxopLimit (uint8_t txop);
295
  void SetQosTxopLimit (uint8_t txop);
296
  /**
297
   * Set order bit in the frame control field.
298
   */
271
  void SetOrder (void);
299
  void SetOrder (void);
300
  /**
301
   * Unset order bit in the frame control field.
302
   */
272
  void SetNoOrder (void);
303
  void SetNoOrder (void);
273
304
274
  /**
305
  /**
 Lines 438-443    Link Here 
438
   * \return true if the header is an Action header, false otherwise
469
   * \return true if the header is an Action header, false otherwise
439
   */
470
   */
440
  bool IsAction () const;
471
  bool IsAction () const;
472
  /**
473
   * Check if the header is a Multihop action header.
474
   *
475
   * \return true if the header is a Multihop action header,
476
   *         false otherwise
477
   */
441
  bool IsMultihopAction () const;
478
  bool IsMultihopAction () const;
442
  /**
479
  /**
443
   * Return the raw duration from the Duration/ID field.
480
   * Return the raw duration from the Duration/ID field.
 Lines 505-510    Link Here 
505
   * \return true if the end of service period (EOSP) is set, false otherwise
542
   * \return true if the end of service period (EOSP) is set, false otherwise
506
   */
543
   */
507
  bool IsQosEosp (void) const;
544
  bool IsQosEosp (void) const;
545
  /**
546
   * Check if the A-MSDU present bit is set in the QoS control field.
547
   *
548
   * \return true if the A-MSDU present bit is set,
549
   *        false otherwise
550
   */
508
  bool IsQosAmsdu (void) const;
551
  bool IsQosAmsdu (void) const;
509
  /**
552
  /**
510
   * Return the Traffic ID of a QoS header.
553
   * Return the Traffic ID of a QoS header.
 Lines 518-525    Link Here 
518
   * \return the QoS ACK Policy of a QoS header
561
   * \return the QoS ACK Policy of a QoS header
519
   */
562
   */
520
  enum QosAckPolicy GetQosAckPolicy (void) const;
563
  enum QosAckPolicy GetQosAckPolicy (void) const;
564
  /**
565
   * Return the TXOP limit.
566
   *
567
   * \return the TXOP limit
568
   */
521
  uint8_t GetQosTxopLimit (void) const;
569
  uint8_t GetQosTxopLimit (void) const;
522
570
571
  /**
572
   * Return the size of the WifiMacHeader in octets.
573
   * GetSerializedSize calls this function.
574
   *
575
   * \return the size of the WifiMacHeader in octets
576
   */
523
  uint32_t GetSize (void) const;
577
  uint32_t GetSize (void) const;
524
  /**
578
  /**
525
   * Return a string corresponds to the header type.
579
   * Return a string corresponds to the header type.
(-)a/src/wifi/model/wifi-mac-queue.h (-4 / +120 lines)
 Lines 56-69    Link Here 
56
  WifiMacQueue ();
56
  WifiMacQueue ();
57
  ~WifiMacQueue ();
57
  ~WifiMacQueue ();
58
58
59
  /**
60
   * Set the maximum queue size.
61
   *
62
   * \param maxSize the maximum queue size
63
   */
59
  void SetMaxSize (uint32_t maxSize);
64
  void SetMaxSize (uint32_t maxSize);
65
  /**
66
   * Set the maximum delay before the packet is discarded.
67
   *
68
   * \param delay the maximum delay
69
   */
60
  void SetMaxDelay (Time delay);
70
  void SetMaxDelay (Time delay);
71
  /**
72
   * Return the maximum queue size.
73
   *
74
   * \return the maximum queue size
75
   */
61
  uint32_t GetMaxSize (void) const;
76
  uint32_t GetMaxSize (void) const;
77
  /**
78
   * Return the maximum delay before the packet is discarded.
79
   *
80
   * \return the maximum delay
81
   */
62
  Time GetMaxDelay (void) const;
82
  Time GetMaxDelay (void) const;
63
83
84
  /**
85
   * Enqueue the given packet and its corresponding WifiMacHeader at the <i>end</i> of the queue.
86
   *
87
   * \param packet the packet to be euqueued at the end
88
   * \param hdr the header of the given packet
89
   */
64
  void Enqueue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
90
  void Enqueue (Ptr<const Packet> packet, const WifiMacHeader &hdr);
91
  /**
92
   * Enqueue the given packet and its corresponding WifiMacHeader at the <i>front</i> of the queue.
93
   *
94
   * \param packet the packet to be euqueued at the end
95
   * \param hdr the header of the given packet
96
   */
65
  void PushFront (Ptr<const Packet> packet, const WifiMacHeader &hdr);
97
  void PushFront (Ptr<const Packet> packet, const WifiMacHeader &hdr);
98
  /**
99
   * Dequeue the packet in the front of the queue.
100
   *
101
   * \param hdr the WifiMacHeader of the packet
102
   * \return the packet
103
   */
66
  Ptr<const Packet> Dequeue (WifiMacHeader *hdr);
104
  Ptr<const Packet> Dequeue (WifiMacHeader *hdr);
105
  /**
106
   * Peek the packet in the front of the queue. The packet is not removed.
107
   *
108
   * \param hdr the WifiMacHeader of the packet
109
   * \return the packet
110
   */
67
  Ptr<const Packet> Peek (WifiMacHeader *hdr);
111
  Ptr<const Packet> Peek (WifiMacHeader *hdr);
68
  /**
112
  /**
69
   * Searchs and returns, if is present in this queue, first packet having
113
   * Searchs and returns, if is present in this queue, first packet having
 Lines 71-76    Link Here 
71
   * equals to <i>tid</i>. This method removes the packet from this queue.
115
   * equals to <i>tid</i>. This method removes the packet from this queue.
72
   * Is typically used by ns3::EdcaTxopN in order to perform correct MSDU
116
   * Is typically used by ns3::EdcaTxopN in order to perform correct MSDU
73
   * aggregation (A-MSDU).
117
   * aggregation (A-MSDU).
118
   *
119
   * \param hdr the header of the dequeued packet
120
   * \param tid the given TID
121
   * \param type the given address type
122
   * \param addr the given destination
123
   * \return packet
74
   */
124
   */
75
  Ptr<const Packet> DequeueByTidAndAddress (WifiMacHeader *hdr,
125
  Ptr<const Packet> DequeueByTidAndAddress (WifiMacHeader *hdr,
76
                                            uint8_t tid,
126
                                            uint8_t tid,
 Lines 82-87    Link Here 
82
   * equals to <i>tid</i>. This method doesn't remove the packet from this queue.
132
   * equals to <i>tid</i>. This method doesn't remove the packet from this queue.
83
   * Is typically used by ns3::EdcaTxopN in order to perform correct MSDU
133
   * Is typically used by ns3::EdcaTxopN in order to perform correct MSDU
84
   * aggregation (A-MSDU).
134
   * aggregation (A-MSDU).
135
   *
136
   * \param hdr the header of the dequeued packet
137
   * \param tid the given TID
138
   * \param type the given address type
139
   * \param addr the given destination
140
   * \return packet
85
   */
141
   */
86
  Ptr<const Packet> PeekByTidAndAddress (WifiMacHeader *hdr,
142
  Ptr<const Packet> PeekByTidAndAddress (WifiMacHeader *hdr,
87
                                         uint8_t tid,
143
                                         uint8_t tid,
 Lines 91-101    Link Here 
91
   * If exists, removes <i>packet</i> from queue and returns true. Otherwise it
147
   * If exists, removes <i>packet</i> from queue and returns true. Otherwise it
92
   * takes no effects and return false. Deletion of the packet is
148
   * takes no effects and return false. Deletion of the packet is
93
   * performed in linear time (O(n)).
149
   * performed in linear time (O(n)).
150
   *
151
   * \param packet the packet to be removed
152
   * \return true if the packet was removed, false otherwise
94
   */
153
   */
95
  bool Remove (Ptr<const Packet> packet);
154
  bool Remove (Ptr<const Packet> packet);
96
  /**
155
  /**
97
   * Returns number of QoS packets having tid equals to <i>tid</i> and address
156
   * Returns number of QoS packets having tid equals to <i>tid</i> and address
98
   * specified by <i>type</i> equals to <i>addr</i>.
157
   * specified by <i>type</i> equals to <i>addr</i>.
158
   *
159
   * \param tid the given TID
160
   * \param type the given address type
161
   * \param addr the given destination
162
   * \return the number of QoS packets
99
   */
163
   */
100
  uint32_t GetNPacketsByTidAndAddress (uint8_t tid,
164
  uint32_t GetNPacketsByTidAndAddress (uint8_t tid,
101
                                       WifiMacHeader::AddressType type,
165
                                       WifiMacHeader::AddressType type,
 Lines 106-137    Link Here 
106
   * respectively that index a pending agreement in the BlockAckManager object.
170
   * respectively that index a pending agreement in the BlockAckManager object.
107
   * So that packet must not be transmitted until reception of an ADDBA response frame from station
171
   * So that packet must not be transmitted until reception of an ADDBA response frame from station
108
   * addressed by <i>addr</i>. This method removes the packet from queue.
172
   * addressed by <i>addr</i>. This method removes the packet from queue.
173
   *
174
   * \param hdr the header of the dequeued packet
175
   * \param tStamp
176
   * \param blockedPackets
177
   * \return packet
109
   */
178
   */
110
  Ptr<const Packet> DequeueFirstAvailable (WifiMacHeader *hdr,
179
  Ptr<const Packet> DequeueFirstAvailable (WifiMacHeader *hdr,
111
                                           Time &tStamp,
180
                                           Time &tStamp,
112
                                           const QosBlockedDestinations *blockedPackets);
181
                                           const QosBlockedDestinations *blockedPackets);
113
  /**
182
  /**
114
   * Returns first available packet for transmission. The packet isn't removed from queue.
183
   * Returns first available packet for transmission. The packet isn't removed from queue.  
184
   *
185
   * \param hdr the header of the dequeued packet
186
   * \param tStamp
187
   * \param blockedPackets
188
   * \return packet
115
   */
189
   */
116
  Ptr<const Packet> PeekFirstAvailable (WifiMacHeader *hdr,
190
  Ptr<const Packet> PeekFirstAvailable (WifiMacHeader *hdr,
117
                                        Time &tStamp,
191
                                        Time &tStamp,
118
                                        const QosBlockedDestinations *blockedPackets);
192
                                        const QosBlockedDestinations *blockedPackets);
193
  /**
194
   * Flush the queue.
195
   */
119
  void Flush (void);
196
  void Flush (void);
120
197
198
  /**
199
   * Return if the queue is empty.
200
   *
201
   * \return true if the queue is empty, false otherwise
202
   */
121
  bool IsEmpty (void);
203
  bool IsEmpty (void);
204
  /**
205
   * Return the current queue size.
206
   *
207
   * \return the current queue size
208
   */
122
  uint32_t GetSize (void);
209
  uint32_t GetSize (void);
123
private:
210
private:
124
  struct Item;
211
  struct Item;
125
212
213
  /**
214
   * typedef for packet (struct Item) queue.
215
   */
126
  typedef std::list<struct Item> PacketQueue;
216
  typedef std::list<struct Item> PacketQueue;
217
  /**
218
   * typedef for packet (struct Item) queue reverse iterator.
219
   */
127
  typedef std::list<struct Item>::reverse_iterator PacketQueueRI;
220
  typedef std::list<struct Item>::reverse_iterator PacketQueueRI;
221
  /**
222
   * typedef for packet (struct Item) queue iterator.
223
   */
128
  typedef std::list<struct Item>::iterator PacketQueueI;
224
  typedef std::list<struct Item>::iterator PacketQueueI;
225
  /**
226
   * Clean up the queue by removing packets that exceeded the maximum delay.
227
   */
228
  void Cleanup (void);
229
  /**
230
   * Return the appropriate address for the given packet (given by PacketQueue iterator).
231
   *
232
   * \param type
233
   * \param it
234
   * \return the address
235
   */
236
  Mac48Address GetAddressForPacket (enum WifiMacHeader::AddressType type, PacketQueueI it);
129
237
130
  void Cleanup (void);
238
  /**
131
  Mac48Address GetAddressForPacket (enum WifiMacHeader::AddressType type, PacketQueueI);
239
   * A struct that holds information about a packet for putting
132
240
   * in a packet queue.
241
   */
133
  struct Item
242
  struct Item
134
  {
243
  {
244
    /**
245
     * Create a struct with the given parameters.
246
     *
247
     * \param packet
248
     * \param hdr
249
     * \param tstamp
250
     */
135
    Item (Ptr<const Packet> packet,
251
    Item (Ptr<const Packet> packet,
136
          const WifiMacHeader &hdr,
252
          const WifiMacHeader &hdr,
137
          Time tstamp);
253
          Time tstamp);
(-)a/src/wifi/model/wifi-mode.h (-4 / +5 lines)
 Lines 198-208    Link Here 
198
   *        associated WifiMode is used.
198
   *        associated WifiMode is used.
199
   * \param dataRate the rate (bits/second) at which the user data is transmitted
199
   * \param dataRate the rate (bits/second) at which the user data is transmitted
200
   * \param codingRate if convolutional coding is used for this rate
200
   * \param codingRate if convolutional coding is used for this rate
201
   * then this parameter specifies the convolutional coding rate
201
   *        then this parameter specifies the convolutional coding rate
202
   * used. If there is no explicit convolutional coding step (e.g.,
202
   *        used. If there is no explicit convolutional coding step (e.g.,
203
   * for DSSS rates) then the caller should set this parameter to
203
   *        for DSSS rates) then the caller should set this parameter to
204
   * WIFI_CODE_RATE_UNCODED.
204
   *        WIFI_CODE_RATE_UNCODED.
205
   * \param constellationSize the order of the constellation used.
205
   * \param constellationSize the order of the constellation used.
206
   * \return WifiMode
206
   *
207
   *
207
   * Create a WifiMode.
208
   * Create a WifiMode.
208
   */
209
   */
(-)a/src/wifi/model/wifi-phy-state-helper.h (+118 lines)
 Lines 42-63    Link Here 
42
  void SetReceiveOkCallback (WifiPhy::RxOkCallback callback);
42
  void SetReceiveOkCallback (WifiPhy::RxOkCallback callback);
43
  void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback);
43
  void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback);
44
  void RegisterListener (WifiPhyListener *listener);
44
  void RegisterListener (WifiPhyListener *listener);
45
  /**
46
   * Return the current state of WifiPhy.
47
   *
48
   * \return the current state of WifiPhy
49
   */
45
  enum WifiPhy::State GetState (void);
50
  enum WifiPhy::State GetState (void);
51
  /**
52
   * Check whether the current state is CCA busy.
53
   *
54
   * \return true if the current state is CCA busy, false otherwise
55
   */
46
  bool IsStateCcaBusy (void);
56
  bool IsStateCcaBusy (void);
57
  /**
58
   * Check whether the current state is IDLE.
59
   *
60
   * \return true if the current state is IDLE, false otherwise
61
   */
47
  bool IsStateIdle (void);
62
  bool IsStateIdle (void);
63
  /**
64
   * Check whether the current state is not IDLE.
65
   *
66
   * \return true if the current state is not IDLE, false otherwise
67
   */
48
  bool IsStateBusy (void);
68
  bool IsStateBusy (void);
69
  /**
70
   * Check whether the current state is RX.
71
   *
72
   * \return true if the current state is RX, false otherwise
73
   */
49
  bool IsStateRx (void);
74
  bool IsStateRx (void);
75
  /**
76
   * Check whether the current state is TX.
77
   *
78
   * \return true if the current state is TX, false otherwise
79
   */
50
  bool IsStateTx (void);
80
  bool IsStateTx (void);
81
  /**
82
   * Check whether the current state is SWITCHING.
83
   *
84
   * \return true if the current state is SWITCHING, false otherwise
85
   */
51
  bool IsStateSwitching (void);
86
  bool IsStateSwitching (void);
87
  /**
88
   * Return the elapsed time of the current state.
89
   *
90
   * \return the elapsed time of the current state
91
   */
52
  Time GetStateDuration (void);
92
  Time GetStateDuration (void);
93
  /**
94
   * Return the time before the state is back to IDLE.
95
   *
96
   * \return the delay before the state is back to IDLE
97
   */
53
  Time GetDelayUntilIdle (void);
98
  Time GetDelayUntilIdle (void);
99
  /**
100
   * Return the time the last RX start.
101
   *
102
   * \return the time the last RX start.
103
   */
54
  Time GetLastRxStartTime (void) const;
104
  Time GetLastRxStartTime (void) const;
55
105
106
  /**
107
   * Switch state to TX for the given duration.
108
   *
109
   * \param txDuration the duration of the TX
110
   * \param packet the packet
111
   * \param txMode the transmission mode of the packet
112
   * \param preamble the preamble of the packet
113
   * \param txPower the transmission power
114
   */
56
  void SwitchToTx (Time txDuration, Ptr<const Packet> packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower);
115
  void SwitchToTx (Time txDuration, Ptr<const Packet> packet, WifiMode txMode, WifiPreamble preamble, uint8_t txPower);
116
  /**
117
   * Switch state to RX for the given duration.
118
   *
119
   * \param rxDuration the duration of the RX
120
   */
57
  void SwitchToRx (Time rxDuration);
121
  void SwitchToRx (Time rxDuration);
122
  /**
123
   * Switch state to channel switching for the given duration.
124
   *
125
   * \param switchingDuration the duration of required to switch the channel
126
   */
58
  void SwitchToChannelSwitching (Time switchingDuration);
127
  void SwitchToChannelSwitching (Time switchingDuration);
128
  /**
129
   * Switch from RX after the reception was successful.
130
   *
131
   * \param packet the successfully received packet
132
   * \param snr the SNR of the received packet
133
   * \param mode the transmission mode of the packet
134
   * \param preamble the preamble of the received packet
135
   */
59
  void SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
136
  void SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
137
  /**
138
   * Switch from RX after the reception failed.
139
   *
140
   * \param packet the packet that we failed to received
141
   * \param snr the SNR of the received packet
142
   */
60
  void SwitchFromRxEndError (Ptr<const Packet> packet, double snr);
143
  void SwitchFromRxEndError (Ptr<const Packet> packet, double snr);
144
  /**
145
   * Switch to CCA busy.
146
   *
147
   * \param duration the duration of CCA busy state
148
   */
61
  void SwitchMaybeToCcaBusy (Time duration);
149
  void SwitchMaybeToCcaBusy (Time duration);
62
150
63
  TracedCallback<Time,Time,enum WifiPhy::State> m_stateLogger;
151
  TracedCallback<Time,Time,enum WifiPhy::State> m_stateLogger;
 Lines 66-78    Link Here 
66
154
67
  void LogPreviousIdleAndCcaBusyStates (void);
155
  void LogPreviousIdleAndCcaBusyStates (void);
68
156
157
  /**
158
   * Notify all WifiPhyListener that the transmission has started for the given duration.
159
   *
160
   * \param duration the duration of the transmission
161
   */
69
  void NotifyTxStart (Time duration);
162
  void NotifyTxStart (Time duration);
70
  void NotifyWakeup (void);
163
  void NotifyWakeup (void);
164
  /**
165
   * Notify all WifiPhyListener that the reception has started for the given duration.
166
   *
167
   * \param duration the duration of the reception
168
   */
71
  void NotifyRxStart (Time duration);
169
  void NotifyRxStart (Time duration);
170
  /**
171
   * Notify all WifiPhyListener that the reception was successful.
172
   */
72
  void NotifyRxEndOk (void);
173
  void NotifyRxEndOk (void);
174
  /**
175
   * Notify all WifiPhyListener that the reception was not successful.
176
   */
73
  void NotifyRxEndError (void);
177
  void NotifyRxEndError (void);
178
  /**
179
   * Notify all WifiPhyListener that the CCA has started for the given duration.
180
   *
181
   * \param duration the duration of the CCA state
182
   */
74
  void NotifyMaybeCcaBusyStart (Time duration);
183
  void NotifyMaybeCcaBusyStart (Time duration);
184
  /**
185
   * Notify all WifiPhyListener that we are switching channel with the given channel
186
   * switching delay.
187
   *
188
   * \param duration the delay to switch the channel
189
   */
75
  void NotifySwitchingStart (Time duration);
190
  void NotifySwitchingStart (Time duration);
191
  /**
192
   * Switch the state from RX.
193
   */
76
  void DoSwitchFromRx (void);
194
  void DoSwitchFromRx (void);
77
195
78
  bool m_rxing;
196
  bool m_rxing;
(-)a/src/wifi/model/wifi-phy.h (-2 / +344 lines)
 Lines 400-406    Link Here 
400
   *
400
   *
401
   * This was introduced with 11n
401
   * This was introduced with 11n
402
   *
402
   *
403
   * \param Mcs index in array of supported Mcs
403
   * \param mcs index in array of supported Mcs
404
   * \return the Mcs index whose index is specified.
404
   * \return the Mcs index whose index is specified.
405
   *
405
   *
406
   * \sa WifiPhy::GetNMcs()
406
   * \sa WifiPhy::GetNMcs()
 Lines 445-518    Link Here 
445
   */
445
   */
446
  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
446
  virtual Ptr<WifiChannel> GetChannel (void) const = 0;
447
447
448
  /**
449
   * Return a WifiMode for DSSS at 1Mbps.
450
   *
451
   * \return a WifiMode for DSSS at 1Mbps
452
   */
448
  static WifiMode GetDsssRate1Mbps ();
453
  static WifiMode GetDsssRate1Mbps ();
454
  /**
455
   * Return a WifiMode for DSSS at 2Mbps.
456
   *
457
   * \return a WifiMode for DSSS at 2Mbps
458
   */
449
  static WifiMode GetDsssRate2Mbps ();
459
  static WifiMode GetDsssRate2Mbps ();
460
  /**
461
   * Return a WifiMode for DSSS at 5.5Mbps.
462
   *
463
   * \return a WifiMode for DSSS at 5.5Mbps
464
   */
450
  static WifiMode GetDsssRate5_5Mbps ();
465
  static WifiMode GetDsssRate5_5Mbps ();
466
  /**
467
   * Return a WifiMode for DSSS at 11Mbps.
468
   *
469
   * \return a WifiMode for DSSS at 11Mbps
470
   */
451
  static WifiMode GetDsssRate11Mbps ();
471
  static WifiMode GetDsssRate11Mbps ();
472
  /**
473
   * Return a WifiMode for ERP-ODFM at 6Mbps.
474
   *
475
   * \return a WifiMode for ERP-OFDM at 6Mbps
476
   */
452
  static WifiMode GetErpOfdmRate6Mbps ();
477
  static WifiMode GetErpOfdmRate6Mbps ();
478
  /**
479
   * Return a WifiMode for ERP-ODFM at 9Mbps.
480
   *
481
   * \return a WifiMode for ERP-OFDM at 9Mbps
482
   */
453
  static WifiMode GetErpOfdmRate9Mbps ();
483
  static WifiMode GetErpOfdmRate9Mbps ();
484
  /**
485
   * Return a WifiMode for ERP-ODFM at 12Mbps.
486
   *
487
   * \return a WifiMode for ERP-OFDM at 12Mbps
488
   */
454
  static WifiMode GetErpOfdmRate12Mbps ();
489
  static WifiMode GetErpOfdmRate12Mbps ();
490
  /**
491
   * Return a WifiMode for ERP-ODFM at 18Mbps.
492
   *
493
   * \return a WifiMode for ERP-OFDM at 18Mbps
494
   */
455
  static WifiMode GetErpOfdmRate18Mbps ();
495
  static WifiMode GetErpOfdmRate18Mbps ();
496
  /**
497
   * Return a WifiMode for ERP-ODFM at 24Mbps.
498
   *
499
   * \return a WifiMode for ERP-OFDM at 24Mbps
500
   */
456
  static WifiMode GetErpOfdmRate24Mbps ();
501
  static WifiMode GetErpOfdmRate24Mbps ();
502
  /**
503
   * Return a WifiMode for ERP-ODFM at 36Mbps.
504
   *
505
   * \return a WifiMode for ERP-OFDM at 36Mbps
506
   */
457
  static WifiMode GetErpOfdmRate36Mbps ();
507
  static WifiMode GetErpOfdmRate36Mbps ();
508
  /**
509
   * Return a WifiMode for ERP-ODFM at 48Mbps.
510
   *
511
   * \return a WifiMode for ERP-OFDM at 48Mbps
512
   */
458
  static WifiMode GetErpOfdmRate48Mbps ();
513
  static WifiMode GetErpOfdmRate48Mbps ();
514
  /**
515
   * Return a WifiMode for ERP-ODFM at 54Mbps.
516
   *
517
   * \return a WifiMode for ERP-OFDM at 54Mbps
518
   */
459
  static WifiMode GetErpOfdmRate54Mbps ();
519
  static WifiMode GetErpOfdmRate54Mbps ();
520
  /**
521
   * Return a WifiMode for ODFM at 6Mbps.
522
   *
523
   * \return a WifiMode for OFDM at 6Mbps
524
   */
460
  static WifiMode GetOfdmRate6Mbps ();
525
  static WifiMode GetOfdmRate6Mbps ();
526
  /**
527
   * Return a WifiMode for ODFM at 9Mbps.
528
   *
529
   * \return a WifiMode for OFDM at 9Mbps
530
   */
461
  static WifiMode GetOfdmRate9Mbps ();
531
  static WifiMode GetOfdmRate9Mbps ();
532
  /**
533
   * Return a WifiMode for ODFM at 12Mbps.
534
   *
535
   * \return a WifiMode for OFDM at 12Mbps
536
   */
462
  static WifiMode GetOfdmRate12Mbps ();
537
  static WifiMode GetOfdmRate12Mbps ();
538
  /**
539
   * Return a WifiMode for ODFM at 18Mbps.
540
   *
541
   * \return a WifiMode for OFDM at 18Mbps
542
   */
463
  static WifiMode GetOfdmRate18Mbps ();
543
  static WifiMode GetOfdmRate18Mbps ();
544
  /**
545
   * Return a WifiMode for ODFM at 24Mbps.
546
   *
547
   * \return a WifiMode for OFDM at 24Mbps
548
   */
464
  static WifiMode GetOfdmRate24Mbps ();
549
  static WifiMode GetOfdmRate24Mbps ();
550
  /**
551
   * Return a WifiMode for ODFM at 36Mbps.
552
   *
553
   * \return a WifiMode for OFDM at 36Mbps
554
   */
465
  static WifiMode GetOfdmRate36Mbps ();
555
  static WifiMode GetOfdmRate36Mbps ();
556
  /**
557
   * Return a WifiMode for ODFM at 48Mbps.
558
   *
559
   * \return a WifiMode for OFDM at 48Mbps
560
   */
466
  static WifiMode GetOfdmRate48Mbps ();
561
  static WifiMode GetOfdmRate48Mbps ();
562
  /**
563
   * Return a WifiMode for ODFM at 54Mbps.
564
   *
565
   * \return a WifiMode for OFDM at 54Mbps
566
   */
467
  static WifiMode GetOfdmRate54Mbps ();
567
  static WifiMode GetOfdmRate54Mbps ();
568
  /**
569
   * Return a WifiMode for ODFM at 3Mbps with 10MHz channel spacing.
570
   *
571
   * \return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing
572
   */
468
  static WifiMode GetOfdmRate3MbpsBW10MHz ();
573
  static WifiMode GetOfdmRate3MbpsBW10MHz ();
574
  /**
575
   * Return a WifiMode for ODFM at 4.5Mbps with 10MHz channel spacing.
576
   *
577
   * \return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing
578
   */
469
  static WifiMode GetOfdmRate4_5MbpsBW10MHz ();
579
  static WifiMode GetOfdmRate4_5MbpsBW10MHz ();
580
  /**
581
   * Return a WifiMode for ODFM at 6Mbps with 10MHz channel spacing.
582
   *
583
   * \return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing
584
   */
470
  static WifiMode GetOfdmRate6MbpsBW10MHz ();
585
  static WifiMode GetOfdmRate6MbpsBW10MHz ();
586
  /**
587
   * Return a WifiMode for ODFM at 9Mbps with 10MHz channel spacing.
588
   *
589
   * \return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing
590
   */
471
  static WifiMode GetOfdmRate9MbpsBW10MHz ();
591
  static WifiMode GetOfdmRate9MbpsBW10MHz ();
592
  /**
593
   * Return a WifiMode for ODFM at 12Mbps with 10MHz channel spacing.
594
   *
595
   * \return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing
596
   */
472
  static WifiMode GetOfdmRate12MbpsBW10MHz ();
597
  static WifiMode GetOfdmRate12MbpsBW10MHz ();
598
  /**
599
   * Return a WifiMode for ODFM at 18Mbps with 10MHz channel spacing.
600
   *
601
   * \return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing
602
   */
473
  static WifiMode GetOfdmRate18MbpsBW10MHz ();
603
  static WifiMode GetOfdmRate18MbpsBW10MHz ();
604
  /**
605
   * Return a WifiMode for ODFM at 24Mbps with 10MHz channel spacing.
606
   *
607
   * \return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing
608
   */
474
  static WifiMode GetOfdmRate24MbpsBW10MHz ();
609
  static WifiMode GetOfdmRate24MbpsBW10MHz ();
610
  /**
611
   * Return a WifiMode for ODFM at 27Mbps with 10MHz channel spacing.
612
   *
613
   * \return a WifiMode for OFDM at 27Mbps with 10MHz channel spacing
614
   */
475
  static WifiMode GetOfdmRate27MbpsBW10MHz ();
615
  static WifiMode GetOfdmRate27MbpsBW10MHz ();
616
  /**
617
   * Return a WifiMode for ODFM at 1.5Mbps with 5MHz channel spacing.
618
   *
619
   * \return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing
620
   */
476
  static WifiMode GetOfdmRate1_5MbpsBW5MHz ();
621
  static WifiMode GetOfdmRate1_5MbpsBW5MHz ();
622
  /**
623
   * Return a WifiMode for ODFM at 2.25Mbps with 5MHz channel spacing.
624
   *
625
   * \return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing
626
   */
477
  static WifiMode GetOfdmRate2_25MbpsBW5MHz ();
627
  static WifiMode GetOfdmRate2_25MbpsBW5MHz ();
628
  /**
629
   * Return a WifiMode for ODFM at 3Mbps with 5MHz channel spacing.
630
   *
631
   * \return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing
632
   */
478
  static WifiMode GetOfdmRate3MbpsBW5MHz ();
633
  static WifiMode GetOfdmRate3MbpsBW5MHz ();
634
  /**
635
   * Return a WifiMode for ODFM at 4.5Mbps with 5MHz channel spacing.
636
   *
637
   * \return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing
638
   */
479
  static WifiMode GetOfdmRate4_5MbpsBW5MHz ();
639
  static WifiMode GetOfdmRate4_5MbpsBW5MHz ();
640
  /**
641
   * Return a WifiMode for ODFM at 6Mbps with 5MHz channel spacing.
642
   *
643
   * \return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing
644
   */
480
  static WifiMode GetOfdmRate6MbpsBW5MHz ();
645
  static WifiMode GetOfdmRate6MbpsBW5MHz ();
646
  /**
647
   * Return a WifiMode for ODFM at 9Mbps with 5MHz channel spacing.
648
   *
649
   * \return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing
650
   */
481
  static WifiMode GetOfdmRate9MbpsBW5MHz ();
651
  static WifiMode GetOfdmRate9MbpsBW5MHz ();
652
  /**
653
   * Return a WifiMode for ODFM at 12Mbps with 5MHz channel spacing.
654
   *
655
   * \return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing
656
   */
482
  static WifiMode GetOfdmRate12MbpsBW5MHz ();
657
  static WifiMode GetOfdmRate12MbpsBW5MHz ();
658
  /**
659
   * Return a WifiMode for ODFM at 13.5Mbps with 5MHz channel spacing.
660
   *
661
   * \return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing
662
   */
483
  static WifiMode GetOfdmRate13_5MbpsBW5MHz ();
663
  static WifiMode GetOfdmRate13_5MbpsBW5MHz ();
664
  /**
665
   * Return a WifiMode for ODFM at 6.5Mbps with 20MHz channel spacing.
666
   *
667
   * \return a WifiMode for OFDM at 6.5Mbps with 20MHz channel spacing
668
   */
484
  static WifiMode GetOfdmRate6_5MbpsBW20MHz ();
669
  static WifiMode GetOfdmRate6_5MbpsBW20MHz ();
670
  /**
671
   * Return a WifiMode for ODFM at 13Mbps with 20MHz channel spacing.
672
   *
673
   * \return a WifiMode for OFDM at 13Mbps with 20MHz channel spacing
674
   */
485
  static WifiMode GetOfdmRate13MbpsBW20MHz ();
675
  static WifiMode GetOfdmRate13MbpsBW20MHz ();
676
  /**
677
   * Return a WifiMode for ODFM at 19.5Mbps with 20MHz channel spacing.
678
   *
679
   * \return a WifiMode for OFDM at 19.5Mbps with 20MHz channel spacing
680
   */
486
  static WifiMode GetOfdmRate19_5MbpsBW20MHz ();
681
  static WifiMode GetOfdmRate19_5MbpsBW20MHz ();
682
  /**
683
   * Return a WifiMode for ODFM at 26Mbps with 20MHz channel spacing.
684
   *
685
   * \return a WifiMode for OFDM at 26Mbps with 20MHz channel spacing
686
   */
487
  static WifiMode GetOfdmRate26MbpsBW20MHz ();
687
  static WifiMode GetOfdmRate26MbpsBW20MHz ();
688
  /**
689
   * Return a WifiMode for ODFM at 39Mbps with 20MHz channel spacing.
690
   *
691
   * \return a WifiMode for OFDM at 39Mbps with 20MHz channel spacing
692
   */
488
  static WifiMode GetOfdmRate39MbpsBW20MHz ();
693
  static WifiMode GetOfdmRate39MbpsBW20MHz ();
694
  /**
695
   * Return a WifiMode for ODFM at 52Mbps with 20MHz channel spacing.
696
   *
697
   * \return a WifiMode for OFDM at 52Mbps with 20MHz channel spacing
698
   */
489
  static WifiMode GetOfdmRate52MbpsBW20MHz ();
699
  static WifiMode GetOfdmRate52MbpsBW20MHz ();
700
  /**
701
   * Return a WifiMode for ODFM at 58.5Mbps with 20MHz channel spacing.
702
   *
703
   * \return a WifiMode for OFDM at 58.5Mbps with 20MHz channel spacing
704
   */
490
  static WifiMode GetOfdmRate58_5MbpsBW20MHz ();
705
  static WifiMode GetOfdmRate58_5MbpsBW20MHz ();
706
  /**
707
   * Return a WifiMode for ODFM at 65Mbps with 20MHz channel spacing.
708
   *
709
   * \return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing
710
   */
491
  static WifiMode GetOfdmRate65MbpsBW20MHz ();
711
  static WifiMode GetOfdmRate65MbpsBW20MHz ();
712
  /**
713
   * Return a WifiMode for ODFM at 13.5Mbps with 40MHz channel spacing.
714
   *
715
   * \return a WifiMode for OFDM at 13.5Mbps with 40MHz channel spacing
716
   */
492
  static WifiMode GetOfdmRate13_5MbpsBW40MHz ();
717
  static WifiMode GetOfdmRate13_5MbpsBW40MHz ();
493
  static WifiMode GetOfdmRate27MbpsBW40MHz (); 
718
  /**
719
   * Return a WifiMode for ODFM at 27Mbps with 40MHz channel spacing.
720
   *
721
   * \return a WifiMode for OFDM at 27Mbps with 40MHz channel spacing
722
   */
723
  static WifiMode GetOfdmRate27MbpsBW40MHz ();
724
  /**
725
   * Return a WifiMode for ODFM at 40.5Mbps with 40MHz channel spacing.
726
   *
727
   * \return a WifiMode for OFDM at 40.5Mbps with 40MHz channel spacing
728
   */
494
  static WifiMode GetOfdmRate40_5MbpsBW40MHz ();
729
  static WifiMode GetOfdmRate40_5MbpsBW40MHz ();
730
  /**
731
   * Return a WifiMode for ODFM at 54Mbps with 40MHz channel spacing.
732
   *
733
   * \return a WifiMode for OFDM at 54Mbps with 40MHz channel spacing
734
   */
495
  static WifiMode GetOfdmRate54MbpsBW40MHz ();
735
  static WifiMode GetOfdmRate54MbpsBW40MHz ();
736
  /**
737
   * Return a WifiMode for ODFM at 81Mbps with 40MHz channel spacing.
738
   *
739
   * \return a WifiMode for OFDM at 81Mbps with 40MHz channel spacing
740
   */
496
  static WifiMode GetOfdmRate81MbpsBW40MHz ();
741
  static WifiMode GetOfdmRate81MbpsBW40MHz ();
742
  /**
743
   * Return a WifiMode for ODFM at 108Mbps with 40MHz channel spacing.
744
   *
745
   * \return a WifiMode for OFDM at 108Mbps with 40MHz channel spacing
746
   */
497
  static WifiMode GetOfdmRate108MbpsBW40MHz ();
747
  static WifiMode GetOfdmRate108MbpsBW40MHz ();
748
  /**
749
   * Return a WifiMode for ODFM at 121.5Mbps with 40MHz channel spacing.
750
   *
751
   * \return a WifiMode for OFDM at 121.5Mbps with 40MHz channel spacing
752
   */
498
  static WifiMode GetOfdmRate121_5MbpsBW40MHz ();
753
  static WifiMode GetOfdmRate121_5MbpsBW40MHz ();
754
  /**
755
   * Return a WifiMode for ODFM at 135Mbps with 40MHz channel spacing.
756
   *
757
   * \return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing
758
   */
499
  static WifiMode GetOfdmRate135MbpsBW40MHz ();
759
  static WifiMode GetOfdmRate135MbpsBW40MHz ();
500
  //Rates for clause 20 with short guard interval
760
  //Rates for clause 20 with short guard interval
761
  /**
762
   * Return a WifiMode for ODFM at 7.2Mbps with 20MHz channel spacing.
763
   *
764
   * \return a WifiMode for OFDM at 7.2Mbps with 20MHz channel spacing
765
   */
501
  static WifiMode GetOfdmRate7_2MbpsBW20MHz ();
766
  static WifiMode GetOfdmRate7_2MbpsBW20MHz ();
767
  /**
768
   * Return a WifiMode for ODFM at 14.4Mbps with 20MHz channel spacing.
769
   *
770
   * \return a WifiMode for OFDM at 14.4Mbps with 20MHz channel spacing
771
   */
502
  static WifiMode GetOfdmRate14_4MbpsBW20MHz ();
772
  static WifiMode GetOfdmRate14_4MbpsBW20MHz ();
773
  /**
774
   * Return a WifiMode for ODFM at 21.7Mbps with 20MHz channel spacing.
775
   *
776
   * \return a WifiMode for OFDM at 21.7Mbps with 20MHz channel spacing
777
   */
503
  static WifiMode GetOfdmRate21_7MbpsBW20MHz ();
778
  static WifiMode GetOfdmRate21_7MbpsBW20MHz ();
779
  /**
780
   * Return a WifiMode for ODFM at 28.9Mbps with 20MHz channel spacing.
781
   *
782
   * \return a WifiMode for OFDM at 28.9Mbps with 20MHz channel spacing
783
   */
504
  static WifiMode GetOfdmRate28_9MbpsBW20MHz ();
784
  static WifiMode GetOfdmRate28_9MbpsBW20MHz ();
785
  /**
786
   * Return a WifiMode for ODFM at 43.3Mbps with 20MHz channel spacing.
787
   *
788
   * \return a WifiMode for OFDM at 43.3Mbps with 20MHz channel spacing
789
   */
505
  static WifiMode GetOfdmRate43_3MbpsBW20MHz ();
790
  static WifiMode GetOfdmRate43_3MbpsBW20MHz ();
791
  /**
792
   * Return a WifiMode for ODFM at 57.8Mbps with 20MHz channel spacing.
793
   *
794
   * \return a WifiMode for OFDM at 57.8Mbps with 20MHz channel spacing
795
   */
506
  static WifiMode GetOfdmRate57_8MbpsBW20MHz ();
796
  static WifiMode GetOfdmRate57_8MbpsBW20MHz ();
797
  /**
798
   * Return a WifiMode for ODFM at 65Mbps with 20MHz channel spacing.
799
   * The rate supports short guard interval.
800
   *
801
   * \return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing
802
   */
507
  static WifiMode GetOfdmRate65MbpsBW20MHzShGi ();
803
  static WifiMode GetOfdmRate65MbpsBW20MHzShGi ();
804
  /**
805
   * Return a WifiMode for ODFM at 72.2Mbps with 20MHz channel spacing.
806
   *
807
   * \return a WifiMode for OFDM at 72.2Mbps with 20MHz channel spacing
808
   */
508
  static WifiMode GetOfdmRate72_2MbpsBW20MHz ();
809
  static WifiMode GetOfdmRate72_2MbpsBW20MHz ();
810
  /**
811
   * Return a WifiMode for ODFM at 15Mbps with 40MHz channel spacing.
812
   *
813
   * \return a WifiMode for OFDM at 15Mbps with 40MHz channel spacing
814
   */
509
  static WifiMode GetOfdmRate15MbpsBW40MHz ();
815
  static WifiMode GetOfdmRate15MbpsBW40MHz ();
816
  /**
817
   * Return a WifiMode for ODFM at 30Mbps with 40MHz channel spacing.
818
   *
819
   * \return a WifiMode for OFDM at 30Mbps with 40MHz channel spacing
820
   */
510
  static WifiMode GetOfdmRate30MbpsBW40MHz (); 
821
  static WifiMode GetOfdmRate30MbpsBW40MHz (); 
822
  /**
823
   * Return a WifiMode for ODFM at 45Mbps with 40MHz channel spacing.
824
   *
825
   * \return a WifiMode for OFDM at 45Mbps with 40MHz channel spacing
826
   */
511
  static WifiMode GetOfdmRate45MbpsBW40MHz ();
827
  static WifiMode GetOfdmRate45MbpsBW40MHz ();
828
  /**
829
   * Return a WifiMode for ODFM at 60Mbps with 40MHz channel spacing.
830
   *
831
   * \return a WifiMode for OFDM at 60Mbps with 40MHz channel spacing
832
   */
512
  static WifiMode GetOfdmRate60MbpsBW40MHz ();
833
  static WifiMode GetOfdmRate60MbpsBW40MHz ();
834
  /**
835
   * Return a WifiMode for ODFM at 90Mbps with 40MHz channel spacing.
836
   *
837
   * \return a WifiMode for OFDM at 90Mbps with 40MHz channel spacing
838
   */
513
  static WifiMode GetOfdmRate90MbpsBW40MHz ();
839
  static WifiMode GetOfdmRate90MbpsBW40MHz ();
840
  /**
841
   * Return a WifiMode for ODFM at 120Mbps with 40MHz channel spacing.
842
   *
843
   * \return a WifiMode for OFDM at 120Mbps with 40MHz channel spacing
844
   */
514
  static WifiMode GetOfdmRate120MbpsBW40MHz ();
845
  static WifiMode GetOfdmRate120MbpsBW40MHz ();
846
  /**
847
   * Return a WifiMode for ODFM at 135Mbps with 40MHz channel spacing.
848
   * The rate supports short guard interval.
849
   *
850
   * \return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing
851
   */
515
  static WifiMode GetOfdmRate135MbpsBW40MHzShGi ();
852
  static WifiMode GetOfdmRate135MbpsBW40MHzShGi ();
853
  /**
854
   * Return a WifiMode for ODFM at 150Mbps with 40MHz channel spacing.
855
   *
856
   * \return a WifiMode for OFDM at 150Mbps with 40MHz channel spacing
857
   */
516
  static WifiMode GetOfdmRate150MbpsBW40MHz ();
858
  static WifiMode GetOfdmRate150MbpsBW40MHz ();
517
859
518
860
(-)a/src/wifi/model/wifi-remote-station-manager.h (-17 / +68 lines)
 Lines 125-143    Link Here 
125
  /**
125
  /**
126
   * Sets the maximum STA short retry count (SSRC).
126
   * Sets the maximum STA short retry count (SSRC).
127
   *
127
   *
128
   * \param the maximum SSRC
128
   * \param maxSsrc the maximum SSRC
129
   */
129
   */
130
  void SetMaxSsrc (uint32_t maxSsrc);
130
  void SetMaxSsrc (uint32_t maxSsrc);
131
  /**
131
  /**
132
   * Sets the maximum STA long retry count (SLRC).
132
   * Sets the maximum STA long retry count (SLRC).
133
   *
133
   *
134
   * \param the maximum SLRC
134
   * \param maxSlrc the maximum SLRC
135
   */
135
   */
136
  void SetMaxSlrc (uint32_t maxSlrc);
136
  void SetMaxSlrc (uint32_t maxSlrc);
137
  /**
137
  /**
138
   * Sets the RTS threshold.
138
   * Sets the RTS threshold.
139
   *
139
   *
140
   * \param the RTS threshold
140
   * \param threshold the RTS threshold
141
   */
141
   */
142
  void SetRtsCtsThreshold (uint32_t threshold);
142
  void SetRtsCtsThreshold (uint32_t threshold);
143
  /**
143
  /**
 Lines 148-154    Link Here 
148
   */
148
   */
149
  void SetFragmentationThreshold (uint32_t threshold);
149
  void SetFragmentationThreshold (uint32_t threshold);
150
  /**
150
  /**
151
   * Records HT capabilities of remote station.
151
   * Records HT capabilities of the remote station.
152
   *
152
   *
153
   * \param from the address of the station being recorded
153
   * \param from the address of the station being recorded
154
   * \param htcapabilities the HT capabilities of the station
154
   * \param htcapabilities the HT capabilities of the station
 Lines 207-217    Link Here 
207
   *          false otherwise
207
   *          false otherwise
208
   */
208
   */
209
  bool GetGreenfieldSupported (Mac48Address address) const;
209
  bool GetGreenfieldSupported (Mac48Address address) const;
210
  /**
211
   * Add a given Modulation and Coding Scheme (MCS) index to
212
   * the set of basic MCS.
213
   *
214
   * \param mcs the MCS index
215
   */
210
  void AddBasicMcs (uint8_t mcs);
216
  void AddBasicMcs (uint8_t mcs);
211
217
218
  /**
219
   * Return the default Modulation and Coding Scheme (MCS) index.
220
   *
221
   * \return the default MCS index
222
   */
212
  uint8_t GetDefaultMcs (void) const;
223
  uint8_t GetDefaultMcs (void) const;
224
  /**
225
   * Return the number of basic MCS index.
226
   *
227
   * \return the number of basic MCS index
228
   */
213
  uint32_t GetNBasicMcs (void) const;
229
  uint32_t GetNBasicMcs (void) const;
230
  /**
231
   * Return the MCS at the given <i>list</i> index.
232
   *
233
   * \param i the position in the list
234
   * \return the MCS at the given list index
235
   */
214
  uint8_t GetBasicMcs (uint32_t i) const;
236
  uint8_t GetBasicMcs (uint32_t i) const;
237
  /**
238
   * Record the MCS index supported by the station.
239
   * 
240
   * \param address the address of the station
241
   * \param mcs the MCS index
242
   */
215
  void AddSupportedMcs (Mac48Address address, uint8_t mcs);
243
  void AddSupportedMcs (Mac48Address address, uint8_t mcs);
216
244
217
  /**
245
  /**
 Lines 342-347    Link Here 
342
  /**
370
  /**
343
   * Since CTS-to-self parameters are not dependent on the station,
371
   * Since CTS-to-self parameters are not dependent on the station,
344
   * it is implemented in wifiremote station manager
372
   * it is implemented in wifiremote station manager
373
   *
374
   * \return the transmission mode to use to send the CTS-to-self prior to the
375
   *          transmission of the data packet itself.
345
   */
376
   */
346
  WifiTxVector DoGetCtsToSelfTxVector (void);
377
  WifiTxVector DoGetCtsToSelfTxVector (void);
347
378
 Lines 427-432    Link Here 
427
  /**
458
  /**
428
   * Return if we need to do Cts-to-self before sending a DATA.
459
   * Return if we need to do Cts-to-self before sending a DATA.
429
   *
460
   *
461
   * \param txVector the TXVECTOR of the packet to be sent
430
   * \return true if Cts-to-self is needed, false otherwise
462
   * \return true if Cts-to-self is needed, false otherwise
431
   */
463
   */
432
  bool NeedCtsToSelf (WifiTxVector txVector);
464
  bool NeedCtsToSelf (WifiTxVector txVector);
 Lines 519-525    Link Here 
519
  /**
551
  /**
520
   * Set the default transmission power level
552
   * Set the default transmission power level
521
   *
553
   *
522
   * \param the default transmission power level
554
   * \param txPower the default transmission power level
523
   */
555
   */
524
  void SetDefaultTxPowerLevel (uint8_t txPower);
556
  void SetDefaultTxPowerLevel (uint8_t txPower);
525
 /**
557
 /**
 Lines 544-550    Link Here 
544
   * \return the number of modes supported by the given station
576
   * \return the number of modes supported by the given station
545
   */
577
   */
546
  uint32_t GetNSupported (const WifiRemoteStation *station) const;
578
  uint32_t GetNSupported (const WifiRemoteStation *station) const;
579
  /**
580
   * Return the MCS index supported by the specified station at the specified index.
581
   *
582
   * \param station the station being queried
583
   * \param i the index
584
   * \return the MCS index at the given index of the specified station
585
   */
547
  uint8_t GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const;
586
  uint8_t GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const;
587
  /**
588
   * Return the number of MCS supported by the given station.
589
   *
590
   * \param station the station being queried
591
   * \return the number of MCS supported by the given station
592
   */
548
  uint32_t GetNMcsSupported (const WifiRemoteStation *station) const;
593
  uint32_t GetNMcsSupported (const WifiRemoteStation *station) const;
549
594
550
  /**
595
  /**
 Lines 555-560    Link Here 
555
   *          false otherwise
600
   *          false otherwise
556
   */
601
   */
557
  bool GetShortGuardInterval (const WifiRemoteStation *station) const;
602
  bool GetShortGuardInterval (const WifiRemoteStation *station) const;
603
  /**
604
   * Return whether the given station supports space-time block coding (STBC).
605
   *
606
   * \param station the station being queried
607
   * \return true if the station supports STBC, false otherwise
608
   */
558
  bool GetStbc (const WifiRemoteStation *station) const;
609
  bool GetStbc (const WifiRemoteStation *station) const;
559
  /**
610
  /**
560
   * Return whether the station supports Greenfield or not.
611
   * Return whether the station supports Greenfield or not.
 Lines 594-600    Link Here 
594
  uint32_t GetShortRetryCount (const WifiRemoteStation *station) const;
645
  uint32_t GetShortRetryCount (const WifiRemoteStation *station) const;
595
private:
646
private:
596
  /**
647
  /**
597
   * \param station the station with which we need to communicate
648
   * \param station the station that we need to communicate
598
   * \param packet the packet to send
649
   * \param packet the packet to send
599
   * \param normally indicates whether the normal 802.11 rts enable mechanism would
650
   * \param normally indicates whether the normal 802.11 rts enable mechanism would
600
   *        request that the rts is sent or not.
651
   *        request that the rts is sent or not.
 Lines 606-612    Link Here 
606
  virtual bool DoNeedRts (WifiRemoteStation *station,
657
  virtual bool DoNeedRts (WifiRemoteStation *station,
607
                          Ptr<const Packet> packet, bool normally);
658
                          Ptr<const Packet> packet, bool normally);
608
  /**
659
  /**
609
   * \param station the station with which we need to communicate
660
   * \param station the station that we need to communicate
610
   * \param packet the packet to send
661
   * \param packet the packet to send
611
   * \param normally indicates whether the normal 802.11 rts enable mechanism would
662
   * \param normally indicates whether the normal 802.11 rts enable mechanism would
612
   *        request that the rts is retransmitted or not.
663
   *        request that the rts is retransmitted or not.
 Lines 619-625    Link Here 
619
  virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station,
670
  virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station,
620
                                        Ptr<const Packet> packet, bool normally);
671
                                        Ptr<const Packet> packet, bool normally);
621
  /**
672
  /**
622
   * \param station the station with which we need to communicate
673
   * \param station the station that we need to communicate
623
   * \param packet the packet to send
674
   * \param packet the packet to send
624
   * \param normally indicates whether the normal 802.11 data retransmission mechanism
675
   * \param normally indicates whether the normal 802.11 data retransmission mechanism
625
   *        would request that the data is retransmitted or not.
676
   *        would request that the data is retransmitted or not.
 Lines 633-639    Link Here 
633
                                         Ptr<const Packet> packet, bool normally);
684
                                         Ptr<const Packet> packet, bool normally);
634
685
635
  /**
686
  /**
636
   * \param station the station with which we need to communicate
687
   * \param station the station that we need to communicate
637
   * \param packet the packet to send
688
   * \param packet the packet to send
638
   * \param normally indicates whether the normal 802.11 data fragmentation mechanism
689
   * \param normally indicates whether the normal 802.11 data fragmentation mechanism
639
   *        would request that the data packet is fragmented or not.
690
   *        would request that the data packet is fragmented or not.
 Lines 656-662    Link Here 
656
   */
707
   */
657
  virtual WifiRemoteStation* DoCreateStation (void) const = 0;
708
  virtual WifiRemoteStation* DoCreateStation (void) const = 0;
658
 /**
709
 /**
659
   * \param station the station with which we need to communicate
710
   * \param station the station that we need to communicate
660
   * \param size size of the packet or fragment we want to send
711
   * \param size size of the packet or fragment we want to send
661
   * \return the transmission mode to use to send a packet to the station
712
   * \return the transmission mode to use to send a packet to the station
662
   *
713
   *
 Lines 666-672    Link Here 
666
  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station,
717
  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station,
667
                                  uint32_t size) = 0;
718
                                  uint32_t size) = 0;
668
  /**
719
  /**
669
   * \param station the station with which we need to communicate
720
   * \param station the station that we need to communicate
670
   * \return the transmission mode to use to send an rts to the station
721
   * \return the transmission mode to use to send an rts to the station
671
   *
722
   *
672
   * Note: This method is called before sending an rts to a station
723
   * Note: This method is called before sending an rts to a station
 Lines 717-737    Link Here 
717
   * This method is a pure virtual method that must be implemented by the sub-class.
768
   * This method is a pure virtual method that must be implemented by the sub-class.
718
   * This allows different types of WifiRemoteStationManager to respond differently,
769
   * This allows different types of WifiRemoteStationManager to respond differently,
719
   *
770
   *
720
   * \param station the station with which we failed to send RTS
771
   * \param station the station that we failed to send RTS
721
   */
772
   */
722
  virtual void DoReportRtsFailed (WifiRemoteStation *station) = 0;
773
  virtual void DoReportRtsFailed (WifiRemoteStation *station) = 0;
723
  /**
774
  /**
724
   * This method is a pure virtual method that must be implemented by the sub-class.
775
   * This method is a pure virtual method that must be implemented by the sub-class.
725
   * This allows different types of WifiRemoteStationManager to respond differently,
776
   * This allows different types of WifiRemoteStationManager to respond differently,
726
   *
777
   *
727
   * \param station the station with which we failed to send DATA
778
   * \param station the station that we failed to send DATA
728
   */
779
   */
729
  virtual void DoReportDataFailed (WifiRemoteStation *station) = 0;
780
  virtual void DoReportDataFailed (WifiRemoteStation *station) = 0;
730
  /**
781
  /**
731
   * This method is a pure virtual method that must be implemented by the sub-class.
782
   * This method is a pure virtual method that must be implemented by the sub-class.
732
   * This allows different types of WifiRemoteStationManager to respond differently,
783
   * This allows different types of WifiRemoteStationManager to respond differently,
733
   *
784
   *
734
   * \param station the station with which we successfully sent RTS
785
   * \param station the station that we successfully sent RTS
735
   * \param ctsSnr the SNR of the CTS we received
786
   * \param ctsSnr the SNR of the CTS we received
736
   * \param ctsMode the WifiMode the receiver used to send the CTS
787
   * \param ctsMode the WifiMode the receiver used to send the CTS
737
   * \param rtsSnr the SNR of the RTS we sent
788
   * \param rtsSnr the SNR of the RTS we sent
 Lines 742-748    Link Here 
742
   * This method is a pure virtual method that must be implemented by the sub-class.
793
   * This method is a pure virtual method that must be implemented by the sub-class.
743
   * This allows different types of WifiRemoteStationManager to respond differently,
794
   * This allows different types of WifiRemoteStationManager to respond differently,
744
   *
795
   *
745
   * \param station the station with which we successfully sent RTS
796
   * \param station the station that we successfully sent RTS
746
   * \param ackSnr the SNR of the ACK we received
797
   * \param ackSnr the SNR of the ACK we received
747
   * \param ackMode the WifiMode the receiver used to send the ACK
798
   * \param ackMode the WifiMode the receiver used to send the ACK
748
   * \param dataSnr the SNR of the DATA we sent
799
   * \param dataSnr the SNR of the DATA we sent
 Lines 753-766    Link Here 
753
   * This method is a pure virtual method that must be implemented by the sub-class.
804
   * This method is a pure virtual method that must be implemented by the sub-class.
754
   * This allows different types of WifiRemoteStationManager to respond differently,
805
   * This allows different types of WifiRemoteStationManager to respond differently,
755
   *
806
   *
756
   * \param station the station with which we failed to send RTS
807
   * \param station the station that we failed to send RTS
757
   */
808
   */
758
  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station) = 0;
809
  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station) = 0;
759
  /**
810
  /**
760
   * This method is a pure virtual method that must be implemented by the sub-class.
811
   * This method is a pure virtual method that must be implemented by the sub-class.
761
   * This allows different types of WifiRemoteStationManager to respond differently,
812
   * This allows different types of WifiRemoteStationManager to respond differently,
762
   *
813
   *
763
   * \param station the station with which we failed to send DATA
814
   * \param station the station that we failed to send DATA
764
   */
815
   */
765
  virtual void DoReportFinalDataFailed (WifiRemoteStation *station) = 0;
816
  virtual void DoReportFinalDataFailed (WifiRemoteStation *station) = 0;
766
  /**
817
  /**
(-)a/src/wifi/model/wifi-tx-vector.h (-6 / +20 lines)
 Lines 53-60    Link Here 
53
   *  \returns the txvector payload mode
53
   *  \returns the txvector payload mode
54
   */
54
   */
55
  WifiMode GetMode (void) const;
55
  WifiMode GetMode (void) const;
56
 /**
56
  /**
57
  * Sets the selected payload transmission mode
57
  * Sets the selected payload transmission mode
58
  *
59
  * \param mode
58
  */
60
  */
59
  void SetMode (WifiMode mode);
61
  void SetMode (WifiMode mode);
60
  /**
62
  /**
 Lines 63-76    Link Here 
63
  uint8_t GetTxPowerLevel (void) const;
65
  uint8_t GetTxPowerLevel (void) const;
64
  /**
66
  /**
65
   * Sets the selected transmission power level
67
   * Sets the selected transmission power level
68
   *
69
   * \param powerlevel
66
   */
70
   */
67
  void SetTxPowerLevel (uint8_t powerlevel);
71
  void SetTxPowerLevel (uint8_t powerlevel);
68
  /**
72
  /**
69
   *  \returns the number of retries
73
   *  \returns the number of retries
70
   */
74
   */
71
  uint8_t GetRetries (void) const;
75
  uint8_t GetRetries (void) const;
72
   /**
76
  /**
73
   * Sets the number of retries
77
   * Sets the number of retries
78
   *
79
   * \param retries
74
   */
80
   */
75
  void SetRetries (uint8_t retries);
81
  void SetRetries (uint8_t retries);
76
  /**
82
  /**
 Lines 79-100    Link Here 
79
  bool IsShortGuardInterval (void) const;
85
  bool IsShortGuardInterval (void) const;
80
   /**
86
   /**
81
   * Sets if short gurad interval is being used
87
   * Sets if short gurad interval is being used
88
   *
89
   * \param guardinterval enable or disable short guard interval
82
   */
90
   */
83
  void SetShortGuardInterval (bool guardinterval);
91
  void SetShortGuardInterval (bool guardinterval);
84
 /**
92
  /**
85
   *  \returns the number of Nss
93
   *  \returns the number of Nss
86
   */
94
   */
87
  uint8_t GetNss (void) const;
95
  uint8_t GetNss (void) const;
88
   /**
96
  /**
89
   * Sets the number of Nss refer to IEEE802.11n Table 20-28 for explanation and range
97
   * Sets the number of Nss refer to IEEE802.11n Table 20-28 for explanation and range
98
   *
99
   * \param nss
90
   */
100
   */
91
  void SetNss (uint8_t nss);
101
  void SetNss (uint8_t nss);
92
  /**
102
  /**
93
   *  \returns the number of Ness  
103
   *  \returns the number of Ness  
94
   */
104
   */
95
  uint8_t GetNess (void) const;
105
  uint8_t GetNess (void) const;
96
   /**
106
  /**
97
   * Sets the Ness number refer to IEEE802.11n Table 20-6 for explanation
107
   * Sets the Ness number refer to IEEE802.11n Table 20-6 for explanation
108
   *
109
   * \param ness
98
   */
110
   */
99
  void SetNess (uint8_t ness);
111
  void SetNess (uint8_t ness);
100
  /**
112
  /**
 Lines 103-110    Link Here 
103
  bool IsStbc (void) const;
115
  bool IsStbc (void) const;
104
  /**
116
  /**
105
   * Sets if STBC is being used
117
   * Sets if STBC is being used
118
   *
119
   * \param stbc enable or disable STBC
106
   */
120
   */
107
  void SetStbc (bool stbcsatuts);
121
  void SetStbc (bool stbc);
108
122
109
  
123
  
110
private:
124
private:
(-)a/src/wifi/model/yans-error-rate-model.h (+35 lines)
 Lines 103-114    Link Here 
103
   * \return a Binomial distribution
103
   * \return a Binomial distribution
104
   */
104
   */
105
  double Binomial (uint32_t k, double p, uint32_t n) const;
105
  double Binomial (uint32_t k, double p, uint32_t n) const;
106
  /**
107
   * \param ber
108
   * \param d
109
   * \return double
110
   */
106
  double CalculatePdOdd (double ber, unsigned int d) const;
111
  double CalculatePdOdd (double ber, unsigned int d) const;
112
  /**
113
   * \param ber
114
   * \param d
115
   * \return double
116
   */
107
  double CalculatePdEven (double ber, unsigned int d) const;
117
  double CalculatePdEven (double ber, unsigned int d) const;
118
  /**
119
   * \param ber
120
   * \param d
121
   * \return double
122
   */
108
  double CalculatePd (double ber, unsigned int d) const;
123
  double CalculatePd (double ber, unsigned int d) const;
124
  /**
125
   * \param snr
126
   * \param nbits
127
   * \param signalSpread
128
   * \param phyRate
129
   * \param dFree
130
   * \param adFree
131
   * \return double
132
   */
109
  double GetFecBpskBer (double snr, double nbits,
133
  double GetFecBpskBer (double snr, double nbits,
110
                        uint32_t signalSpread, uint32_t phyRate,
134
                        uint32_t signalSpread, uint32_t phyRate,
111
                        uint32_t dFree, uint32_t adFree) const;
135
                        uint32_t dFree, uint32_t adFree) const;
136
  /**
137
   * \param snr
138
   * \param nbits
139
   * \param signalSpread
140
   * \param phyRate
141
   * \param m
142
   * \param dfree
143
   * \param adFree
144
   * \param adFreePlusOne
145
   * \return double
146
   */
112
  double GetFecQamBer (double snr, uint32_t nbits,
147
  double GetFecQamBer (double snr, uint32_t nbits,
113
                       uint32_t signalSpread,
148
                       uint32_t signalSpread,
114
                       uint32_t phyRate,
149
                       uint32_t phyRate,
(-)a/src/wifi/model/yans-wifi-phy.h (-1 / +98 lines)
 Lines 69-77    Link Here 
69
  YansWifiPhy ();
69
  YansWifiPhy ();
70
  virtual ~YansWifiPhy ();
70
  virtual ~YansWifiPhy ();
71
71
72
  /**
73
   * Set the YansWifiChannel this YansWifiPhy is to be connected to.
74
   *
75
   * \param channel the YansWifiChannel this YansWifiPhy is to be connected to
76
   */
72
  void SetChannel (Ptr<YansWifiChannel> channel);
77
  void SetChannel (Ptr<YansWifiChannel> channel);
73
78
79
  /**
80
   * Set the current channel number.
81
   *
82
   * \param id the channel number
83
   */
74
  void SetChannelNumber (uint16_t id);
84
  void SetChannelNumber (uint16_t id);
85
  /**
86
   * Return the current channel number.
87
   *
88
   * \return the current channel number
89
   */
75
  uint16_t GetChannelNumber () const;
90
  uint16_t GetChannelNumber () const;
76
  /**
91
  /**
77
   * Return current center channel frequency in MHz.
92
   * Return current center channel frequency in MHz.
 Lines 80-85    Link Here 
80
   */  
95
   */  
81
  double GetChannelFrequencyMhz () const;
96
  double GetChannelFrequencyMhz () const;
82
97
98
  /**
99
   * Starting receiving the packet (i.e. the first bit of the preamble has arrived).
100
   *
101
   * \param packet the arriving packet
102
   * \param rxPowerDbm the receive power in dBm
103
   * \param txVector the TXVECTOR of the arriving packet
104
   * \param preamble the preamble of the arriving packet
105
   */
83
  void StartReceivePacket (Ptr<Packet> packet,
106
  void StartReceivePacket (Ptr<Packet> packet,
84
                           double rxPowerDbm,
107
                           double rxPowerDbm,
85
                           WifiTxVector txVector,
108
                           WifiTxVector txVector,
 Lines 206-212    Link Here 
206
   */
229
   */
207
  Ptr<Object> GetMobility (void);
230
  Ptr<Object> GetMobility (void);
208
231
232
  /**
233
   * Return the minimum available transmission power level (dBm).
234
   * \return the minimum available transmission power level (dBm)
235
   */
209
  virtual double GetTxPowerStart (void) const;
236
  virtual double GetTxPowerStart (void) const;
237
  /**
238
   * Return the maximum available transmission power level (dBm).
239
   * \return the maximum available transmission power level (dBm)
240
   */
210
  virtual double GetTxPowerEnd (void) const;
241
  virtual double GetTxPowerEnd (void) const;
211
  /**
242
  /**
212
   * Return the number of available transmission power levels.
243
   * Return the number of available transmission power levels.
 Lines 321-327    Link Here 
321
  /**
352
  /**
322
   * Enable or disable channel bonding support.
353
   * Enable or disable channel bonding support.
323
   * 
354
   * 
324
   * \param channelBonding Enable or disable channel bonding
355
   * \param channelbonding Enable or disable channel bonding
325
   */
356
   */
326
  virtual void SetChannelBonding (bool channelbonding) ;
357
  virtual void SetChannelBonding (bool channelbonding) ;
327
358
 Lines 353-371    Link Here 
353
private:
384
private:
354
  YansWifiPhy (const YansWifiPhy &o);
385
  YansWifiPhy (const YansWifiPhy &o);
355
  virtual void DoDispose (void);
386
  virtual void DoDispose (void);
387
  /**
388
   * Configure YansWifiPhy with appropriate channel frequency and
389
   * supported rates for 802.11a standard.
390
   */
356
  void Configure80211a (void);
391
  void Configure80211a (void);
392
  /**
393
   * Configure YansWifiPhy with appropriate channel frequency and
394
   * supported rates for 802.11b standard.
395
   */
357
  void Configure80211b (void);
396
  void Configure80211b (void);
397
  /**
398
   * Configure YansWifiPhy with appropriate channel frequency and
399
   * supported rates for 802.11g standard.
400
   */
358
  void Configure80211g (void);
401
  void Configure80211g (void);
402
  /**
403
   * Configure YansWifiPhy with appropriate channel frequency and
404
   * supported rates for 802.11a standard with 10MHz channel spacing.
405
   */
359
  void Configure80211_10Mhz (void);
406
  void Configure80211_10Mhz (void);
407
  /**
408
   * Configure YansWifiPhy with appropriate channel frequency and
409
   * supported rates for 802.11a standard with 5MHz channel spacing.
410
   */
360
  void Configure80211_5Mhz ();
411
  void Configure80211_5Mhz ();
361
  void ConfigureHolland (void);
412
  void ConfigureHolland (void);
413
  /**
414
   * Configure YansWifiPhy with appropriate channel frequency and
415
   * supported rates for 802.11n standard.
416
   */
362
  void Configure80211n (void);
417
  void Configure80211n (void);
418
  /**
419
   * Return the energy detection threshold.
420
   *
421
   * \return the energy detection threshold.
422
   */
363
  double GetEdThresholdW (void) const;
423
  double GetEdThresholdW (void) const;
424
  /**
425
   * Convert from dBm to Watts.
426
   *
427
   * \param dbm the power in dBm
428
   * \return the equivalent Watts for the given dBm
429
   */
364
  double DbmToW (double dbm) const;
430
  double DbmToW (double dbm) const;
431
  /**
432
   * Convert from dB to ratio.
433
   *
434
   * \param db
435
   * \return ratio
436
   */
365
  double DbToRatio (double db) const;
437
  double DbToRatio (double db) const;
438
  /**
439
   * Convert from Watts to dBm.
440
   *
441
   * \param w the power in Watts
442
   * \return the equivalent dBm for the given Watts
443
   */
366
  double WToDbm (double w) const;
444
  double WToDbm (double w) const;
445
  /**
446
   * Convert from ratio to dB.
447
   *
448
   * \param ratio
449
   * \return dB
450
   */
367
  double RatioToDb (double ratio) const;
451
  double RatioToDb (double ratio) const;
452
  /**
453
   * Get the power of the given power level in dBm.
454
   * In YansWifiPhy implementation, the power levels are equally spaced (in dBm).
455
   *
456
   * \param power the power level
457
   * \return the transmission power in dBm at the given power level
458
   */
368
  double GetPowerDbm (uint8_t power) const;
459
  double GetPowerDbm (uint8_t power) const;
460
  /**
461
   * The last bit of the packet has arrived.
462
   *
463
   * \param packet the packet that the last bit has arrived
464
   * \param event the corresponding event of the first time the packet arrives
465
   */
369
  void EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
466
  void EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
370
467
371
private:
468
private:

Return to bug 938