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

(-)a/src/lte/examples/lena-deactivate-bearer.cc (-1 / +1 lines)
 Lines 102-108    Link Here 
102
102
103
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
103
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
104
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
104
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
105
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
105
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
106
106
107
  NodeContainer ueNodes;
107
  NodeContainer ueNodes;
108
  NodeContainer enbNodes;
108
  NodeContainer enbNodes;
(-)a/src/lte/examples/lena-distributed-ffr.cc (-1 / +1 lines)
 Lines 158-164    Link Here 
158
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
158
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
159
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
159
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
160
  // interface 0 is localhost, 1 is the p2p device
160
  // interface 0 is localhost, 1 is the p2p device
161
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
161
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
162
162
163
  // Create Nodes: eNodeB and UE
163
  // Create Nodes: eNodeB and UE
164
  NodeContainer enbNodes;
164
  NodeContainer enbNodes;
(-)a/src/lte/examples/lena-dual-stripe.cc (-1 / +1 lines)
 Lines 671-677    Link Here 
671
671
672
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
672
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
673
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
673
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
674
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
674
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
675
675
676
      // for internetworking purposes, consider together home UEs and macro UEs
676
      // for internetworking purposes, consider together home UEs and macro UEs
677
      ues.Add (homeUes);
677
      ues.Add (homeUes);
(-)a/src/lte/examples/lena-simple-epc-emu.cc (-1 / +1 lines)
 Lines 113-119    Link Here 
113
113
114
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
114
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
115
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
115
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
116
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
116
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
117
117
118
  NodeContainer ueNodes;
118
  NodeContainer ueNodes;
119
  NodeContainer enbNodes;
119
  NodeContainer enbNodes;
(-)a/src/lte/examples/lena-simple-epc.cc (-1 / +1 lines)
 Lines 100-106    Link Here 
100
100
101
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
101
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
102
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
102
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
103
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
103
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
104
104
105
  NodeContainer ueNodes;
105
  NodeContainer ueNodes;
106
  NodeContainer enbNodes;
106
  NodeContainer enbNodes;
(-)a/src/lte/examples/lena-simple-two-epc.cc (+299 lines)
Line 0    Link Here 
1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4
 *
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
7
 * published by the Free Software Foundation;
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
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
17
 *
18
 * Author: Jaume Nin <jaume.nin@cttc.cat>
19
 *         Tommaso Pecorella <tommaso.pecorella@unifi.it>
20
 */
21
22
#include "ns3/lte-helper.h"
23
#include "ns3/epc-helper.h"
24
#include "ns3/core-module.h"
25
#include "ns3/network-module.h"
26
#include "ns3/ipv4-global-routing-helper.h"
27
#include "ns3/internet-module.h"
28
#include "ns3/mobility-module.h"
29
#include "ns3/lte-module.h"
30
#include "ns3/applications-module.h"
31
#include "ns3/csma-helper.h"
32
#include "ns3/config-store.h"
33
//#include "ns3/gtk-config-store.h"
34
35
using namespace ns3;
36
37
/**
38
 * Sample simulation script for LTE+EPC. It instantiates several eNodeB,
39
 * attaches one UE per eNodeB starts a flow for each UE to  and from a remote host.
40
 * It also  starts yet another flow between each UE pair.
41
 */
42
43
NS_LOG_COMPONENT_DEFINE ("EpcFirstExample");
44
45
int
46
main (int argc, char *argv[])
47
{
48
49
  uint16_t numberOfNodes = 2;
50
  double simTime = 1.1;
51
  double distance = 60.0;
52
  double interPacketInterval = 100;
53
  bool useCa = false;
54
55
//  LogComponentEnable ("PointToPointEpcHelper", LOG_LEVEL_ALL);
56
57
  // Command line arguments
58
  CommandLine cmd;
59
  cmd.AddValue("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes);
60
  cmd.AddValue("simTime", "Total duration of the simulation [s])", simTime);
61
  cmd.AddValue("distance", "Distance between eNBs [m]", distance);
62
  cmd.AddValue("interPacketInterval", "Inter packet interval [ms])", interPacketInterval);
63
  cmd.AddValue("useCa", "Whether to use carrier aggregation.", useCa);
64
  cmd.Parse(argc, argv);
65
66
  ConfigStore inputConfig;
67
  inputConfig.ConfigureDefaults();
68
69
  // parse again so you can override default values from the command line
70
  cmd.Parse(argc, argv);
71
72
  if (useCa)
73
    {
74
      Config::SetDefault ("ns3::LteHelper::UseCa", BooleanValue (useCa));
75
      Config::SetDefault ("ns3::LteHelper::NumberOfComponentCarriers", UintegerValue (2));
76
      Config::SetDefault ("ns3::LteHelper::EnbComponentCarrierManager", StringValue ("ns3::RrComponentCarrierManager"));
77
    }
78
79
  InternetStackHelper internet;
80
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
81
82
  // Network A
83
  Ptr<LteHelper> lteAHelper = CreateObject<LteHelper> ();
84
  Ptr<PointToPointEpcHelper>  epcAHelper = CreateObject<PointToPointEpcHelper> ();
85
  lteAHelper->SetEpcHelper (epcAHelper);
86
87
  Ptr<Node> pgwA = epcAHelper->GetPgwNode ();
88
89
  NodeContainer ueNodesA;
90
  NodeContainer enbNodesA;
91
  enbNodesA.Create(numberOfNodes);
92
  ueNodesA.Create(numberOfNodes);
93
94
  // Install Mobility Model
95
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
96
  for (uint16_t i = 0; i < numberOfNodes; i++)
97
    {
98
      positionAlloc->Add (Vector(distance * i, 0, 0));
99
    }
100
  MobilityHelper mobilityA;
101
  mobilityA.SetMobilityModel("ns3::ConstantPositionMobilityModel");
102
  mobilityA.SetPositionAllocator(positionAlloc);
103
  mobilityA.Install(enbNodesA);
104
  mobilityA.Install(ueNodesA);
105
106
  // Install LTE Devices to the nodes
107
  NetDeviceContainer enbLteADevs = lteAHelper->InstallEnbDevice (enbNodesA);
108
  NetDeviceContainer ueLteADevs = lteAHelper->InstallUeDevice (ueNodesA);
109
110
  // Install the IP stack on the UEs
111
  internet.Install (ueNodesA);
112
  Ipv4InterfaceContainer ueAIpIface;
113
  ueAIpIface = epcAHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteADevs));
114
  // Assign IP address to UEs, and install applications
115
  for (uint32_t u = 0; u < ueNodesA.GetN (); ++u)
116
    {
117
      Ptr<Node> ueNode = ueNodesA.Get (u);
118
      // Set the default gateway for the UE
119
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
120
      ueStaticRouting->SetDefaultRoute (epcAHelper->GetUeDefaultGatewayAddress (), 1);
121
    }
122
123
  // Attach one UE per eNodeB
124
  for (uint16_t i = 0; i < numberOfNodes; i++)
125
    {
126
      lteAHelper->Attach (ueLteADevs.Get(i), enbLteADevs.Get(i));
127
      // side effect: the default EPS bearer will be activated
128
    }
129
130
  // Network B
131
  Ptr<LteHelper> lteBHelper = CreateObject<LteHelper> ();
132
  lteBHelper->SetUplinkSpectrumChannel (lteAHelper->GetUplinkSpectrumChannel ());
133
  lteBHelper->SetDownlinkSpectrumChannel (lteAHelper->GetDownlinkSpectrumChannel ());
