View | Details | Raw Unified | Return to bug 3015
Collapse All | Expand All

(-)a/src/lte/helper/radio-bearer-stats-connector.cc (-236 / +138 lines)
 Lines 1-6    Link Here 
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
 Lines 15-33    Link Here 
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
 Lines 102-108    Link Here 
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
 Lines 120-274    Link Here 
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",
 Lines 277-284    Link Here 
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",
 Lines 288-449    Link Here 
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
(-)a/src/lte/helper/radio-bearer-stats-connector.h (-134 / +52 lines)
 Lines 1-6    Link Here 
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
 Lines 15-35    Link Here 
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
23
#ifndef RADIO_BEARER_STATS_CONNECTOR_H
22
#ifndef RADIO_BEARER_STATS_CONNECTOR_H
24
#define RADIO_BEARER_STATS_CONNECTOR_H
23
#define RADIO_BEARER_STATS_CONNECTOR_H
25
24
25
#include "ns3/ptr.h"
26
#include "ns3/simple-ref-count.h"
27
#include "ns3/config.h"
28
#include "ns3/traced-callback.h"
26
29
27
#include <ns3/traced-callback.h>
28
#include <ns3/config.h>
29
#include <ns3/simple-ref-count.h>
30
#include <ns3/ptr.h>
31
32
#include <set>
33
#include <map>
30
#include <map>
34
31
35
namespace ns3 {
32
namespace ns3 {
 Lines 75-82    Link Here 
75
  // trace sinks, to be used with MakeBoundCallback
72
  // trace sinks, to be used with MakeBoundCallback
76
73
77
  /**
74
  /**
75
   * Function hooked to NewUeContext trace source at eNB RRC,
76
   * which is fired upon creation of a new UE context.
77
   * It stores the UE manager path and connects the callback that will be called
78
   * when the DRB is created in the eNB.
79
   * \param c
80
   * \param context
81
   * \param cellid
82
   * \param rnti
83
   */
84
  static void NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellid, uint16_t rnti);
85
86
  /**
78
   * Function hooked to RandomAccessSuccessful trace source at UE RRC,
87
   * Function hooked to RandomAccessSuccessful trace source at UE RRC,
79
   * which is fired upon successful completion of the random access procedure
88
   * which is fired upon successful completion of the random access procedure.
89
   * It connects the callbacks for the SRB0 at the eNB and the UE.
80
   * \param c
90
   * \param c
81
   * \param context
91
   * \param context
82
   * \param imsi
92
   * \param imsi
 Lines 86-177    Link Here 
86
  static void NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
96
  static void NotifyRandomAccessSuccessfulUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
87
97
88
  /**
98
  /**
89
   * Sink connected source of UE Connection Setup trace. Not used.
99
   * Function hooked to Srb1Created trace source at UE RRC,
100
   * which is fired when SRB1 is created, i.e. RLC and PDCP are created for one LC = 1.
101
   * It connects the callbacks for the DRB at the eNB.
90
   * \param c
102
   * \param c
91
   * \param context
103
   * \param context
92
   * \param imsi
104
   * \param imsi
93
   * \param cellid
105
   * \param cellid
94
   * \param rnti
106
   * \param rnti
95
   */
107
   */
96
  static void NotifyConnectionSetupUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
108
  static void CreatedSrb1Ue (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
97
109
98
  /**
110
  /**
99
   * Function hooked to ConnectionReconfiguration trace source at UE RRC,
111
   * Function hooked to DrbCreated trace source at UE manager in eNB RRC,
100
   * which is fired upon RRC connection reconfiguration
112
   * which is fired when DRB is created, i.e. RLC and PDCP are created for LC = lcid.
113
   * It connects the callbacks for the DRB at the eNB.
101
   * \param c
114
   * \param c
102
   * \param context
115
   * \param context
103
   * \param imsi
116
   * \param imsi
104
   * \param cellid
117
   * \param cellid
105
   * \param rnti
118
   * \param rnti
119
   * \param lcid
106
   */
120
   */
107
  static void NotifyConnectionReconfigurationUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
121
  static void CreatedDrbEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid);
108
122
109
  /**
123
  /**
110
   * Function hooked to HandoverStart trace source at UE RRC,
124
   * Function hooked to DrbCreated trace source at UE RRC,
111
   * which is fired upon start of a handover procedure
125
   * which is fired when DRB is created, i.e. RLC and PDCP are created for LC = lcid.
126
   * It connects the callbacks for the DRB at the UE.
112
   * \param c
127
   * \param c
113
   * \param context
128
   * \param context
114
   * \param imsi
129
   * \param imsi
115
   * \param cellid
130
   * \param cellid
116
   * \param rnti
131
   * \param rnti
117
   * \param targetCellId
132
   * \param lcid
118
   */
133
   */
119
  static void NotifyHandoverStartUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
134
  static void CreatedDrbUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint8_t lcid);
