Fix JIRA LENA-284, cellId was not being reported in some callbacks and in some situations cellId was being reported 0, now fixed and reporting always correct cellId

This commit is contained in:
Jaume Nin
2012-11-14 15:42:40 +01:00
parent 18c3badd05
commit 7639d631a6
4 changed files with 61 additions and 8 deletions

View File

@@ -794,6 +794,31 @@ FindImsiFromUeRlcPath (std::string path)
}
uint16_t
FindCellIdFromUeRlcPath (std::string path)
{
NS_LOG_FUNCTION (path);
// Sample path input:
// /NodeList/#NodeId/DeviceList/#DeviceId/LteUeRrc/RadioBearer/#LCID/RxPDU
// We retrieve the LteUeNetDevice path
std::string lteUeNetDevicePath = path.substr (0, path.find ("/LteUeRrc"));
Config::MatchContainer match = Config::LookupMatches (lteUeNetDevicePath);
if (match.GetN () != 0)
{
Ptr<Object> ueNetDevice = match.Get (0);
NS_LOG_LOGIC ("FindImsiFromUeRlcPath: " << path << ", " << ueNetDevice->GetObject<LteUeNetDevice> ()->GetImsi ());
return ueNetDevice->GetObject<LteUeNetDevice> ()->GetRrc ()->GetCellId ();
}
else
{
NS_FATAL_ERROR ("Lookup " << lteUeNetDevicePath << " got no matches");
}
}
uint64_t
FindImsiFromEnbMac (std::string path, uint16_t rnti)
{
@@ -866,7 +891,18 @@ DlRxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
imsi = FindImsiFromUeRlcPath (path);
rlcStats->SetImsiPath (path, imsi);
}
rlcStats->DlRxPdu (imsi, rnti, lcid, packetSize, delay);
uint16_t cellId = 0;
if (rlcStats->ExistsCellIdPath (path) == true)
{
cellId = rlcStats->GetCellIdPath (path);
}
else
{
cellId = FindCellIdFromUeRlcPath (path);
rlcStats->SetCellIdPath (path, cellId);
}
rlcStats->DlRxPdu (cellId, imsi, rnti, lcid, packetSize, delay);
}
void
@@ -894,7 +930,18 @@ UlTxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::string path,
imsi = FindImsiFromUeRlcPath (path);
rlcStats->SetImsiPath (path, imsi);
}
rlcStats->UlTxPdu (imsi, rnti, lcid, packetSize);
uint16_t cellId = 0;
if (rlcStats->ExistsCellIdPath (path) == true)
{
cellId = rlcStats->GetCellIdPath (path);
}
else
{
cellId = FindCellIdFromUeRlcPath (path);
rlcStats->SetCellIdPath (path, cellId);
}
rlcStats->UlTxPdu (cellId, imsi, rnti, lcid, packetSize);
}
void

View File

@@ -96,13 +96,14 @@ RadioBearerStatsCalculator::DoDispose ()
}
void
RadioBearerStatsCalculator::UlTxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
RadioBearerStatsCalculator::UlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize)
{
NS_LOG_FUNCTION (this << "UlTxPDU" << imsi << rnti << (uint32_t) lcid << packetSize);
CheckEpoch ();
ImsiLcidPair_t p (imsi, lcid);
if (Simulator::Now () > m_startTime)
{
m_ulCellId[p] = cellId;
m_flowId[p] = LteFlowId_t (rnti, lcid);
m_ulTxPackets[p]++;
m_ulTxData[p] += packetSize;
@@ -154,13 +155,14 @@ RadioBearerStatsCalculator::UlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rn
}
void
RadioBearerStatsCalculator::DlRxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
RadioBearerStatsCalculator::DlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay)
{
NS_LOG_FUNCTION (this << "DlRxPDU" << imsi << rnti << (uint32_t) lcid << packetSize << delay);
CheckEpoch ();
ImsiLcidPair_t p (imsi, lcid);
if (Simulator::Now () > m_startTime)
{
m_dlCellId[p] = cellId;
m_dlRxPackets[p]++;
m_dlRxData[p] += packetSize;

View File

@@ -113,13 +113,14 @@ public:
/**
* Notifies the stats calculator that an uplink transmission has occurred.
* @param cellId CellId of the attached Enb
* @param imsi IMSI of the UE who transmitted the PDU
* @param rnti C-RNTI of the UE who transmitted the PDU
* @param lcid LCID through which the PDU has been transmitted
* @param packetSize size of the PDU in bytes
*/
void
UlTxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
UlTxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize);
/**
* Notifies the stats calculator that an uplink reception has occurred.
@@ -146,6 +147,7 @@ public:
/**
* Notifies the stats calculator that an downlink reception has occurred.
* @param cellId CellId of the attached Enb
* @param imsi IMSI of the UE who received the PDU
* @param rnti C-RNTI of the UE who received the PDU
* @param lcid LCID through which the PDU has been transmitted
@@ -153,7 +155,7 @@ public:
* @param delay RLC to RLC delay in nanoseconds
*/
void
DlRxPdu (uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
DlRxPdu (uint16_t cellId, uint64_t imsi, uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay);
/**
* Gets the number of transmitted uplink packets.

View File

@@ -261,7 +261,8 @@ LteSimpleHelperDlRxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::s
{
NS_LOG_FUNCTION (rlcStats << path << rnti << (uint16_t)lcid << packetSize << delay);
uint64_t imsi = 333;
rlcStats->DlRxPdu (imsi, rnti, lcid, packetSize, delay);
uint16_t cellId = 555;
rlcStats->DlRxPdu (cellId, imsi, rnti, lcid, packetSize, delay);
}
void
@@ -281,7 +282,8 @@ LteSimpleHelperUlTxPduCallback (Ptr<RadioBearerStatsCalculator> rlcStats, std::s
{
NS_LOG_FUNCTION (rlcStats << path << rnti << (uint16_t)lcid << packetSize);
uint64_t imsi = 1111;
rlcStats->UlTxPdu (imsi, rnti, lcid, packetSize);
uint16_t cellId = 555;
rlcStats->UlTxPdu (cellId, imsi, rnti, lcid, packetSize);
}
void