134
135
  Ptr<PointToPointEpcHelper>  epcBHelper = CreateObject<PointToPointEpcHelper> ();
136
  lteBHelper->SetEpcHelper (epcBHelper);
137
138
  Ptr<Node> pgwB = epcBHelper->GetPgwNode ();
139
140
  NodeContainer ueNodesB;
141
  NodeContainer enbNodesB;
142
  enbNodesB.Create(numberOfNodes);
143
  ueNodesB.Create(numberOfNodes);
144
145
  // Install Mobility Model
146
  Ptr<ListPositionAllocator> positionAllocB = CreateObject<ListPositionAllocator> ();
147
  for (uint16_t i = 0; i < numberOfNodes; i++)
148
    {
149
      positionAllocB->Add (Vector(distance * i, 500, 0));
150
    }
151
  MobilityHelper mobilityB;
152
  mobilityB.SetMobilityModel("ns3::ConstantPositionMobilityModel");
153
  mobilityB.SetPositionAllocator(positionAllocB);
154
  mobilityB.Install(enbNodesB);
155
  mobilityB.Install(ueNodesB);
156
157
  // Install LTE Devices to the nodes
158
  NetDeviceContainer enbLteBDevs = lteBHelper->InstallEnbDevice (enbNodesB);
159
  NetDeviceContainer ueLteBDevs = lteBHelper->InstallUeDevice (ueNodesB);
160
161
  // Install the IP stack on the UEs
162
  internet.Install (ueNodesB);
163
  Ipv4InterfaceContainer ueBIpIface;
164
  ueBIpIface = epcBHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteBDevs));
165
  // Assign IP address to UEs, and install applications
166
  for (uint32_t u = 0; u < ueNodesB.GetN (); ++u)
167
    {
168
      Ptr<Node> ueNode = ueNodesB.Get (u);
169
      // Set the default gateway for the UE
170
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
171
      ueStaticRouting->SetDefaultRoute (epcBHelper->GetUeDefaultGatewayAddress (), 1);
172
    }
173
174
  // Attach one UE per eNodeB
175
  for (uint16_t i = 0; i < numberOfNodes; i++)
176
    {
177
      lteBHelper->Attach (ueLteBDevs.Get(i), enbLteBDevs.Get(i));
178
      // side effect: the default EPS bearer will be activated
179
    }
180
181
  // Create a single RemoteHost
182
  NodeContainer remoteHostContainer;
183
  remoteHostContainer.Create (1);
184
  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
185
  internet.Install (remoteHostContainer);
186
187
  // Create the Internet
188
  CsmaHelper csma;
189
  NodeContainer internetNodes;
190
  internetNodes.Add (remoteHost);
191
  internetNodes.Add (pgwA);
192
  internetNodes.Add (pgwB);
193
194
  csma.SetDeviceAttribute ("Mtu", UintegerValue (1500));
195
  csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
196
  csma.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
197
  NetDeviceContainer internetDevices = csma.Install (internetNodes);
198
  Ipv4AddressHelper ipv4h;
199
  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
200
  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
201
  // interface 0 is localhost, 1 is the csma device
202
  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
203
204
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
205
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
206
207
208
  // Install and start applications on UEs and remote host
209
  uint16_t dlPort = 1234;
210
  uint16_t ulPort = 2000;
211
  uint16_t otherPort = 3000;
212
  ApplicationContainer clientApps;
213
  ApplicationContainer serverApps;
214
  for (uint32_t u = 0; u < ueNodesA.GetN (); ++u)
215
    {
216
      ++ulPort;
217
      ++otherPort;
218
      PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
219
      PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
220
      PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
221
      serverApps.Add (dlPacketSinkHelper.Install (ueNodesA.Get(u)));
222
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
223
      serverApps.Add (packetSinkHelper.Install (ueNodesA.Get(u)));
224
225
      UdpClientHelper dlClient (ueAIpIface.GetAddress (u), dlPort);
226
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
227
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
228
229
      UdpClientHelper ulClient (remoteHostAddr, ulPort);
230
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
231
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
232
233
      UdpClientHelper client (ueAIpIface.GetAddress (u), otherPort);
234
      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
235
      client.SetAttribute ("MaxPackets", UintegerValue(1000000));
236
237
      clientApps.Add (dlClient.Install (remoteHost));
238
      clientApps.Add (ulClient.Install (ueNodesA.Get(u)));
239
      if (u+1 < ueNodesA.GetN ())
240
        {
241
          clientApps.Add (client.Install (ueNodesA.Get(u+1)));
242
        }
243
      else
244
        {
245
          clientApps.Add (client.Install (ueNodesA.Get(0)));
246
        }
247
    }
248
  for (uint32_t u = 0; u < ueNodesB.GetN (); ++u)
249
    {
250
      ++ulPort;
251
      ++otherPort;
252
      PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
253
      PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
254
      PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
255
      serverApps.Add (dlPacketSinkHelper.Install (ueNodesB.Get(u)));
256
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
257
      serverApps.Add (packetSinkHelper.Install (ueNodesB.Get(u)));
258
259
      UdpClientHelper dlClient (ueBIpIface.GetAddress (u), dlPort);
260
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
261
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
262
263
      UdpClientHelper ulClient (remoteHostAddr, ulPort);
264
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
265
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
266
267
      UdpClientHelper client (ueBIpIface.GetAddress (u), otherPort);
268
      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
269
      client.SetAttribute ("MaxPackets", UintegerValue(1000000));
270
271
      clientApps.Add (dlClient.Install (remoteHost));
272
      clientApps.Add (ulClient.Install (ueNodesB.Get(u)));
273
      if (u+1 < ueNodesB.GetN ())
274
        {
275
          clientApps.Add (client.Install (ueNodesB.Get(u+1)));
276
        }
277
      else
278
        {
279
          clientApps.Add (client.Install (ueNodesB.Get(0)));
280
        }
281
    }
282
  serverApps.Start (Seconds (0.01));
283
  clientApps.Start (Seconds (0.01));
284
//  lteAHelper->EnableTraces ();
285
//  lteBHelper->EnableTraces ();
286
  // Uncomment to enable PCAP tracing
287
  //p2ph.EnablePcapAll("lena-epc-first");
288
289
  Simulator::Stop (Seconds (simTime));
290
  Simulator::Run ();
291
292
  /*GtkConfigStore config;
293
  config.ConfigureAttributes();*/
294
295
  Simulator::Destroy();
296
  return 0;
297
298
}
299
(-)a/src/lte/examples/lena-x2-handover-measures.cc (-1 / +1 lines)
 Lines 206-212    Link Here 
206
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
206
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
207
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
207
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
208
  // interface 0 is localhost, 1 is the p2p device
208
  // interface 0 is localhost, 1 is the p2p device