120
135
121
  /**
122
   * Function hooked to HandoverStart trace source at UE RRC,
123
   * which is fired upon successful termination of a handover procedure
124
   * \param c
125
   * \param context
126
   * \param imsi
127
   * \param cellid
128
   * \param rnti
129
   */
130
  static void NotifyHandoverEndOkUe (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
131
132
  /**
133
   * Function hooked to NewUeContext trace source at eNB RRC,
134
   * which is fired upon creation of a new UE context
135
   * \param c
136
   * \param context
137
   * \param cellid
138
   * \param rnti
139
   */
140
  static void NotifyNewUeContextEnb (RadioBearerStatsConnector* c, std::string context, uint16_t cellid, uint16_t rnti);
141
142
  /**
143
   * Function hooked to ConnectionReconfiguration trace source at eNB RRC,
144
   * which is fired upon RRC connection reconfiguration
145
   * \param c
146
   * \param context
147
   * \param imsi
148
   * \param cellid
149
   * \param rnti
150
   */
151
  static void NotifyConnectionReconfigurationEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
152
153
  /**
154
   * Function hooked to HandoverStart trace source at eNB RRC,
155
   * which is fired upon start of a handover procedure
156
   * \param c
157
   * \param context
158
   * \param imsi
159
   * \param cellid
160
   * \param rnti
161
   * \param targetCellId
162
   */
163
  static void NotifyHandoverStartEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti, uint16_t targetCellId);
164
165
  /**
166
   * Function hooked to HandoverEndOk trace source at eNB RRC,
167
   * which is fired upon successful termination of a handover procedure
168
   * \param c
169
   * \param context
170
   * \param imsi
171
   * \param cellid
172
   * \param rnti
173
   */
