38 * Packet Mode Tagger |
38 * Packet Mode Tagger |
39 ***************************************************************/ |
39 ***************************************************************/ |
40 |
40 |
41 namespace ns3 { |
41 namespace ns3 { |
42 |
42 |
43 class TxModeTag : public Tag |
43 class HighLatencyDataTxVectorTag : public Tag |
44 { |
44 { |
45 public: |
45 public: |
46 TxModeTag (); |
46 HighLatencyDataTxVectorTag (); |
47 TxModeTag (WifiMode rtsMode, WifiMode dataMode); |
47 HighLatencyDataTxVectorTag (WifiTxVector dataTxVector); |
48 WifiMode GetRtsMode (void) const; |
48 WifiTxVector GetDataTxVector (void) const; |
49 WifiMode GetDataMode (void) const; |
|
50 |
49 |
51 static TypeId GetTypeId (void); |
50 static TypeId GetTypeId (void); |
52 virtual TypeId GetInstanceTypeId (void) const; |
51 virtual TypeId GetInstanceTypeId (void) const; |
53 virtual uint32_t GetSerializedSize (void) const; |
52 virtual uint32_t GetSerializedSize (void) const; |
54 virtual void Serialize (TagBuffer i) const; |
53 virtual void Serialize (TagBuffer i) const; |
55 virtual void Deserialize (TagBuffer i); |
54 virtual void Deserialize (TagBuffer i); |
56 virtual void Print (std::ostream &os) const; |
55 virtual void Print (std::ostream &os) const; |
57 private: |
56 private: |
58 WifiMode m_rtsMode; |
57 WifiTxVector m_dataTxVector; |
59 WifiMode m_dataMode; |
|
60 }; |
58 }; |
61 |
59 |
62 TxModeTag::TxModeTag () |
60 HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag () |
63 { |
61 { |
64 } |
62 } |
65 TxModeTag::TxModeTag (WifiMode rtsMode, WifiMode dataMode) |
63 HighLatencyDataTxVectorTag::HighLatencyDataTxVectorTag ( WifiTxVector dataTxVector) |
66 : m_rtsMode (rtsMode), |
64 : m_dataTxVector (dataTxVector) |
67 m_dataMode (dataMode) |
65 { |
68 { |
66 } |
69 } |
67 |
70 WifiMode |
68 WifiTxVector |
71 TxModeTag::GetRtsMode (void) const |
69 HighLatencyDataTxVectorTag::GetDataTxVector (void) const |
72 { |
70 { |
73 return m_rtsMode; |
71 return m_dataTxVector; |
74 } |
|
75 WifiMode |
|
76 TxModeTag::GetDataMode (void) const |
|
77 { |
|
78 return m_dataMode; |
|
79 } |
72 } |
80 TypeId |
73 TypeId |
81 TxModeTag::GetTypeId (void) |
74 HighLatencyDataTxVectorTag::GetTypeId (void) |
82 { |
75 { |
83 static TypeId tid = TypeId ("ns3::TxModeTag") |
76 static TypeId tid = TypeId ("ns3::HighLatencyDataTxVectorTag") |
84 .SetParent<Tag> () |
77 .SetParent<Tag> () |
85 .AddConstructor<TxModeTag> () |
78 .AddConstructor<HighLatencyDataTxVectorTag> () |
86 .AddAttribute ("RtsTxMode", |
79 ; |
87 "Tx mode of rts to use later", |
|
88 EmptyAttributeValue (), |
|
89 MakeWifiModeAccessor (&TxModeTag::GetRtsMode), |
|
90 MakeWifiModeChecker ()) |
|
91 .AddAttribute ("DataTxMode", |
|
92 "Tx mode of data to use later", |
|
93 EmptyAttributeValue (), |
|
94 MakeWifiModeAccessor (&TxModeTag::GetDataMode), |
|
95 MakeWifiModeChecker ()) |
|
96 ; |
|
97 return tid; |
80 return tid; |
98 } |
81 } |
99 TypeId |
82 TypeId |
100 TxModeTag::GetInstanceTypeId (void) const |
83 HighLatencyDataTxVectorTag::GetInstanceTypeId (void) const |
101 { |
84 { |
102 return GetTypeId (); |
85 return GetTypeId (); |
103 } |
86 } |
104 uint32_t |
87 uint32_t |
105 TxModeTag::GetSerializedSize (void) const |
88 HighLatencyDataTxVectorTag::GetSerializedSize (void) const |
106 { |
89 { |
107 return sizeof (WifiMode) * 2; |
90 return sizeof (WifiTxVector); |
108 } |
91 } |
109 void |
92 void |
110 TxModeTag::Serialize (TagBuffer i) const |
93 HighLatencyDataTxVectorTag::Serialize (TagBuffer i) const |
111 { |
94 { |
112 i.Write ((uint8_t *)&m_rtsMode, sizeof (WifiMode)); |
95 i.Write ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector)); |
113 i.Write ((uint8_t *)&m_dataMode, sizeof (WifiMode)); |
96 } |
114 } |
97 void |
115 void |
98 HighLatencyDataTxVectorTag::Deserialize (TagBuffer i) |
116 TxModeTag::Deserialize (TagBuffer i) |
99 { |
117 { |
100 i.Read ((uint8_t *)&m_dataTxVector, sizeof (WifiTxVector)); |
118 i.Read ((uint8_t *)&m_rtsMode, sizeof (WifiMode)); |
101 } |
119 i.Read ((uint8_t *)&m_dataMode, sizeof (WifiMode)); |
102 void |
120 } |
103 HighLatencyDataTxVectorTag::Print (std::ostream &os) const |
121 void |
104 { |
122 TxModeTag::Print (std::ostream &os) const |
105 os << "Data=" << m_dataTxVector; |
123 { |
106 } |
124 os << "Rts=" << m_rtsMode << ", Data=" << m_dataMode; |
107 |
|
108 class HighLatencyRtsTxVectorTag : public Tag |
|
109 { |
|
110 public: |
|
111 HighLatencyRtsTxVectorTag (); |
|
112 HighLatencyRtsTxVectorTag (WifiTxVector rtsTxVector); |
|
113 WifiTxVector GetRtsTxVector (void) const; |
|
114 |
|
115 static TypeId GetTypeId (void); |
|
116 virtual TypeId GetInstanceTypeId (void) const; |
|
117 virtual uint32_t GetSerializedSize (void) const; |
|
118 virtual void Serialize (TagBuffer i) const; |
|
119 virtual void Deserialize (TagBuffer i); |
|
120 virtual void Print (std::ostream &os) const; |
|
121 private: |
|
122 WifiTxVector m_rtsTxVector; |
|
123 }; |
|
124 |
|
125 HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag () |
|
126 { |
|
127 } |
|
128 HighLatencyRtsTxVectorTag::HighLatencyRtsTxVectorTag ( WifiTxVector rtsTxVector) |
|
129 : m_rtsTxVector (rtsTxVector) |
|
130 { |
|
131 } |
|
132 |
|
133 WifiTxVector |
|
134 HighLatencyRtsTxVectorTag::GetRtsTxVector (void) const |
|
135 { |
|
136 return m_rtsTxVector; |
|
137 } |
|
138 TypeId |
|
139 HighLatencyRtsTxVectorTag::GetTypeId (void) |
|
140 { |
|
141 static TypeId tid = TypeId ("ns3::HighLatencyRtsTxVectorTag") |
|
142 .SetParent<Tag> () |
|
143 .AddConstructor<HighLatencyRtsTxVectorTag> () |
|
144 ; |
|
145 return tid; |
|
146 } |
|
147 TypeId |
|
148 HighLatencyRtsTxVectorTag::GetInstanceTypeId (void) const |
|
149 { |
|
150 return GetTypeId (); |
|
151 } |
|
152 uint32_t |
|
153 HighLatencyRtsTxVectorTag::GetSerializedSize (void) const |
|
154 { |
|
155 return sizeof (WifiTxVector); |
|
156 } |
|
157 void |
|
158 HighLatencyRtsTxVectorTag::Serialize (TagBuffer i) const |
|
159 { |
|
160 i.Write ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector)); |
|
161 } |
|
162 void |
|
163 HighLatencyRtsTxVectorTag::Deserialize (TagBuffer i) |
|
164 { |
|
165 i.Read ((uint8_t *)&m_rtsTxVector, sizeof (WifiTxVector)); |
|
166 } |
|
167 void |
|
168 HighLatencyRtsTxVectorTag::Print (std::ostream &os) const |
|
169 { |
|
170 os << "Rts=" << m_rtsTxVector; |
|
171 } |
|
172 |
|
173 class HighLatencyCtsToSelfTxVectorTag : public Tag |
|
174 { |
|
175 public: |
|
176 HighLatencyCtsToSelfTxVectorTag (); |
|
177 HighLatencyCtsToSelfTxVectorTag (WifiTxVector ctsToSelfTxVector); |
|
178 WifiTxVector GetCtsToSelfTxVector (void) const; |
|
179 |
|
180 static TypeId GetTypeId (void); |
|
181 virtual TypeId GetInstanceTypeId (void) const; |
|
182 virtual uint32_t GetSerializedSize (void) const; |
|
183 virtual void Serialize (TagBuffer i) const; |
|
184 virtual void Deserialize (TagBuffer i); |
|
185 virtual void Print (std::ostream &os) const; |
|
186 private: |
|
187 WifiTxVector m_ctsToSelfTxVector; |
|
188 }; |
|
189 |
|
190 HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag () |
|
191 { |
|
192 } |
|
193 HighLatencyCtsToSelfTxVectorTag::HighLatencyCtsToSelfTxVectorTag ( WifiTxVector ctsToSelfTxVector) |
|
194 : m_ctsToSelfTxVector (ctsToSelfTxVector) |
|
195 { |
|
196 } |
|
197 |
|
198 WifiTxVector |
|
199 HighLatencyCtsToSelfTxVectorTag::GetCtsToSelfTxVector (void) const |
|
200 { |
|
201 return m_ctsToSelfTxVector; |
|
202 } |
|
203 TypeId |
|
204 HighLatencyCtsToSelfTxVectorTag::GetTypeId (void) |
|
205 { |
|
206 static TypeId tid = TypeId ("ns3::HighLatencyCtsToSelfTxVectorTag") |
|
207 .SetParent<Tag> () |
|
208 .AddConstructor<HighLatencyCtsToSelfTxVectorTag> () |
|
209 ; |
|
210 return tid; |
|
211 } |
|
212 TypeId |
|
213 HighLatencyCtsToSelfTxVectorTag::GetInstanceTypeId (void) const |
|
214 { |
|
215 return GetTypeId (); |
|
216 } |
|
217 uint32_t |
|
218 HighLatencyCtsToSelfTxVectorTag::GetSerializedSize (void) const |
|
219 { |
|
220 return sizeof (WifiTxVector); |
|
221 } |
|
222 void |
|
223 HighLatencyCtsToSelfTxVectorTag::Serialize (TagBuffer i) const |
|
224 { |
|
225 i.Write ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector)); |
|
226 } |
|
227 void |
|
228 HighLatencyCtsToSelfTxVectorTag::Deserialize (TagBuffer i) |
|
229 { |
|
230 i.Read ((uint8_t *)&m_ctsToSelfTxVector, sizeof (WifiTxVector)); |
|
231 } |
|
232 void |
|
233 HighLatencyCtsToSelfTxVectorTag::Print (std::ostream &os) const |
|
234 { |
|
235 os << "Cts To Self=" << m_ctsToSelfTxVector; |
125 } |
236 } |
126 |
237 |
127 } // namespace ns3 |
238 } // namespace ns3 |
128 |
|
129 |
239 |
130 namespace ns3 { |
240 namespace ns3 { |
131 |
241 |
132 NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager); |
242 NS_OBJECT_ENSURE_REGISTERED (WifiRemoteStationManager); |
133 |
243 |
170 MakeUintegerChecker<uint32_t> ()) |
280 MakeUintegerChecker<uint32_t> ()) |
171 .AddAttribute ("NonUnicastMode", "Wifi mode used for non-unicast transmissions.", |
281 .AddAttribute ("NonUnicastMode", "Wifi mode used for non-unicast transmissions.", |
172 WifiModeValue (), |
282 WifiModeValue (), |
173 MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicastMode), |
283 MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicastMode), |
174 MakeWifiModeChecker ()) |
284 MakeWifiModeChecker ()) |
|
285 .AddAttribute ("DefaultTxPowerLevel", "Default power level to be used for transmissions. " |
|
286 "This is the power level that is used by all those WifiManagers that do not" |
|
287 "implement TX power control.", |
|
288 UintegerValue (0), |
|
289 MakeUintegerAccessor (&WifiRemoteStationManager::m_defaultTxPowerLevel), |
|
290 MakeUintegerChecker<uint8_t> ()) |
175 .AddTraceSource ("MacTxRtsFailed", |
291 .AddTraceSource ("MacTxRtsFailed", |
176 "The transmission of a RTS by the MAC layer has failed", |
292 "The transmission of a RTS by the MAC layer has failed", |
177 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxRtsFailed)) |
293 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTxRtsFailed)) |
178 .AddTraceSource ("MacTxDataFailed", |
294 .AddTraceSource ("MacTxDataFailed", |
179 "The transmission of a data packet by the MAC layer has failed", |
295 "The transmission of a data packet by the MAC layer has failed", |
344 if (IsLowLatency () || address.IsGroup ()) |
516 if (IsLowLatency () || address.IsGroup ()) |
345 { |
517 { |
346 return; |
518 return; |
347 } |
519 } |
348 WifiRemoteStation *station = Lookup (address, header); |
520 WifiRemoteStation *station = Lookup (address, header); |
349 WifiMode rts = DoGetRtsMode (station); |
521 WifiTxVector rts = DoGetRtsTxVector (station); |
350 WifiMode data = DoGetDataMode (station, fullPacketSize); |
522 WifiTxVector data = DoGetDataTxVector (station, fullPacketSize); |
351 TxModeTag tag; |
523 WifiTxVector ctstoself = DoGetCtsToSelfTxVector (); |
|
524 HighLatencyDataTxVectorTag datatag; |
|
525 HighLatencyRtsTxVectorTag rtstag; |
|
526 HighLatencyCtsToSelfTxVectorTag ctstoselftag; |
352 // first, make sure that the tag is not here anymore. |
527 // first, make sure that the tag is not here anymore. |
353 ConstCast<Packet> (packet)->RemovePacketTag (tag); |
528 ConstCast<Packet> (packet)->RemovePacketTag (datatag); |
354 tag = TxModeTag (rts, data); |
529 ConstCast<Packet> (packet)->RemovePacketTag (rtstag); |
|
530 ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag); |
|
531 datatag = HighLatencyDataTxVectorTag (data); |
|
532 rtstag = HighLatencyRtsTxVectorTag (rts); |
|
533 ctstoselftag = HighLatencyCtsToSelfTxVectorTag (ctstoself); |
355 // and then, add it back |
534 // and then, add it back |
356 packet->AddPacketTag (tag); |
535 packet->AddPacketTag (datatag); |
357 } |
536 packet->AddPacketTag (rtstag); |
358 WifiMode |
537 packet->AddPacketTag (ctstoselftag); |
359 WifiRemoteStationManager::GetDataMode (Mac48Address address, const WifiMacHeader *header, |
538 } |
|
539 WifiTxVector |
|
540 WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHeader *header, |
360 Ptr<const Packet> packet, uint32_t fullPacketSize) |
541 Ptr<const Packet> packet, uint32_t fullPacketSize) |
361 { |
542 { |
362 if (address.IsGroup ()) |
543 if (address.IsGroup ()) |
363 { |
544 { |
364 return GetNonUnicastMode (); |
545 WifiTxVector v; |
|
546 v.SetMode (GetNonUnicastMode ()); |
|
547 v.SetTxPowerLevel (m_defaultTxPowerLevel); |
|
548 v.SetShortGuardInterval (false); |
|
549 v.SetNss (1); |
|
550 v.SetNess (0); |
|
551 v.SetStbc (false); |
|
552 return v; |
365 } |
553 } |
366 if (!IsLowLatency ()) |
554 if (!IsLowLatency ()) |
367 { |
555 { |
368 TxModeTag tag; |
556 HighLatencyDataTxVectorTag datatag; |
369 bool found; |
557 bool found; |
370 found = ConstCast<Packet> (packet)->PeekPacketTag (tag); |
558 found = ConstCast<Packet> (packet)->PeekPacketTag (datatag); |
371 NS_ASSERT (found); |
559 NS_ASSERT (found); |
372 return tag.GetDataMode (); |
560 // cast found to void, to suppress 'found' set but not used |
373 } |
561 // compiler warning |
374 return DoGetDataMode (Lookup (address, header), fullPacketSize); |
562 (void) found; |
375 } |
563 return datatag.GetDataTxVector (); |
376 WifiMode |
564 } |
377 WifiRemoteStationManager::GetRtsMode (Mac48Address address, const WifiMacHeader *header, |
565 return DoGetDataTxVector (Lookup (address, header), fullPacketSize); |
|
566 } |
|
567 WifiTxVector |
|
568 WifiRemoteStationManager::GetCtsToSelfTxVector(const WifiMacHeader *header, |
378 Ptr<const Packet> packet) |
569 Ptr<const Packet> packet) |
379 { |
570 { |
380 NS_ASSERT (!address.IsGroup ()); |
571 |
381 if (!IsLowLatency ()) |
572 if (!IsLowLatency ()) |
382 { |
573 { |
383 TxModeTag tag; |
574 HighLatencyCtsToSelfTxVectorTag ctstoselftag; |
384 bool found; |
575 bool found; |
385 found = ConstCast<Packet> (packet)->PeekPacketTag (tag); |
576 found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag); |
386 NS_ASSERT (found); |
577 NS_ASSERT (found); |
387 return tag.GetRtsMode (); |
578 // cast found to void, to suppress 'found' set but not used |
388 } |
579 // compiler warning |
389 return DoGetRtsMode (Lookup (address, header)); |
580 (void) found; |
|
581 return ctstoselftag.GetCtsToSelfTxVector (); |
|
582 } |
|
583 return DoGetCtsToSelfTxVector (); |
|
584 } |
|
585 |
|
586 WifiTxVector |
|
587 WifiRemoteStationManager::DoGetCtsToSelfTxVector (void) |
|
588 { |
|
589 return WifiTxVector (GetDefaultMode(), GetDefaultTxPowerLevel (),0,m_wifiPhy->GetGuardInterval(),GetNumberOfTransmitAntennas(), GetNumberOfTransmitAntennas(), false); |
|
590 } |
|
591 |
|
592 WifiTxVector |
|
593 WifiRemoteStationManager::GetRtsTxVector (Mac48Address address, const WifiMacHeader *header, |
|
594 Ptr<const Packet> packet) |
|
595 { |
|
596 NS_ASSERT (!address.IsGroup ()); |
|
597 if (!IsLowLatency ()) |
|
598 { |
|
599 HighLatencyRtsTxVectorTag rtstag; |
|
600 bool found; |
|
601 found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag); |
|
602 NS_ASSERT (found); |
|
603 // cast found to void, to suppress 'found' set but not used |
|
604 // compiler warning |
|
605 (void) found; |
|
606 return rtstag.GetRtsTxVector (); |
|
607 } |
|
608 return DoGetRtsTxVector (Lookup (address, header)); |
390 } |
609 } |
391 void |
610 void |
392 WifiRemoteStationManager::ReportRtsFailed (Mac48Address address, const WifiMacHeader *header) |
611 WifiRemoteStationManager::ReportRtsFailed (Mac48Address address, const WifiMacHeader *header) |
393 { |
612 { |
394 NS_ASSERT (!address.IsGroup ()); |
613 NS_ASSERT (!address.IsGroup ()); |
691 } |
981 } |
692 |
982 |
693 return mode; |
983 return mode; |
694 } |
984 } |
695 |
985 |
696 WifiMode |
986 WifiTxVector |
697 WifiRemoteStationManager::GetCtsMode (Mac48Address address, WifiMode rtsMode) |
987 WifiRemoteStationManager::GetCtsTxVector (Mac48Address address, WifiMode rtsMode) |
698 { |
988 { |
699 NS_ASSERT (!address.IsGroup ()); |
989 NS_ASSERT (!address.IsGroup ()); |
700 return GetControlAnswerMode (address, rtsMode); |
990 WifiTxVector v; |
701 } |
991 v.SetMode (GetControlAnswerMode (address, rtsMode)); |
702 WifiMode |
992 v.SetTxPowerLevel (DoGetCtsTxPowerLevel (address, v.GetMode())); |
703 WifiRemoteStationManager::GetAckMode (Mac48Address address, WifiMode dataMode) |
993 v.SetShortGuardInterval (DoGetCtsTxGuardInterval(address, v.GetMode())); |
704 { |
994 v.SetNss (DoGetCtsTxNss(address, v.GetMode())); |
705 NS_ASSERT (!address.IsGroup ()); |
995 v.SetNess (DoGetCtsTxNess(address, v.GetMode())); |
706 return GetControlAnswerMode (address, dataMode); |
996 v.SetStbc (DoGetCtsTxStbc(address, v.GetMode())); |
707 } |
997 return v; |
|
998 } |
|
999 WifiTxVector |
|
1000 WifiRemoteStationManager::GetAckTxVector (Mac48Address address, WifiMode dataMode) |
|
1001 { |
|
1002 NS_ASSERT (!address.IsGroup ()); |
|
1003 WifiTxVector v; |
|
1004 v.SetMode (GetControlAnswerMode (address, dataMode)); |
|
1005 v.SetTxPowerLevel (DoGetAckTxPowerLevel (address, v.GetMode())); |
|
1006 v.SetShortGuardInterval(DoGetAckTxGuardInterval(address, v.GetMode())); |
|
1007 v.SetNss(DoGetAckTxNss(address, v.GetMode())); |
|
1008 v.SetNess(DoGetAckTxNess(address, v.GetMode())); |
|
1009 v.SetStbc(DoGetAckTxStbc(address, v.GetMode())); |
|
1010 return v; |
|
1011 } |
|
1012 WifiTxVector |
|
1013 WifiRemoteStationManager::GetBlockAckTxVector (Mac48Address address, WifiMode blockAckReqMode) |
|
1014 { |
|
1015 NS_ASSERT (!address.IsGroup ()); |
|
1016 WifiTxVector v; |
|
1017 v.SetMode (GetControlAnswerMode (address, blockAckReqMode)); |
|
1018 v.SetTxPowerLevel (DoGetBlockAckTxPowerLevel (address, v.GetMode())); |
|
1019 v.SetShortGuardInterval (DoGetBlockAckTxGuardInterval(address, v.GetMode())); |
|
1020 v.SetNss (DoGetBlockAckTxNss(address, v.GetMode())); |
|
1021 v.SetNess (DoGetBlockAckTxNess(address, v.GetMode())); |
|
1022 v.SetStbc (DoGetBlockAckTxStbc(address, v.GetMode())); |
|
1023 return v; |
|
1024 } |
|
1025 |
|
1026 uint8_t |
|
1027 WifiRemoteStationManager::DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode) |
|
1028 { |
|
1029 return m_defaultTxPowerLevel; |
|
1030 } |
|
1031 |
|
1032 bool |
|
1033 WifiRemoteStationManager::DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode) |
|
1034 { |
|
1035 return m_wifiPhy->GetGuardInterval(); |
|
1036 } |
|
1037 |
|
1038 uint8_t |
|
1039 WifiRemoteStationManager::DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode) |
|
1040 { |
|
1041 return 1; |
|
1042 } |
|
1043 uint8_t |
|
1044 WifiRemoteStationManager::DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode) |
|
1045 { |
|
1046 return 0; |
|
1047 } |
|
1048 bool |
|
1049 WifiRemoteStationManager::DoGetCtsTxStbc(Mac48Address address, WifiMode ctsMode) |
|
1050 { |
|
1051 return m_wifiPhy->GetStbc(); |
|
1052 } |
|
1053 |
|
1054 uint8_t |
|
1055 WifiRemoteStationManager::DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode) |
|
1056 { |
|
1057 return m_defaultTxPowerLevel; |
|
1058 } |
|
1059 |
|
1060 bool |
|
1061 WifiRemoteStationManager::DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode) |
|
1062 { |
|
1063 return m_wifiPhy->GetGuardInterval(); |
|
1064 } |
|
1065 |
|
1066 uint8_t |
|
1067 WifiRemoteStationManager::DoGetAckTxNss(Mac48Address address, WifiMode ackMode) |
|
1068 { |
|
1069 return 1; |
|
1070 } |
|
1071 uint8_t |
|
1072 WifiRemoteStationManager::DoGetAckTxNess(Mac48Address address, WifiMode ackMode) |
|
1073 { |
|
1074 return 0; |
|
1075 } |
|
1076 bool |
|
1077 WifiRemoteStationManager::DoGetAckTxStbc(Mac48Address address, WifiMode ackMode) |
|
1078 { |
|
1079 return m_wifiPhy->GetStbc(); |
|
1080 } |
|
1081 |
|
1082 uint8_t |
|
1083 WifiRemoteStationManager::DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode) |
|
1084 { |
|
1085 return m_defaultTxPowerLevel; |
|
1086 } |
|
1087 |
|
1088 bool |
|
1089 WifiRemoteStationManager::DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode) |
|
1090 { |
|
1091 return m_wifiPhy->GetGuardInterval(); |
|
1092 } |
|
1093 |
|
1094 uint8_t |
|
1095 WifiRemoteStationManager::DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode) |
|
1096 { |
|
1097 return 1; |
|
1098 } |
|
1099 uint8_t |
|
1100 WifiRemoteStationManager::DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode) |
|
1101 { |
|
1102 return 0; |
|
1103 } |
|
1104 bool |
|
1105 WifiRemoteStationManager::DoGetBlockAckTxStbc(Mac48Address address, WifiMode blockAckMode) |
|
1106 { |
|
1107 return m_wifiPhy->GetStbc(); |
|
1108 } |
|
1109 |
|
1110 |
|
1111 uint8_t |
|
1112 WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const |
|
1113 { |
|
1114 return m_defaultTxPowerLevel; |
|
1115 } |
|
1116 |
708 |
1117 |
709 WifiRemoteStationInfo |
1118 WifiRemoteStationInfo |
710 WifiRemoteStationManager::GetInfo (Mac48Address address) |
1119 WifiRemoteStationManager::GetInfo (Mac48Address address) |
711 { |
1120 { |
712 WifiRemoteStationState *state = LookupState (address); |
1121 WifiRemoteStationState *state = LookupState (address); |
850 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const |
1313 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint32_t i) const |
851 { |
1314 { |
852 NS_ASSERT (i < GetNSupported (station)); |
1315 NS_ASSERT (i < GetNSupported (station)); |
853 return station->m_state->m_operationalRateSet[i]; |
1316 return station->m_state->m_operationalRateSet[i]; |
854 } |
1317 } |
|
1318 uint8_t |
|
1319 WifiRemoteStationManager::GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const |
|
1320 { |
|
1321 NS_ASSERT (i < GetNMcsSupported (station)); |
|
1322 return station->m_state->m_operationalMcsSet[i]; |
|
1323 } |
|
1324 bool |
|
1325 WifiRemoteStationManager::GetShortGuardInterval (const WifiRemoteStation *station) const |
|
1326 { |
|
1327 return station->m_state->m_shortGuardInterval; |
|
1328 } |
|
1329 bool |
|
1330 WifiRemoteStationManager::GetGreenfield (const WifiRemoteStation *station) const |
|
1331 { |
|
1332 return station->m_state->m_greenfield; |
|
1333 } |
|
1334 bool |
|
1335 WifiRemoteStationManager::GetStbc (const WifiRemoteStation *station) const |
|
1336 { |
|
1337 return station->m_state->m_stbc; |
|
1338 } |
|
1339 uint32_t |
|
1340 WifiRemoteStationManager::GetNumberOfReceiveAntennas (const WifiRemoteStation *station) const |
|
1341 { |
|
1342 return station->m_state->m_rx; |
|
1343 } |
|
1344 uint32_t |
|
1345 WifiRemoteStationManager::GetNumberOfTransmitAntennas (const WifiRemoteStation *station) const |
|
1346 { |
|
1347 return station->m_state->m_tx; |
|
1348 } |
|
1349 uint32_t |
|
1350 WifiRemoteStationManager::GetShortRetryCount (const WifiRemoteStation *station) const |
|
1351 { |
|
1352 return station->m_ssrc; |
|
1353 } |
|
1354 uint32_t |
|
1355 WifiRemoteStationManager::GetLongRetryCount (const WifiRemoteStation *station) const |
|
1356 { |
|
1357 return station->m_slrc; |
|
1358 } |
855 uint32_t |
1359 uint32_t |
856 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const |
1360 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const |
857 { |
1361 { |
858 return station->m_state->m_operationalRateSet.size (); |
1362 return station->m_state->m_operationalRateSet.size (); |
859 } |
1363 } |
860 |
1364 uint32_t |
|
1365 WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) const |
|
1366 { |
|
1367 return station->m_state->m_operationalMcsSet.size (); |
|
1368 } |
|
1369 void |
|
1370 WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower) |
|
1371 { |
|
1372 m_defaultTxPowerLevel = txPower; |
|
1373 } |
|
1374 |
|
1375 //support 11n |
|
1376 uint32_t |
|
1377 WifiRemoteStationManager::GetNumberOfTransmitAntennas (void) |
|
1378 { |
|
1379 return m_wifiPhy->GetNumberOfTransmitAntennas(); |
|
1380 } |
861 //WifiRemoteStationInfo constructor |
1381 //WifiRemoteStationInfo constructor |
862 WifiRemoteStationInfo::WifiRemoteStationInfo () |
1382 WifiRemoteStationInfo::WifiRemoteStationInfo () |
863 : m_memoryTime (Seconds (1.0)), |
1383 : m_memoryTime (Seconds (1.0)), |
864 m_lastUpdate (Seconds (0.0)), |
1384 m_lastUpdate (Seconds (0.0)), |
865 m_failAvg (0.0) |
1385 m_failAvg (0.0) |