209
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
209
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
210
210
211
  /*
211
  /*
212
   * Network topology:
212
   * Network topology:
(-)a/src/lte/examples/lena-x2-handover.cc (-1 / +1 lines)
 Lines 187-193    Link Here 
187
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
187
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
188
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
188
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
189
  // interface 0 is localhost, 1 is the p2p device
189
  // interface 0 is localhost, 1 is the p2p device
190
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
190
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
191
191
192
  NodeContainer ueNodes;
192
  NodeContainer ueNodes;
193
  NodeContainer enbNodes;
193
  NodeContainer enbNodes;
(-)a/src/lte/examples/wscript (+3 lines)
 Lines 34-39    Link Here 
34
    obj = bld.create_ns3_program('lena-simple-epc',
34
    obj = bld.create_ns3_program('lena-simple-epc',
35
                                 ['lte'])
35
                                 ['lte'])
36
    obj.source = 'lena-simple-epc.cc'
36
    obj.source = 'lena-simple-epc.cc'
37
    obj = bld.create_ns3_program('lena-simple-two-epc',
38
                                 ['lte'])
39
    obj.source = 'lena-simple-two-epc.cc'
37
    obj = bld.create_ns3_program('lena-deactivate-bearer',
40
    obj = bld.create_ns3_program('lena-deactivate-bearer',
38
                                 ['lte'])
41
                                 ['lte'])
39
    obj.source = 'lena-deactivate-bearer.cc'
42
    obj.source = 'lena-deactivate-bearer.cc'
(-)a/src/lte/helper/emu-epc-helper.cc (-3 / +22 lines)
 Lines 26-31    Link Here 
26
#include <ns3/mac48-address.h>
26
#include <ns3/mac48-address.h>
27
#include <ns3/eps-bearer.h>
27
#include <ns3/eps-bearer.h>
28
#include <ns3/ipv4-address.h>
28
#include <ns3/ipv4-address.h>
29
#include <ns3/ipv4-address-generator.h>
29
#include <ns3/internet-stack-helper.h>
30
#include <ns3/internet-stack-helper.h>
30
#include <ns3/packet-socket-helper.h>
31
#include <ns3/packet-socket-helper.h>
31
#include <ns3/packet-socket-address.h>
32
#include <ns3/packet-socket-address.h>
 Lines 91-110    Link Here 
91
                   StringValue ("00:00:00:eb:00"),
92
                   StringValue ("00:00:00:eb:00"),
92
                   MakeStringAccessor (&EmuEpcHelper::m_enbMacAddressBase),
93
                   MakeStringAccessor (&EmuEpcHelper::m_enbMacAddressBase),
93
                   MakeStringChecker ())
94
                   MakeStringChecker ())
95
    .AddAttribute ("BaseIpv4Prefix",
96
                   "The 8 bit IPv4 prefix to be used for the assignment of IPv4 addresses to PGW and UE.",
97
                   Ipv4AddressValue (Ipv4Address ("7.0.0.0")),
98
                   MakeIpv4AddressAccessor (&EmuEpcHelper::m_uePgwBaseIpv4Prefix),
99
                   MakeIpv4AddressChecker ())
94
    ;
100
    ;
95
  return tid;
101
  return tid;
96
}
102
}
97
103
104
TypeId
105
EmuEpcHelper::GetInstanceTypeId () const
106
{
107
  return GetTypeId ();
108
}
109
110
98
void
111
void
99
EmuEpcHelper::DoInitialize ()
112
EmuEpcHelper::DoInitialize ()
100
{
113
{
101
  NS_LOG_LOGIC (this);   
114
  NS_LOG_LOGIC (this);   
102
115
116
  // we use a /16 bit IPv4 net for an EPC network
117
  m_uePgwCurrentIpv4Prefix = m_uePgwBaseIpv4Prefix.CombineMask (Ipv4Mask ("255.0.0.0"));  //Initialize
118
  Ipv4AddressGenerator::Init (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0"));
103
119
104
  // we use a /8 net for all UEs
120
  while (!Ipv4AddressGenerator::IsNetworkAllocated (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0")))
105
  m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0");
121
    {
122
      m_uePgwCurrentIpv4Prefix = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0"));
123
    }
106
124
107
  
125
  m_ueAddressHelper.SetBase (m_uePgwCurrentIpv4Prefix, "255.255.0.0"); //The helper will assign IPv4 addresses using this 16 bit prefix
126
  //Now we get an unique 16 bit IPv4 prefix for this EPC, which not used by any other EPC
108
 
127
 
109
  // create SgwPgwNode
128
  // create SgwPgwNode
110
  m_sgwPgw = CreateObject<Node> ();
129
  m_sgwPgw = CreateObject<Node> ();
(-)a/src/lte/helper/emu-epc-helper.h (+22 lines)
 Lines 70-78    Link Here 
70
   *  \return The object TypeId.
70
   *  \return The object TypeId.
71
   */
71
   */
72
  static TypeId GetTypeId (void);
72
  static TypeId GetTypeId (void);
73
  TypeId GetInstanceTypeId () const;
73
  virtual void DoInitialize ();
74
  virtual void DoInitialize ();
74
  virtual void DoDispose ();
75
  virtual void DoDispose ();
75
76
77
  /**
78
   * Get the IPv4 network address used by the EPC.
79
   * The EPC will use a /16 network address.
80
   *
81
   * \returns The EPC IPv4 network address.
82
   */
83
  Ipv4Address GetEpcIpv4NetworkAddress ();
84
76
  // inherited from EpcHelper
85
  // inherited from EpcHelper
77
  virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
86
  virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
78
  virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
87
  virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
 Lines 92-97    Link Here 
92
  Ipv4AddressHelper m_ueAddressHelper; 
101
  Ipv4AddressHelper m_ueAddressHelper; 
93
102
94
  /**
103
  /**
104
   * The common 8 bit prefix used for the IPv4 address assignment of
105
   * all the EPC networks
106
   */
107
  Ipv4Address m_uePgwBaseIpv4Prefix;
108
109
  /**
110
   * The 16 bit prefix used for the IPv4 address assignment of
111
   * the UE and PGW.
112
   * The current IPv4 prefix will be the first available one in the /8 pool.
113
   */
114
  Ipv4Address m_uePgwCurrentIpv4Prefix;
115
116
  /**
95
   * SGW-PGW network element
117
   * SGW-PGW network element
96
   */  
118
   */  
97
  Ptr<Node> m_sgwPgw; 
119
  Ptr<Node> m_sgwPgw; 
(-)a/src/lte/helper/lte-helper.cc (-27 / +111 lines)
 Lines 71-84    Link Here 
71
71
72
namespace ns3 {
72
namespace ns3 {
73
73
74
uint64_t LteHelper::m_imsiCounter = 0;
75
uint16_t LteHelper::m_cellIdCounter = 1;
76
74
NS_LOG_COMPONENT_DEFINE ("LteHelper");
77
NS_LOG_COMPONENT_DEFINE ("LteHelper");
75
78
76
NS_OBJECT_ENSURE_REGISTERED (LteHelper);
79
NS_OBJECT_ENSURE_REGISTERED (LteHelper);
77
80
78
LteHelper::LteHelper (void)
81
LteHelper::LteHelper (void)
79
  : m_fadingStreamsAssigned (false),
82
  : m_fadingStreamsAssigned (false)
80
    m_imsiCounter (0),
81
    m_cellIdCounter {1}
82
{
83
{
83
  NS_LOG_FUNCTION (this);
84
  NS_LOG_FUNCTION (this);
84
  m_enbNetDeviceFactory.SetTypeId (LteEnbNetDevice::GetTypeId ());
85
  m_enbNetDeviceFactory.SetTypeId (LteEnbNetDevice::GetTypeId ());
 Lines 86-91    Link Here 
86
  m_ueNetDeviceFactory.SetTypeId (LteUeNetDevice::GetTypeId ());
87
  m_ueNetDeviceFactory.SetTypeId (LteUeNetDevice::GetTypeId ());
87
  m_ueAntennaModelFactory.SetTypeId (IsotropicAntennaModel::GetTypeId ());
88
  m_ueAntennaModelFactory.SetTypeId (IsotropicAntennaModel::GetTypeId ());
88
  m_channelFactory.SetTypeId (MultiModelSpectrumChannel::GetTypeId ());
89
  m_channelFactory.SetTypeId (MultiModelSpectrumChannel::GetTypeId ());
90
  m_downlinkChannel = 0;
91
  m_uplinkChannel = 0;
92
89
}
93
}
90
94
91
void 
95
void 
 Lines 98-104    Link Here 
98
  m_phyRxStats = CreateObject<PhyRxStatsCalculator> ();
102
  m_phyRxStats = CreateObject<PhyRxStatsCalculator> ();
99
  m_macStats = CreateObject<MacStatsCalculator> ();
103
  m_macStats = CreateObject<MacStatsCalculator> ();
100
  Object::DoInitialize ();
104
  Object::DoInitialize ();
101
102
}
105
}
103
106
104
LteHelper::~LteHelper (void)
107
LteHelper::~LteHelper (void)
 Lines 224-237    Link Here 