174
  static void NotifyHandoverEndOkEnb (RadioBearerStatsConnector* c, std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
175
136
176
private:
137
private:
177
  /**
138
  /**
 Lines 183-272    Link Here 
183
  void StoreUeManagerPath (std::string ueManagerPath, uint16_t cellId, uint16_t rnti);
144
  void StoreUeManagerPath (std::string ueManagerPath, uint16_t cellId, uint16_t rnti);
184
145
185
  /**
146
  /**
186
   * Connects Srb0 trace sources at UE and eNB to RLC and PDCP calculators,
147
   * Connects SRB0 trace sources at UE and eNB to RLC and PDCP calculators
187
   * and Srb1 trace sources at eNB to RLC and PDCP calculators,
148
   * \param context
188
   * \param ueRrcPath
189
   * \param imsi
149
   * \param imsi
190
   * \param cellId
150
   * \param cellId
191
   * \param rnti
151
   * \param rnti
192
   */
152
   */
193
  void ConnectSrb0Traces (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti);
153
  void ConnectTracesSrb0 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
194
154
195
  /**
155
  /**
196
   * Connects Srb1 trace sources at UE to RLC and PDCP calculators
156
   * Connects SRB1 trace sources at UE and eNB to RLC and PDCP calculators
197
   * \param ueRrcPath
157
   * \param context
198
   * \param imsi
158
   * \param imsi
199
   * \param cellId
159
   * \param cellId
200
   * \param rnti
160
   * \param rnti
201
   */
161
   */
202
  void ConnectSrb1TracesUe (std::string ueRrcPath, uint64_t imsi, uint16_t cellId, uint16_t rnti);
162
  void ConnectTracesSrb1 (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti);
203
163
204
  /**
164
  /**
205
   * Connects all trace sources at UE to RLC and PDCP calculators.
165
   * Connects DRB trace sources at eNB to RLC and PDCP calculators
206
   * This function can connect traces only once for UE.
207
   * \param context
166
   * \param context
208
   * \param imsi
167
   * \param imsi
209
   * \param cellid
168
   * \param cellId
210
   * \param rnti
169
   * \param rnti
170
   * \param lcid
211
   */
171
   */
212
  void ConnectTracesUeIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
172
  void ConnectTracesDrbEnb (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid);
213
173
214
  /**
174
  /**
215
   * Connects all trace sources at eNB to RLC and PDCP calculators.
175
   * Connects DRB trace sources at UE to RLC and PDCP calculators
216
   * This function can connect traces only once for eNB.
217
   * \param context
176
   * \param context
218
   * \param imsi
177
   * \param imsi
219
   * \param cellid
178
   * \param cellId
220
   * \param rnti
179
   * \param rnti
180
   * \param lcid
221
   */
181
   */
222
  void ConnectTracesEnbIfFirstTime (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
182
  void ConnectTracesDrbUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, uint8_t lcid);
223
224
  /**
225
   * Connects all trace sources at UE to RLC and PDCP calculators.
226
   * \param context
227
   * \param imsi
228
   * \param cellid
229
   * \param rnti
230
   */
231
  void ConnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
232
233
  /**
234
   * Disconnects all trace sources at UE to RLC and PDCP calculators.
235
   * Function is not implemented.
236
   * \param context
237
   * \param imsi
238
   * \param cellid
239
   * \param rnti
240
   */
241
  void DisconnectTracesUe (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
242
243
  /**
244
   * Connects all trace sources at eNB to RLC and PDCP calculators
245
   * \param context
246
   * \param imsi
247
   * \param cellid
248
   * \param rnti
249
   */
250
  void ConnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
251
252
  /**
253
   * Disconnects all trace sources at eNB to RLC and PDCP calculators.
254
   * Function is not implemented.
255
   * \param context
256
   * \param imsi
257
   * \param cellid
258
   * \param rnti
259
   */
260
  void DisconnectTracesEnb (std::string context, uint64_t imsi, uint16_t cellid, uint16_t rnti);
261
262
183
263
  Ptr<RadioBearerStatsCalculator> m_rlcStats; //!< Calculator for RLC Statistics
184
  Ptr<RadioBearerStatsCalculator> m_rlcStats; //!< Calculator for RLC Statistics
264
  Ptr<RadioBearerStatsCalculator> m_pdcpStats; //!< Calculator for PDCP Statistics
185
  Ptr<RadioBearerStatsCalculator> m_pdcpStats; //!< Calculator for PDCP Statistics
265
186
266
  bool m_connected; //!< true if traces are connected to sinks, initially set to false
187
  bool m_connected; //!< true if traces are connected to sinks, initially set to false
267
  std::set<uint64_t> m_imsiSeenUe; //!< stores all UEs for which RLC and PDCP traces were connected
188
//   std::set<uint64_t> m_imsiSeenUe; //!< stores all UEs for which RLC and PDCP traces were connected
268
  std::set<uint64_t> m_imsiSeenEnb; //!< stores all eNBs for which RLC and PDCP traces were connected
189
//   std::set<uint64_t> m_imsiSeenEnb; //!< stores all eNBs for which RLC and PDCP traces were connected
269
  
190
270
  /**
191
  /**
271
   * Struct used as key in m_ueManagerPathByCellIdRnti map
192
   * Struct used as key in m_ueManagerPathByCellIdRnti map
272
   */
193
   */
 Lines 292-300    Link Here 
292
213
293
};
214
};
294
215
295
296
297
} // namespace ns3
216
} // namespace ns3
298
217
299
300
#endif // RADIO_BEARER_STATS_CONNECTOR_H
218
#endif // RADIO_BEARER_STATS_CONNECTOR_H
(-)a/src/lte/model/lte-enb-rrc.cc (+6 lines)
 Lines 345-350    Link Here 
