lte: Add new RaResponseTimeout trace source in LteUeMac

This commit is contained in:
ZorazeAli
2019-04-24 10:30:10 +02:00
parent dac14cf60f
commit bcc537561b
2 changed files with 31 additions and 1 deletions

View File

@@ -235,7 +235,13 @@ LteUeMac::GetTypeId (void)
static TypeId tid = TypeId ("ns3::LteUeMac")
.SetParent<Object> ()
.SetGroupName("Lte")
.AddConstructor<LteUeMac> ();
.AddConstructor<LteUeMac> ()
.AddTraceSource ("RaResponseTimeout",
"trace fired upon RA response timeout",
MakeTraceSourceAccessor (&LteUeMac::m_raResponseTimeoutTrace),
"ns3::LteUeMac::RaResponseTimeoutTracedCallback")
;
return tid;
}
@@ -498,6 +504,9 @@ LteUeMac::RaResponseTimeout (bool contention)
m_waitingForRaResponse = false;
// 3GPP 36.321 5.1.4
++m_preambleTransmissionCounter;
//fire RA response timeout trace
m_raResponseTimeoutTrace (m_imsi, contention, m_preambleTransmissionCounter,
m_rachConfig.preambleTransMax + 1);
if (m_preambleTransmissionCounter == m_rachConfig.preambleTransMax + 1)
{
NS_LOG_INFO ("RAR timeout, preambleTransMax reached => giving up");

View File

@@ -34,6 +34,7 @@
#include <vector>
#include <ns3/packet.h>
#include <ns3/packet-burst.h>
#include <ns3/traced-callback.h>
namespace ns3 {
@@ -60,6 +61,19 @@ public:
virtual ~LteUeMac ();
virtual void DoDispose (void);
/**
* \brief TracedCallback signature for RA response timeout events
* exporting IMSI, contention flag, preamble transmission counter
* and the max limit of preamble transmission
*
* \param [in] imsi
* \param [in] contention
* \param [in] preambleTxCounter
* \param [in] maxPreambleTxLimit
*/
typedef void (* RaResponseTimeoutTracedCallback)
(uint64_t imsi, bool contention, uint8_t preambleTxCounter, uint8_t maxPreambleTxLimit);
/**
* \brief Get the LTE MAC SAP provider
* \return a pointer to the LTE MAC SAP provider
@@ -273,6 +287,13 @@ private:
uint32_t m_subframeNo; ///< subframe number
uint8_t m_raRnti; ///< RA RNTI
bool m_waitingForRaResponse; ///< waiting for RA response
/**
* \brief The `RaResponseTimeout` trace source. Fired RA response timeout.
* Exporting IMSI, contention flag, preamble transmission counter
* and the max limit of preamble transmission.
*/
TracedCallback<uint64_t, bool, uint8_t, uint8_t> m_raResponseTimeoutTrace;
};
} // namespace ns3