224
}
227
}
225
228
226
void
229
void
230
LteHelper::SetUplinkSpectrumChannel (Ptr<SpectrumChannel> ulChannel)
231
{
232
  m_uplinkChannel = ulChannel;
233
}
234
235
void
236
LteHelper::SetDownlinkSpectrumChannel (Ptr<SpectrumChannel> dlChannel)
237
{
238
  m_downlinkChannel = dlChannel;
239
}
240
241
void
227
LteHelper::ChannelModelInitialization (void)
242
LteHelper::ChannelModelInitialization (void)
228
{
243
{
229
  // Channel Object (i.e. Ptr<SpectrumChannel>) are within a vector
244
  // Channel Object (i.e. Ptr<SpectrumChannel>) are within a vector
230
  // PathLossModel Objects are vectors --> in InstallSingleEnb we will set the frequency
245
  // PathLossModel Objects are vectors --> in InstallSingleEnb we will set the frequency
231
  NS_LOG_FUNCTION (this << m_noOfCcs);
246
  NS_LOG_FUNCTION (this << m_noOfCcs);
232
247
233
  m_downlinkChannel = m_channelFactory.Create<SpectrumChannel> ();
248
  if (m_downlinkChannel == 0)
234
  m_uplinkChannel = m_channelFactory.Create<SpectrumChannel> ();
249
    {
250
      m_downlinkChannel = m_channelFactory.Create<SpectrumChannel> ();
251
    }
252
  if (m_uplinkChannel == 0)
253
    {
254
      m_uplinkChannel = m_channelFactory.Create<SpectrumChannel> ();
255
    }
235
256
236
  m_downlinkPathlossModel = m_pathlossModelFactory.Create ();
257
  m_downlinkPathlossModel = m_pathlossModelFactory.Create ();
237
  Ptr<SpectrumPropagationLossModel> dlSplm = m_downlinkPathlossModel->GetObject<SpectrumPropagationLossModel> ();
258
  Ptr<SpectrumPropagationLossModel> dlSplm = m_downlinkPathlossModel->GetObject<SpectrumPropagationLossModel> ();
 Lines 756-761    Link Here 
756
      rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
777
      rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
757
    }
778
    }
758
779
780
  m_enbNetDevices.push_back (dev);
759
  return dev;
781
  return dev;
760
}
782
}
761
783
 Lines 935-940    Link Here 
935
957
936
  dev->Initialize ();
958
  dev->Initialize ();
937
959
960
  m_ueNetDevices.push_back (dev);
938
  return dev;
961
  return dev;
939
}
962
}
940
963
 Lines 1351-1357    Link Here 
1351
{
1374
{
1352
  NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once");
1375
  NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once");
1353
  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
1376
  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
1354
  m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats);
1377
  m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats, m_ueNetDevices, m_enbNetDevices);
1355
}
1378
}
1356
1379
1357
int64_t
1380
int64_t
 Lines 1414-1442    Link Here 
1414
void
1437
void
1415
LteHelper::EnableDlTxPhyTraces (void)
1438
LteHelper::EnableDlTxPhyTraces (void)
1416
{
1439
{
1417
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission",
1440
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1418
                   MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats));
1441
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1442
    {
1443
      std::ostringstream path;
1444
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1445
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1446
           << "/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission";
1447
      Config::Connect (path.str (),
1448
                       MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats));
1449
    }
1419
}
1450
}
1420
1451
1421
void
1452
void
1422
LteHelper::EnableUlTxPhyTraces (void)
1453
LteHelper::EnableUlTxPhyTraces (void)
1423
{
1454
{
1424
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission",
1455
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1425
                   MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats));
1456
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1457
    {
1458
      std::ostringstream path;
1459
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1460
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1461
           << "/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission";
1462
      Config::Connect (path.str (),
1463
                       MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats));
1464
    }
1426
}
1465
}
1427
1466
1428
void
1467
void
1429
LteHelper::EnableDlRxPhyTraces (void)
1468
LteHelper::EnableDlRxPhyTraces (void)
1430
{
1469
{
1431
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception",
1470
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1432
                   MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats));
1471
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1472
    {
1473
      std::ostringstream path;
1474
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1475
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1476
           << "/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception";
1477
      Config::Connect (path.str (),
1478
                       MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats));
1479
    }
1433
}
1480
}
1434
1481
1435
void
1482
void
1436
LteHelper::EnableUlRxPhyTraces (void)
1483
LteHelper::EnableUlRxPhyTraces (void)
1437
{
1484
{
1438
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception",
1485
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1439
                   MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats));
1486
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1487
    {
1488
      std::ostringstream path;
1489
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1490
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1491
           << "/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception";
1492
      Config::Connect (path.str (),
1493
                       MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats));
1494
    }
1440
}
1495
}
1441
1496
1442
1497
 Lines 1452-1486    Link Here 
1452
LteHelper::EnableDlMacTraces (void)
1507
LteHelper::EnableDlMacTraces (void)
1453
{
1508
{
1454
  NS_LOG_FUNCTION_NOARGS ();
1509
  NS_LOG_FUNCTION_NOARGS ();
1455
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
1510
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1456
                   MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats));
1511
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1512
    {
1513
      std::ostringstream path;
1514
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1515
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1516
           << "/ComponentCarrierMap/*/LteEnbMac/DlScheduling";
1517
      Config::Connect (path.str (),
1518
                       MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats));
1519
    }
1457
}
1520
}
1458
1521
1459
void
1522
void
1460
LteHelper::EnableUlMacTraces (void)
1523
LteHelper::EnableUlMacTraces (void)
1461
{
1524
{
1462
  NS_LOG_FUNCTION_NOARGS ();
1525
  NS_LOG_FUNCTION_NOARGS ();
1463
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
1526
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1464
                   MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats));
1527
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1528
    {
1529
      std::ostringstream path;
1530
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1531
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1532
           << "/ComponentCarrierMap/*/LteEnbMac/UlScheduling";
1533
      Config::Connect (path.str (),
1534
                       MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats));
1535
    }
1465
}
1536
}
1466
1537
1467
void
1538
void
1468
LteHelper::EnableDlPhyTraces (void)
1539
LteHelper::EnableDlPhyTraces (void)
1469
{
1540
{
1470
  NS_LOG_FUNCTION_NOARGS ();
1541
  NS_LOG_FUNCTION_NOARGS ();
1471
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",
1542
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1472
                   MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats));
1543
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1544
    {
1545
      std::ostringstream path;
1546
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1547
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1548
           << "/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr";
1549
      Config::Connect (path.str (),
1550
                       MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats));
1551
    }
