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 (+296 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
  Ptr<PointToPointEpcHelper>  epcBHelper = CreateObject<PointToPointEpcHelper> ();
133
  lteBHelper->SetEpcHelper (epcBHelper);
134
135
  Ptr<Node> pgwB = epcBHelper->GetPgwNode ();
136
137
  NodeContainer ueNodesB;
138
  NodeContainer enbNodesB;
139
  enbNodesB.Create(numberOfNodes);
140
  ueNodesB.Create(numberOfNodes);
141
142
  // Install Mobility Model
143
  Ptr<ListPositionAllocator> positionAllocB = CreateObject<ListPositionAllocator> ();
144
  for (uint16_t i = 0; i < numberOfNodes; i++)
145
    {
146
      positionAllocB->Add (Vector(distance * i, 500, 0));
147
    }
148
  MobilityHelper mobilityB;
149
  mobilityB.SetMobilityModel("ns3::ConstantPositionMobilityModel");
150
  mobilityB.SetPositionAllocator(positionAllocB);
151
  mobilityB.Install(enbNodesB);
152
  mobilityB.Install(ueNodesB);
153
154
  // Install LTE Devices to the nodes
155
  NetDeviceContainer enbLteBDevs = lteBHelper->InstallEnbDevice (enbNodesB);
156
  NetDeviceContainer ueLteBDevs = lteBHelper->InstallUeDevice (ueNodesB);
157
158
  // Install the IP stack on the UEs
159
  internet.Install (ueNodesB);
160
  Ipv4InterfaceContainer ueBIpIface;
161
  ueBIpIface = epcBHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteBDevs));
162
  // Assign IP address to UEs, and install applications
163
  for (uint32_t u = 0; u < ueNodesB.GetN (); ++u)
164
    {
165
      Ptr<Node> ueNode = ueNodesB.Get (u);
166
      // Set the default gateway for the UE
167
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
168
      ueStaticRouting->SetDefaultRoute (epcBHelper->GetUeDefaultGatewayAddress (), 1);
169
    }
170
171
  // Attach one UE per eNodeB
172
  for (uint16_t i = 0; i < numberOfNodes; i++)
173
    {
174
      lteBHelper->Attach (ueLteBDevs.Get(i), enbLteBDevs.Get(i));
175
      // side effect: the default EPS bearer will be activated
176
    }
177
178
  // Create a single RemoteHost
179
  NodeContainer remoteHostContainer;
180
  remoteHostContainer.Create (1);
181
  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
182
  internet.Install (remoteHostContainer);
183
184
  // Create the Internet
185
  CsmaHelper csma;
186
  NodeContainer internetNodes;
187
  internetNodes.Add (remoteHost);
188
  internetNodes.Add (pgwA);
189
  internetNodes.Add (pgwB);
190
191
  csma.SetDeviceAttribute ("Mtu", UintegerValue (1500));
192
  csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
193
  csma.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
194
  NetDeviceContainer internetDevices = csma.Install (internetNodes);
195
  Ipv4AddressHelper ipv4h;
196
  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
197
  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
198
  // interface 0 is localhost, 1 is the csma device
199
  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
200
201
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
202
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1);
203
204
205
  // Install and start applications on UEs and remote host
206
  uint16_t dlPort = 1234;
207
  uint16_t ulPort = 2000;
208
  uint16_t otherPort = 3000;
209
  ApplicationContainer clientApps;
210
  ApplicationContainer serverApps;
211
  for (uint32_t u = 0; u < ueNodesA.GetN (); ++u)
