--- a/src/lte/examples/lena-deactivate-bearer.cc +++ a/src/lte/examples/lena-deactivate-bearer.cc @@ -102,7 +102,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); NodeContainer ueNodes; NodeContainer enbNodes; --- a/src/lte/examples/lena-distributed-ffr.cc +++ a/src/lte/examples/lena-distributed-ffr.cc @@ -158,7 +158,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // interface 0 is localhost, 1 is the p2p device - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Create Nodes: eNodeB and UE NodeContainer enbNodes; --- a/src/lte/examples/lena-dual-stripe.cc +++ a/src/lte/examples/lena-dual-stripe.cc @@ -671,7 +671,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // for internetworking purposes, consider together home UEs and macro UEs ues.Add (homeUes); --- a/src/lte/examples/lena-simple-epc-emu.cc +++ a/src/lte/examples/lena-simple-epc-emu.cc @@ -113,7 +113,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); NodeContainer ueNodes; NodeContainer enbNodes; --- a/src/lte/examples/lena-simple-epc.cc +++ a/src/lte/examples/lena-simple-epc.cc @@ -100,7 +100,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); NodeContainer ueNodes; NodeContainer enbNodes; --- a/src/lte/examples/lena-simple-two-epc.cc +++ a/src/lte/examples/lena-simple-two-epc.cc @@ -0,0 +1,299 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ +/* + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Jaume Nin + * Tommaso Pecorella + */ + +#include "ns3/lte-helper.h" +#include "ns3/epc-helper.h" +#include "ns3/core-module.h" +#include "ns3/network-module.h" +#include "ns3/ipv4-global-routing-helper.h" +#include "ns3/internet-module.h" +#include "ns3/mobility-module.h" +#include "ns3/lte-module.h" +#include "ns3/applications-module.h" +#include "ns3/csma-helper.h" +#include "ns3/config-store.h" +//#include "ns3/gtk-config-store.h" + +using namespace ns3; + +/** + * Sample simulation script for LTE+EPC. It instantiates several eNodeB, + * attaches one UE per eNodeB starts a flow for each UE to and from a remote host. + * It also starts yet another flow between each UE pair. + */ + +NS_LOG_COMPONENT_DEFINE ("EpcFirstExample"); + +int +main (int argc, char *argv[]) +{ + + uint16_t numberOfNodes = 2; + double simTime = 1.1; + double distance = 60.0; + double interPacketInterval = 100; + bool useCa = false; + +// LogComponentEnable ("PointToPointEpcHelper", LOG_LEVEL_ALL); + + // Command line arguments + CommandLine cmd; + cmd.AddValue("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes); + cmd.AddValue("simTime", "Total duration of the simulation [s])", simTime); + cmd.AddValue("distance", "Distance between eNBs [m]", distance); + cmd.AddValue("interPacketInterval", "Inter packet interval [ms])", interPacketInterval); + cmd.AddValue("useCa", "Whether to use carrier aggregation.", useCa); + cmd.Parse(argc, argv); + + ConfigStore inputConfig; + inputConfig.ConfigureDefaults(); + + // parse again so you can override default values from the command line + cmd.Parse(argc, argv); + + if (useCa) + { + Config::SetDefault ("ns3::LteHelper::UseCa", BooleanValue (useCa)); + Config::SetDefault ("ns3::LteHelper::NumberOfComponentCarriers", UintegerValue (2)); + Config::SetDefault ("ns3::LteHelper::EnbComponentCarrierManager", StringValue ("ns3::RrComponentCarrierManager")); + } + + InternetStackHelper internet; + Ipv4StaticRoutingHelper ipv4RoutingHelper; + + // Network A + Ptr lteAHelper = CreateObject (); + Ptr epcAHelper = CreateObject (); + lteAHelper->SetEpcHelper (epcAHelper); + + Ptr pgwA = epcAHelper->GetPgwNode (); + + NodeContainer ueNodesA; + NodeContainer enbNodesA; + enbNodesA.Create(numberOfNodes); + ueNodesA.Create(numberOfNodes); + + // Install Mobility Model + Ptr positionAlloc = CreateObject (); + for (uint16_t i = 0; i < numberOfNodes; i++) + { + positionAlloc->Add (Vector(distance * i, 0, 0)); + } + MobilityHelper mobilityA; + mobilityA.SetMobilityModel("ns3::ConstantPositionMobilityModel"); + mobilityA.SetPositionAllocator(positionAlloc); + mobilityA.Install(enbNodesA); + mobilityA.Install(ueNodesA); + + // Install LTE Devices to the nodes + NetDeviceContainer enbLteADevs = lteAHelper->InstallEnbDevice (enbNodesA); + NetDeviceContainer ueLteADevs = lteAHelper->InstallUeDevice (ueNodesA); + + // Install the IP stack on the UEs + internet.Install (ueNodesA); + Ipv4InterfaceContainer ueAIpIface; + ueAIpIface = epcAHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteADevs)); + // Assign IP address to UEs, and install applications + for (uint32_t u = 0; u < ueNodesA.GetN (); ++u) + { + Ptr ueNode = ueNodesA.Get (u); + // Set the default gateway for the UE + Ptr ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject ()); + ueStaticRouting->SetDefaultRoute (epcAHelper->GetUeDefaultGatewayAddress (), 1); + } + + // Attach one UE per eNodeB + for (uint16_t i = 0; i < numberOfNodes; i++) + { + lteAHelper->Attach (ueLteADevs.Get(i), enbLteADevs.Get(i)); + // side effect: the default EPS bearer will be activated + } + + // Network B + Ptr lteBHelper = CreateObject (); + lteBHelper->SetUplinkSpectrumChannel (lteAHelper->GetUplinkSpectrumChannel ()); + lteBHelper->SetDownlinkSpectrumChannel (lteAHelper->GetDownlinkSpectrumChannel ()); + + Ptr epcBHelper = CreateObject (); + lteBHelper->SetEpcHelper (epcBHelper); + + Ptr pgwB = epcBHelper->GetPgwNode (); + + NodeContainer ueNodesB; + NodeContainer enbNodesB; + enbNodesB.Create(numberOfNodes); + ueNodesB.Create(numberOfNodes); + + // Install Mobility Model + Ptr positionAllocB = CreateObject (); + for (uint16_t i = 0; i < numberOfNodes; i++) + { + positionAllocB->Add (Vector(distance * i, 500, 0)); + } + MobilityHelper mobilityB; + mobilityB.SetMobilityModel("ns3::ConstantPositionMobilityModel"); + mobilityB.SetPositionAllocator(positionAllocB); + mobilityB.Install(enbNodesB); + mobilityB.Install(ueNodesB); + + // Install LTE Devices to the nodes + NetDeviceContainer enbLteBDevs = lteBHelper->InstallEnbDevice (enbNodesB); + NetDeviceContainer ueLteBDevs = lteBHelper->InstallUeDevice (ueNodesB); + + // Install the IP stack on the UEs + internet.Install (ueNodesB); + Ipv4InterfaceContainer ueBIpIface; + ueBIpIface = epcBHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteBDevs)); + // Assign IP address to UEs, and install applications + for (uint32_t u = 0; u < ueNodesB.GetN (); ++u) + { + Ptr ueNode = ueNodesB.Get (u); + // Set the default gateway for the UE + Ptr ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject ()); + ueStaticRouting->SetDefaultRoute (epcBHelper->GetUeDefaultGatewayAddress (), 1); + } + + // Attach one UE per eNodeB + for (uint16_t i = 0; i < numberOfNodes; i++) + { + lteBHelper->Attach (ueLteBDevs.Get(i), enbLteBDevs.Get(i)); + // side effect: the default EPS bearer will be activated + } + + // Create a single RemoteHost + NodeContainer remoteHostContainer; + remoteHostContainer.Create (1); + Ptr remoteHost = remoteHostContainer.Get (0); + internet.Install (remoteHostContainer); + + // Create the Internet + CsmaHelper csma; + NodeContainer internetNodes; + internetNodes.Add (remoteHost); + internetNodes.Add (pgwA); + internetNodes.Add (pgwB); + + csma.SetDeviceAttribute ("Mtu", UintegerValue (1500)); + csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s"))); + csma.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010))); + NetDeviceContainer internetDevices = csma.Install (internetNodes); + Ipv4AddressHelper ipv4h; + ipv4h.SetBase ("1.0.0.0", "255.0.0.0"); + Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices); + // interface 0 is localhost, 1 is the csma device + Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1); + + Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); + + + // Install and start applications on UEs and remote host + uint16_t dlPort = 1234; + uint16_t ulPort = 2000; + uint16_t otherPort = 3000; + ApplicationContainer clientApps; + ApplicationContainer serverApps; + for (uint32_t u = 0; u < ueNodesA.GetN (); ++u) + { + ++ulPort; + ++otherPort; + PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort)); + PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort)); + PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort)); + serverApps.Add (dlPacketSinkHelper.Install (ueNodesA.Get(u))); + serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); + serverApps.Add (packetSinkHelper.Install (ueNodesA.Get(u))); + + UdpClientHelper dlClient (ueAIpIface.GetAddress (u), dlPort); + dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + UdpClientHelper ulClient (remoteHostAddr, ulPort); + ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + UdpClientHelper client (ueAIpIface.GetAddress (u), otherPort); + client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + client.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + clientApps.Add (dlClient.Install (remoteHost)); + clientApps.Add (ulClient.Install (ueNodesA.Get(u))); + if (u+1 < ueNodesA.GetN ()) + { + clientApps.Add (client.Install (ueNodesA.Get(u+1))); + } + else + { + clientApps.Add (client.Install (ueNodesA.Get(0))); + } + } + for (uint32_t u = 0; u < ueNodesB.GetN (); ++u) + { + ++ulPort; + ++otherPort; + PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort)); + PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort)); + PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort)); + serverApps.Add (dlPacketSinkHelper.Install (ueNodesB.Get(u))); + serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); + serverApps.Add (packetSinkHelper.Install (ueNodesB.Get(u))); + + UdpClientHelper dlClient (ueBIpIface.GetAddress (u), dlPort); + dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + UdpClientHelper ulClient (remoteHostAddr, ulPort); + ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + UdpClientHelper client (ueBIpIface.GetAddress (u), otherPort); + client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval))); + client.SetAttribute ("MaxPackets", UintegerValue(1000000)); + + clientApps.Add (dlClient.Install (remoteHost)); + clientApps.Add (ulClient.Install (ueNodesB.Get(u))); + if (u+1 < ueNodesB.GetN ()) + { + clientApps.Add (client.Install (ueNodesB.Get(u+1))); + } + else + { + clientApps.Add (client.Install (ueNodesB.Get(0))); + } + } + serverApps.Start (Seconds (0.01)); + clientApps.Start (Seconds (0.01)); +// lteAHelper->EnableTraces (); +// lteBHelper->EnableTraces (); + // Uncomment to enable PCAP tracing + //p2ph.EnablePcapAll("lena-epc-first"); + + Simulator::Stop (Seconds (simTime)); + Simulator::Run (); + + /*GtkConfigStore config; + config.ConfigureAttributes();*/ + + Simulator::Destroy(); + return 0; + +} + --- a/src/lte/examples/lena-x2-handover-measures.cc +++ a/src/lte/examples/lena-x2-handover-measures.cc @@ -206,7 +206,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // interface 0 is localhost, 1 is the p2p device - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); /* * Network topology: --- a/src/lte/examples/lena-x2-handover.cc +++ a/src/lte/examples/lena-x2-handover.cc @@ -187,7 +187,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // interface 0 is localhost, 1 is the p2p device - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); NodeContainer ueNodes; NodeContainer enbNodes; --- a/src/lte/examples/wscript +++ a/src/lte/examples/wscript @@ -34,6 +34,9 @@ obj = bld.create_ns3_program('lena-simple-epc', ['lte']) obj.source = 'lena-simple-epc.cc' + obj = bld.create_ns3_program('lena-simple-two-epc', + ['lte']) + obj.source = 'lena-simple-two-epc.cc' obj = bld.create_ns3_program('lena-deactivate-bearer', ['lte']) obj.source = 'lena-deactivate-bearer.cc' --- a/src/lte/helper/emu-epc-helper.cc +++ a/src/lte/helper/emu-epc-helper.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -91,20 +92,38 @@ StringValue ("00:00:00:eb:00"), MakeStringAccessor (&EmuEpcHelper::m_enbMacAddressBase), MakeStringChecker ()) + .AddAttribute ("BaseIpv4Prefix", + "The 8 bit IPv4 prefix to be used for the assignment of IPv4 addresses to PGW and UE.", + Ipv4AddressValue (Ipv4Address ("7.0.0.0")), + MakeIpv4AddressAccessor (&EmuEpcHelper::m_uePgwBaseIpv4Prefix), + MakeIpv4AddressChecker ()) ; return tid; } +TypeId +EmuEpcHelper::GetInstanceTypeId () const +{ + return GetTypeId (); +} + + void EmuEpcHelper::DoInitialize () { NS_LOG_LOGIC (this); + // we use a /16 bit IPv4 net for an EPC network + m_uePgwCurrentIpv4Prefix = m_uePgwBaseIpv4Prefix.CombineMask (Ipv4Mask ("255.0.0.0")); //Initialize + Ipv4AddressGenerator::Init (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0")); - // we use a /8 net for all UEs - m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0"); + while (!Ipv4AddressGenerator::IsNetworkAllocated (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0"))) + { + m_uePgwCurrentIpv4Prefix = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0")); + } - + m_ueAddressHelper.SetBase (m_uePgwCurrentIpv4Prefix, "255.255.0.0"); //The helper will assign IPv4 addresses using this 16 bit prefix + //Now we get an unique 16 bit IPv4 prefix for this EPC, which not used by any other EPC // create SgwPgwNode m_sgwPgw = CreateObject (); --- a/src/lte/helper/emu-epc-helper.h +++ a/src/lte/helper/emu-epc-helper.h @@ -70,9 +70,18 @@ * \return The object TypeId. */ static TypeId GetTypeId (void); + TypeId GetInstanceTypeId () const; virtual void DoInitialize (); virtual void DoDispose (); + /** + * Get the IPv4 network address used by the EPC. + * The EPC will use a /16 network address. + * + * \returns The EPC IPv4 network address. + */ + Ipv4Address GetEpcIpv4NetworkAddress (); + // inherited from EpcHelper virtual void AddEnb (Ptr enbNode, Ptr lteEnbNetDevice, uint16_t cellId); virtual void AddUe (Ptr ueLteDevice, uint64_t imsi); @@ -92,6 +101,19 @@ Ipv4AddressHelper m_ueAddressHelper; /** + * The common 8 bit prefix used for the IPv4 address assignment of + * all the EPC networks + */ + Ipv4Address m_uePgwBaseIpv4Prefix; + + /** + * The 16 bit prefix used for the IPv4 address assignment of + * the UE and PGW. + * The current IPv4 prefix will be the first available one in the /8 pool. + */ + Ipv4Address m_uePgwCurrentIpv4Prefix; + + /** * SGW-PGW network element */ Ptr m_sgwPgw; --- a/src/lte/helper/lte-helper.cc +++ a/src/lte/helper/lte-helper.cc @@ -71,14 +71,15 @@ namespace ns3 { +uint64_t LteHelper::m_imsiCounter = 0; +uint16_t LteHelper::m_cellIdCounter = 1; + NS_LOG_COMPONENT_DEFINE ("LteHelper"); NS_OBJECT_ENSURE_REGISTERED (LteHelper); LteHelper::LteHelper (void) - : m_fadingStreamsAssigned (false), - m_imsiCounter (0), - m_cellIdCounter {1} + : m_fadingStreamsAssigned (false) { NS_LOG_FUNCTION (this); m_enbNetDeviceFactory.SetTypeId (LteEnbNetDevice::GetTypeId ()); @@ -86,6 +87,9 @@ m_ueNetDeviceFactory.SetTypeId (LteUeNetDevice::GetTypeId ()); m_ueAntennaModelFactory.SetTypeId (IsotropicAntennaModel::GetTypeId ()); m_channelFactory.SetTypeId (MultiModelSpectrumChannel::GetTypeId ()); + m_downlinkChannel = 0; + m_uplinkChannel = 0; + } void @@ -98,7 +102,6 @@ m_phyRxStats = CreateObject (); m_macStats = CreateObject (); Object::DoInitialize (); - } LteHelper::~LteHelper (void) @@ -224,14 +227,32 @@ } void +LteHelper::SetUplinkSpectrumChannel (Ptr ulChannel) +{ + m_uplinkChannel = ulChannel; +} + +void +LteHelper::SetDownlinkSpectrumChannel (Ptr dlChannel) +{ + m_downlinkChannel = dlChannel; +} + +void LteHelper::ChannelModelInitialization (void) { // Channel Object (i.e. Ptr) are within a vector // PathLossModel Objects are vectors --> in InstallSingleEnb we will set the frequency NS_LOG_FUNCTION (this << m_noOfCcs); - m_downlinkChannel = m_channelFactory.Create (); - m_uplinkChannel = m_channelFactory.Create (); + if (m_downlinkChannel == 0) + { + m_downlinkChannel = m_channelFactory.Create (); + } + if (m_uplinkChannel == 0) + { + m_uplinkChannel = m_channelFactory.Create (); + } m_downlinkPathlossModel = m_pathlossModelFactory.Create (); Ptr dlSplm = m_downlinkPathlossModel->GetObject (); @@ -756,6 +777,7 @@ rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ()); } + m_enbNetDevices.push_back (dev); return dev; } @@ -935,6 +957,7 @@ dev->Initialize (); + m_ueNetDevices.push_back (dev); return dev; } @@ -1351,7 +1374,7 @@ { NS_ASSERT_MSG (m_rlcStats == 0, "please make sure that LteHelper::EnableRlcTraces is called at most once"); m_rlcStats = CreateObject ("RLC"); - m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats); + m_radioBearerStatsConnector.EnableRlcStats (m_rlcStats, m_ueNetDevices, m_enbNetDevices); } int64_t @@ -1414,29 +1437,61 @@ void LteHelper::EnableDlTxPhyTraces (void) { - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission", - MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats)); + std::list >::iterator iter; + for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission"; + Config::Connect (path.str (), + MakeBoundCallback (&PhyTxStatsCalculator::DlPhyTransmissionCallback, m_phyTxStats)); + } } void LteHelper::EnableUlTxPhyTraces (void) { - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission", - MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats)); + std::list >::iterator iter; + for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission"; + Config::Connect (path.str (), + MakeBoundCallback (&PhyTxStatsCalculator::UlPhyTransmissionCallback, m_phyTxStats)); + } } void LteHelper::EnableDlRxPhyTraces (void) { - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception", - MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats)); + std::list >::iterator iter; + for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception"; + Config::Connect (path.str (), + MakeBoundCallback (&PhyRxStatsCalculator::DlPhyReceptionCallback, m_phyRxStats)); + } } void LteHelper::EnableUlRxPhyTraces (void) { - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception", - MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats)); + std::list >::iterator iter; + for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception"; + Config::Connect (path.str (), + MakeBoundCallback (&PhyRxStatsCalculator::UlPhyReceptionCallback, m_phyRxStats)); + } } @@ -1452,35 +1507,64 @@ LteHelper::EnableDlMacTraces (void) { NS_LOG_FUNCTION_NOARGS (); - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling", - MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats)); + std::list >::iterator iter; + for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMap/*/LteEnbMac/DlScheduling"; + Config::Connect (path.str (), + MakeBoundCallback (&MacStatsCalculator::DlSchedulingCallback, m_macStats)); + } } void LteHelper::EnableUlMacTraces (void) { NS_LOG_FUNCTION_NOARGS (); - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling", - MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats)); + std::list >::iterator iter; + for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMap/*/LteEnbMac/UlScheduling"; + Config::Connect (path.str (), + MakeBoundCallback (&MacStatsCalculator::UlSchedulingCallback, m_macStats)); + } } void LteHelper::EnableDlPhyTraces (void) { NS_LOG_FUNCTION_NOARGS (); - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr", - MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats)); + std::list >::iterator iter; + for (iter = m_ueNetDevices.begin (); iter != m_ueNetDevices.end (); iter ++) + { + std::ostringstream path; + path << "/NodeList/" << (*iter)->GetNode ()->GetId () + << "/DeviceList/" << (*iter)->GetIfIndex () + << "/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr"; + Config::Connect (path.str (), + MakeBoundCallback (&PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback, m_phyStats)); + } } void LteHelper::EnableUlPhyTraces (void) { NS_LOG_FUNCTION_NOARGS (); - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr", - MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats)); - Config::Connect ("/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference", - MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats)); - + std::list >::iterator iter; + for (iter = m_enbNetDevices.begin (); iter != m_enbNetDevices.end (); iter ++) + { + std::string basePath; + basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ()); + Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr", + MakeBoundCallback (&PhyStatsCalculator::ReportUeSinr, m_phyStats)); + Config::Connect (basePath + "/ComponentCarrierMap/*/LteEnbPhy/ReportInterference", + MakeBoundCallback (&PhyStatsCalculator::ReportInterference, m_phyStats)); + } } Ptr @@ -1494,7 +1578,7 @@ { NS_ASSERT_MSG (m_pdcpStats == 0, "please make sure that LteHelper::EnablePdcpTraces is called at most once"); m_pdcpStats = CreateObject ("PDCP"); - m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats); + m_radioBearerStatsConnector.EnablePdcpStats (m_pdcpStats, m_ueNetDevices, m_enbNetDevices); } Ptr --- a/src/lte/helper/lte-helper.h +++ a/src/lte/helper/lte-helper.h @@ -42,6 +42,7 @@ #include #include #include +#include namespace ns3 { @@ -52,6 +53,8 @@ class EpcHelper; class PropagationLossModel; class SpectrumPropagationLossModel; +class LteUeNetDevice; + /** * \ingroup lte @@ -677,6 +680,19 @@ */ Ptr GetDownlinkSpectrumChannel (void) const; + /** + * Set the SpectrumChannel instance used for the uplink + * \param ulChannel a pointer to the SpectrumChannel instance used for the uplink + */ + void SetUplinkSpectrumChannel (Ptr ulChannel); + + + /** + * Set the SpectrumChannel instance used for the downlink + * \param dlChannel a pointer to the SpectrumChannel instance used for the downlink + */ + void SetDownlinkSpectrumChannel (Ptr dlChannel); + protected: // inherited from Object @@ -812,13 +828,13 @@ * new UE is installed (by InstallSingleUeDevice()). The first UE will have * an IMSI of 1. The maximum number of UE is 2^64 (~4.2e9). */ - uint64_t m_imsiCounter; + static uint64_t m_imsiCounter; /** * Keep track of the number of cell ID allocated. Increases by one every time * a new eNodeB is installed (by InstallSingleEnbDevice()). The first eNodeB * will have a cell ID of 1. The maximum number of eNodeB is 65535. */ - uint16_t m_cellIdCounter; + static uint16_t m_cellIdCounter; /** * The `UseIdealRrc` attribute. If true, LteRrcProtocolIdeal will be used for @@ -855,6 +871,16 @@ */ uint16_t m_noOfCcs; + /** + * List of the UEs installed by this helper + */ + std::list > m_ueNetDevices; + + /** + * List of the eNB installed by this helper + */ + std::list > m_enbNetDevices; + }; // end of `class LteHelper` --- a/src/lte/helper/point-to-point-epc-helper.cc +++ a/src/lte/helper/point-to-point-epc-helper.cc @@ -18,6 +18,7 @@ * Author: Jaume Nin * Nicola Baldo * Manuel Requena + * Manoj Kumar Rana */ #include @@ -26,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -52,16 +54,40 @@ { NS_LOG_FUNCTION (this); + // To access the attribute value within the constructor + ObjectBase::ConstructSelf (AttributeConstructionList ()); + // since we use point-to-point links for all S1-U links, // we use a /30 subnet which can hold exactly two addresses // (remember that net broadcast and null address are not valid) - m_s1uIpv4AddressHelper.SetBase ("10.0.0.0", "255.255.255.252"); - - m_x2Ipv4AddressHelper.SetBase ("12.0.0.0", "255.255.255.252"); + Ipv4Address s1uIpv4AddressNet = Ipv4Address ("10.0.0.0"); + Ipv4AddressGenerator::Init (s1uIpv4AddressNet, Ipv4Mask ("255.255.0.0")); + while (!Ipv4AddressGenerator::IsNetworkAllocated (s1uIpv4AddressNet, Ipv4Mask ("255.255.0.0"))) + { + s1uIpv4AddressNet = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0")); + } + m_s1uIpv4AddressHelper.SetBase (s1uIpv4AddressNet, "255.255.255.252"); - // we use a /8 net for all UEs - m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0"); - + Ipv4Address x2Ipv4AddressNet = Ipv4Address ("12.0.0.0"); + Ipv4AddressGenerator::Init (x2Ipv4AddressNet, Ipv4Mask ("255.255.0.0")); + while (!Ipv4AddressGenerator::IsNetworkAllocated (x2Ipv4AddressNet, Ipv4Mask ("255.255.0.0"))) + { + x2Ipv4AddressNet = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0")); + } + m_x2Ipv4AddressHelper.SetBase (x2Ipv4AddressNet, "255.255.255.252"); + + // we use a /16 bit IPv4 net for an EPC network + m_uePgwCurrentIpv4Prefix = m_uePgwBaseIpv4Prefix.CombineMask (Ipv4Mask ("255.0.0.0")); //Initialize + Ipv4AddressGenerator::Init (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0")); + + while (!Ipv4AddressGenerator::IsNetworkAllocated (m_uePgwCurrentIpv4Prefix, Ipv4Mask ("255.255.0.0"))) + { + m_uePgwCurrentIpv4Prefix = Ipv4AddressGenerator::NextNetwork (Ipv4Mask ("255.255.0.0")); + } + + m_ueAddressHelper.SetBase (m_uePgwCurrentIpv4Prefix, "255.255.0.0"); //The helper will assign IPv4 addresses using this 16 bit prefix + //Now we get an unique 16 bit IPv4 prefix for this EPC, which not used by any other EPC + // create SgwPgwNode m_sgwPgw = CreateObject (); InternetStackHelper internet; @@ -144,10 +170,21 @@ UintegerValue (3000), MakeUintegerAccessor (&PointToPointEpcHelper::m_x2LinkMtu), MakeUintegerChecker ()) - ; + .AddAttribute ("BaseIpv4Prefix", + "The 8 bit IPv4 prefix to be used for the assignment of IPv4 addresses to PGW and UE.", + Ipv4AddressValue (Ipv4Address ("7.0.0.0")), + MakeIpv4AddressAccessor (&PointToPointEpcHelper::m_uePgwBaseIpv4Prefix), + MakeIpv4AddressChecker ()) + ; return tid; } +TypeId +PointToPointEpcHelper::GetInstanceTypeId () const +{ + return GetTypeId (); +} + void PointToPointEpcHelper::DoDispose () { @@ -184,8 +221,8 @@ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject ()->GetNInterfaces ()); Ptr enbDev = enbSgwDevices.Get (0); Ptr sgwDev = enbSgwDevices.Get (1); + Ipv4InterfaceContainer enbSgwIpIfaces = m_s1uIpv4AddressHelper.Assign (enbSgwDevices); m_s1uIpv4AddressHelper.NewNetwork (); - Ipv4InterfaceContainer enbSgwIpIfaces = m_s1uIpv4AddressHelper.Assign (enbSgwDevices); NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after assigning Ipv4 addr to S1 dev: " << enb->GetObject ()->GetNInterfaces ()); Ipv4Address enbAddress = enbSgwIpIfaces.GetAddress (0); @@ -255,8 +292,8 @@ Ptr enb1Dev = enbDevices.Get (0); Ptr enb2Dev = enbDevices.Get (1); + Ipv4InterfaceContainer enbIpIfaces = m_x2Ipv4AddressHelper.Assign (enbDevices); m_x2Ipv4AddressHelper.NewNetwork (); - Ipv4InterfaceContainer enbIpIfaces = m_x2Ipv4AddressHelper.Assign (enbDevices); NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after assigning Ipv4 addr to X2 dev: " << enb1->GetObject ()->GetNInterfaces ()); NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject ()->GetNInterfaces ()); @@ -319,22 +356,18 @@ return bearerId; } - Ptr PointToPointEpcHelper::GetPgwNode () { return m_sgwPgw; } - Ipv4InterfaceContainer PointToPointEpcHelper::AssignUeIpv4Address (NetDeviceContainer ueDevices) { return m_ueAddressHelper.Assign (ueDevices); } - - Ipv4Address PointToPointEpcHelper::GetUeDefaultGatewayAddress () { --- a/src/lte/helper/point-to-point-epc-helper.h +++ a/src/lte/helper/point-to-point-epc-helper.h @@ -18,6 +18,7 @@ * Author: Jaume Nin * Nicola Baldo * Manuel Requena + * Manoj Kumar Rana */ #ifndef POINT_TO_POINT_EPC_HELPER_H @@ -68,8 +69,17 @@ * \return The object TypeId. */ static TypeId GetTypeId (void); + TypeId GetInstanceTypeId () const; virtual void DoDispose (); + /** + * Get the IPv4 network address used by the EPC. + * The EPC will use a /16 network address. + * + * \returns The EPC IPv4 network address. + */ + Ipv4Address GetEpcIpv4NetworkAddress (); + // inherited from EpcHelper virtual void AddEnb (Ptr enbNode, Ptr lteEnbNetDevice, uint16_t cellId); virtual void AddUe (Ptr ueLteDevice, uint64_t imsi); @@ -84,11 +94,24 @@ private: /** - * helper to assign addresses to UE devices as well as to the TUN device of the SGW/PGW + * helper to assign IPv4 addresses to UE devices as well as to the TUN device of the SGW/PGW */ Ipv4AddressHelper m_ueAddressHelper; /** + * The common 8 bit prefix used for the IPv4 address assignment of + * all the EPC networks + */ + Ipv4Address m_uePgwBaseIpv4Prefix; + + /** + * The 16 bit prefix used for the IPv4 address assignment of + * the UE and PGW. + * The current IPv4 prefix will be the first available one in the /8 pool. + */ + Ipv4Address m_uePgwCurrentIpv4Prefix; + + /** * SGW-PGW network element */ Ptr m_sgwPgw; --- a/src/lte/helper/radio-bearer-stats-connector.cc +++ a/src/lte/helper/radio-bearer-stats-connector.cc @@ -28,6 +28,8 @@ #include #include #include +#include +#include namespace ns3 { @@ -132,41 +134,60 @@ } void -RadioBearerStatsConnector::EnableRlcStats (Ptr rlcStats) +RadioBearerStatsConnector::EnableRlcStats (Ptr rlcStats, + std::list > ueNetDevices, + std::list > enbNetDevices) { m_rlcStats = rlcStats; - EnsureConnected (); + EnsureConnected (ueNetDevices, enbNetDevices); } void -RadioBearerStatsConnector::EnablePdcpStats (Ptr pdcpStats) +RadioBearerStatsConnector::EnablePdcpStats (Ptr pdcpStats, + std::list > ueNetDevices, + std::list > enbNetDevices) { m_pdcpStats = pdcpStats; - EnsureConnected (); + EnsureConnected (ueNetDevices, enbNetDevices); } void -RadioBearerStatsConnector::EnsureConnected () +RadioBearerStatsConnector::EnsureConnected (std::list > ueNetDevices, + std::list > enbNetDevices) { NS_LOG_FUNCTION (this); if (!m_connected) { - Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/NewUeContext", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/RandomAccessSuccessful", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/ConnectionReconfiguration", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionReconfiguration", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationUe, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverStart", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartEnb, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverStart", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartUe, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteEnbRrc/HandoverEndOk", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this)); - Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverEndOk", - MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this)); + for (std::list >::iterator iter = enbNetDevices.begin (); + iter != enbNetDevices.end (); + iter ++) + { + std::string basePath; + basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ()); + Config::Connect (basePath + "/LteEnbRrc/NewUeContext", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyNewUeContextEnb, this)); + Config::Connect (basePath + "/LteEnbRrc/ConnectionReconfiguration", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationEnb, this)); + Config::Connect (basePath + "/LteEnbRrc/HandoverStart", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartEnb, this)); + Config::Connect (basePath + "/LteEnbRrc/HandoverEndOk", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkEnb, this)); + } + for (std::list >::iterator iter = ueNetDevices.begin (); + iter != ueNetDevices.end (); + iter ++) + { + std::string basePath; + basePath = "/NodeList/" + std::to_string ((*iter)->GetNode ()->GetId ()) + "/DeviceList/" + std::to_string ((*iter)->GetIfIndex ()); + Config::Connect (basePath + "/LteUeRrc/RandomAccessSuccessful", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyRandomAccessSuccessfulUe, this)); + Config::Connect (basePath + "/LteUeRrc/ConnectionReconfiguration", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyConnectionReconfigurationUe, this)); + Config::Connect (basePath + "/LteUeRrc/HandoverStart", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverStartUe, this)); + Config::Connect (basePath + "/LteUeRrc/HandoverEndOk", + MakeBoundCallback (&RadioBearerStatsConnector::NotifyHandoverEndOkUe, this)); + } m_connected = true; } } --- a/src/lte/helper/radio-bearer-stats-connector.h +++ a/src/lte/helper/radio-bearer-stats-connector.h @@ -35,6 +35,8 @@ namespace ns3 { class RadioBearerStatsCalculator; +class LteUeNetDevice; +class LteEnbNetDevice; /** * \ingroup lte @@ -57,20 +59,30 @@ * Enables trace sinks for RLC layer. Usually, this function * is called by LteHelper::EnableRlcTraces(). * \param rlcStats statistics calculator for RLC layer + * \param ueNetDevices list of the UE to connect + * \param enbNetDevices list of the eNB to connect */ - void EnableRlcStats (Ptr rlcStats); - + void EnableRlcStats (Ptr rlcStats, + std::list > ueNetDevices, + std::list > enbNetDevices); /** * Enables trace sinks for PDCP layer. Usually, this function * is called by LteHelper::EnablePdcpTraces(). * \param pdcpStats statistics calculator for PDCP layer + * \param ueNetDevices list of the UE to connect + * \param enbNetDevices list of the eNB to connect */ - void EnablePdcpStats (Ptr pdcpStats); + void EnablePdcpStats (Ptr pdcpStats, + std::list > ueNetDevices, + std::list > enbNetDevices); /** * Connects trace sinks to appropriate trace sources + * \param ueNetDevices list of the UE to connect + * \param enbNetDevices list of the eNB to connect */ - void EnsureConnected (); + void EnsureConnected (std::list > ueNetDevices, + std::list > enbNetDevices); // trace sinks, to be used with MakeBoundCallback --- a/src/lte/model/lte-enb-rrc.cc +++ a/src/lte/model/lte-enb-rrc.cc @@ -857,6 +857,7 @@ UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg) { NS_LOG_FUNCTION (this); + switch (m_state) { case INITIAL_RANDOM_ACCESS: @@ -910,6 +911,7 @@ UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg) { NS_LOG_FUNCTION (this); + switch (m_state) { case CONNECTION_SETUP: --- a/src/lte/test/epc-test-s1u-downlink.cc +++ a/src/lte/test/epc-test-s1u-downlink.cc @@ -153,7 +153,7 @@ Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // hardcoded UE addresses for now - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); --- a/src/lte/test/epc-test-s1u-uplink.cc +++ a/src/lte/test/epc-test-s1u-uplink.cc @@ -370,7 +370,7 @@ Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // hardcoded UE addresses for now - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); --- a/src/lte/test/lte-test-cell-selection.cc +++ a/src/lte/test/lte-test-cell-selection.cc @@ -308,7 +308,7 @@ // Routing of the Internet Host (towards the LTE network) Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Install the IP stack on the UEs internet.Install (ueNodes); --- a/src/lte/test/lte-test-cqa-ff-mac-scheduler.cc +++ a/src/lte/test/lte-test-cqa-ff-mac-scheduler.cc @@ -303,7 +303,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); @@ -546,7 +546,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // LogComponentDisableAll (LOG_LEVEL_ALL); --- a/src/lte/test/lte-test-deactivate-bearer.cc +++ a/src/lte/test/lte-test-deactivate-bearer.cc @@ -164,7 +164,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL); --- a/src/lte/test/lte-test-fdtbfq-ff-mac-scheduler.cc +++ a/src/lte/test/lte-test-fdtbfq-ff-mac-scheduler.cc @@ -299,7 +299,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); @@ -545,7 +545,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // LogComponentDisableAll (LOG_LEVEL_ALL); --- a/src/lte/test/lte-test-frequency-reuse.cc +++ a/src/lte/test/lte-test-frequency-reuse.cc @@ -1464,7 +1464,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // interface 0 is localhost, 1 is the p2p device - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Create Nodes: eNodeB and UE NodeContainer enbNodes; --- a/src/lte/test/lte-test-pss-ff-mac-scheduler.cc +++ a/src/lte/test/lte-test-pss-ff-mac-scheduler.cc @@ -300,7 +300,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); @@ -546,7 +546,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // LogComponentDisableAll (LOG_LEVEL_ALL); --- a/src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc +++ a/src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc @@ -299,7 +299,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); @@ -545,7 +545,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // LogComponentDisableAll (LOG_LEVEL_ALL); --- a/src/lte/test/lte-test-ue-measurements.cc +++ a/src/lte/test/lte-test-ue-measurements.cc @@ -1744,7 +1744,7 @@ // Routing of the Internet Host (towards the LTE network) Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Enable layer-3 filtering Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient", --- a/src/lte/test/test-lte-epc-e2e-data.cc +++ a/src/lte/test/test-lte-epc-e2e-data.cc @@ -177,7 +177,7 @@ Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); // hardcoded UE addresses for now - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.255.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); NodeContainer enbs; --- a/src/lte/test/test-lte-handover-target.cc +++ a/src/lte/test/test-lte-handover-target.cc @@ -318,7 +318,7 @@ // Routing of the Internet Host (towards the LTE network) Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Create Devices and install them in the Nodes (eNB and UE) NetDeviceContainer enbDevs; --- a/src/lte/test/test-lte-x2-handover.cc +++ a/src/lte/test/test-lte-x2-handover.cc @@ -280,7 +280,7 @@ Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject ()); - remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); + remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.255.0.0"), 1); // Install the IP stack on the UEs internet.Install (ueNodes);