1473
}
1552
}
1474
1553
1475
void
1554
void
1476
LteHelper::EnableUlPhyTraces (void)
1555
LteHelper::EnableUlPhyTraces (void)
1477
{
1556
{
1478
  NS_LOG_FUNCTION_NOARGS ();
1557
  NS_LOG_FUNCTION_NOARGS ();
1479
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1558
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1480
                   MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats));
1559
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1481
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1560
    {
1482
                   MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats));
1561
      std::string basePath;
1483
1562
      basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ());
1563
      Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1564
                       MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats));
1565
      Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1566
                       MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats));
1567
    }
1484
}
1568
}
1485
1569
1486
Ptr<RadioBearerStatsCalculator>
1570
Ptr<RadioBearerStatsCalculator>
 Lines 1494-1500    Link Here 
1494
{
1578
{
1495
  NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once");
1579
  NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once");
1496
  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
1580
  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
1497
  m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats);
1581
  m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats, m_ueNetDevices, m_enbNetDevices);
1498
}
1582
}
1499
1583
1500
Ptr<RadioBearerStatsCalculator>
1584
Ptr<RadioBearerStatsCalculator>
(-)a/src/lte/helper/lte-helper.h (-2 / +28 lines)
 Lines 42-47    Link Here 
42
#include <ns3/component-carrier-enb.h>
42
#include <ns3/component-carrier-enb.h>
43
#include <ns3/cc-helper.h>
43
#include <ns3/cc-helper.h>
44
#include <map>
44
#include <map>
45
#include <list>
45
46
46
namespace ns3 {
47
namespace ns3 {
47
48
 Lines 52-57    Link Here 
52
class EpcHelper;
53
class EpcHelper;
53
class PropagationLossModel;
54
class PropagationLossModel;
54
class SpectrumPropagationLossModel;
55
class SpectrumPropagationLossModel;
56
class LteUeNetDevice;
57
55
58
56
/**
59
/**
57
 * \ingroup lte
60
 * \ingroup lte
 Lines 677-682    Link Here 
677
   */
680
   */
678
  Ptr<SpectrumChannel> GetDownlinkSpectrumChannel (void) const;
681
  Ptr<SpectrumChannel> GetDownlinkSpectrumChannel (void) const;
679
682
683
  /**
684
   * Set the SpectrumChannel instance used for the uplink
685
   * \param ulChannel a pointer to the SpectrumChannel instance used for the uplink
686
   */
687
  void SetUplinkSpectrumChannel (Ptr<SpectrumChannel> ulChannel);
688
689
690
  /**
691
   * Set the SpectrumChannel instance used for the downlink
692
   * \param dlChannel a pointer to the SpectrumChannel instance used for the downlink
693
   */
694
  void SetDownlinkSpectrumChannel (Ptr<SpectrumChannel> dlChannel);
695
680
696
681
protected:
697
protected:
682
  // inherited from Object
698
  // inherited from Object
 Lines 812-824    Link Here 
812
   * new UE is installed (by InstallSingleUeDevice()). The first UE will have
828
   * new UE is installed (by InstallSingleUeDevice()). The first UE will have
813
   * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9).
829
   * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9).
814
   */
830
   */
815
  uint64_t m_imsiCounter;
831
  static uint64_t m_imsiCounter;
816
  /**
832
  /**
817
   * Keep track of the number of cell ID allocated. Increases by one every time
833
   * Keep track of the number of cell ID allocated. Increases by one every time
818
   * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB
834
   * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB
819
   * will have a cell ID of 1. The maximum number of eNodeB is 65535.
835
   * will have a cell ID of 1. The maximum number of eNodeB is 65535.
820
   */
836
   */
821
  uint16_t m_cellIdCounter;
837
  static uint16_t m_cellIdCounter;
822
838
823
  /**
839
  /**
824
   * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for
840
   * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for
 Lines 855-860    Link Here 
855
   */
871
   */
856
  uint16_t m_noOfCcs;
872
  uint16_t m_noOfCcs;
857
873
874
  /**
875
   * List of the UEs installed by this helper
876
   */
877
  std::list<Ptr<LteUeNetDevice> > m_ueNetDevices;
878
879
  /**
880
   * List of the eNB installed by this helper
881
   */
882
  std::list<Ptr<LteEnbNetDevice> > m_enbNetDevices;
883
858
};   // end of `class LteHelper`
884
};   // end of `class LteHelper`
859
885
860
886
(-)a/src/lte/helper/point-to-point-epc-helper.cc (-13 / +46 lines)
 Lines 18-23    Link Here 
18
 * Author: Jaume Nin <jnin@cttc.es>
18
 * Author: Jaume Nin <jnin@cttc.es>
19
 *         Nicola Baldo <nbaldo@cttc.es>
19
 *         Nicola Baldo <nbaldo@cttc.es>
20
 *         Manuel Requena <manuel.requena@cttc.es>
20
 *         Manuel Requena <manuel.requena@cttc.es>
21
 *         Manoj Kumar Rana <manoj24.rana@gmail.com>
21
 */
22
 */
22
23
23
#include <ns3/point-to-point-epc-helper.h>
24
#include <ns3/point-to-point-epc-helper.h>
 Lines 26-31    Link Here 
26
#include <ns3/mac48-address.h>
27
#include <ns3/mac48-address.h>
27
#include <ns3/eps-bearer.h>
28
#include <ns3/eps-bearer.h>
28
#include <ns3/ipv4-address.h>
29
#include <ns3/ipv4-address.h>
30
#include <ns3/ipv4-address-generator.h>
29
#include <ns3/internet-stack-helper.h>
31
#include <ns3/internet-stack-helper.h>
30
#include <ns3/point-to-point-helper.h>
32
#include <ns3/point-to-point-helper.h>
31
#include <ns3/packet-socket-helper.h>
33
#include <ns3/packet-socket-helper.h>
 Lines 52-67    Link Here 