345
                     "UeManager at the eNB RRC",
345
                     "UeManager at the eNB RRC",
346
                     MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace),
346
                     MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace),
347
                     "ns3::UeManager::StateTracedCallback")
347
                     "ns3::UeManager::StateTracedCallback")
348
    .AddTraceSource ("DrbCreated",
349
                     "trace fired after DRB is created",
350
                     MakeTraceSourceAccessor (&UeManager::m_drbCreatedTrace),
351
                     "ns3::UeManager::ImsiCidRntiLcIdTracedCallback")
348
  ;
352
  ;
349
  return tid;
353
  return tid;
350
}
354
}
 Lines 415-420    Link Here 
415
      drbInfo->m_pdcp = pdcp;
419
      drbInfo->m_pdcp = pdcp;
416
    }
420
    }
417
421
422
  m_drbCreatedTrace (m_imsi, m_rrc->ComponentCarrierToCellId (m_componentCarrierId), m_rnti, lcid);
423
418
  std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping = m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer (bearer, bearerId, m_rnti, lcid, m_rrc->GetLogicalChannelGroup (bearer), rlc->GetLteMacSapUser ());
424
  std::vector<LteCcmRrcSapProvider::LcsConfig> lcOnCcMapping = m_rrc->m_ccmRrcSapProvider->SetupDataRadioBearer (bearer, bearerId, m_rnti, lcid, m_rrc->GetLogicalChannelGroup (bearer), rlc->GetLteMacSapUser ());
419
  // LteEnbCmacSapProvider::LcInfo lcinfo;
425
  // LteEnbCmacSapProvider::LcInfo lcinfo;
420
  // lcinfo.rnti = m_rnti;
426
  // lcinfo.rnti = m_rnti;
(-)a/src/lte/model/lte-enb-rrc.h (+7 lines)
 Lines 519-524    Link Here 
519
   */
519
   */
520
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
520
  TracedCallback<uint64_t, uint16_t, uint16_t, State, State> m_stateTransitionTrace;
521
521
522
  /**
523
   * The `DrbCreated` trace source. Fired when DRB is created, i.e.
524
   * the RLC and PDCP entities are created for one logical channel.
525
   * Exporting IMSI, cell ID, RNTI, and LCID
526
   */
527
  TracedCallback<uint64_t, uint16_t, uint16_t, uint8_t> m_drbCreatedTrace;
528
522
  uint16_t m_sourceX2apId; ///< source X2 ap ID
529
  uint16_t m_sourceX2apId; ///< source X2 ap ID
523
  uint16_t m_sourceCellId; ///< source cell ID
530
  uint16_t m_sourceCellId; ///< source cell ID
524
  uint16_t m_targetCellId; ///< target cell ID
531
  uint16_t m_targetCellId; ///< target cell ID
(-)a/src/lte/model/lte-ue-rrc.cc (-2 / +13 lines)
 Lines 281-286    Link Here 
281
                     "trace fired after configuring secondary carriers",
281
                     "trace fired after configuring secondary carriers",
282
                     MakeTraceSourceAccessor (&LteUeRrc::m_sCarrierConfiguredTrace),
282
                     MakeTraceSourceAccessor (&LteUeRrc::m_sCarrierConfiguredTrace),
283
                     "ns3::LteUeRrc::SCarrierConfiguredTracedCallback")