212
    {
213
      ++ulPort;
214
      ++otherPort;
215
      PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
216
      PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
217
      PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
218
      serverApps.Add (dlPacketSinkHelper.Install (ueNodesA.Get(u)));
219
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
220
      serverApps.Add (packetSinkHelper.Install (ueNodesA.Get(u)));
221
222
      UdpClientHelper dlClient (ueAIpIface.GetAddress (u), dlPort);
223
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
224
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
225
226
      UdpClientHelper ulClient (remoteHostAddr, ulPort);
227
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
228
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
229
230
      UdpClientHelper client (ueAIpIface.GetAddress (u), otherPort);
231
      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
232
      client.SetAttribute ("MaxPackets", UintegerValue(1000000));
233
234
      clientApps.Add (dlClient.Install (remoteHost));
235
      clientApps.Add (ulClient.Install (ueNodesA.Get(u)));
236
      if (u+1 < ueNodesA.GetN ())
237
        {
238
          clientApps.Add (client.Install (ueNodesA.Get(u+1)));
239
        }
240
      else
241
        {
242
          clientApps.Add (client.Install (ueNodesA.Get(0)));
243
        }
244
    }
245
  for (uint32_t u = 0; u < ueNodesB.GetN (); ++u)
246
    {
247
      ++ulPort;
248
      ++otherPort;
249
      PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
250
      PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
251
      PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
252
      serverApps.Add (dlPacketSinkHelper.Install (ueNodesB.Get(u)));
253
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
254
      serverApps.Add (packetSinkHelper.Install (ueNodesB.Get(u)));
255
256
      UdpClientHelper dlClient (ueBIpIface.GetAddress (u), dlPort);
257
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
258
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
259
260
      UdpClientHelper ulClient (remoteHostAddr, ulPort);
261
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
262
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
263
264
      UdpClientHelper client (ueBIpIface.GetAddress (u), otherPort);
265
      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
266
      client.SetAttribute ("MaxPackets", UintegerValue(1000000));
267
268
      clientApps.Add (dlClient.Install (remoteHost));
269
      clientApps.Add (ulClient.Install (ueNodesB.Get(u)));
270
      if (u+1 < ueNodesB.GetN ())
271
        {
272
          clientApps.Add (client.Install (ueNodesB.Get(u+1)));
273
        }
274
      else
275
        {
276
          clientApps.Add (client.Install (ueNodesB.Get(0)));
277
        }
278
    }
279
  serverApps.Start (Seconds (0.01));
280
  clientApps.Start (Seconds (0.01));
281
//  lteAHelper->EnableTraces ();
282
//  lteBHelper->EnableTraces ();
283
  // Uncomment to enable PCAP tracing
284
  //p2ph.EnablePcapAll("lena-epc-first");
285
286
  Simulator::Stop (Seconds (simTime));
287
  Simulator::Run ();
288
289
  /*GtkConfigStore config;
290
  config.ConfigureAttributes();*/
291
292
  Simulator::Destroy();
293
  return 0;
294
295
}
296
(-)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 (-22 / +86 lines)
 Lines 71-83    Link Here 
71
71
72
namespace ns3 {
72
namespace ns3 {
73
73
74
uint64_t LteHelper::m_imsiCounter = 0;
75
74
NS_LOG_COMPONENT_DEFINE ("LteHelper");
76
NS_LOG_COMPONENT_DEFINE ("LteHelper");
75
77
76
NS_OBJECT_ENSURE_REGISTERED (LteHelper);
78
NS_OBJECT_ENSURE_REGISTERED (LteHelper);
77
79
78
LteHelper::LteHelper (void)
80
LteHelper::LteHelper (void)
79
  : m_fadingStreamsAssigned (false),
81
  : m_fadingStreamsAssigned (false),
80
    m_imsiCounter (0),
81
    m_cellIdCounter {1}
82
    m_cellIdCounter {1}
82
{
83
{
83
  NS_LOG_FUNCTION (this);
84
  NS_LOG_FUNCTION (this);
 Lines 756-761    Link Here 
756
      rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
757
      rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
757
    }
758
    }
758
759
760
  m_enbNetDevices.push_back (dev);
759
  return dev;
761
  return dev;
760
}
762
}
761
763
 Lines 935-940    Link Here 
935
937
936
  dev->Initialize ();
938
  dev->Initialize ();