52
{
54
{
53
  NS_LOG_FUNCTION (this);
55
  NS_LOG_FUNCTION (this);
54
56
57
  // To access the attribute value within the constructor
58
  ObjectBase::ConstructSelf (AttributeConstructionList ());
59
55
  // since we use point-to-point links for all S1-U links, 
60
  // since we use point-to-point links for all S1-U links, 
56
  // we use a /30 subnet which can hold exactly two addresses 
61
  // we use a /30 subnet which can hold exactly two addresses 
57
  // (remember that net broadcast and null address are not valid)
62
  // (remember that net broadcast and null address are not valid)
58
  m_s1uIpv4AddressHelper.SetBase ("10.0.0.0", "255.255.255.252");
63
  Ipv4Address s1uIpv4AddressNet = Ipv4Address ("10.0.0.0");
59
64
  Ipv4AddressGenerator::Init (s1uIpv4AddressNet, Ipv4Mask ("255.255.0.0"));
60
  m_x2Ipv4AddressHelper.SetBase ("12.0.0.0", "255.255.255.252");
65
  while (!Ipv4AddressGenerator::IsNetworkAllocated (s1uIpv4AddressNet, Ipv4Mask ("255.255.0.0")))
66
    {
67
      s1uIpv4AddressNet = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0"));
68
    }
69
  m_s1uIpv4AddressHelper.SetBase (s1uIpv4AddressNet, "255.255.255.252");
61
70
62
  // we use a /8 net for all UEs
71
  Ipv4Address x2Ipv4AddressNet = Ipv4Address ("12.0.0.0");
63
  m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0");
72
  Ipv4AddressGenerator::Init (x2Ipv4AddressNet, Ipv4Mask ("255.255.0.0"));
64
  
73
  while (!Ipv4AddressGenerator::IsNetworkAllocated (x2Ipv4AddressNet, Ipv4Mask ("255.255.0.0")))
74
    {
75
      x2Ipv4AddressNet = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0"));
76
    }
77
  m_x2Ipv4AddressHelper.SetBase (x2Ipv4AddressNet, "255.255.255.252");
78
79
  // we use a /16 bit IPv4 net for an EPC network
80
  m_uePgwCurrentIpv4Prefix = m_uePgwBaseIpv4Prefix.CombineMask (Ipv4Mask ("255.0.0.0"));  //Initialize
81
  Ipv4AddressGenerator::Init (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0"));
82
83
  while (!Ipv4AddressGenerator::IsNetworkAllocated (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0")))
84
    {
85
      m_uePgwCurrentIpv4Prefix = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0"));
86
    }
87
88
  m_ueAddressHelper.SetBase (m_uePgwCurrentIpv4Prefix, "255.255.0.0"); //The helper will assign IPv4 addresses using this 16 bit prefix
89
  //Now we get an unique 16 bit IPv4 prefix for this EPC, which not used by any other EPC
90
65
  // create SgwPgwNode
91
  // create SgwPgwNode
66
  m_sgwPgw = CreateObject<Node> ();
92
  m_sgwPgw = CreateObject<Node> ();
67
  InternetStackHelper internet;
93
  InternetStackHelper internet;
 Lines 144-153    Link Here 
144
                   UintegerValue (3000),
170
                   UintegerValue (3000),
145
                   MakeUintegerAccessor (&PointToPointEpcHelper::m_x2LinkMtu),
171
                   MakeUintegerAccessor (&PointToPointEpcHelper::m_x2LinkMtu),
146
                   MakeUintegerChecker<uint16_t> ())
172
                   MakeUintegerChecker<uint16_t> ())
147
  ;
173
     .AddAttribute ("BaseIpv4Prefix",
174
                    "The 8 bit IPv4 prefix to be used for the assignment of IPv4 addresses to PGW and UE.",
175
                    Ipv4AddressValue (Ipv4Address ("7.0.0.0")),
176
                    MakeIpv4AddressAccessor (&PointToPointEpcHelper::m_uePgwBaseIpv4Prefix),
177
                    MakeIpv4AddressChecker ())
178
 ;
148
  return tid;
179
  return tid;
149
}
180
}
150
181
182
TypeId
183
PointToPointEpcHelper::GetInstanceTypeId () const
184
{
185
  return GetTypeId ();
186
}
187
151
void
188
void
152
PointToPointEpcHelper::DoDispose ()
189
PointToPointEpcHelper::DoDispose ()
153
{
190
{
 Lines 184-191    Link Here 
184
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());  
221
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());  
185
  Ptr<NetDevice> enbDev = enbSgwDevices.Get (0);
222
  Ptr<NetDevice> enbDev = enbSgwDevices.Get (0);
186
  Ptr<NetDevice> sgwDev = enbSgwDevices.Get (1);
223
  Ptr<NetDevice> sgwDev = enbSgwDevices.Get (1);
224
  Ipv4InterfaceContainer enbSgwIpIfaces = m_s1uIpv4AddressHelper.Assign (enbSgwDevices);
187
  m_s1uIpv4AddressHelper.NewNetwork ();
225
  m_s1uIpv4AddressHelper.NewNetwork ();
188
  Ipv4InterfaceContainer enbSgwIpIfaces = m_s1uIpv4AddressHelper.Assign (enbSgwDevices);
189
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after assigning Ipv4 addr to S1 dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
226
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after assigning Ipv4 addr to S1 dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
190
  
227
  
191
  Ipv4Address enbAddress = enbSgwIpIfaces.GetAddress (0);
228
  Ipv4Address enbAddress = enbSgwIpIfaces.GetAddress (0);
 Lines 255-262    Link Here 
255
  Ptr<NetDevice> enb1Dev = enbDevices.Get (0);
292
  Ptr<NetDevice> enb1Dev = enbDevices.Get (0);
256
  Ptr<NetDevice> enb2Dev = enbDevices.Get (1);
293
  Ptr<NetDevice> enb2Dev = enbDevices.Get (1);
257
294
295
  Ipv4InterfaceContainer enbIpIfaces = m_x2Ipv4AddressHelper.Assign (enbDevices);
258
  m_x2Ipv4AddressHelper.NewNetwork ();
296
  m_x2Ipv4AddressHelper.NewNetwork ();
259
  Ipv4InterfaceContainer enbIpIfaces = m_x2Ipv4AddressHelper.Assign (enbDevices);
260
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after assigning Ipv4 addr to X2 dev: " << enb1->GetObject<Ipv4> ()->GetNInterfaces ());
297
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after assigning Ipv4 addr to X2 dev: " << enb1->GetObject<Ipv4> ()->GetNInterfaces ());
261
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
298
  NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
262
299
 Lines 319-340    Link Here 
319
  return bearerId;
356
  return bearerId;
320
}
357
}
321
358
322
323
Ptr<Node>
359
Ptr<Node>
324
PointToPointEpcHelper::GetPgwNode ()
360
PointToPointEpcHelper::GetPgwNode ()
325
{
361
{
326
  return m_sgwPgw;
362
  return m_sgwPgw;
327
}
363
}
328
364
329
330
Ipv4InterfaceContainer 
365
Ipv4InterfaceContainer 
331
PointToPointEpcHelper::AssignUeIpv4Address (NetDeviceContainer ueDevices)
366
PointToPointEpcHelper::AssignUeIpv4Address (NetDeviceContainer ueDevices)
332
{
367
{
333
  return m_ueAddressHelper.Assign (ueDevices);
368
  return m_ueAddressHelper.Assign (ueDevices);
334
}
369
}
335
370
336
337
338
Ipv4Address
371
Ipv4Address
339
PointToPointEpcHelper::GetUeDefaultGatewayAddress ()
372
PointToPointEpcHelper::GetUeDefaultGatewayAddress ()
340
{
373
{
(-)a/src/lte/helper/point-to-point-epc-helper.h (-1 / +24 lines)
 Lines 18-23    Link Here 
18
 * Author: Jaume Nin <jnin@cttc.es>
18
 * Author: Jaume Nin <jnin@cttc.es>
19
 *         Nicola Baldo <nbaldo@cttc.es>
19
 *         Nicola Baldo <nbaldo@cttc.es>
20
 *         Manuel Requena <manuel.requena@cttc.es>
20
 *         Manuel Requena <manuel.requena@cttc.es>
21
 *         Manoj Kumar Rana <manoj24.rana@gmail.com>
21
 */
22
 */
22
23
23
#ifndef POINT_TO_POINT_EPC_HELPER_H
24
#ifndef POINT_TO_POINT_EPC_HELPER_H
 Lines 68-75    Link Here 
68
   *  \return The object TypeId.
69
   *  \return The object TypeId.
69
   */
70
   */
70
  static TypeId GetTypeId (void);
71
  static TypeId GetTypeId (void);
72
  TypeId GetInstanceTypeId () const;
71
  virtual void DoDispose ();
73
  virtual void DoDispose ();
72
74
75
  /**
76
   * Get the IPv4 network address used by the EPC.
77
   * The EPC will use a /16 network address.
78
   *
79
   * \returns The EPC IPv4 network address.
80
   */
81
  Ipv4Address GetEpcIpv4NetworkAddress ();
82
73
  // inherited from EpcHelper
83
  // inherited from EpcHelper
74
  virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
84
  virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
75
  virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
85
  virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
 Lines 84-94    Link Here 
84
private:
94
private:
85
95
86
  /** 
96
  /** 
87
   * helper to assign addresses to UE devices as well as to the TUN device of the SGW/PGW
97
   * helper to assign IPv4 addresses to UE devices as well as to the TUN device of the SGW/PGW
88
   */
98
   */
89
  Ipv4AddressHelper m_ueAddressHelper; 
99
  Ipv4AddressHelper m_ueAddressHelper; 
90
  
100
  
91
  /**
101
  /**
102
   * The common 8 bit prefix used for the IPv4 address assignment of
103
   * all the EPC networks
104
   */
105
  Ipv4Address m_uePgwBaseIpv4Prefix;
106
107
  /**
108
   * The 16 bit prefix used for the IPv4 address assignment of
109
   * the UE and PGW.
110
   * The current IPv4 prefix will be the first available one in the /8 pool.
111
   */
112
  Ipv4Address m_uePgwCurrentIpv4Prefix;
113
114
  /**
92
   * SGW-PGW network element
115
   * SGW-PGW network element
93
   */
116
   */
94
  Ptr<Node> m_sgwPgw; 
117
  Ptr<Node> m_sgwPgw; 
(-)a/src/lte/helper/radio-bearer-stats-connector.cc (-21 / +42 lines)
 Lines 28-33    Link Here 
28
#include <ns3/lte-enb-net-device.h>
28
#include <ns3/lte-enb-net-device.h>
29
#include <ns3/lte-ue-rrc.h>
29
#include <ns3/lte-ue-rrc.h>
30
#include <ns3/lte-ue-net-device.h>
30
#include <ns3/lte-ue-net-device.h>
31
#include <ns3/node.h>
32
#include <string>
31
33
32
namespace ns3 {
34
namespace ns3 {
33
35
 Lines 132-172    Link Here 
132
}
134
}
133
135
134
void 
136
void 
135
RadioBearerStatsConnector::EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats)
137
RadioBearerStatsConnector::EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats,
138
                                           std::list<Ptr<LteUeNetDevice> > ueNetDevices,
139
                                           std::list<Ptr<LteEnbNetDevice> > enbNetDevices)
