parameter to specify the time units used on the report. The new parameter is
optional and if not specified defaults to the previous behavior (Time::S).
+
TxopTrace: new trace source exported by EdcaTxopN.
Changes to existing API:
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 3294ec877..a4479c9b3 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -27,6 +27,7 @@ Bugs fixed
- Bug 2007 - uan: Remove deprecation on SetRxThresholdDb
- Bug 2221 - network: Remove constraint on size of ns3::Packet Tag objects
- Bug 2450 - LogDistancePropagationLossModel is not continuous
+- Bug 2463 - create trace source to trace the TXOP time that is actually used
- Bug 2477 - DCF manager assert
- Bug 2492 - uan: Make use of RxGain attribute in UanPhyGen class
- Bug 2511 - HT Greenfield is not working
diff --git a/src/wifi/model/edca-txop-n.cc b/src/wifi/model/edca-txop-n.cc
index 622ff63fe..0c6eaa383 100644
--- a/src/wifi/model/edca-txop-n.cc
+++ b/src/wifi/model/edca-txop-n.cc
@@ -248,6 +248,10 @@ EdcaTxopN::GetTypeId (void)
"Trace source for contention window values",
MakeTraceSourceAccessor (&EdcaTxopN::m_cwTrace),
"ns3::TracedValue::Uint32Callback")
+ .AddTraceSource ("TxopTrace",
+ "Trace source for txop start and duration times",
+ MakeTraceSourceAccessor (&EdcaTxopN::m_txopTrace),
+ "ns3::TracedValueCallback::Time")
;
return tid;
}
@@ -1184,9 +1188,10 @@ void
EdcaTxopN::StartNext (void)
{
NS_LOG_FUNCTION (this);
+ NS_ASSERT (GetTxopLimit () == NanoSeconds (0) || Simulator::Now () - m_startTxop <= GetTxopLimit ());
+
WifiMacHeader hdr;
Time tstamp;
-
Ptr peekedPacket = m_queue->PeekByTidAndAddress (&hdr,
m_currentHdr.GetQosTid (),
WifiMacHeader::ADDR1,
@@ -1194,6 +1199,11 @@ EdcaTxopN::StartNext (void)
&tstamp);
if (peekedPacket == 0)
{
+ if (GetTxopLimit () > NanoSeconds (0))
+ {
+ NS_ASSERT (Simulator::Now () - m_startTxop <= GetTxopLimit ());
+ m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop);
+ }
return;
}
@@ -1227,6 +1237,11 @@ EdcaTxopN::StartNext (void)
m_currentHdr.GetAddr1 ());
GetLow ()->StartTransmission (m_currentPacket, &m_currentHdr, params, m_transmissionListener);
}
+ else if (GetTxopLimit () > NanoSeconds (0))
+ {
+ NS_ASSERT (Simulator::Now () - m_startTxop <= GetTxopLimit ());
+ m_txopTrace (m_startTxop, Simulator::Now () - m_startTxop);
+ }
}
Time
diff --git a/src/wifi/model/edca-txop-n.h b/src/wifi/model/edca-txop-n.h
index d743de7cb..49972dd92 100644
--- a/src/wifi/model/edca-txop-n.h
+++ b/src/wifi/model/edca-txop-n.h
@@ -579,6 +579,7 @@ private:
bool m_isAccessRequestedForRts;
TracedValue m_backoffTrace;
TracedValue m_cwTrace;
+ TracedCallback