937
939
940
  m_ueNetDevices.push_back (dev);
938
  return dev;
941
  return dev;
939
}
942
}
940
943
 Lines 1351-1357    Link Here 
1351
{
1354
{
1352
  NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once");
1355
  NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once");
1353
  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
1356
  m_rlcStats = CreateObject<RadioBearerStatsCalculator> ("RLC");
1354
  m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats);
1357
  m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats, m_ueNetDevices, m_enbNetDevices);
1355
}
1358
}
1356
1359
1357
int64_t
1360
int64_t
 Lines 1414-1442    Link Here 
1414
void
1417
void
1415
LteHelper::EnableDlTxPhyTraces (void)
1418
LteHelper::EnableDlTxPhyTraces (void)
1416
{
1419
{
1417
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission",
1420
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1418
                   MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats));
1421
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1422
    {
1423
      std::ostringstream path;
1424
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1425
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1426
           << "/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission";
1427
      Config::Connect (path.str (),
1428
                       MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats));
1429
    }
1419
}
1430
}
1420
1431
1421
void
1432
void
1422
LteHelper::EnableUlTxPhyTraces (void)
1433
LteHelper::EnableUlTxPhyTraces (void)
1423
{
1434
{
1424
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission",
1435
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1425
                   MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats));
1436
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1437
    {
1438
      std::ostringstream path;
1439
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1440
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1441
           << "/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission";
1442
      Config::Connect (path.str (),
1443
                       MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats));
1444
    }
1426
}
1445
}
1427
1446
1428
void
1447
void
1429
LteHelper::EnableDlRxPhyTraces (void)
1448
LteHelper::EnableDlRxPhyTraces (void)
1430
{
1449
{
1431
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception",
1450
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1432
                   MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats));
1451
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1452
    {
1453
      std::ostringstream path;
1454
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1455
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1456
           << "/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception";
1457
      Config::Connect (path.str (),
1458
                       MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats));
1459
    }
1433
}
1460
}
1434
1461
1435
void
1462
void
1436
LteHelper::EnableUlRxPhyTraces (void)
1463
LteHelper::EnableUlRxPhyTraces (void)
1437
{
1464
{
1438
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception",
1465
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1439
                   MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats));
1466
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1467
    {
1468
      std::ostringstream path;
1469
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1470
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1471
           << "/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception";
1472
      Config::Connect (path.str (),
1473
                       MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats));
1474
    }
1440
}
1475
}
1441
1476
1442
1477
 Lines 1452-1486    Link Here 
1452
LteHelper::EnableDlMacTraces (void)
1487
LteHelper::EnableDlMacTraces (void)
1453
{
1488
{
1454
  NS_LOG_FUNCTION_NOARGS ();
1489
  NS_LOG_FUNCTION_NOARGS ();
1455
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
1490
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1456
                   MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats));
1491
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1492
    {
1493
      std::ostringstream path;
1494
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1495
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1496
           << "/ComponentCarrierMap/*/LteEnbMac/DlScheduling";
1497
      Config::Connect (path.str (),
1498
                       MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats));
1499
    }
1457
}
1500
}
1458
1501
1459
void
1502
void
1460
LteHelper::EnableUlMacTraces (void)
1503
LteHelper::EnableUlMacTraces (void)
1461
{
1504
{
1462
  NS_LOG_FUNCTION_NOARGS ();
1505
  NS_LOG_FUNCTION_NOARGS ();
1463
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
1506
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1464
                   MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats));
1507
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1508
    {
1509
      std::ostringstream path;
1510
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1511
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1512
           << "/ComponentCarrierMap/*/LteEnbMac/UlScheduling";
1513
      Config::Connect (path.str (),
1514
                       MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats));
1515
    }