136
{
140
{
137
  m_rlcStats = rlcStats;
141
  m_rlcStats = rlcStats;
138
  EnsureConnected ();
142
  EnsureConnected (ueNetDevices, enbNetDevices);
139
}
143
}
140
144
141
void 
145
void 
142
RadioBearerStatsConnector::EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats)
146
RadioBearerStatsConnector::EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats,
147
                                            std::list<Ptr<LteUeNetDevice> > ueNetDevices,
148
                                            std::list<Ptr<LteEnbNetDevice> > enbNetDevices)
143
{
149
{
144
  m_pdcpStats = pdcpStats;
150
  m_pdcpStats = pdcpStats;
145
  EnsureConnected ();
151
  EnsureConnected (ueNetDevices, enbNetDevices);
146
}
152
}
147
153
148
void 
154
void 
149
RadioBearerStatsConnector::EnsureConnected ()
155
RadioBearerStatsConnector::EnsureConnected (std::list<Ptr<LteUeNetDevice> > ueNetDevices,
156
                                            std::list<Ptr<LteEnbNetDevice> > enbNetDevices)
150
{
157
{
151
  NS_LOG_FUNCTION (this);
158
  NS_LOG_FUNCTION (this);
152
  if (!m_connected)
159
  if (!m_connected)
153
    {
160
    {
154
      Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/NewUeContext",
161
      for (std::list<Ptr<LteEnbNetDevice> >::iterator iter = enbNetDevices.begin ();
155
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this));
162
          iter != enbNetDevices.end ();
156
      Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful",
163
          iter ++)
157
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this));
164
        {
158
      Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionReconfiguration",
165
          std::string basePath;
159
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this));
166
          basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ());
160
      Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionReconfiguration",
167
          Config::Connect (basePath + "/LteEnbRrc/NewUeContext",
161
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationUe, this));
168
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this));
162
      Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverStart",
169
          Config::Connect (basePath + "/LteEnbRrc/ConnectionReconfiguration",
163
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartEnb, this));
170
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this));
164
      Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverStart",
171
          Config::Connect (basePath + "/LteEnbRrc/HandoverStart",
165
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartUe, this));
172
                            MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartEnb, this));
166
      Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverEndOk",
173
          Config::Connect (basePath + "/LteEnbRrc/HandoverEndOk",
167
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this));
174
                            MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this));
168
      Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverEndOk",
175
         }
169
		       MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this));
176
      for (std::list<Ptr<LteUeNetDevice> >::iterator iter = ueNetDevices.begin ();
177
          iter != ueNetDevices.end ();
178
          iter ++)
179
        {
180
          std::string basePath;
181
          basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ());
182
          Config::Connect (basePath + "/LteUeRrc/RandomAccessSuccessful",
183
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this));
184
          Config::Connect (basePath + "/LteUeRrc/ConnectionReconfiguration",
185
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationUe, this));
186
          Config::Connect (basePath + "/LteUeRrc/HandoverStart",
187
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartUe, this));
188
          Config::Connect (basePath + "/LteUeRrc/HandoverEndOk",
189
                           MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this));
190
         }
170
      m_connected = true;
191
      m_connected = true;
171
    }
192
    }
172
}
193
}
(-)a/src/lte/helper/radio-bearer-stats-connector.h (-4 / +16 lines)
 Lines 35-40    Link Here 
35
namespace ns3 {
35
namespace ns3 {
36
36
37
class RadioBearerStatsCalculator;
37
class RadioBearerStatsCalculator;
38
class LteUeNetDevice;
39
class LteEnbNetDevice;
38
40
39
/**
41
/**
40
 * \ingroup lte
42
 * \ingroup lte
 Lines 57-76    Link Here 
57
   * Enables trace sinks for RLC layer. Usually, this function
59
   * Enables trace sinks for RLC layer. Usually, this function
58
   * is called by LteHelper::EnableRlcTraces().
60
   * is called by LteHelper::EnableRlcTraces().
59
   * \param rlcStats statistics calculator for RLC layer
61
   * \param rlcStats statistics calculator for RLC layer
62
   * \param ueNetDevices list of the UE to connect
63
   * \param enbNetDevices list of the eNB to connect
60
   */
64
   */
61
  void EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats);
65
  void EnableRlcStats (Ptr<RadioBearerStatsCalculator> rlcStats,
62
66
                       std::list<Ptr<LteUeNetDevice> > ueNetDevices,
67
                       std::list<Ptr<LteEnbNetDevice> > enbNetDevices);
63
  /**
68
  /**
64
   * Enables trace sinks for PDCP layer. Usually, this function
69
   * Enables trace sinks for PDCP layer. Usually, this function
65
   * is called by LteHelper::EnablePdcpTraces().
70
   * is called by LteHelper::EnablePdcpTraces().
66
   * \param pdcpStats statistics calculator for PDCP layer
71
   * \param pdcpStats statistics calculator for PDCP layer
72
   * \param ueNetDevices list of the UE to connect
73
   * \param enbNetDevices list of the eNB to connect
67
   */
74
   */
68
  void EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats);
75
  void EnablePdcpStats (Ptr<RadioBearerStatsCalculator> pdcpStats,
76
                        std::list<Ptr<LteUeNetDevice> > ueNetDevices,
77
                        std::list<Ptr<LteEnbNetDevice> > enbNetDevices);