283
                     "ns3::LteUeRrc::SCarrierConfiguredTracedCallback")
284
    .AddTraceSource ("Srb1Created",
285
                     "trace fired after SRB1 is created",
286
                     MakeTraceSourceAccessor (&LteUeRrc::m_srb1CreatedTrace),
287
                     "ns3::LteUeRrc::ImsiCidRntiTracedCallback")
288
    .AddTraceSource ("DrbCreated",
289
                     "trace fired after DRB is created",
290
                     MakeTraceSourceAccessor (&LteUeRrc::m_drbCreatedTrace),
291
                     "ns3::LteUeRrc::ImsiCidRntiLcIdTracedCallback")
284
  ;
292
  ;
285
  return tid;
293
  return tid;
286
}
294
}
 Lines 1339-1345    Link Here 
1339
          m_srb1->m_rlc = rlc;
1347
          m_srb1->m_rlc = rlc;
1340
          m_srb1->m_pdcp = pdcp;
1348
          m_srb1->m_pdcp = pdcp;
1341
          m_srb1->m_srbIdentity = 1;
1349
          m_srb1->m_srbIdentity = 1;
1342
          
1350
          m_srb1CreatedTrace (m_imsi, m_cellId, m_rnti);
1351
1343
          m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1352
          m_srb1->m_logicalChannelConfig.priority = stamIt->logicalChannelConfig.priority;
1344
          m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1353
          m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = stamIt->logicalChannelConfig.prioritizedBitRateKbps;
1345
          m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
1354
          m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = stamIt->logicalChannelConfig.bucketSizeDurationMs;
 Lines 1433-1439    Link Here 
1433
          m_bid2DrbidMap[dtamIt->epsBearerIdentity] = dtamIt->drbIdentity;
1442
          m_bid2DrbidMap[dtamIt->epsBearerIdentity] = dtamIt->drbIdentity;
1434
  
1443
  
1435
          m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (dtamIt->drbIdentity, drbInfo));
1444
          m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (dtamIt->drbIdentity, drbInfo));
1436
  
1445
1446
          m_drbCreatedTrace (m_imsi, m_cellId, m_rnti, dtamIt->drbIdentity);
1447
1437
1448
1438
          struct LteUeCmacSapProvider::LogicalChannelConfig lcConfig;
1449
          struct LteUeCmacSapProvider::LogicalChannelConfig lcConfig;
1439
          lcConfig.priority = dtamIt->logicalChannelConfig.priority;
1450
          lcConfig.priority = dtamIt->logicalChannelConfig.priority;
(-)a/src/lte/model/lte-ue-rrc.h (+12 lines)
 Lines 858-863    Link Here 
858
   * message.
858
   * message.
859
   */
859
   */
860
  TracedCallback<Ptr<LteUeRrc>, std::list<LteRrcSap::SCellToAddMod> > m_sCarrierConfiguredTrace;
860
  TracedCallback<Ptr<LteUeRrc>, std::list<LteRrcSap::SCellToAddMod> > m_sCarrierConfiguredTrace;
861
  /**
862
   * The `Srb1Created` trace source. Fired when SRB1 is created, i.e.
863
   * the RLC and PDCP entities are created for logical channel = 1.
864
   * Exporting IMSI, cell ID, and RNTI
865
   */
866
  TracedCallback<uint64_t, uint16_t, uint16_t> m_srb1CreatedTrace;
867
  /**
868
   * The `DrbCreated` trace source. Fired when DRB is created, i.e.
869
   * the RLC and PDCP entities are created for one logical channel.
870
   * Exporting IMSI, cell ID, RNTI, and LCID
871
   */
872
  TracedCallback<uint64_t, uint16_t, uint16_t, uint8_t> m_drbCreatedTrace;
861
873
862
  /// True if a connection request by upper layers is pending.
874
  /// True if a connection request by upper layers is pending.
863
  bool m_connectionPending;
875
  bool m_connectionPending;

Return to bug 3015