1465
}
1516
}
1466
1517
1467
void
1518
void
1468
LteHelper::EnableDlPhyTraces (void)
1519
LteHelper::EnableDlPhyTraces (void)
1469
{
1520
{
1470
  NS_LOG_FUNCTION_NOARGS ();
1521
  NS_LOG_FUNCTION_NOARGS ();
1471
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",
1522
  std::list<Ptr<LteUeNetDevice> >::iterator iter;
1472
                   MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats));
1523
  for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++)
1524
    {
1525
      std::ostringstream path;
1526
      path << "/NodeList/" << (*iter)->GetNode ()->GetId ()
1527
           << "/DeviceList/" << (*iter)->GetIfIndex ()
1528
           << "/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr";
1529
      Config::Connect (path.str (),
1530
                       MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats));
1531
    }
1473
}
1532
}
1474
1533
1475
void
1534
void
1476
LteHelper::EnableUlPhyTraces (void)
1535
LteHelper::EnableUlPhyTraces (void)
1477
{
1536
{
1478
  NS_LOG_FUNCTION_NOARGS ();
1537
  NS_LOG_FUNCTION_NOARGS ();
1479
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1538
  std::list<Ptr<LteEnbNetDevice> >::iterator iter;
1480
                   MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats));
1539
  for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++)
1481
  Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1540
    {
1482
                   MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats));
1541
      std::string basePath;
1483
1542
      basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ());
1543
      Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1544
                       MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats));
1545
      Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1546
                       MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats));
1547
    }
1484
}
1548
}
1485
1549
1486
Ptr<RadioBearerStatsCalculator>
1550
Ptr<RadioBearerStatsCalculator>
 Lines 1494-1500    Link Here 
1494
{
1558
{
1495
  NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once");
1559
  NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once");
1496
  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
1560
  m_pdcpStats = CreateObject<RadioBearerStatsCalculator> ("PDCP");
1497
  m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats);
1561
  m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats, m_ueNetDevices, m_enbNetDevices);
1498
}
1562
}
1499
1563
1500
Ptr<RadioBearerStatsCalculator>
1564
Ptr<RadioBearerStatsCalculator>
(-)a/src/lte/helper/lte-helper.h (-1 / +14 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 812-818    Link Here 
812
   * new UE is installed (by InstallSingleUeDevice()). The first UE will have
815
   * 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).
816
   * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9).
814
   */
817
   */
815
  uint64_t m_imsiCounter;
818
  static uint64_t m_imsiCounter;
816
  /**
819
  /**
817
   * Keep track of the number of cell ID allocated. Increases by one every time
820
   * 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
821
   * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB
 Lines 855-860    Link Here 
855
   */
858
   */
856
  uint16_t m_noOfCcs;
859
  uint16_t m_noOfCcs;
857
860
861
  /**
862
   * List of the UEs installed by this helper
863
   */
864
  std::list<Ptr<LteUeNetDevice> > m_ueNetDevices;
865
866
  /**
867
   * List of the eNB installed by this helper
868
   */
869
  std::list<Ptr<LteEnbNetDevice> > m_enbNetDevices;
870
858
};   // end of `class LteHelper`
871
};   // end of `class LteHelper`
859
872
860
873
(-)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 (+6 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
861
  std::cout << "* RecvRrcConnectionRequest " <<  this << " in state " << ToString (m_state) << " from " << msg.ueIdentity << std::endl;
862
860
  switch (m_state)
863
  switch (m_state)
861
    {
864
    {
862
    case INITIAL_RANDOM_ACCESS:
865
    case INITIAL_RANDOM_ACCESS:
 Lines 910-915    Link Here 
910
UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg)
913
UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg)
911
{
914
{
912
  NS_LOG_FUNCTION (this);
915
  NS_LOG_FUNCTION (this);
916
917
  std::cout << "* RecvRrcConnectionSetupCompleted " <<  this << " in state " << ToString (m_state) << std::endl;
918
913
  switch (m_state)
919
  switch (m_state)
914
    {
920
    {
915
    case CONNECTION_SETUP:
921
    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