69
78
70
  /**
79
  /**
71
   * Connects trace sinks to appropriate trace sources
80
   * Connects trace sinks to appropriate trace sources
81
   * \param ueNetDevices list of the UE to connect
82
   * \param enbNetDevices list of the eNB to connect
72
   */
83
   */
73
  void EnsureConnected ();
84
  void EnsureConnected (std::list<Ptr<LteUeNetDevice> > ueNetDevices,
85
                        std::list<Ptr<LteEnbNetDevice> > enbNetDevices);
74
86
75
  // trace sinks, to be used with MakeBoundCallback
87
  // trace sinks, to be used with MakeBoundCallback
76
88
(-)a/src/lte/model/lte-enb-rrc.cc (+2 lines)
 Lines 857-862    Link Here 
857
UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg)
857
UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg)
858
{
858
{
859
  NS_LOG_FUNCTION (this);
859
  NS_LOG_FUNCTION (this);
860
860
  switch (m_state)
861
  switch (m_state)
861
    {
862
    {
862
    case INITIAL_RANDOM_ACCESS:
863
    case INITIAL_RANDOM_ACCESS:
 Lines 910-915    Link Here 
910
UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg)
911
UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg)
911
{
912
{
912
  NS_LOG_FUNCTION (this);
913
  NS_LOG_FUNCTION (this);
914
913
  switch (m_state)
915
  switch (m_state)
914
    {
916
    {
915
    case CONNECTION_SETUP:
917
    case CONNECTION_SETUP:
(-)a/src/lte/test/epc-test-s1u-downlink.cc (-1 / +1 lines)
 Lines 153-159    Link Here 
153
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
153
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
154
154
155
  // hardcoded UE addresses for now
155
  // hardcoded UE addresses for now
156
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1);
156
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
157
  
157
  
158
158
159
159
(-)a/src/lte/test/epc-test-s1u-uplink.cc (-1 / +1 lines)
 Lines 370-376    Link Here 
370
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
370
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
371
371
372
  // hardcoded UE addresses for now
372
  // hardcoded UE addresses for now
373
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1);
373
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
374
  
374
  
375
375
376
376
(-)a/src/lte/test/lte-test-cell-selection.cc (-1 / +1 lines)
 Lines 308-314    Link Here 
308
      // Routing of the Internet Host (towards the LTE network)
308
      // Routing of the Internet Host (towards the LTE network)
309
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
309
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
310
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
310
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
311
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
311
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
312
312
313
      // Install the IP stack on the UEs
313
      // Install the IP stack on the UEs
314
      internet.Install (ueNodes);
314
      internet.Install (ueNodes);
(-)a/src/lte/test/lte-test-cqa-ff-mac-scheduler.cc (-2 / +2 lines)
 Lines 303-309    Link Here 
303
303
304
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
304
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
305
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
305
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
306
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
306
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
307
307
308
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
308
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
309
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
309
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
 Lines 546-552    Link Here 
546
546
547
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
547
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
548
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
548
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
549
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
549
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
550
550
551
551
552
//   LogComponentDisableAll (LOG_LEVEL_ALL);
552
//   LogComponentDisableAll (LOG_LEVEL_ALL);
(-)a/src/lte/test/lte-test-deactivate-bearer.cc (-1 / +1 lines)
 Lines 164-170    Link Here 
164
164
165
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
165
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
166
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
166
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
167
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
167
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
168
168
169
  // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
169
  // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
170
170
(-)a/src/lte/test/lte-test-fdtbfq-ff-mac-scheduler.cc (-2 / +2 lines)
 Lines 299-305    Link Here 
299
299
300
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
300
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
301
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
301
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
302
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
302
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
303
303
304
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
304
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
305
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
305
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
 Lines 545-551    Link Here 
545
545
546
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
546
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
547
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
547
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
548
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
548
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
549
549
550
550
551
//   LogComponentDisableAll (LOG_LEVEL_ALL);
551
//   LogComponentDisableAll (LOG_LEVEL_ALL);
(-)a/src/lte/test/lte-test-frequency-reuse.cc (-1 / +1 lines)
 Lines 1464-1470    Link Here 
1464
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1464
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1465
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1465
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1466
  // interface 0 is localhost, 1 is the p2p device
1466
  // interface 0 is localhost, 1 is the p2p device
1467
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
1467
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
1468
1468
1469
  // Create Nodes: eNodeB and UE
1469
  // Create Nodes: eNodeB and UE
1470
  NodeContainer enbNodes;
1470
  NodeContainer enbNodes;
(-)a/src/lte/test/lte-test-pss-ff-mac-scheduler.cc (-2 / +2 lines)
 Lines 300-306    Link Here 
300
300
301
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
301
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
302
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
302
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
303
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
303
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
304
304
305
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
305
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
306
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
306
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
 Lines 546-552    Link Here 
546
546
547
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
547
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
548
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
548
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
549
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
549
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
550
550
551
551
552
//   LogComponentDisableAll (LOG_LEVEL_ALL);
552
//   LogComponentDisableAll (LOG_LEVEL_ALL);
(-)a/src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc (-2 / +2 lines)
 Lines 299-305    Link Here 
299
299
300
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
300
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
301
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
301
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
302
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
302
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
303
303
304
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
304
  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
305
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
305
  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
 Lines 545-551    Link Here 
545
545
546
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
546
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
547
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
547
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
548
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
548
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
549
549
550
550
551
//   LogComponentDisableAll (LOG_LEVEL_ALL);
551
//   LogComponentDisableAll (LOG_LEVEL_ALL);
(-)a/src/lte/test/lte-test-ue-measurements.cc (-1 / +1 lines)
 Lines 1744-1750    Link Here 
1744
  // Routing of the Internet Host (towards the LTE network)
1744
  // Routing of the Internet Host (towards the LTE network)
1745
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1745
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1746
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1746
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1747
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
1747
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
1748
1748
1749
  // Enable layer-3 filtering
1749
  // Enable layer-3 filtering
1750
  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1750
  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
(-)a/src/lte/test/test-lte-epc-e2e-data.cc (-1 / +1 lines)
 Lines 177-183    Link Here 
177
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
177
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
178
178
179
  // hardcoded UE addresses for now
179
  // hardcoded UE addresses for now
180
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1);
180
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
181
  
181
  
182
182
183
  NodeContainer enbs;
183
  NodeContainer enbs;
(-)a/src/lte/test/test-lte-handover-target.cc (-1 / +1 lines)
 Lines 318-324    Link Here 
318
  // Routing of the Internet Host (towards the LTE network)
318
  // Routing of the Internet Host (towards the LTE network)
319
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
319
  Ipv4StaticRoutingHelper ipv4RoutingHelper;
320
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
320
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
321
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
321
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
322
322
323
  // Create Devices and install them in the Nodes (eNB and UE)
323
  // Create Devices and install them in the Nodes (eNB and UE)
324
  NetDeviceContainer enbDevs;
324
  NetDeviceContainer enbDevs;
(-)a/src/lte/test/test-lte-x2-handover.cc (-1 / +1 lines)
 Lines 280-286    Link Here 
280
280
281
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
281
      Ipv4StaticRoutingHelper ipv4RoutingHelper;
282
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
282
      Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
283
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
283
      remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
284
284
285
      // Install the IP stack on the UEs      
285
      // Install the IP stack on the UEs      
286
      internet.Install (ueNodes);
286
      internet.Install (ueNodes);

Return to bug 2835