author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Tue, 27 May 2008 15:32:08 -0700 | |
changeset 3154 | aa61e5f85334 |
parent 2784 | 49006cbbfac7 |
child 3185 | c859e129a934 |
permissions | -rw-r--r-- |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
1912
028e1945d5b2
fix copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1911
diff
changeset
|
3 |
* Copyright (c) 2005,2006,2007 INRIA |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
20 |
#ifndef WIFI_REMOTE_STATION_MANAGER_H |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
21 |
#define WIFI_REMOTE_STATION_MANAGER_H |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
23 |
#include <vector> |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include <utility> |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include "ns3/mac48-address.h" |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
26 |
#include "ns3/packet.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
27 |
#include "ns3/object.h" |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
28 |
#include "ns3/traced-value.h" |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
29 |
#include "wifi-mode.h" |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
|
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
namespace ns3 { |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
32 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
33 |
class WifiRemoteStation; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
34 |
class NonUnicastWifiRemoteStation; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
35 |
class WifiPhy; |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
|
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
37 |
/** |
3154 | 38 |
* \brief hold a list of per-remote-station state. |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
39 |
* |
3154 | 40 |
* \sa ns3::WifiRemoteStation. |
2602
d9262bff6df2
add back support for introspected doxygen.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2530
diff
changeset
|
41 |
*/ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
42 |
class WifiRemoteStationManager : public Object |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
43 |
{ |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
44 |
private: |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
45 |
typedef std::vector<WifiMode> BasicModes; |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
public: |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
47 |
typedef BasicModes::const_iterator BasicModesIterator; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
48 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
49 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
50 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
51 |
WifiRemoteStationManager (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
52 |
virtual ~WifiRemoteStationManager (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
53 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
54 |
virtual void SetupPhy (Ptr<WifiPhy> phy); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
55 |
|
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
56 |
uint32_t GetMaxSsrc (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
57 |
uint32_t GetMaxSlrc (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
58 |
uint32_t GetRtsCtsThreshold (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
59 |
uint32_t GetFragmentationThreshold (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
60 |
void SetMaxSsrc (uint32_t maxSsrc); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
61 |
void SetMaxSlrc (uint32_t maxSlrc); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
62 |
void SetRtsCtsThreshold (uint32_t threshold); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
63 |
void SetFragmentationThreshold (uint32_t threshold); |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
|
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
65 |
// Invoked in a STA upon dis-association |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
66 |
// or in an AP upon reboot |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
67 |
void Reset (void); |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
68 |
// Invoked in a STA upon association to store |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
69 |
// the set of rates which belong to the |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
70 |
// BSSBasicRateSet of the associated AP |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
71 |
// and which are supported locally. |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
72 |
// Invoked in an AP to configure the BSSBasicRateSet |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
73 |
void AddBasicMode (WifiMode mode); |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
74 |
|
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
75 |
WifiMode GetDefaultMode (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
76 |
uint32_t GetNBasicModes (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
77 |
WifiMode GetBasicMode (uint32_t i) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
78 |
BasicModesIterator BeginBasicModes (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
79 |
BasicModesIterator EndBasicModes (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
80 |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
81 |
bool IsLowLatency (void) const; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
82 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
83 |
WifiRemoteStation *Lookup (Mac48Address address); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
84 |
WifiRemoteStation *LookupNonUnicast (void); |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
85 |
protected: |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
86 |
friend class WifiRemoteStation; |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
87 |
virtual void DoDispose (void); |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
88 |
private: |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
89 |
typedef std::vector <std::pair<Mac48Address, WifiRemoteStation *> > Stations; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
90 |
virtual class WifiRemoteStation *CreateStation (void) = 0; |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
91 |
Stations m_stations; |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
92 |
WifiMode m_defaultTxMode; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
93 |
NonUnicastWifiRemoteStation *m_nonUnicast; |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
94 |
BasicModes m_basicModes; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
95 |
bool m_isLowLatency; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
96 |
uint32_t m_maxSsrc; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
97 |
uint32_t m_maxSlrc; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
98 |
uint32_t m_rtsCtsThreshold; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
99 |
uint32_t m_fragmentationThreshold; |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
100 |
}; |
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
101 |
|
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
102 |
} // namespace ns3 |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
103 |
|
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
104 |
namespace ns3 { |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
105 |
|
3154 | 106 |
/** |
107 |
* \brief hold per-remote-station state. |
|
108 |
* |
|
109 |
* The state in this class is used to keep track |
|
110 |
* of association status if we are in an infrastructure |
|
111 |
* network and to perform the selection of tx parameters |
|
112 |
* on a per-packet basis. |
|
113 |
*/ |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
114 |
class WifiRemoteStation { |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
115 |
public: |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
116 |
|
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
117 |
static TypeId GetTypeId (void); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
118 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
119 |
WifiRemoteStation (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
120 |
virtual ~WifiRemoteStation (); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
121 |
|
3154 | 122 |
/** |
123 |
* Invoked in an AP upon disassociation of a |
|
124 |
* specific STA. |
|
125 |
*/ |
|
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
126 |
void Reset (void); |
3154 | 127 |
/** |
128 |
* Invoked in a STA or AP to store the set of |
|
129 |
* modes supported by a destination which is |
|
130 |
* also supported locally. |
|
131 |
* The set of supported modes includes |
|
132 |
* the BSSBasicRateSet. |
|
133 |
*/ |
|
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
134 |
void AddSupportedMode (WifiMode mode); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
135 |
|
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1982
diff
changeset
|
136 |
bool IsBrandNew (void) const; |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
137 |
bool IsAssociated (void) const; |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
138 |
bool IsWaitAssocTxOk (void) const; |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
139 |
void RecordWaitAssocTxOk (void); |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
140 |
void RecordGotAssocTxOk (void); |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
141 |
void RecordGotAssocTxFailed (void); |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
142 |
void RecordDisassociated (void); |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
143 |
|
3154 | 144 |
/** |
145 |
* \param packet the packet to queue |
|
146 |
* \param fullPacketSize the size of the packet after its 802.11 MAC header has been added. |
|
147 |
* |
|
148 |
* This method is typically invoked just before queuing a packet for transmission. |
|
149 |
* It is a no-op unless the IsLowLatency attribute of the attached ns3::WifiRemoteStationManager |
|
150 |
* is set to false, in which case, the tx parameters of the packet are calculated and stored in |
|
151 |
* the packet as a tag. These tx parameters are later retrieved from GetDadaMode and GetRtsMode. |
|
152 |
*/ |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
153 |
void PrepareForQueue (Ptr<const Packet> packet, uint32_t fullPacketSize); |
3154 | 154 |
/** |
155 |
* \param packet the packet to send |
|
156 |
* \param fullPacketSize the size of the packet after its 802.11 MAC header has been added. |
|
157 |
* \returns the transmission mode to use to send this packet |
|
158 |
*/ |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
159 |
WifiMode GetDataMode (Ptr<const Packet> packet, uint32_t fullPacketSize); |
3154 | 160 |
/** |
161 |
* \param packet the packet to send |
|
162 |
* \param fullPacketSize the size of the packet after its 802.11 MAC header has been added. |
|
163 |
* \returns the transmission mode to use to send the RTS prior to the |
|
164 |
* transmission of the data packet itself. |
|
165 |
*/ |
|
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
166 |
WifiMode GetRtsMode (Ptr<const Packet> packet); |
3154 | 167 |
/** |
168 |
* Should be invoked whenever the RtsTimeout associated to a transmission |
|
169 |
* attempt expires. |
|
170 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
171 |
void ReportRtsFailed (void); |
3154 | 172 |
/** |
173 |
* Should be invoked whenever the AckTimeout associated to a transmission |
|
174 |
* attempt expires. |
|
175 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
176 |
void ReportDataFailed (void); |
3154 | 177 |
/** |
178 |
* Should be invoked whenever we receive the Cts associated to an RTS |
|
179 |
* we just sent. |
|
180 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
181 |
void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr); |
3154 | 182 |
/** |
183 |
* Should be invoked whenever we receive the Ack associated to a data packet |
|
184 |
* we just sent. |
|
185 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
186 |
void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr); |
3154 | 187 |
/** |
188 |
* Should be invoked after calling ReportRtsFailed if |
|
189 |
* NeedRtsRetransmission returns false |
|
190 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
191 |
void ReportFinalRtsFailed (void); |
3154 | 192 |
/** |
193 |
* Should be invoked after calling ReportDataFailed if |
|
194 |
* NeedDataRetransmission returns false |
|
195 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
196 |
void ReportFinalDataFailed (void); |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
197 |
|
3154 | 198 |
/** |
199 |
* \param rxSnr the snr of the packet received |
|
200 |
* \param txMode the transmission mode used for the packet received. |
|
201 |
* |
|
202 |
* Should be invoked whenever a packet is successfully received. |
|
203 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
204 |
void ReportRxOk (double rxSnr, WifiMode txMode); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
205 |
|
3154 | 206 |
/** |
207 |
* \param packet the packet to send |
|
208 |
* \returns true if we want to use an RTS/CTS handshake for this |
|
209 |
* packet before sending it, false otherwise. |
|
210 |
*/ |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2269
diff
changeset
|
211 |
virtual bool NeedRts (Ptr<const Packet> packet); |
3154 | 212 |
/** |
213 |
* \param packet the packet to send |
|
214 |
* \returns true if we want to restart a failed RTS/CTS |
|
215 |
* handshake, false otherwise. |
|
216 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
217 |
virtual bool NeedRtsRetransmission (Ptr<const Packet> packet); |
3154 | 218 |
/** |
219 |
* \param packet the packet to send |
|
220 |
* \returns true if we want to resend a packet |
|
221 |
* after a failed transmission attempt, false otherwise. |
|
222 |
*/ |
|
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
223 |
virtual bool NeedDataRetransmission (Ptr<const Packet> packet); |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
224 |
|
3154 | 225 |
/** |
226 |
* \param the packet to send |
|
227 |
* \returns true if this packet should be fragmented, false otherwise. |
|
228 |
*/ |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2269
diff
changeset
|
229 |
virtual bool NeedFragmentation (Ptr<const Packet> packet); |
3154 | 230 |
/** |
231 |
* \param the packet to send |
|
232 |
* \returns the number of fragments which should be used for this packet. |
|
233 |
*/ |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2269
diff
changeset
|
234 |
virtual uint32_t GetNFragments (Ptr<const Packet> packet); |
3154 | 235 |
/** |
236 |
* \param the packet to send |
|
237 |
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero). |
|
238 |
* \returns the size of the corresponding fragment. |
|
239 |
*/ |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2269
diff
changeset
|
240 |
virtual uint32_t GetFragmentSize (Ptr<const Packet> packet, uint32_t fragmentNumber); |
3154 | 241 |
/** |
242 |
* \param the packet to send |
|
243 |
* \param fragmentNumber the fragment index of the next fragment to send (starts at zero). |
|
244 |
* \returns true if this is the last fragment, false otherwise. |
|
245 |
*/ |
|
2349
b1df486516a4
allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2269
diff
changeset
|
246 |
virtual bool IsLastFragment (Ptr<const Packet> packet, uint32_t fragmentNumber); |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
247 |
|
3154 | 248 |
/** |
249 |
* \param rtsMode the transmission mode used to send an RTS we just received |
|
250 |
* \returns the transmission mode to use for the CTS to complete the RTS/CTS |
|
251 |
* handshake. |
|
252 |
*/ |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
253 |
WifiMode GetCtsMode (WifiMode rtsMode); |
3154 | 254 |
/** |
255 |
* \param ackMode the transmission mode used to send an ACK we just received |
|
256 |
* \returns the transmission mode to use for the ACK to complete the data/ACK |
|
257 |
* handshake. |
|
258 |
*/ |
|
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
259 |
WifiMode GetAckMode (WifiMode dataMode); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
260 |
|
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
261 |
private: |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
262 |
typedef std::vector<WifiMode> SupportedModes; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2508
diff
changeset
|
263 |
virtual Ptr<WifiRemoteStationManager> GetManager (void) const = 0; |
2268
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
264 |
virtual WifiMode DoGetDataMode (uint32_t size) = 0; |
0e57ac711220
introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2003
diff
changeset
|
265 |
virtual WifiMode DoGetRtsMode (void) = 0; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
266 |
protected: |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
267 |
virtual void DoReportRtsFailed (void) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
268 |
virtual void DoReportDataFailed (void) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
269 |
virtual void DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
270 |
virtual void DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
271 |
virtual void DoReportFinalRtsFailed (void) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
272 |
virtual void DoReportFinalDataFailed (void) = 0; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
273 |
virtual void DoReportRxOk (double rxSnr, WifiMode txMode) = 0; |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
274 |
uint32_t GetNSupportedModes (void) const; |
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
275 |
WifiMode GetSupportedMode (uint32_t i) const; |
1911
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
276 |
private: |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
277 |
bool IsIn (WifiMode mode) const; |
e24ae66c6918
use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1908
diff
changeset
|
278 |
WifiMode GetControlAnswerMode (WifiMode reqMode); |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
279 |
enum { |
2003
335dc094e52a
support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1982
diff
changeset
|
280 |
BRAND_NEW, |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
281 |
DISASSOC, |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
282 |
WAIT_ASSOC_TX_OK, |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
283 |
GOT_ASSOC_TX_OK |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
284 |
} m_state; |
1930
ec22299cf6bb
rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1913
diff
changeset
|
285 |
SupportedModes m_modes; |
2784
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
286 |
TracedValue<uint32_t> m_ssrc; |
49006cbbfac7
GetMaxSsrc -> NeedRtsTransmission and GetMaxSlrc -> NeedDataRetransmission
Federico Maguolo <maguolof@dei.unipd.it>
parents:
2602
diff
changeset
|
287 |
TracedValue<uint32_t> m_slrc; |
1906
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
288 |
}; |
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
289 |
|
c0901f40bd7e
move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1893
diff
changeset
|
290 |
} // namespace ns3 |
1893
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
291 |
|
d72388b06b22
add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
292 |
#endif /* MAC_STATIONS_H */ |