|
|
| 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 |
/* |
2 |
/* |
| 3 |
* Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
3 |
* Copyright (c) 2012-2018 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
| 4 |
* |
4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or modify |
5 |
* This program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License version 2 as |
6 |
* it under the terms of the GNU General Public License version 2 as |
|
|
| 15 |
* along with this program; if not, write to the Free Software |
15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 |
* |
17 |
* |
| 18 |
* Author: Nicola Baldo <nbaldo@cttc.es> |
18 |
* Authors: Nicola Baldo <nbaldo@cttc.es> |
|
|
19 |
* Manuel Requena <manuel.requena@cttc.es> |
| 19 |
*/ |
20 |
*/ |
| 20 |
|
21 |
|
| 21 |
|
22 |
#include "ns3/log.h" |
| 22 |
#include <ns3/log.h> |
23 |
#include "radio-bearer-stats-calculator.h" |
| 23 |
|
|
|
| 24 |
|
| 25 |
#include "radio-bearer-stats-connector.h" |
24 |
#include "radio-bearer-stats-connector.h" |
| 26 |
#include "radio-bearer-stats-calculator.h" |
|
|
| 27 |
#include <ns3/lte-enb-rrc.h> |
| 28 |
#include <ns3/lte-enb-net-device.h> |
| 29 |
#include <ns3/lte-ue-rrc.h> |
| 30 |
#include <ns3/lte-ue-net-device.h> |
| 31 |
|
25 |
|
| 32 |
namespace ns3 { |
26 |
namespace ns3 { |
| 33 |
|
27 |
|
|
|
| 102 |
uint16_t rnti, uint8_t lcid, uint32_t packetSize) |
96 |
uint16_t rnti, uint8_t lcid, uint32_t packetSize) |
| 103 |
{ |
97 |
{ |
| 104 |
NS_LOG_FUNCTION (path << rnti << (uint16_t)lcid << packetSize); |
98 |
NS_LOG_FUNCTION (path << rnti << (uint16_t)lcid << packetSize); |
| 105 |
|
|
|
| 106 |
arg->stats->UlTxPdu (arg->cellId, arg->imsi, rnti, lcid, packetSize); |
99 |
arg->stats->UlTxPdu (arg->cellId, arg->imsi, rnti, lcid, packetSize); |
| 107 |
} |
100 |
} |
| 108 |
|
101 |
|
|
|
| 120 |
uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay) |
113 |
uint16_t rnti, uint8_t lcid, uint32_t packetSize, uint64_t delay) |
| 121 |
{ |
114 |
{ |
| 122 |
NS_LOG_FUNCTION (path << rnti << (uint16_t)lcid << packetSize << delay); |
115 |
NS_LOG_FUNCTION (path << rnti << (uint16_t)lcid << packetSize << delay); |
| 123 |
|
|
|
| 124 |
arg->stats->UlRxPdu (arg->cellId, arg->imsi, rnti, lcid, packetSize, delay); |
116 |
arg->stats->UlRxPdu (arg->cellId, arg->imsi, rnti, lcid, packetSize, delay); |
| 125 |
} |
117 |
} |
| 126 |
|
118 |
|
| 127 |
|
119 |
|
| 128 |
|
|
|
| 129 |
RadioBearerStatsConnector::RadioBearerStatsConnector () |
120 |
RadioBearerStatsConnector::RadioBearerStatsConnector () |
| 130 |
: m_connected (false) |
121 |
: m_connected (false) |
| 131 |
{ |
122 |
{ |
| 132 |
} |
123 |
} |
| 133 |
|
124 |
|
| 134 |
void |
125 |
void |
| 135 |
RadioBearerStatsConnector::EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats) |
126 |
RadioBearerStatsConnector::EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats) |
| 136 |
{ |
127 |
{ |
| 137 |
m_rlcStats = rlcStats; |
128 |
m_rlcStats = rlcStats; |
| 138 |
EnsureConnected (); |
129 |
EnsureConnected (); |
| 139 |
} |
130 |
} |
| 140 |
|
131 |
|
| 141 |
void |
132 |
void |
| 142 |
RadioBearerStatsConnector::EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats) |
133 |
RadioBearerStatsConnector::EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats) |
| 143 |
{ |
134 |
{ |
| 144 |
m_pdcpStats = pdcpStats; |
135 |
m_pdcpStats = pdcpStats; |
| 145 |
EnsureConnected (); |
136 |
EnsureConnected (); |
| 146 |
} |
137 |
} |
| 147 |
|
138 |
|
| 148 |
void |
139 |
void |
| 149 |
RadioBearerStatsConnector::EnsureConnected () |
140 |
RadioBearerStatsConnector::EnsureConnected () |
| 150 |
{ |
141 |
{ |
| 151 |
NS_LOG_FUNCTION (this); |
142 |
NS_LOG_FUNCTION (this); |
| 152 |
if (!m_connected) |
143 |
if (!m_connected) |
| 153 |
{ |
144 |
{ |
| 154 |
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/NewUeContext", |
145 |
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/NewUeContext", |
| 155 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this)); |
146 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this)); |
|
|
147 |
|
| 156 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful", |
148 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful", |
| 157 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this)); |
149 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this)); |
| 158 |
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionReconfiguration", |
150 |
|
| 159 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this)); |
151 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/Srb1Created", |
| 160 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionReconfiguration", |
152 |
MakeBoundCallback (&RadioBearerStatsConnector::CreatedSrb1Ue, this)); |
| 161 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationUe, this)); |
153 |
|
| 162 |
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverStart", |
154 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/DrbCreated", |
| 163 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartEnb, this)); |
155 |
MakeBoundCallback (&RadioBearerStatsConnector::CreatedDrbUe, this)); |
| 164 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverStart", |
156 |
|
| 165 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartUe, this)); |
|
|
| 166 |
Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverEndOk", |
| 167 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this)); |
| 168 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverEndOk", |
| 169 |
MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this)); |
| 170 |
m_connected = true; |
157 |
m_connected = true; |
| 171 |
} |
158 |
} |
| 172 |
} |
159 |
} |
| 173 |
|
160 |
|
| 174 |
void |
161 |
void |
| 175 |
RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
162 |
RadioBearerStatsConnector::StoreUeManagerPath (std::string context, uint16_t cellId, uint16_t rnti) |
| 176 |
{ |
163 |
{ |
| 177 |
c->ConnectSrb0Traces (context, imsi, cellId, rnti); |
164 |
NS_LOG_FUNCTION (this << context << cellId << rnti); |
|
|
165 |
std::string ueManagerPath; |
| 166 |
ueManagerPath = context.substr (0, context.rfind ("/")) + "/UeMap/" + std::to_string (rnti); |
| 167 |
NS_LOG_DEBUG ("ueManagerPath = " << ueManagerPath); |
| 168 |
CellIdRnti key; |
| 169 |
key.cellId = cellId; |
| 170 |
key.rnti = rnti; |
| 171 |
m_ueManagerPathByCellIdRnti[key] = ueManagerPath; |
| 172 |
|
| 173 |
Config::Connect (ueManagerPath + "/DrbCreated", |
| 174 |
MakeBoundCallback (&RadioBearerStatsConnector::CreatedDrbEnb, this)); |
| 178 |
} |
175 |
} |
| 179 |
|
176 |
|
| 180 |
void |
177 |
void |
| 181 |
RadioBearerStatsConnector::NotifyConnectionSetupUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
|
|
| 182 |
{ |
| 183 |
c->ConnectSrb1TracesUe (context, imsi, cellId, rnti); |
| 184 |
} |
| 185 |
|
| 186 |
void |
| 187 |
RadioBearerStatsConnector::NotifyConnectionReconfigurationUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 188 |
{ |
| 189 |
c->ConnectTracesUeIfFirstTime (context, imsi, cellId, rnti); |
| 190 |
} |
| 191 |
|
| 192 |
void |
| 193 |
RadioBearerStatsConnector::NotifyHandoverStartUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t targetCellId) |
| 194 |
{ |
| 195 |
c->DisconnectTracesUe (context, imsi, cellId, rnti); |
| 196 |
} |
| 197 |
|
| 198 |
void |
| 199 |
RadioBearerStatsConnector::NotifyHandoverEndOkUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 200 |
{ |
| 201 |
c->ConnectTracesUe (context, imsi, cellId, rnti); |
| 202 |
} |
| 203 |
|
| 204 |
void |
| 205 |
RadioBearerStatsConnector::NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellId, uint16_t rnti) |
178 |
RadioBearerStatsConnector::NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellId, uint16_t rnti) |
| 206 |
{ |
179 |
{ |
|
|
180 |
NS_LOG_FUNCTION (c << context << cellId << rnti); |
| 207 |
c->StoreUeManagerPath (context, cellId, rnti); |
181 |
c->StoreUeManagerPath (context, cellId, rnti); |
| 208 |
} |
182 |
} |
| 209 |
|
183 |
|
| 210 |
void |
184 |
void |
| 211 |
RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
185 |
RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 212 |
{ |
186 |
{ |
| 213 |
c->ConnectTracesEnbIfFirstTime (context, imsi, cellId, rnti); |
187 |
NS_LOG_FUNCTION (c << context << imsi << cellId << rnti); |
|
|
188 |
c->ConnectTracesSrb0 (context, imsi, cellId, rnti); |
| 214 |
} |
189 |
} |
| 215 |
|
190 |
|
| 216 |
void |
191 |
void |
| 217 |
RadioBearerStatsConnector::NotifyHandoverStartEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t targetCellId) |
192 |
RadioBearerStatsConnector::CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
| 218 |
{ |
193 |
{ |
| 219 |
c->DisconnectTracesEnb (context, imsi, cellId, rnti); |
194 |
NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid); |
|
|
195 |
c->ConnectTracesDrbEnb (context, imsi, cellId, rnti, lcid); |
| 220 |
} |
196 |
} |
| 221 |
|
197 |
|
| 222 |
void |
198 |
void |
| 223 |
RadioBearerStatsConnector::NotifyHandoverEndOkEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
199 |
RadioBearerStatsConnector::CreatedSrb1Ue (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 224 |
{ |
200 |
{ |
| 225 |
c->ConnectTracesEnb (context, imsi, cellId, rnti); |
201 |
NS_LOG_FUNCTION (c << context << imsi << cellId << rnti); |
|
|
202 |
c->ConnectTracesSrb1 (context, imsi, cellId, rnti); |
| 226 |
} |
203 |
} |
| 227 |
|
204 |
|
| 228 |
void |
205 |
void |
| 229 |
RadioBearerStatsConnector::StoreUeManagerPath (std::string context, uint16_t cellId, uint16_t rnti) |
206 |
RadioBearerStatsConnector::CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
| 230 |
{ |
207 |
{ |
| 231 |
NS_LOG_FUNCTION (this << context << cellId << rnti); |
208 |
NS_LOG_FUNCTION (c << context << imsi << cellId << rnti << (uint16_t)lcid); |
| 232 |
std::ostringstream ueManagerPath; |
209 |
c->ConnectTracesDrbUe (context, imsi, cellId, rnti, lcid); |
| 233 |
ueManagerPath << context.substr (0, context.rfind ("/")) << "/UeMap/" << (uint32_t) rnti; |
|
|
| 234 |
CellIdRnti key; |
| 235 |
key.cellId = cellId; |
| 236 |
key.rnti = rnti; |
| 237 |
m_ueManagerPathByCellIdRnti[key] = ueManagerPath.str (); |
| 238 |
} |
210 |
} |
| 239 |
|
211 |
|
| 240 |
void |
212 |
void |
| 241 |
RadioBearerStatsConnector::ConnectSrb0Traces (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
213 |
RadioBearerStatsConnector::ConnectTracesSrb0 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 242 |
{ |
214 |
{ |
| 243 |
NS_LOG_FUNCTION (this << imsi << cellId << rnti); |
215 |
NS_LOG_FUNCTION (this << context << imsi << cellId << rnti); |
| 244 |
std::string ueRrcPath = context.substr (0, context.rfind ("/")); |
216 |
std::string ueRrcPath = context.substr (0, context.rfind ("/")); |
|
|
217 |
NS_LOG_LOGIC ("ueRrcPath = " << ueRrcPath); |
| 245 |
CellIdRnti key; |
218 |
CellIdRnti key; |
| 246 |
key.cellId = cellId; |
219 |
key.cellId = cellId; |
| 247 |
key.rnti = rnti; |
220 |
key.rnti = rnti; |
| 248 |
std::map<CellIdRnti, std::string>::iterator it = m_ueManagerPathByCellIdRnti.find (key); |
221 |
std::map<CellIdRnti, std::string>::iterator it = m_ueManagerPathByCellIdRnti.find (key); |
| 249 |
NS_ASSERT (it != m_ueManagerPathByCellIdRnti.end ()); |
222 |
NS_ASSERT (it != m_ueManagerPathByCellIdRnti.end ()); |
| 250 |
std::string ueManagerPath = it->second; |
223 |
std::string ueManagerPath = it->second; |
| 251 |
NS_LOG_LOGIC (this << " ueManagerPath: " << ueManagerPath); |
224 |
NS_LOG_LOGIC ("ueManagerPath = " << ueManagerPath); |
| 252 |
m_ueManagerPathByCellIdRnti.erase (it); |
|
|
| 253 |
|
| 254 |
if (m_rlcStats) |
225 |
if (m_rlcStats) |
| 255 |
{ |
226 |
{ |
| 256 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
227 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 257 |
arg->imsi = imsi; |
228 |
arg->imsi = imsi; |
| 258 |
arg->cellId = cellId; |
229 |
arg->cellId = cellId; |
| 259 |
arg->stats = m_rlcStats; |
230 |
arg->stats = m_rlcStats; |
| 260 |
|
|
|
| 261 |
// diconnect eventually previously connected SRB0 both at UE and eNB |
| 262 |
Config::Disconnect (ueRrcPath + "/Srb0/LteRlc/TxPDU", |
| 263 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 264 |
Config::Disconnect (ueRrcPath + "/Srb0/LteRlc/RxPDU", |
| 265 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 266 |
Config::Disconnect (ueManagerPath + "/Srb0/LteRlc/TxPDU", |
| 267 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 268 |
Config::Disconnect (ueManagerPath + "/Srb0/LteRlc/RxPDU", |
| 269 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 270 |
|
| 271 |
// connect SRB0 both at UE and eNB |
| 272 |
Config::Connect (ueRrcPath + "/Srb0/LteRlc/TxPDU", |
231 |
Config::Connect (ueRrcPath + "/Srb0/LteRlc/TxPDU", |
| 273 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
232 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 274 |
Config::Connect (ueRrcPath + "/Srb0/LteRlc/RxPDU", |
233 |
Config::Connect (ueRrcPath + "/Srb0/LteRlc/RxPDU", |
|
|
| 277 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
236 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 278 |
Config::Connect (ueManagerPath + "/Srb0/LteRlc/RxPDU", |
237 |
Config::Connect (ueManagerPath + "/Srb0/LteRlc/RxPDU", |
| 279 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
238 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
|
|
239 |
} |
| 240 |
} |
| 280 |
|
241 |
|
| 281 |
// connect SRB1 at eNB only (at UE SRB1 will be setup later) |
242 |
void |
|
|
243 |
RadioBearerStatsConnector::ConnectTracesSrb1 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 244 |
{ |
| 245 |
NS_LOG_FUNCTION (this << context << imsi << cellId << rnti); |
| 246 |
std::string ueRrcPath = context.substr (0, context.rfind ("/")); |
| 247 |
NS_LOG_LOGIC ("ueRrcPath = " << ueRrcPath); |
| 248 |
CellIdRnti key; |
| 249 |
key.cellId = cellId; |
| 250 |
key.rnti = rnti; |
| 251 |
std::map<CellIdRnti, std::string>::iterator it = m_ueManagerPathByCellIdRnti.find (key); |
| 252 |
NS_ASSERT (it != m_ueManagerPathByCellIdRnti.end ()); |
| 253 |
std::string ueManagerPath = it->second; |
| 254 |
NS_LOG_LOGIC ("ueManagerPath = " << ueManagerPath); |
| 255 |
if (m_rlcStats) |
| 256 |
{ |
| 257 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 258 |
arg->imsi = imsi; |
| 259 |
arg->cellId = cellId; |
| 260 |
arg->stats = m_rlcStats; |
| 261 |
Config::Connect (ueRrcPath + "/Srb1/LteRlc/TxPDU", |
| 262 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 263 |
Config::Connect (ueRrcPath + "/Srb1/LteRlc/RxPDU", |
| 264 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 282 |
Config::Connect (ueManagerPath + "/Srb1/LteRlc/TxPDU", |
265 |
Config::Connect (ueManagerPath + "/Srb1/LteRlc/TxPDU", |
| 283 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
266 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 284 |
Config::Connect (ueManagerPath + "/Srb1/LteRlc/RxPDU", |
267 |
Config::Connect (ueManagerPath + "/Srb1/LteRlc/RxPDU", |
|
|
| 288 |
{ |
271 |
{ |
| 289 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
272 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 290 |
arg->imsi = imsi; |
273 |
arg->imsi = imsi; |
| 291 |
arg->cellId = cellId; |
274 |
arg->cellId = cellId; |
| 292 |
arg->stats = m_pdcpStats; |
275 |
arg->stats = m_pdcpStats; |
| 293 |
|
276 |
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/TxPDU", |
| 294 |
// connect SRB1 at eNB only (at UE SRB1 will be setup later) |
277 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
|
|
278 |
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/RxPDU", |
| 279 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 280 |
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/TxPDU", |
| 281 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 295 |
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/RxPDU", |
282 |
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/RxPDU", |
| 296 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
283 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 297 |
Config::Connect (ueManagerPath + "/Srb1/LtePdcp/TxPDU", |
|
|
| 298 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 299 |
} |
284 |
} |
| 300 |
} |
285 |
} |
| 301 |
|
286 |
|
| 302 |
void |
287 |
void |
| 303 |
RadioBearerStatsConnector::ConnectSrb1TracesUe (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
288 |
RadioBearerStatsConnector::ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
| 304 |
{ |
289 |
{ |
| 305 |
NS_LOG_FUNCTION (this << imsi << cellId << rnti); |
290 |
NS_LOG_FUNCTION (this << context << imsi << cellId << rnti << (uint16_t)lcid); |
| 306 |
if (m_rlcStats) |
291 |
NS_LOG_LOGIC ("expected context should match /NodeList/*/DeviceList/*/LteEnbRrc/"); |
|
|
292 |
std::string basePath; |
| 293 |
basePath = context.substr (0, context.rfind ("/")) + "/DataRadioBearerMap/" + std::to_string (lcid - 2); |
| 294 |
NS_LOG_LOGIC ("basePath = " << basePath); |
| 295 |
if (m_rlcStats) |
| 307 |
{ |
296 |
{ |
| 308 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
297 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 309 |
arg->imsi = imsi; |
298 |
arg->imsi = imsi; |
| 310 |
arg->cellId = cellId; |
299 |
arg->cellId = cellId; |
| 311 |
arg->stats = m_rlcStats; |
300 |
arg->stats = m_rlcStats; |
| 312 |
Config::Connect (ueRrcPath + "/Srb1/LteRlc/TxPDU", |
301 |
Config::Connect (basePath + "/LteRlc/TxPDU", |
|
|
302 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 303 |
Config::Connect (basePath + "/LteRlc/RxPDU", |
| 304 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 305 |
} |
| 306 |
if (m_pdcpStats) |
| 307 |
{ |
| 308 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 309 |
arg->imsi = imsi; |
| 310 |
arg->cellId = cellId; |
| 311 |
arg->stats = m_pdcpStats; |
| 312 |
Config::Connect (basePath + "/LtePdcp/TxPDU", |
| 313 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 314 |
Config::Connect (basePath + "/LtePdcp/RxPDU", |
| 315 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 316 |
} |
| 317 |
} |
| 318 |
|
| 319 |
void |
| 320 |
RadioBearerStatsConnector::ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid) |
| 321 |
{ |
| 322 |
NS_LOG_FUNCTION (this << context << imsi << cellId << rnti << (uint16_t)lcid); |
| 323 |
NS_LOG_LOGIC ("expected context should match /NodeList/*/DeviceList/*/LteUeRrc/"); |
| 324 |
std::string basePath; |
| 325 |
basePath = context.substr (0, context.rfind ("/")) + "/DataRadioBearerMap/" + std::to_string (lcid); |
| 326 |
NS_LOG_LOGIC ("basePath = " << basePath); |
| 327 |
if (m_rlcStats) |
| 328 |
{ |
| 329 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 330 |
arg->imsi = imsi; |
| 331 |
arg->cellId = cellId; |
| 332 |
arg->stats = m_rlcStats; |
| 333 |
Config::Connect (basePath + "/LteRlc/TxPDU", |
| 313 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
334 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 314 |
Config::Connect (ueRrcPath + "/Srb1/LteRlc/RxPDU", |
335 |
Config::Connect (basePath + "/LteRlc/RxPDU", |
| 315 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
336 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 316 |
} |
337 |
} |
| 317 |
if (m_pdcpStats) |
338 |
if (m_pdcpStats) |
| 318 |
{ |
339 |
{ |
| 319 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
340 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 320 |
arg->imsi = imsi; |
341 |
arg->imsi = imsi; |
| 321 |
arg->cellId = cellId; |
342 |
arg->cellId = cellId; |
| 322 |
arg->stats = m_pdcpStats; |
343 |
arg->stats = m_pdcpStats; |
| 323 |
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/RxPDU", |
344 |
Config::Connect (basePath + "/LtePdcp/TxPDU", |
| 324 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
345 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 325 |
Config::Connect (ueRrcPath + "/Srb1/LtePdcp/TxPDU", |
346 |
Config::Connect (basePath + "/LtePdcp/RxPDU", |
| 326 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
347 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 327 |
} |
|
|
| 328 |
} |
| 329 |
|
| 330 |
void |
| 331 |
RadioBearerStatsConnector::ConnectTracesUeIfFirstTime (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 332 |
{ |
| 333 |
NS_LOG_FUNCTION (this << context); |
| 334 |
if (m_imsiSeenUe.find (imsi) == m_imsiSeenUe.end ()) |
| 335 |
{ |
| 336 |
m_imsiSeenUe.insert (imsi); |
| 337 |
ConnectTracesUe (context, imsi, cellId, rnti); |
| 338 |
} |
| 339 |
} |
| 340 |
|
| 341 |
void |
| 342 |
RadioBearerStatsConnector::ConnectTracesEnbIfFirstTime (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 343 |
{ |
| 344 |
NS_LOG_FUNCTION (this << context); |
| 345 |
if (m_imsiSeenEnb.find (imsi) == m_imsiSeenEnb.end ()) |
| 346 |
{ |
| 347 |
m_imsiSeenEnb.insert (imsi); |
| 348 |
ConnectTracesEnb (context, imsi, cellId, rnti); |
| 349 |
} |
348 |
} |
| 350 |
} |
349 |
} |
| 351 |
|
350 |
|
| 352 |
void |
|
|
| 353 |
RadioBearerStatsConnector::ConnectTracesUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 354 |
{ |
| 355 |
NS_LOG_FUNCTION (this << context); |
| 356 |
NS_LOG_LOGIC (this << "expected context should match /NodeList/*/DeviceList/*/LteUeRrc/"); |
| 357 |
std::string basePath = context.substr (0, context.rfind ("/")); |
| 358 |
if (m_rlcStats) |
| 359 |
{ |
| 360 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 361 |
arg->imsi = imsi; |
| 362 |
arg->cellId = cellId; |
| 363 |
arg->stats = m_rlcStats; |
| 364 |
Config::Connect (basePath + "/DataRadioBearerMap/*/LteRlc/TxPDU", |
| 365 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 366 |
Config::Connect (basePath + "/DataRadioBearerMap/*/LteRlc/RxPDU", |
| 367 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 368 |
Config::Connect (basePath + "/Srb1/LteRlc/TxPDU", |
| 369 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 370 |
Config::Connect (basePath + "/Srb1/LteRlc/RxPDU", |
| 371 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 372 |
|
| 373 |
} |
| 374 |
if (m_pdcpStats) |
| 375 |
{ |
| 376 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 377 |
arg->imsi = imsi; |
| 378 |
arg->cellId = cellId; |
| 379 |
arg->stats = m_pdcpStats; |
| 380 |
Config::Connect (basePath + "/DataRadioBearerMap/*/LtePdcp/RxPDU", |
| 381 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 382 |
Config::Connect (basePath + "/DataRadioBearerMap/*/LtePdcp/TxPDU", |
| 383 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 384 |
Config::Connect (basePath + "/Srb1/LtePdcp/RxPDU", |
| 385 |
MakeBoundCallback (&DlRxPduCallback, arg)); |
| 386 |
Config::Connect (basePath + "/Srb1/LtePdcp/TxPDU", |
| 387 |
MakeBoundCallback (&UlTxPduCallback, arg)); |
| 388 |
} |
| 389 |
} |
| 390 |
|
| 391 |
void |
| 392 |
RadioBearerStatsConnector::ConnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 393 |
{ |
| 394 |
NS_LOG_FUNCTION (this << context); |
| 395 |
NS_LOG_LOGIC (this << "expected context should match /NodeList/*/DeviceList/*/LteEnbRrc/"); |
| 396 |
std::ostringstream basePath; |
| 397 |
basePath << context.substr (0, context.rfind ("/")) << "/UeMap/" << (uint32_t) rnti; |
| 398 |
if (m_rlcStats) |
| 399 |
{ |
| 400 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 401 |
arg->imsi = imsi; |
| 402 |
arg->cellId = cellId; |
| 403 |
arg->stats = m_rlcStats; |
| 404 |
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LteRlc/RxPDU", |
| 405 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 406 |
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LteRlc/TxPDU", |
| 407 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 408 |
Config::Connect (basePath.str () + "/Srb0/LteRlc/RxPDU", |
| 409 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 410 |
Config::Connect (basePath.str () + "/Srb0/LteRlc/TxPDU", |
| 411 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 412 |
Config::Connect (basePath.str () + "/Srb1/LteRlc/RxPDU", |
| 413 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 414 |
Config::Connect (basePath.str () + "/Srb1/LteRlc/TxPDU", |
| 415 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 416 |
} |
| 417 |
if (m_pdcpStats) |
| 418 |
{ |
| 419 |
Ptr<BoundCallbackArgument> arg = Create<BoundCallbackArgument> (); |
| 420 |
arg->imsi = imsi; |
| 421 |
arg->cellId = cellId; |
| 422 |
arg->stats = m_pdcpStats; |
| 423 |
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LtePdcp/TxPDU", |
| 424 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 425 |
Config::Connect (basePath.str () + "/DataRadioBearerMap/*/LtePdcp/RxPDU", |
| 426 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 427 |
Config::Connect (basePath.str () + "/Srb1/LtePdcp/TxPDU", |
| 428 |
MakeBoundCallback (&DlTxPduCallback, arg)); |
| 429 |
Config::Connect (basePath.str () + "/Srb1/LtePdcp/RxPDU", |
| 430 |
MakeBoundCallback (&UlRxPduCallback, arg)); |
| 431 |
} |
| 432 |
} |
| 433 |
|
| 434 |
void |
| 435 |
RadioBearerStatsConnector::DisconnectTracesUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 436 |
{ |
| 437 |
NS_LOG_FUNCTION (this); |
| 438 |
} |
| 439 |
|
| 440 |
|
| 441 |
void |
| 442 |
RadioBearerStatsConnector::DisconnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
| 443 |
{ |
| 444 |
NS_LOG_FUNCTION (this); |
| 445 |
} |
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
} // namespace ns3 |
351 |
} // namespace ns3 |