22 #include "ns3/simulator.h"
23 #include "ns3/assert.h"
26 #include "ns3/boolean.h"
27 #include "ns3/double.h"
28 #include "ns3/uinteger.h"
29 #include "ns3/wifi-phy.h"
30 #include "ns3/trace-source-accessor.h"
56 virtual void Print (std::ostream &os)
const;
66 : m_rtsMode (rtsMode),
85 .AddConstructor<TxModeTag> ()
86 .AddAttribute (
"RtsTxMode",
87 "Tx mode of rts to use later",
90 MakeWifiModeChecker ())
91 .AddAttribute (
"DataTxMode",
92 "Tx mode of data to use later",
95 MakeWifiModeChecker ())
137 static TypeId tid =
TypeId (
"ns3::WifiRemoteStationManager")
139 .AddAttribute (
"IsLowLatency",
"If true, we attempt to modelize a so-called low-latency device: a device"
140 " where decisions about tx parameters can be made on a per-packet basis and feedback about the"
141 " transmission of each packet is obtained before sending the next. Otherwise, we modelize a "
142 " high-latency device, that is a device where we cannot update our decision about tx parameters"
143 " after every packet transmission.",
146 MakeBooleanChecker ())
147 .AddAttribute (
"MaxSsrc",
"The maximum number of retransmission attempts for an RTS. This value"
148 " will not have any effect on some rate control algorithms.",
151 MakeUintegerChecker<uint32_t> ())
152 .AddAttribute (
"MaxSlrc",
"The maximum number of retransmission attempts for a DATA packet. This value"
153 " will not have any effect on some rate control algorithms.",
156 MakeUintegerChecker<uint32_t> ())
157 .AddAttribute (
"RtsCtsThreshold",
"If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than "
158 "this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. "
159 "This value will not have any effect on some rate control algorithms.",
162 MakeUintegerChecker<uint32_t> ())
163 .AddAttribute (
"FragmentationThreshold",
"If the size of the data packet + LLC header + MAC header + FCS trailer is bigger"
164 "than this value, we fragment it such that the size of the fragments are equal or smaller "
165 "than this value, as per IEEE Std. 802.11-2007, Section 9.4. "
166 "This value will not have any effect on some rate control algorithms.",
169 MakeUintegerChecker<uint32_t> ())
170 .AddAttribute (
"NonUnicastMode",
"Wifi mode used for non-unicast transmissions.",
173 MakeWifiModeChecker ())
174 .AddTraceSource (
"MacTxRtsFailed",
175 "The transmission of a RTS by the MAC layer has failed",
177 .AddTraceSource (
"MacTxDataFailed",
178 "The transmission of a data packet by the MAC layer has failed",
180 .AddTraceSource (
"MacTxFinalRtsFailed",
181 "The transmission of a RTS has exceeded the maximum number of attempts",
183 .AddTraceSource (
"MacTxFinalDataFailed",
184 "The transmission of a data packet has exceeded the maximum number of attempts",
200 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
270 state->m_operationalRateSet.clear ();
278 for (
WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
286 state->m_operationalRateSet.push_back (mode);
352 ConstCast<Packet> (packet)->RemovePacketTag (tag);
369 found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
384 found = ConstCast<Packet> (packet)->PeekPacketTag (tag);
410 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
414 station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
420 double ackSnr,
WifiMode ackMode,
double dataSnr)
424 station->m_state->m_info.NotifyTxSuccess (station->m_slrc);
433 station->m_state->m_info.NotifyTxFailed ();
443 station->m_state->m_info.NotifyTxFailed ();
476 bool normally = station->m_ssrc <
GetMaxSsrc ();
485 bool normally = station->m_slrc <
GetMaxSlrc ();
513 if (fragmentNumber >= nFragment)
517 if (fragmentNumber == nFragment - 1)
520 return lastFragmentSize;
534 return fragmentOffset;
541 bool isLast = fragmentNumber == (
GetNFragments (packet) - 1);
568 if ((!found || i->GetPhyRate () > mode.
GetPhyRate ())
644 <<
". Check standard and selected rates match.");
673 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
675 if ((*i)->m_address == address)
699 return Lookup (address, tid);
706 if ((*i)->m_tid == tid
707 && (*i)->m_state->m_address == address)
716 station->
m_tid = tid;
817 : m_memoryTime (
Seconds (1.0)),
836 m_failAvg = (double)retryCounter / (1 + (
double) retryCounter) * (1.0 - coefficient) + coefficient *
m_failAvg;