author | Mirko Banchi <mk.banchi@gmail.com> |
Wed, 03 Feb 2010 20:34:51 +0100 | |
changeset 5956 | e9918be47f78 |
parent 5955 | 10fbe045901e |
child 5957 | dd5ece55acb9 |
permissions | -rw-r--r-- |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005, 2006 INRIA |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
4 |
* Copyright (c) 2009 MIRKO BANCHI |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* This program is free software; you can redistribute it and/or modify |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* it under the terms of the GNU General Public License version 2 as |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* GNU General Public License for more details. |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* along with this program; if not, write to the Free Software |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
20 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#ifndef MAC_LOW_H |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#define MAC_LOW_H |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <vector> |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
#include <stdint.h> |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
27 |
#include <ostream> |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
28 |
#include <map> |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
#include "wifi-mac-header.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
#include "wifi-mode.h" |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1922
diff
changeset
|
32 |
#include "wifi-preamble.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
33 |
#include "wifi-remote-station-manager.h" |
5955
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
34 |
#include "ctrl-headers.h" |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
35 |
#include "mgt-headers.h" |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
36 |
#include "block-ack-agreement.h" |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
#include "ns3/mac48-address.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
#include "ns3/callback.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
#include "ns3/event-id.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
#include "ns3/packet.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
#include "ns3/nstime.h" |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
namespace ns3 { |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
class WifiPhy; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
46 |
class WifiMac; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
|
2059 | 48 |
/** |
49 |
* \brief listen to events coming from ns3::MacLow. |
|
50 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
class MacLowTransmissionListener { |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
public: |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
MacLowTransmissionListener (); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
virtual ~MacLowTransmissionListener (); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
|
2059 | 56 |
/** |
57 |
* \param snr the snr of the cts |
|
58 |
* \param txMode the txMode of the cts |
|
59 |
* |
|
60 |
* ns3::MacLow received an expected CTS within |
|
61 |
* CtsTimeout. |
|
62 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
63 |
virtual void GotCts (double snr, WifiMode txMode) = 0; |
2059 | 64 |
/** |
65 |
* ns3::MacLow did not receive an expected CTS |
|
66 |
* within CtsTimeout. |
|
67 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
68 |
virtual void MissedCts (void) = 0; |
2059 | 69 |
/** |
70 |
* \param snr the snr of the ack |
|
71 |
* \param txMode the transmission mode of the ack |
|
72 |
* |
|
73 |
* ns3::MacLow received an expected ACL within |
|
74 |
* AckTimeout. The <i>snr</i> and <i>txMode</i> |
|
75 |
* arguments are not valid when SUPER_FAST_ACK is |
|
76 |
* used. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
virtual void GotAck (double snr, WifiMode txMode) = 0; |
2059 | 79 |
/** |
80 |
* ns3::MacLow did not receive an expected ACK within |
|
81 |
* AckTimeout. |
|
82 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
83 |
virtual void MissedAck (void) = 0; |
2059 | 84 |
/** |
5955
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
85 |
* \param blockAck Block ack response header |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
86 |
* \param source Address of block ack sender |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
87 |
* |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
88 |
* Invoked when ns3::MacLow receives a block ack frame. |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
89 |
* Block ack frame is received after a block ack request |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
90 |
* and contains information about the correct reception |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
91 |
* of a set of packet for which a normal ack wasn't send. |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
92 |
* Default implementation for this method is empty. Every |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
93 |
* queue that intends to be notified by MacLow of reception |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
94 |
* of a block ack must redefine this function. |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
95 |
*/ |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
96 |
virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address source); |
10fbe045901e
add support for block ack in MacLowTransmissionListener
Mirko Banchi <mk.banchi@gmail.com>
parents:
5954
diff
changeset
|
97 |
/** |
2059 | 98 |
* Invoked when ns3::MacLow wants to start a new transmission |
99 |
* as configured by MacLowTransmissionParameters::EnableNextData. |
|
100 |
* The listener is expected to call again MacLow::StartTransmission |
|
101 |
* with the "next" data to send. |
|
102 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
103 |
virtual void StartNext (void) = 0; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
104 |
|
2059 | 105 |
/** |
106 |
* Invoked if this transmission was canceled |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
107 |
* one way or another. When this method is invoked, |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
108 |
* you can assume that the packet has not been passed |
2059 | 109 |
* down the stack to the PHY. |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
110 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
virtual void Cancel (void) = 0; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
112 |
}; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
113 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
114 |
|
2059 | 115 |
/** |
116 |
* \brief listen to NAV events |
|
117 |
* |
|
118 |
* This class is typically connected to an instance of ns3::Dcf |
|
119 |
* and calls to its methods are forwards to the corresponding |
|
120 |
* ns3::Dcf methods. |
|
121 |
*/ |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
122 |
class MacLowDcfListener { |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
123 |
public: |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
124 |
MacLowDcfListener (); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
125 |
virtual ~MacLowDcfListener (); |
2059 | 126 |
/** |
127 |
* \param duration duration of NAV timer |
|
128 |
*/ |
|
2146
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
129 |
virtual void NavStart (Time duration) = 0; |
2059 | 130 |
/** |
131 |
* \param duration duration of NAV timer |
|
132 |
*/ |
|
2146
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
133 |
virtual void NavReset (Time duration) = 0; |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
134 |
virtual void AckTimeoutStart (Time duration) = 0; |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
135 |
virtual void AckTimeoutReset () = 0; |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
136 |
virtual void CtsTimeoutStart (Time duration) = 0; |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
137 |
virtual void CtsTimeoutReset () = 0; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
138 |
}; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
|
2059 | 140 |
/** |
141 |
* \brief control how a packet is transmitted. |
|
142 |
* |
|
143 |
* The ns3::MacLow::StartTransmission method expects |
|
144 |
* an instance of this class to describe how the packet |
|
145 |
* should be transmitted. |
|
146 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
class MacLowTransmissionParameters { |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
148 |
public: |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
149 |
MacLowTransmissionParameters (); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
150 |
|
2059 | 151 |
/** |
152 |
* Wait ACKTimeout for an ACK. If we get an ACK |
|
153 |
* on time, call MacLowTransmissionListener::GotAck. |
|
154 |
* Call MacLowTransmissionListener::MissedAck otherwise. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
155 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
156 |
void EnableAck (void); |
2059 | 157 |
/** |
158 |
* - wait PIFS after end-of-tx. If idle, call |
|
159 |
* MacLowTransmissionListener::MissedAck. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
160 |
* - if busy at end-of-tx+PIFS, wait end-of-rx |
2059 | 161 |
* - if Ack ok at end-of-rx, call |
162 |
* MacLowTransmissionListener::GotAck. |
|
163 |
* - if Ack not ok at end-of-rx, report call |
|
164 |
* MacLowTransmissionListener::MissedAck |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
165 |
* at end-of-rx+SIFS. |
2059 | 166 |
* |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
167 |
* This is really complicated but it is needed for |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
168 |
* proper HCCA support. |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
169 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
170 |
void EnableFastAck (void); |
2059 | 171 |
/** |
172 |
* - if busy at end-of-tx+PIFS, call |
|
173 |
* MacLowTransmissionListener::GotAck |
|
174 |
* - if idle at end-of-tx+PIFS, call |
|
175 |
* MacLowTransmissionListener::MissedAck |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
176 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
177 |
void EnableSuperFastAck (void); |
2059 | 178 |
/** |
5954
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
179 |
* Wait BASICBLOCKACKTimeout for a Basic Block Ack Response frame. |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
180 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
181 |
void EnableBasicBlockAck (void); |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
182 |
/** |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
183 |
* Wait COMPRESSEDBLOCKACKTimeout for a Compressed Block Ack Response frame. |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
184 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
185 |
void EnableCompressedBlockAck (void); |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
186 |
/** |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
187 |
* NOT IMPLEMENTED FOR NOW |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
188 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
189 |
void EnableMultiTidBlockAck (void); |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
190 |
/** |
2059 | 191 |
* Send a RTS, and wait CTSTimeout for a CTS. If we get a |
192 |
* CTS on time, call MacLowTransmissionListener::GotCts |
|
193 |
* and send data. Otherwise, call MacLowTransmissionListener::MissedCts |
|
194 |
* and do not send data. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
195 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
196 |
void EnableRts (void); |
2059 | 197 |
/** |
198 |
* \param size size of next data to send after current packet is |
|
199 |
* sent. |
|
200 |
* |
|
201 |
* Add the transmission duration of the next data to the |
|
202 |
* durationId of the outgoing packet and call |
|
203 |
* MacLowTransmissionListener::StartNext at the end of |
|
204 |
* the current transmission + SIFS. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
205 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
206 |
void EnableNextData (uint32_t size); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
207 |
|
2059 | 208 |
/** |
209 |
* \param durationId the value to set in the duration/Id field of |
|
210 |
* the outgoing packet. |
|
211 |
* |
|
212 |
* Ignore all other durationId calculation and simply force the |
|
213 |
* packet's durationId field to this value. |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
214 |
*/ |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
215 |
void EnableOverrideDurationId (Time durationId); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
216 |
|
2059 | 217 |
/** |
218 |
* Do not wait for Ack after data transmission. Typically |
|
219 |
* used for Broadcast and multicast frames. |
|
220 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
221 |
void DisableAck (void); |
2059 | 222 |
/** |
223 |
* Do not send rts and wait for cts before sending data. |
|
224 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
225 |
void DisableRts (void); |
2059 | 226 |
/** |
227 |
* Do not attempt to send data burst after current transmission |
|
228 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
229 |
void DisableNextData (void); |
2059 | 230 |
/** |
231 |
* Do not force the duration/id field of the packet: its |
|
232 |
* value is automatically calculated by the MacLow before |
|
233 |
* calling WifiPhy::Send. |
|
234 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
235 |
void DisableOverrideDurationId (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
236 |
|
2059 | 237 |
/** |
238 |
* \returns true if must wait for ACK after data transmission, |
|
239 |
* false otherwise. |
|
240 |
* |
|
241 |
* This methods returns true when any of MustWaitNormalAck, |
|
242 |
* MustWaitFastAck, or MustWaitSuperFastAck return true. |
|
243 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
244 |
bool MustWaitAck (void) const; |
2059 | 245 |
/** |
246 |
* \returns true if normal ACK protocol should be used, false |
|
247 |
* otherwise. |
|
248 |
* |
|
249 |
* \sa EnableAck |
|
250 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
251 |
bool MustWaitNormalAck (void) const; |
2059 | 252 |
/** |
253 |
* \returns true if fast ack protocol should be used, false |
|
254 |
* otherwise. |
|
255 |
* |
|
256 |
* \sa EnableFastAck |
|
257 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
258 |
bool MustWaitFastAck (void) const; |
2059 | 259 |
/** |
260 |
* \returns true if super fast ack protocol should be used, false |
|
261 |
* otherwise. |
|
262 |
* |
|
263 |
* \sa EnableSuperFastAck |
|
264 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
265 |
bool MustWaitSuperFastAck (void) const; |
2059 | 266 |
/** |
5954
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
267 |
* \returns true if block ack mechanism is used, false otherwise. |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
268 |
* |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
269 |
* \sa EnableBlockAck |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
270 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
271 |
bool MustWaitBasicBlockAck (void) const; |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
272 |
/** |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
273 |
* \returns true if compressed block ack mechanism is used, false otherwise. |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
274 |
* |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
275 |
* \sa EnableCompressedBlockAck |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
276 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
277 |
bool MustWaitCompressedBlockAck (void) const; |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
278 |
/** |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
279 |
* \returns true if multi-tid block ack mechanism is used, false otherwise. |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
280 |
* |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
281 |
* \sa EnableMultiTidBlockAck |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
282 |
*/ |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
283 |
bool MustWaitMultiTidBlockAck (void) const; |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
284 |
/** |
2059 | 285 |
* \returns true if RTS should be sent and CTS waited for before |
286 |
* sending data, false otherwise. |
|
287 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
288 |
bool MustSendRts (void) const; |
2059 | 289 |
/** |
290 |
* \returns true if a duration/id was forced with |
|
291 |
* EnableOverrideDurationId, false otherwise. |
|
292 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
293 |
bool HasDurationId (void) const; |
2059 | 294 |
/** |
295 |
* \returns the duration/id forced by EnableOverrideDurationId |
|
296 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
297 |
Time GetDurationId (void) const; |
2059 | 298 |
/** |
299 |
* \returns true if EnableNextData was called, false otherwise. |
|
300 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
301 |
bool HasNextPacket (void) const; |
2059 | 302 |
/** |
303 |
* \returns the size specified by EnableNextData. |
|
304 |
*/ |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
305 |
uint32_t GetNextPacketSize (void) const; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
306 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
307 |
private: |
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
308 |
friend std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters ¶ms); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
309 |
uint32_t m_nextSize; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
310 |
enum { |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
311 |
ACK_NONE, |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
312 |
ACK_NORMAL, |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
313 |
ACK_FAST, |
5954
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
314 |
ACK_SUPER_FAST, |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
315 |
BLOCK_ACK_BASIC, |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
316 |
BLOCK_ACK_COMPRESSED, |
2b9e06875b69
add support for block ack in MacLowTransmissionParameters
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
317 |
BLOCK_ACK_MULTI_TID |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
318 |
} m_waitAck; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
319 |
bool m_sendRts; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
320 |
Time m_overrideDurationId; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
321 |
}; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
322 |
|
2985
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
323 |
std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters ¶ms); |
fa0747c4ad5e
use function logging macros
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
324 |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
325 |
|
2059 | 326 |
/** |
327 |
* \brief handle RTS/CTS/DATA/ACK transactions. |
|
328 |
*/ |
|
2350
0b54480c4fd1
Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2290
diff
changeset
|
329 |
class MacLow : public Object { |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
330 |
public: |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
331 |
typedef Callback<void, Ptr<Packet>, const WifiMacHeader*> MacLowRxCallback; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
332 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
333 |
MacLow (); |
2350
0b54480c4fd1
Hook trace sources into the trace system. Add WifiTrace to give a 'simple' API to tracing wifi-specific sources.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2290
diff
changeset
|
334 |
virtual ~MacLow (); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
335 |
|
2054
ba8e810bae4c
derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2022
diff
changeset
|
336 |
void SetPhy (Ptr<WifiPhy> phy); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
337 |
void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
338 |
|
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
339 |
void SetAddress (Mac48Address ad); |
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
340 |
void SetAckTimeout (Time ackTimeout); |
3597
fe35e5be4b78
move cts timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3596
diff
changeset
|
341 |
void SetCtsTimeout (Time ctsTimeout); |
3598
7b209b3b6af2
move sifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3597
diff
changeset
|
342 |
void SetSifs (Time sifs); |
3599
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
343 |
void SetSlotTime (Time slotTime); |
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
344 |
void SetPifs (Time pifs); |
3600
5888dfe3f245
move GetBssid down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3599
diff
changeset
|
345 |
void SetBssid (Mac48Address ad); |
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
346 |
Mac48Address GetAddress (void) const; |
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
347 |
Time GetAckTimeout (void) const; |
3597
fe35e5be4b78
move cts timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3596
diff
changeset
|
348 |
Time GetCtsTimeout (void) const; |
3598
7b209b3b6af2
move sifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3597
diff
changeset
|
349 |
Time GetSifs (void) const; |
3599
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
350 |
Time GetSlotTime (void) const; |
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
351 |
Time GetPifs (void) const; |
3600
5888dfe3f245
move GetBssid down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3599
diff
changeset
|
352 |
Mac48Address GetBssid (void) const; |
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
353 |
|
2059 | 354 |
/** |
355 |
* \param callback the callback which receives every incoming packet. |
|
356 |
* |
|
357 |
* This callback typically forwards incoming packets to |
|
358 |
* an instance of ns3::MacRxMiddle. |
|
359 |
*/ |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
360 |
void SetRxCallback (Callback<void,Ptr<Packet>,const WifiMacHeader *> callback); |
2059 | 361 |
/** |
362 |
* \param listener listen to NAV events for every incoming |
|
363 |
* and outgoing packet. |
|
364 |
*/ |
|
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
365 |
void RegisterDcfListener (MacLowDcfListener *listener); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
366 |
|
2059 | 367 |
/** |
2290
081b4efd800c
fix doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2289
diff
changeset
|
368 |
* \param packet to send (does not include the 802.11 MAC header and checksum) |
081b4efd800c
fix doxygen warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2289
diff
changeset
|
369 |
* \param hdr header associated to the packet to send. |
2059 | 370 |
* \param parameters transmission parameters of packet. |
371 |
* |
|
372 |
* This transmission time includes the time required for |
|
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
373 |
* the next packet transmission if one was selected. |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
374 |
*/ |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2159
diff
changeset
|
375 |
Time CalculateTransmissionTime (Ptr<const Packet> packet, |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
376 |
const WifiMacHeader* hdr, |
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
377 |
const MacLowTransmissionParameters& parameters) const; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
378 |
|
2059 | 379 |
/** |
380 |
* \param packet packet to send |
|
381 |
* \param hdr 802.11 header for packet to send |
|
382 |
* \param parameters the transmission parameters to use for this packet. |
|
383 |
* \param listener listen to transmission events. |
|
384 |
* |
|
385 |
* Start the transmission of the input packet and notify the listener |
|
386 |
* of transmission events. |
|
387 |
*/ |
|
2159
20f882e85b4a
port to Ptr<Packet> branch
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
388 |
void StartTransmission (Ptr<const Packet> packet, |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
389 |
const WifiMacHeader* hdr, |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
390 |
MacLowTransmissionParameters parameters, |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
391 |
MacLowTransmissionListener *listener); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
392 |
|
2059 | 393 |
/** |
394 |
* \param packet packet received |
|
395 |
* \param rxSnr snr of packet received |
|
396 |
* \param txMode transmission mode of packet received |
|
397 |
* \param preamble type of preamble used for the packet received |
|
398 |
* |
|
399 |
* This method is typically invoked by the lower PHY layer to notify |
|
400 |
* the MAC layer that a packet was successfully received. |
|
401 |
*/ |
|
2159
20f882e85b4a
port to Ptr<Packet> branch
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
402 |
void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiMode txMode, WifiPreamble preamble); |
2059 | 403 |
/** |
404 |
* \param packet packet received. |
|
405 |
* \param rxSnr snr of packet received. |
|
406 |
* |
|
407 |
* This method is typically invoked by the lower PHY layer to notify |
|
408 |
* the MAC layer that a packet was unsuccessfully received. |
|
409 |
*/ |
|
3899 | 410 |
void ReceiveError (Ptr<const Packet> packet, double rxSnr); |
5189 | 411 |
/** |
412 |
* \param duration switching delay duration. |
|
413 |
* |
|
414 |
* This method is typically invoked by the PhyMacLowListener to notify |
|
5192 | 415 |
* the MAC layer that a channel switching occured. When a channel switching |
416 |
* occurs, pending MAC transmissions (RTS, CTS, DATA and ACK) are cancelled. |
|
5189 | 417 |
*/ |
418 |
void NotifySwitchingStartNow (Time duration); |
|
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
419 |
/** |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
420 |
* \param respHdr Add block ack response from originator (action frame). |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
421 |
* \param originator Address of peer station involved in block ack mechanism. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
422 |
* \param startingSeq Sequence number of the first MPDU of all packets for which block ack was negotiated. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
423 |
* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
424 |
* This function is typically invoked only by ns3::QapWifiMac and ns3::QstaWifiMac. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
425 |
* If we are transmitting an Add block ack response, MacLow must allocate buffers to collect |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
426 |
* all correctly received packets belonging to category for which block ack was negotiated. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
427 |
* It's needed in order to send a Block ack after corresponding originator's Block ack request. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
428 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
429 |
void CreateBlockAckAgreement (const MgtAddBaResponseHeader *respHdr, Mac48Address originator, |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
430 |
uint16_t startingSeq); |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
431 |
/** |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
432 |
* \param originator Address of peer partecipating in Block Ack mechanism. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
433 |
* \param tid TID for which Block Ack was created. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
434 |
* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
435 |
* Checks if exists an established block ack agreement with <i>originator</i> |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
436 |
* for tid <i>tid</i>. If the agreement exists, tears down it. This function is typically |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
437 |
* invoked when a DELBA frame is received from <i>originator</i>. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
438 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
439 |
void DestroyBlockAckAgreement (Mac48Address originator, uint8_t tid); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
440 |
private: |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
441 |
void CancelAllEvents (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
442 |
uint32_t GetAckSize (void) const; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
443 |
uint32_t GetRtsSize (void) const; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
444 |
uint32_t GetCtsSize (void) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2159
diff
changeset
|
445 |
uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
446 |
Time NowUs (void) const; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
447 |
WifiRemoteStation *GetStation (Mac48Address to) const; |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
448 |
void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr, |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
449 |
WifiMode txMode); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2159
diff
changeset
|
450 |
Time CalculateOverallTxTime (Ptr<const Packet> packet, |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
451 |
const WifiMacHeader* hdr, |
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5192
diff
changeset
|
452 |
const MacLowTransmissionParameters ¶ms) const; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2159
diff
changeset
|
453 |
WifiMode GetRtsTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2159
diff
changeset
|
454 |
WifiMode GetDataTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
455 |
WifiMode GetCtsTxModeForRts (Mac48Address to, WifiMode rtsTxMode) const; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
456 |
WifiMode GetAckTxModeForData (Mac48Address to, WifiMode dataTxMode) const; |
2022
33579d27ce2a
try to simplify duration calculations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
457 |
Time GetCtsDuration (Mac48Address to, WifiMode rtsTxMode) const; |
33579d27ce2a
try to simplify duration calculations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
458 |
Time GetAckDuration (Mac48Address to, WifiMode dataTxMode) const; |
2146
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
459 |
void NotifyNav (const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble); |
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
460 |
void DoNavResetNow (Time duration); |
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
461 |
bool DoNavStartNow (Time duration); |
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
462 |
bool IsNavZero (void) const; |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
463 |
void NotifyAckTimeoutStartNow (Time duration); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
464 |
void NotifyAckTimeoutResetNow (); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
465 |
void NotifyCtsTimeoutStartNow (Time duration); |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
466 |
void NotifyCtsTimeoutResetNow (); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
467 |
void MaybeCancelPrevious (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
468 |
|
2146
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
469 |
void NavCounterResetCtsMissed (Time rtsEndRxTime); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
470 |
void NormalAckTimeout (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
471 |
void FastAckTimeout (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
472 |
void SuperFastAckTimeout (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
473 |
void FastAckFailedTimeout (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
474 |
void CtsTimeout (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
475 |
void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
476 |
void SendAckAfterData (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
477 |
void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
478 |
void WaitSifsAfterEndTx (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
479 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
480 |
void SendRtsForPacket (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
481 |
void SendDataPacket (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
482 |
void SendCurrentTxPacket (void); |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
483 |
void StartDataTxTimers (void); |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
484 |
virtual void DoDispose (void); |
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
485 |
/** |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
486 |
* \param originator Address of peer partecipating in Block Ack mechanism. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
487 |
* \param tid TID for which Block Ack was created. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
488 |
* \param seq Starting sequence |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
489 |
* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
490 |
* This function forward up all completed "old" packets with sequence number |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
491 |
* smaller than <i>seq</i>. All comparison are performed circularly mod 4096. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
492 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
493 |
void RxCompleteBufferedPacketsWithSmallerSequence (uint16_t seq, Mac48Address originator, uint8_t tid); |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
494 |
/** |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
495 |
* \param originator Address of peer partecipating in Block Ack mechanism. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
496 |
* \param tid TID for which Block Ack was created. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
497 |
* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
498 |
* This method is typically invoked when a MPDU with ack policy |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
499 |
* subfield set to Normal Ack is received and a block ack agreement |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
500 |
* for that packet exists. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
501 |
* This happens when the originator of block ack has only few MPDUs to send. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
502 |
* All completed MSDUs starting with starting sequence number of block ack |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
503 |
* agreement are forward up to WifiMac until there is an incomplete MSDU. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
504 |
* See section 9.10.4 in IEEE802.11 standard for more details. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
505 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
506 |
void RxCompleteBufferedPackets (Mac48Address originator, uint8_t tid); |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
507 |
/* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
508 |
* This method checks if exists a valid established block ack agreement. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
509 |
* If there is, store the packet without pass it up to WifiMac. The packet is buffered |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
510 |
* in order of increasing sequence control field. All comparison are performed |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
511 |
* circularly modulo 2^12. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
512 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
513 |
bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr); |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
514 |
|
5189 | 515 |
void SetupPhyMacLowListener (Ptr<WifiPhy> phy); |
516 |
||
2054
ba8e810bae4c
derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2022
diff
changeset
|
517 |
Ptr<WifiPhy> m_phy; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
518 |
Ptr<WifiRemoteStationManager> m_stationManager; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
519 |
MacLowRxCallback m_rxCallback; |
4509
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
520 |
typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI; |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
521 |
typedef std::vector<MacLowDcfListener *> DcfListeners; |
b2654e0f071d
bug 556: DcfManager does not handle AckTimeout properly when there are multiple queues
Kirill V. Andreev <kirillano@yandex.ru>
parents:
3906
diff
changeset
|
522 |
DcfListeners m_dcfListeners; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
523 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
524 |
EventId m_normalAckTimeoutEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
525 |
EventId m_fastAckTimeoutEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
526 |
EventId m_superFastAckTimeoutEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
527 |
EventId m_fastAckFailedTimeoutEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
528 |
EventId m_ctsTimeoutEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
529 |
EventId m_sendCtsEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
530 |
EventId m_sendAckEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
531 |
EventId m_sendDataEvent; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
532 |
EventId m_waitSifsEvent; |
2146
40ad60ac9912
replace Dcf with DcfManager
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2059
diff
changeset
|
533 |
EventId m_navCounterResetCtsMissed; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
534 |
|
2159
20f882e85b4a
port to Ptr<Packet> branch
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2146
diff
changeset
|
535 |
Ptr<Packet> m_currentPacket; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
536 |
WifiMacHeader m_currentHdr; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
537 |
MacLowTransmissionParameters m_txParams; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
538 |
MacLowTransmissionListener *m_listener; |
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
539 |
Mac48Address m_self; |
3600
5888dfe3f245
move GetBssid down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3599
diff
changeset
|
540 |
Mac48Address m_bssid; |
3596
6c39b712a535
move Address and ack timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2985
diff
changeset
|
541 |
Time m_ackTimeout; |
3597
fe35e5be4b78
move cts timeout down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3596
diff
changeset
|
542 |
Time m_ctsTimeout; |
3598
7b209b3b6af2
move sifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3597
diff
changeset
|
543 |
Time m_sifs; |
3599
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
544 |
Time m_slotTime; |
721bd46c15f8
move slot and pifs down to MacLow
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3598
diff
changeset
|
545 |
Time m_pifs; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
546 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
547 |
Time m_lastNavStart; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
548 |
Time m_lastNavDuration; |
5189 | 549 |
|
550 |
// Listerner needed to monitor when a channel switching occurs. |
|
551 |
class PhyMacLowListener *m_phyMacLowListener; |
|
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
552 |
|
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
553 |
/* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
554 |
* BlockAck data structures. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
555 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
556 |
typedef std::pair<Ptr<Packet>, WifiMacHeader> BufferedPacket; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
557 |
typedef std::list<BufferedPacket>::iterator BufferedPacketI; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
558 |
|
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
559 |
typedef std::pair<Mac48Address, uint8_t> AgreementKey; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
560 |
typedef std::pair<BlockAckAgreement, std::list<BufferedPacket> > AgreementValue; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
561 |
|
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
562 |
typedef std::map<AgreementKey, AgreementValue> Agreements; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
563 |
typedef std::map<AgreementKey, AgreementValue>::iterator AgreementsI; |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
564 |
|
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5955
diff
changeset
|
565 |
Agreements m_bAckAgreements; |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
566 |
}; |
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
567 |
|
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
568 |
} // namespace ns3 |
1922
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
569 |
|
dd18bc29fc3c
add MacLow to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
570 |
#endif /* MAC_LOW_H */ |