--- a/CHANGES.html Sun Nov 10 16:53:04 2013 -0800
+++ b/CHANGES.html Tue Nov 12 13:03:13 2013 +0100
@@ -58,6 +58,17 @@
</ul>
<h2>Changes to existing API:</h2>
<ul>
+ <li>A change is introduced for the usage of the EpcHelper
+ class. Previously, the EpcHelper class included both the API
+ definition and its (only) implementation; as such, users would
+ instantiate and use the EpcHelper class directly in their
+ simulation programs. From now on,
+ EpcHelper is just the base class defining the API, and the
+ implementation has been moved to derived classes; as such,
+ users are now expected to use one of the derived classes in
+ their simulation program. The imlpementation previously
+ provided by the EpcHelper class has been moved to the new
+ derived class PointToPointEpcHelper.</li>
<li></li>
</ul>
<h2>Changes to build system:</h2>
--- a/src/lte/examples/lena-dual-stripe.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/examples/lena-dual-stripe.cc Tue Nov 12 13:03:13 2013 +0100
@@ -498,11 +498,11 @@
lteHelper->SetFadingModelAttribute ("TraceFilename", StringValue (fadingTrace));
}
- Ptr<EpcHelper> epcHelper;
+ Ptr<PointToPointEpcHelper> epcHelper;
if (epc)
{
NS_LOG_LOGIC ("enabling EPC");
- epcHelper = CreateObject<EpcHelper> ();
+ epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
}
--- a/src/lte/examples/lena-simple-epc.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/examples/lena-simple-epc.cc Tue Nov 12 13:03:13 2013 +0100
@@ -57,7 +57,7 @@
cmd.Parse(argc, argv);
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
ConfigStore inputConfig;
--- a/src/lte/examples/lena-x2-handover-measures.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/examples/lena-x2-handover-measures.cc Tue Nov 12 13:03:13 2013 +0100
@@ -165,7 +165,7 @@
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
--- a/src/lte/examples/lena-x2-handover.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/examples/lena-x2-handover.cc Tue Nov 12 13:03:13 2013 +0100
@@ -157,7 +157,7 @@
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
lteHelper->SetHandoverAlgorithmType ("ns3::NoOpHandoverAlgorithm"); // disable automatic handover
--- a/src/lte/helper/epc-helper.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/helper/epc-helper.cc Tue Nov 12 13:03:13 2013 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2011-2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ * Copyright (c) 2011-2013 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
@@ -22,23 +22,8 @@
#include <ns3/epc-helper.h>
#include <ns3/log.h>
-#include <ns3/inet-socket-address.h>
-#include <ns3/mac48-address.h>
-#include <ns3/eps-bearer.h>
+#include <ns3/node.h>
#include <ns3/ipv4-address.h>
-#include <ns3/internet-stack-helper.h>
-#include <ns3/point-to-point-helper.h>
-#include <ns3/packet-socket-helper.h>
-#include <ns3/packet-socket-address.h>
-#include <ns3/epc-enb-application.h>
-#include <ns3/epc-sgw-pgw-application.h>
-
-#include <ns3/lte-enb-rrc.h>
-#include <ns3/epc-x2.h>
-#include <ns3/lte-enb-net-device.h>
-#include <ns3/lte-ue-net-device.h>
-#include <ns3/epc-mme.h>
-#include <ns3/epc-ue-nas.h>
namespace ns3 {
@@ -48,58 +33,8 @@
EpcHelper::EpcHelper ()
- : m_gtpuUdpPort (2152) // fixed by the standard
{
NS_LOG_FUNCTION (this);
-
- // 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");
-
- // we use a /8 net for all UEs
- m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0");
-
- // create SgwPgwNode
- m_sgwPgw = CreateObject<Node> ();
- InternetStackHelper internet;
- internet.Install (m_sgwPgw);
-
- // create S1-U socket
- Ptr<Socket> sgwPgwS1uSocket = Socket::CreateSocket (m_sgwPgw, TypeId::LookupByName ("ns3::UdpSocketFactory"));
- int retval = sgwPgwS1uSocket->Bind (InetSocketAddress (Ipv4Address::GetAny (), m_gtpuUdpPort));
- NS_ASSERT (retval == 0);
-
- // create TUN device implementing tunneling of user data over GTP-U/UDP/IP
- m_tunDevice = CreateObject<VirtualNetDevice> ();
- // allow jumbo packets
- m_tunDevice->SetAttribute ("Mtu", UintegerValue (30000));
-
- // yes we need this
- m_tunDevice->SetAddress (Mac48Address::Allocate ());
-
- m_sgwPgw->AddDevice (m_tunDevice);
- NetDeviceContainer tunDeviceContainer;
- tunDeviceContainer.Add (m_tunDevice);
-
- // the TUN device is on the same subnet as the UEs, so when a packet
- // addressed to an UE arrives at the intenet to the WAN interface of
- // the PGW it will be forwarded to the TUN device.
- Ipv4InterfaceContainer tunDeviceIpv4IfContainer = m_ueAddressHelper.Assign (tunDeviceContainer);
-
- // create EpcSgwPgwApplication
- m_sgwPgwApp = CreateObject<EpcSgwPgwApplication> (m_tunDevice, sgwPgwS1uSocket);
- m_sgwPgw->AddApplication (m_sgwPgwApp);
-
- // connect SgwPgwApplication and virtual net device for tunneling
- m_tunDevice->SetSendCallback (MakeCallback (&EpcSgwPgwApplication::RecvFromTunDevice, m_sgwPgwApp));
-
- // Create MME and connect with SGW via S11 interface
- m_mme = CreateObject<EpcMme> ();
- m_mme->SetS11SapSgw (m_sgwPgwApp->GetS11SapSgw ());
- m_sgwPgwApp->SetS11SapMme (m_mme->GetS11SapMme ());
}
EpcHelper::~EpcHelper ()
@@ -112,38 +47,7 @@
{
static TypeId tid = TypeId ("ns3::EpcHelper")
.SetParent<Object> ()
- .AddConstructor<EpcHelper> ()
- .AddAttribute ("S1uLinkDataRate",
- "The data rate to be used for the next S1-U link to be created",
- DataRateValue (DataRate ("10Gb/s")),
- MakeDataRateAccessor (&EpcHelper::m_s1uLinkDataRate),
- MakeDataRateChecker ())
- .AddAttribute ("S1uLinkDelay",
- "The delay to be used for the next S1-U link to be created",
- TimeValue (Seconds (0)),
- MakeTimeAccessor (&EpcHelper::m_s1uLinkDelay),
- MakeTimeChecker ())
- .AddAttribute ("S1uLinkMtu",
- "The MTU of the next S1-U link to be created. Note that, because of the additional GTP/UDP/IP tunneling overhead, you need a MTU larger than the end-to-end MTU that you want to support.",
- UintegerValue (2000),
- MakeUintegerAccessor (&EpcHelper::m_s1uLinkMtu),
- MakeUintegerChecker<uint16_t> ())
- .AddAttribute ("X2LinkDataRate",
- "The data rate to be used for the next X2 link to be created",
- DataRateValue (DataRate ("10Gb/s")),
- MakeDataRateAccessor (&EpcHelper::m_x2LinkDataRate),
- MakeDataRateChecker ())
- .AddAttribute ("X2LinkDelay",
- "The delay to be used for the next X2 link to be created",
- TimeValue (Seconds (0)),
- MakeTimeAccessor (&EpcHelper::m_x2LinkDelay),
- MakeTimeChecker ())
- .AddAttribute ("X2LinkMtu",
- "The MTU of the next X2 link to be created. Note that, because of some big X2 messages, you need a big MTU.",
- UintegerValue (3000),
- MakeUintegerAccessor (&EpcHelper::m_x2LinkMtu),
- MakeUintegerChecker<uint16_t> ())
- ;
+ ;
return tid;
}
@@ -151,194 +55,60 @@
EpcHelper::DoDispose ()
{
NS_LOG_FUNCTION (this);
- m_tunDevice->SetSendCallback (MakeNullCallback<bool, Ptr<Packet>, const Address&, const Address&, uint16_t> ());
- m_tunDevice = 0;
- m_sgwPgwApp = 0;
- m_sgwPgw->Dispose ();
+ Object::DoDispose ();
}
+#define EPC_HELPER_API_CHANGE_MSG "The EpcHelper class is now an abstract class, and should not be used directly any more. Please use one of its derived classes (e.g., PointToPointEpcHelper) instead. For the vast majority of cases, it should be sufficient to search & replace \"<EpcHelper>\" for \"<PointToPointEpcHelper>\" in your code. "
+
void
EpcHelper::AddEnb (Ptr<Node> enb, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId)
{
- NS_LOG_FUNCTION (this << enb << lteEnbNetDevice << cellId);
-
- NS_ASSERT (enb == lteEnbNetDevice->GetNode ());
-
- // add an IPv4 stack to the previously created eNB
- InternetStackHelper internet;
- internet.Install (enb);
- NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after node creation: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
-
- // create a point to point link between the new eNB and the SGW with
- // the corresponding new NetDevices on each side
- NodeContainer enbSgwNodes;
- enbSgwNodes.Add (m_sgwPgw);
- enbSgwNodes.Add (enb);
- PointToPointHelper p2ph;
- p2ph.SetDeviceAttribute ("DataRate", DataRateValue (m_s1uLinkDataRate));
- p2ph.SetDeviceAttribute ("Mtu", UintegerValue (m_s1uLinkMtu));
- p2ph.SetChannelAttribute ("Delay", TimeValue (m_s1uLinkDelay));
- NetDeviceContainer enbSgwDevices = p2ph.Install (enb, m_sgwPgw);
- NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
- Ptr<NetDevice> enbDev = enbSgwDevices.Get (0);
- Ptr<NetDevice> sgwDev = enbSgwDevices.Get (1);
- 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<Ipv4> ()->GetNInterfaces ());
-
- Ipv4Address enbAddress = enbSgwIpIfaces.GetAddress (0);
- Ipv4Address sgwAddress = enbSgwIpIfaces.GetAddress (1);
-
- // create S1-U socket for the ENB
- Ptr<Socket> enbS1uSocket = Socket::CreateSocket (enb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
- int retval = enbS1uSocket->Bind (InetSocketAddress (enbAddress, m_gtpuUdpPort));
- NS_ASSERT (retval == 0);
-
-
- // give PacketSocket powers to the eNB
- //PacketSocketHelper packetSocket;
- //packetSocket.Install (enb);
-
- // create LTE socket for the ENB
- Ptr<Socket> enbLteSocket = Socket::CreateSocket (enb, TypeId::LookupByName ("ns3::PacketSocketFactory"));
- PacketSocketAddress enbLteSocketBindAddress;
- enbLteSocketBindAddress.SetSingleDevice (lteEnbNetDevice->GetIfIndex ());
- enbLteSocketBindAddress.SetProtocol (Ipv4L3Protocol::PROT_NUMBER);
- retval = enbLteSocket->Bind (enbLteSocketBindAddress);
- NS_ASSERT (retval == 0);
- PacketSocketAddress enbLteSocketConnectAddress;
- enbLteSocketConnectAddress.SetPhysicalAddress (Mac48Address::GetBroadcast ());
- enbLteSocketConnectAddress.SetSingleDevice (lteEnbNetDevice->GetIfIndex ());
- enbLteSocketConnectAddress.SetProtocol (Ipv4L3Protocol::PROT_NUMBER);
- retval = enbLteSocket->Connect (enbLteSocketConnectAddress);
- NS_ASSERT (retval == 0);
-
-
- NS_LOG_INFO ("create EpcEnbApplication");
- Ptr<EpcEnbApplication> enbApp = CreateObject<EpcEnbApplication> (enbLteSocket, enbS1uSocket, enbAddress, sgwAddress, cellId);
- enb->AddApplication (enbApp);
- NS_ASSERT (enb->GetNApplications () == 1);
- NS_ASSERT_MSG (enb->GetApplication (0)->GetObject<EpcEnbApplication> () != 0, "cannot retrieve EpcEnbApplication");
- NS_LOG_LOGIC ("enb: " << enb << ", enb->GetApplication (0): " << enb->GetApplication (0));
-
-
- NS_LOG_INFO ("Create EpcX2 entity");
- Ptr<EpcX2> x2 = CreateObject<EpcX2> ();
- enb->AggregateObject (x2);
-
- NS_LOG_INFO ("connect S1-AP interface");
- m_mme->AddEnb (cellId, enbAddress, enbApp->GetS1apSapEnb ());
- m_sgwPgwApp->AddEnb (cellId, enbAddress, sgwAddress);
- enbApp->SetS1apSapMme (m_mme->GetS1apSapMme ());
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
}
-
void
EpcHelper::AddX2Interface (Ptr<Node> enb1, Ptr<Node> enb2)
{
- NS_LOG_FUNCTION (this << enb1 << enb2);
-
- // Create a point to point link between the two eNBs with
- // the corresponding new NetDevices on each side
- NodeContainer enbNodes;
- enbNodes.Add (enb1);
- enbNodes.Add (enb2);
- PointToPointHelper p2ph;
- p2ph.SetDeviceAttribute ("DataRate", DataRateValue (m_x2LinkDataRate));
- p2ph.SetDeviceAttribute ("Mtu", UintegerValue (m_x2LinkMtu));
- p2ph.SetChannelAttribute ("Delay", TimeValue (m_x2LinkDelay));
- NetDeviceContainer enbDevices = p2ph.Install (enb1, enb2);
- NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after installing p2p dev: " << enb1->GetObject<Ipv4> ()->GetNInterfaces ());
- NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after installing p2p dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
- Ptr<NetDevice> enb1Dev = enbDevices.Get (0);
- Ptr<NetDevice> enb2Dev = enbDevices.Get (1);
-
- 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<Ipv4> ()->GetNInterfaces ());
- NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
-
- Ipv4Address enb1X2Address = enbIpIfaces.GetAddress (0);
- Ipv4Address enb2X2Address = enbIpIfaces.GetAddress (1);
-
- // Add X2 interface to both eNBs' X2 entities
- Ptr<EpcX2> enb1X2 = enb1->GetObject<EpcX2> ();
- Ptr<LteEnbNetDevice> enb1LteDev = enb1->GetDevice (0)->GetObject<LteEnbNetDevice> ();
- uint16_t enb1CellId = enb1LteDev->GetCellId ();
- NS_LOG_LOGIC ("LteEnbNetDevice #1 = " << enb1LteDev << " - CellId = " << enb1CellId);
-
- Ptr<EpcX2> enb2X2 = enb2->GetObject<EpcX2> ();
- Ptr<LteEnbNetDevice> enb2LteDev = enb2->GetDevice (0)->GetObject<LteEnbNetDevice> ();
- uint16_t enb2CellId = enb2LteDev->GetCellId ();
- NS_LOG_LOGIC ("LteEnbNetDevice #2 = " << enb2LteDev << " - CellId = " << enb2CellId);
-
- enb1X2->AddX2Interface (enb1CellId, enb1X2Address, enb2CellId, enb2X2Address);
- enb2X2->AddX2Interface (enb2CellId, enb2X2Address, enb1CellId, enb1X2Address);
-
- enb1LteDev->GetRrc ()->AddX2Neighbour (enb2LteDev->GetCellId ());
- enb2LteDev->GetRrc ()->AddX2Neighbour (enb1LteDev->GetCellId ());
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
}
-
void
EpcHelper::AddUe (Ptr<NetDevice> ueDevice, uint64_t imsi)
{
- NS_LOG_FUNCTION (this << imsi << ueDevice );
-
- m_mme->AddUe (imsi);
- m_sgwPgwApp->AddUe (imsi);
-
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
+}
-}
void
EpcHelper::ActivateEpsBearer (Ptr<NetDevice> ueDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer)
{
- NS_LOG_FUNCTION (this << ueDevice << imsi);
-
- // we now retrieve the IPv4 address of the UE and notify it to the SGW;
- // we couldn't do it before since address assignment is triggered by
- // the user simulation program, rather than done by the EPC
- Ptr<Node> ueNode = ueDevice->GetNode ();
- Ptr<Ipv4> ueIpv4 = ueNode->GetObject<Ipv4> ();
- NS_ASSERT_MSG (ueIpv4 != 0, "UEs need to have IPv4 installed before EPS bearers can be activated");
- int32_t interface = ueIpv4->GetInterfaceForDevice (ueDevice);
- NS_ASSERT (interface >= 0);
- NS_ASSERT (ueIpv4->GetNAddresses (interface) == 1);
- Ipv4Address ueAddr = ueIpv4->GetAddress (interface, 0).GetLocal ();
- NS_LOG_LOGIC (" UE IP address: " << ueAddr); m_sgwPgwApp->SetUeAddress (imsi, ueAddr);
-
- m_mme->AddBearer (imsi, tft, bearer);
- Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
- if (ueLteDevice)
- {
- ueLteDevice->GetNas ()->ActivateEpsBearer (bearer, tft);
- }
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
}
Ptr<Node>
EpcHelper::GetPgwNode ()
{
- return m_sgwPgw;
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
+ return Ptr<Node> (0);
}
-
Ipv4InterfaceContainer
EpcHelper::AssignUeIpv4Address (NetDeviceContainer ueDevices)
{
- return m_ueAddressHelper.Assign (ueDevices);
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
+ return Ipv4InterfaceContainer ();
}
-
Ipv4Address
EpcHelper::GetUeDefaultGatewayAddress ()
{
- // return the address of the tun device
- return m_sgwPgw->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal ();
+ NS_FATAL_ERROR (EPC_HELPER_API_CHANGE_MSG);
+ return Ipv4Address ();
}
+
} // namespace ns3
--- a/src/lte/helper/epc-helper.h Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/helper/epc-helper.h Tue Nov 12 13:03:13 2013 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2011-2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ * Copyright (c) 2011-2013 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
@@ -39,12 +39,11 @@
class EpcMme;
/**
- * \brief Helper class to handle the creation of the EPC entities and protocols.
+ * \brief Base helper class to handle the creation of the EPC entities.
*
- * This Helper will create an EPC network topology comprising of a
- * single node that implements both the SGW and PGW functionality, and
- * is connected to all the eNBs in the simulation by means of the S1-U
- * interface.
+ * This class provides the API for the implementation of helpers that
+ * allow to create EPC entities and the nodes and interfaces that host
+ * and connect them.
*/
class EpcHelper : public Object
{
@@ -73,7 +72,7 @@
* \param lteEnbNetDevice the LteEnbNetDevice of the eNB node
* \param cellId ID of the eNB
*/
- void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
+ virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
/**
* Notify the EPC of the existance of a new UE which might attach at a later time
@@ -81,7 +80,7 @@
* \param ueLteDevice the UE device to be attached
* \param imsi the unique identifier of the UE
*/
- void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
+ virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
/**
* Add an X2 interface between two eNB
@@ -89,7 +88,7 @@
* \param enbNode1 one eNB peer of the X2 interface
* \param enbNode2 the other eNB peer of the X2 interface
*/
- void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
+ virtual void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
/**
* Activate an EPS bearer, setting up the corresponding S1-U tunnel.
@@ -102,7 +101,7 @@
* \param tft the Traffic Flow Template of the new bearer
* \param bearer struct describing the characteristics of the EPS bearer to be activated
*/
- void ActivateEpsBearer (Ptr<NetDevice> ueLteDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer);
+ virtual void ActivateEpsBearer (Ptr<NetDevice> ueLteDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer);
/**
@@ -113,7 +112,7 @@
* intended for this method is to allow the user to configure the Gi
* interface of the PGW, i.e., to connect the PGW to the internet.
*/
- Ptr<Node> GetPgwNode ();
+ virtual Ptr<Node> GetPgwNode ();
/**
* Assign IPv4 addresses to UE devices
@@ -122,65 +121,15 @@
*
* \return the interface container, \see Ipv4AddressHelper::Assign() which has similar semantics
*/
- Ipv4InterfaceContainer AssignUeIpv4Address (NetDeviceContainer ueDevices);
+ virtual Ipv4InterfaceContainer AssignUeIpv4Address (NetDeviceContainer ueDevices);
/**
*
* \return the address of the Default Gateway to be used by UEs to reach the internet
*/
- Ipv4Address GetUeDefaultGatewayAddress ();
-
-
-
-private:
-
- /**
- * SGW-PGW network element
- */
-
- /**
- * helper to assign addresses to UE devices as well as to the TUN device of the SGW/PGW
- */
- Ipv4AddressHelper m_ueAddressHelper;
-
- Ptr<Node> m_sgwPgw;
- Ptr<EpcSgwPgwApplication> m_sgwPgwApp;
- Ptr<VirtualNetDevice> m_tunDevice;
- Ptr<EpcMme> m_mme;
-
- /**
- * S1-U interfaces
- */
+ virtual Ipv4Address GetUeDefaultGatewayAddress ();
- /**
- * helper to assign addresses to S1-U NetDevices
- */
- Ipv4AddressHelper m_s1uIpv4AddressHelper;
-
- DataRate m_s1uLinkDataRate;
- Time m_s1uLinkDelay;
- uint16_t m_s1uLinkMtu;
-
- /**
- * UDP port where the GTP-U Socket is bound, fixed by the standard as 2152
- */
- uint16_t m_gtpuUdpPort;
-
- /**
- * Map storing for each IMSI the corresponding eNB NetDevice
- *
- */
- std::map<uint64_t, Ptr<NetDevice> > m_imsiEnbDeviceMap;
-
- /**
- * helper to assign addresses to X2 NetDevices
- */
- Ipv4AddressHelper m_x2Ipv4AddressHelper;
-
- DataRate m_x2LinkDataRate;
- Time m_x2LinkDelay;
- uint16_t m_x2LinkMtu;
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/helper/point-to-point-epc-helper.cc Tue Nov 12 13:03:13 2013 +0100
@@ -0,0 +1,344 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011-2013 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 <jnin@cttc.es>
+ * Nicola Baldo <nbaldo@cttc.es>
+ * Manuel Requena <manuel.requena@cttc.es>
+ */
+
+#include <ns3/point-to-point-epc-helper.h>
+#include <ns3/log.h>
+#include <ns3/inet-socket-address.h>
+#include <ns3/mac48-address.h>
+#include <ns3/eps-bearer.h>
+#include <ns3/ipv4-address.h>
+#include <ns3/internet-stack-helper.h>
+#include <ns3/point-to-point-helper.h>
+#include <ns3/packet-socket-helper.h>
+#include <ns3/packet-socket-address.h>
+#include <ns3/epc-enb-application.h>
+#include <ns3/epc-sgw-pgw-application.h>
+
+#include <ns3/lte-enb-rrc.h>
+#include <ns3/epc-x2.h>
+#include <ns3/lte-enb-net-device.h>
+#include <ns3/lte-ue-net-device.h>
+#include <ns3/epc-mme.h>
+#include <ns3/epc-ue-nas.h>
+
+namespace ns3 {
+
+NS_LOG_COMPONENT_DEFINE ("PointToPointEpcHelper");
+
+NS_OBJECT_ENSURE_REGISTERED (PointToPointEpcHelper);
+
+
+PointToPointEpcHelper::PointToPointEpcHelper ()
+ : m_gtpuUdpPort (2152) // fixed by the standard
+{
+ NS_LOG_FUNCTION (this);
+
+ // 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");
+
+ // we use a /8 net for all UEs
+ m_ueAddressHelper.SetBase ("7.0.0.0", "255.0.0.0");
+
+ // create SgwPgwNode
+ m_sgwPgw = CreateObject<Node> ();
+ InternetStackHelper internet;
+ internet.Install (m_sgwPgw);
+
+ // create S1-U socket
+ Ptr<Socket> sgwPgwS1uSocket = Socket::CreateSocket (m_sgwPgw, TypeId::LookupByName ("ns3::UdpSocketFactory"));
+ int retval = sgwPgwS1uSocket->Bind (InetSocketAddress (Ipv4Address::GetAny (), m_gtpuUdpPort));
+ NS_ASSERT (retval == 0);
+
+ // create TUN device implementing tunneling of user data over GTP-U/UDP/IP
+ m_tunDevice = CreateObject<VirtualNetDevice> ();
+ // allow jumbo packets
+ m_tunDevice->SetAttribute ("Mtu", UintegerValue (30000));
+
+ // yes we need this
+ m_tunDevice->SetAddress (Mac48Address::Allocate ());
+
+ m_sgwPgw->AddDevice (m_tunDevice);
+ NetDeviceContainer tunDeviceContainer;
+ tunDeviceContainer.Add (m_tunDevice);
+
+ // the TUN device is on the same subnet as the UEs, so when a packet
+ // addressed to an UE arrives at the intenet to the WAN interface of
+ // the PGW it will be forwarded to the TUN device.
+ Ipv4InterfaceContainer tunDeviceIpv4IfContainer = m_ueAddressHelper.Assign (tunDeviceContainer);
+
+ // create EpcSgwPgwApplication
+ m_sgwPgwApp = CreateObject<EpcSgwPgwApplication> (m_tunDevice, sgwPgwS1uSocket);
+ m_sgwPgw->AddApplication (m_sgwPgwApp);
+
+ // connect SgwPgwApplication and virtual net device for tunneling
+ m_tunDevice->SetSendCallback (MakeCallback (&EpcSgwPgwApplication::RecvFromTunDevice, m_sgwPgwApp));
+
+ // Create MME and connect with SGW via S11 interface
+ m_mme = CreateObject<EpcMme> ();
+ m_mme->SetS11SapSgw (m_sgwPgwApp->GetS11SapSgw ());
+ m_sgwPgwApp->SetS11SapMme (m_mme->GetS11SapMme ());
+}
+
+PointToPointEpcHelper::~PointToPointEpcHelper ()
+{
+ NS_LOG_FUNCTION (this);
+}
+
+TypeId
+PointToPointEpcHelper::GetTypeId (void)
+{
+ static TypeId tid = TypeId ("ns3::PointToPointEpcHelper")
+ .SetParent<EpcHelper> ()
+ .AddConstructor<PointToPointEpcHelper> ()
+ .AddAttribute ("S1uLinkDataRate",
+ "The data rate to be used for the next S1-U link to be created",
+ DataRateValue (DataRate ("10Gb/s")),
+ MakeDataRateAccessor (&PointToPointEpcHelper::m_s1uLinkDataRate),
+ MakeDataRateChecker ())
+ .AddAttribute ("S1uLinkDelay",
+ "The delay to be used for the next S1-U link to be created",
+ TimeValue (Seconds (0)),
+ MakeTimeAccessor (&PointToPointEpcHelper::m_s1uLinkDelay),
+ MakeTimeChecker ())
+ .AddAttribute ("S1uLinkMtu",
+ "The MTU of the next S1-U link to be created. Note that, because of the additional GTP/UDP/IP tunneling overhead, you need a MTU larger than the end-to-end MTU that you want to support.",
+ UintegerValue (2000),
+ MakeUintegerAccessor (&PointToPointEpcHelper::m_s1uLinkMtu),
+ MakeUintegerChecker<uint16_t> ())
+ .AddAttribute ("X2LinkDataRate",
+ "The data rate to be used for the next X2 link to be created",
+ DataRateValue (DataRate ("10Gb/s")),
+ MakeDataRateAccessor (&PointToPointEpcHelper::m_x2LinkDataRate),
+ MakeDataRateChecker ())
+ .AddAttribute ("X2LinkDelay",
+ "The delay to be used for the next X2 link to be created",
+ TimeValue (Seconds (0)),
+ MakeTimeAccessor (&PointToPointEpcHelper::m_x2LinkDelay),
+ MakeTimeChecker ())
+ .AddAttribute ("X2LinkMtu",
+ "The MTU of the next X2 link to be created. Note that, because of some big X2 messages, you need a big MTU.",
+ UintegerValue (3000),
+ MakeUintegerAccessor (&PointToPointEpcHelper::m_x2LinkMtu),
+ MakeUintegerChecker<uint16_t> ())
+ ;
+ return tid;
+}
+
+void
+PointToPointEpcHelper::DoDispose ()
+{
+ NS_LOG_FUNCTION (this);
+ m_tunDevice->SetSendCallback (MakeNullCallback<bool, Ptr<Packet>, const Address&, const Address&, uint16_t> ());
+ m_tunDevice = 0;
+ m_sgwPgwApp = 0;
+ m_sgwPgw->Dispose ();
+}
+
+
+void
+PointToPointEpcHelper::AddEnb (Ptr<Node> enb, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId)
+{
+ NS_LOG_FUNCTION (this << enb << lteEnbNetDevice << cellId);
+
+ NS_ASSERT (enb == lteEnbNetDevice->GetNode ());
+
+ // add an IPv4 stack to the previously created eNB
+ InternetStackHelper internet;
+ internet.Install (enb);
+ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after node creation: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
+
+ // create a point to point link between the new eNB and the SGW with
+ // the corresponding new NetDevices on each side
+ NodeContainer enbSgwNodes;
+ enbSgwNodes.Add (m_sgwPgw);
+ enbSgwNodes.Add (enb);
+ PointToPointHelper p2ph;
+ p2ph.SetDeviceAttribute ("DataRate", DataRateValue (m_s1uLinkDataRate));
+ p2ph.SetDeviceAttribute ("Mtu", UintegerValue (m_s1uLinkMtu));
+ p2ph.SetChannelAttribute ("Delay", TimeValue (m_s1uLinkDelay));
+ NetDeviceContainer enbSgwDevices = p2ph.Install (enb, m_sgwPgw);
+ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB after installing p2p dev: " << enb->GetObject<Ipv4> ()->GetNInterfaces ());
+ Ptr<NetDevice> enbDev = enbSgwDevices.Get (0);
+ Ptr<NetDevice> sgwDev = enbSgwDevices.Get (1);
+ 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<Ipv4> ()->GetNInterfaces ());
+
+ Ipv4Address enbAddress = enbSgwIpIfaces.GetAddress (0);
+ Ipv4Address sgwAddress = enbSgwIpIfaces.GetAddress (1);
+
+ // create S1-U socket for the ENB
+ Ptr<Socket> enbS1uSocket = Socket::CreateSocket (enb, TypeId::LookupByName ("ns3::UdpSocketFactory"));
+ int retval = enbS1uSocket->Bind (InetSocketAddress (enbAddress, m_gtpuUdpPort));
+ NS_ASSERT (retval == 0);
+
+
+ // give PacketSocket powers to the eNB
+ //PacketSocketHelper packetSocket;
+ //packetSocket.Install (enb);
+
+ // create LTE socket for the ENB
+ Ptr<Socket> enbLteSocket = Socket::CreateSocket (enb, TypeId::LookupByName ("ns3::PacketSocketFactory"));
+ PacketSocketAddress enbLteSocketBindAddress;
+ enbLteSocketBindAddress.SetSingleDevice (lteEnbNetDevice->GetIfIndex ());
+ enbLteSocketBindAddress.SetProtocol (Ipv4L3Protocol::PROT_NUMBER);
+ retval = enbLteSocket->Bind (enbLteSocketBindAddress);
+ NS_ASSERT (retval == 0);
+ PacketSocketAddress enbLteSocketConnectAddress;
+ enbLteSocketConnectAddress.SetPhysicalAddress (Mac48Address::GetBroadcast ());
+ enbLteSocketConnectAddress.SetSingleDevice (lteEnbNetDevice->GetIfIndex ());
+ enbLteSocketConnectAddress.SetProtocol (Ipv4L3Protocol::PROT_NUMBER);
+ retval = enbLteSocket->Connect (enbLteSocketConnectAddress);
+ NS_ASSERT (retval == 0);
+
+
+ NS_LOG_INFO ("create EpcEnbApplication");
+ Ptr<EpcEnbApplication> enbApp = CreateObject<EpcEnbApplication> (enbLteSocket, enbS1uSocket, enbAddress, sgwAddress, cellId);
+ enb->AddApplication (enbApp);
+ NS_ASSERT (enb->GetNApplications () == 1);
+ NS_ASSERT_MSG (enb->GetApplication (0)->GetObject<EpcEnbApplication> () != 0, "cannot retrieve EpcEnbApplication");
+ NS_LOG_LOGIC ("enb: " << enb << ", enb->GetApplication (0): " << enb->GetApplication (0));
+
+
+ NS_LOG_INFO ("Create EpcX2 entity");
+ Ptr<EpcX2> x2 = CreateObject<EpcX2> ();
+ enb->AggregateObject (x2);
+
+ NS_LOG_INFO ("connect S1-AP interface");
+ m_mme->AddEnb (cellId, enbAddress, enbApp->GetS1apSapEnb ());
+ m_sgwPgwApp->AddEnb (cellId, enbAddress, sgwAddress);
+ enbApp->SetS1apSapMme (m_mme->GetS1apSapMme ());
+}
+
+
+void
+PointToPointEpcHelper::AddX2Interface (Ptr<Node> enb1, Ptr<Node> enb2)
+{
+ NS_LOG_FUNCTION (this << enb1 << enb2);
+
+ // Create a point to point link between the two eNBs with
+ // the corresponding new NetDevices on each side
+ NodeContainer enbNodes;
+ enbNodes.Add (enb1);
+ enbNodes.Add (enb2);
+ PointToPointHelper p2ph;
+ p2ph.SetDeviceAttribute ("DataRate", DataRateValue (m_x2LinkDataRate));
+ p2ph.SetDeviceAttribute ("Mtu", UintegerValue (m_x2LinkMtu));
+ p2ph.SetChannelAttribute ("Delay", TimeValue (m_x2LinkDelay));
+ NetDeviceContainer enbDevices = p2ph.Install (enb1, enb2);
+ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #1 after installing p2p dev: " << enb1->GetObject<Ipv4> ()->GetNInterfaces ());
+ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after installing p2p dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
+ Ptr<NetDevice> enb1Dev = enbDevices.Get (0);
+ Ptr<NetDevice> enb2Dev = enbDevices.Get (1);
+
+ 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<Ipv4> ()->GetNInterfaces ());
+ NS_LOG_LOGIC ("number of Ipv4 ifaces of the eNB #2 after assigning Ipv4 addr to X2 dev: " << enb2->GetObject<Ipv4> ()->GetNInterfaces ());
+
+ Ipv4Address enb1X2Address = enbIpIfaces.GetAddress (0);
+ Ipv4Address enb2X2Address = enbIpIfaces.GetAddress (1);
+
+ // Add X2 interface to both eNBs' X2 entities
+ Ptr<EpcX2> enb1X2 = enb1->GetObject<EpcX2> ();
+ Ptr<LteEnbNetDevice> enb1LteDev = enb1->GetDevice (0)->GetObject<LteEnbNetDevice> ();
+ uint16_t enb1CellId = enb1LteDev->GetCellId ();
+ NS_LOG_LOGIC ("LteEnbNetDevice #1 = " << enb1LteDev << " - CellId = " << enb1CellId);
+
+ Ptr<EpcX2> enb2X2 = enb2->GetObject<EpcX2> ();
+ Ptr<LteEnbNetDevice> enb2LteDev = enb2->GetDevice (0)->GetObject<LteEnbNetDevice> ();
+ uint16_t enb2CellId = enb2LteDev->GetCellId ();
+ NS_LOG_LOGIC ("LteEnbNetDevice #2 = " << enb2LteDev << " - CellId = " << enb2CellId);
+
+ enb1X2->AddX2Interface (enb1CellId, enb1X2Address, enb2CellId, enb2X2Address);
+ enb2X2->AddX2Interface (enb2CellId, enb2X2Address, enb1CellId, enb1X2Address);
+
+ enb1LteDev->GetRrc ()->AddX2Neighbour (enb2LteDev->GetCellId ());
+ enb2LteDev->GetRrc ()->AddX2Neighbour (enb1LteDev->GetCellId ());
+}
+
+
+void
+PointToPointEpcHelper::AddUe (Ptr<NetDevice> ueDevice, uint64_t imsi)
+{
+ NS_LOG_FUNCTION (this << imsi << ueDevice );
+
+ m_mme->AddUe (imsi);
+ m_sgwPgwApp->AddUe (imsi);
+
+
+}
+
+void
+PointToPointEpcHelper::ActivateEpsBearer (Ptr<NetDevice> ueDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer)
+{
+ NS_LOG_FUNCTION (this << ueDevice << imsi);
+
+ // we now retrieve the IPv4 address of the UE and notify it to the SGW;
+ // we couldn't do it before since address assignment is triggered by
+ // the user simulation program, rather than done by the EPC
+ Ptr<Node> ueNode = ueDevice->GetNode ();
+ Ptr<Ipv4> ueIpv4 = ueNode->GetObject<Ipv4> ();
+ NS_ASSERT_MSG (ueIpv4 != 0, "UEs need to have IPv4 installed before EPS bearers can be activated");
+ int32_t interface = ueIpv4->GetInterfaceForDevice (ueDevice);
+ NS_ASSERT (interface >= 0);
+ NS_ASSERT (ueIpv4->GetNAddresses (interface) == 1);
+ Ipv4Address ueAddr = ueIpv4->GetAddress (interface, 0).GetLocal ();
+ NS_LOG_LOGIC (" UE IP address: " << ueAddr); m_sgwPgwApp->SetUeAddress (imsi, ueAddr);
+
+ m_mme->AddBearer (imsi, tft, bearer);
+ Ptr<LteUeNetDevice> ueLteDevice = ueDevice->GetObject<LteUeNetDevice> ();
+ if (ueLteDevice)
+ {
+ ueLteDevice->GetNas ()->ActivateEpsBearer (bearer, tft);
+ }
+}
+
+
+Ptr<Node>
+PointToPointEpcHelper::GetPgwNode ()
+{
+ return m_sgwPgw;
+}
+
+
+Ipv4InterfaceContainer
+PointToPointEpcHelper::AssignUeIpv4Address (NetDeviceContainer ueDevices)
+{
+ return m_ueAddressHelper.Assign (ueDevices);
+}
+
+
+
+Ipv4Address
+PointToPointEpcHelper::GetUeDefaultGatewayAddress ()
+{
+ // return the address of the tun device
+ return m_sgwPgw->GetObject<Ipv4> ()->GetAddress (1, 0).GetLocal ();
+}
+
+
+} // namespace ns3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/helper/point-to-point-epc-helper.h Tue Nov 12 13:03:13 2013 +0100
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011-2013 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 <jnin@cttc.es>
+ * Nicola Baldo <nbaldo@cttc.es>
+ * Manuel Requena <manuel.requena@cttc.es>
+ */
+
+#ifndef POINT_TO_POINT_EPC_HELPER_H
+#define POINT_TO_POINT_EPC_HELPER_H
+
+#include <ns3/object.h>
+#include <ns3/ipv4-address-helper.h>
+#include <ns3/data-rate.h>
+#include <ns3/epc-tft.h>
+#include <ns3/eps-bearer.h>
+#include <ns3/epc-helper.h>
+
+namespace ns3 {
+
+class Node;
+class NetDevice;
+class VirtualNetDevice;
+class EpcSgwPgwApplication;
+class EpcX2;
+class EpcMme;
+
+/**
+ * \brief Create an EPC network with PointToPoint links
+ *
+ * This Helper will create an EPC network topology comprising of a
+ * single node that implements both the SGW and PGW functionality, and
+ * an MME node. The S1-U, X2-U and X2-C interfaces are realized over
+ * PointToPoint links.
+ */
+class PointToPointEpcHelper : public EpcHelper
+{
+public:
+
+ /**
+ * Constructor
+ */
+ PointToPointEpcHelper ();
+
+ /**
+ * Destructor
+ */
+ virtual ~PointToPointEpcHelper ();
+
+ // inherited from Object
+ static TypeId GetTypeId (void);
+ virtual void DoDispose ();
+
+ // inherited from EpcHelper
+ virtual void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId);
+ virtual void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi);
+ virtual void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
+ virtual void ActivateEpsBearer (Ptr<NetDevice> ueLteDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer);
+ virtual Ptr<Node> GetPgwNode ();
+ virtual Ipv4InterfaceContainer AssignUeIpv4Address (NetDeviceContainer ueDevices);
+ virtual Ipv4Address GetUeDefaultGatewayAddress ();
+
+
+
+private:
+
+ /**
+ * SGW-PGW network element
+ */
+
+ /**
+ * helper to assign addresses to UE devices as well as to the TUN device of the SGW/PGW
+ */
+ Ipv4AddressHelper m_ueAddressHelper;
+
+ Ptr<Node> m_sgwPgw;
+ Ptr<EpcSgwPgwApplication> m_sgwPgwApp;
+ Ptr<VirtualNetDevice> m_tunDevice;
+ Ptr<EpcMme> m_mme;
+
+ /**
+ * S1-U interfaces
+ */
+
+ /**
+ * helper to assign addresses to S1-U NetDevices
+ */
+ Ipv4AddressHelper m_s1uIpv4AddressHelper;
+
+ DataRate m_s1uLinkDataRate;
+ Time m_s1uLinkDelay;
+ uint16_t m_s1uLinkMtu;
+
+ /**
+ * UDP port where the GTP-U Socket is bound, fixed by the standard as 2152
+ */
+ uint16_t m_gtpuUdpPort;
+
+ /**
+ * Map storing for each IMSI the corresponding eNB NetDevice
+ *
+ */
+ std::map<uint64_t, Ptr<NetDevice> > m_imsiEnbDeviceMap;
+
+ /**
+ * helper to assign addresses to X2 NetDevices
+ */
+ Ipv4AddressHelper m_x2Ipv4AddressHelper;
+
+ DataRate m_x2LinkDataRate;
+ Time m_x2LinkDelay;
+ uint16_t m_x2LinkMtu;
+
+};
+
+
+
+
+} // namespace ns3
+
+#endif // POINT_TO_POINT_EPC_HELPER_H
--- a/src/lte/test/epc-test-s1u-downlink.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/epc-test-s1u-downlink.cc Tue Nov 12 13:03:13 2013 +0100
@@ -23,7 +23,7 @@
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/test.h"
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/epc-enb-application.h"
#include "ns3/packet-sink-helper.h"
#include "ns3/udp-echo-helper.h"
@@ -97,7 +97,7 @@
void
EpcS1uDlTestCase::DoRun ()
{
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
Ptr<Node> pgw = epcHelper->GetPgwNode ();
// allow jumbo packets
--- a/src/lte/test/epc-test-s1u-uplink.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/epc-test-s1u-uplink.cc Tue Nov 12 13:03:13 2013 +0100
@@ -27,7 +27,7 @@
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/test.h"
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/epc-enb-application.h"
#include "ns3/packet-sink-helper.h"
#include "ns3/point-to-point-helper.h"
@@ -293,7 +293,7 @@
void
EpcS1uUlTestCase::DoRun ()
{
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
Ptr<Node> pgw = epcHelper->GetPgwNode ();
// allow jumbo packets
--- a/src/lte/test/lte-test-cell-selection.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/lte-test-cell-selection.cc Tue Nov 12 13:03:13 2013 +0100
@@ -29,7 +29,7 @@
#include <ns3/mobility-helper.h>
#include <ns3/lte-helper.h>
-#include <ns3/epc-helper.h>
+#include <ns3/point-to-point-epc-helper.h>
#include <ns3/internet-stack-helper.h>
#include <ns3/point-to-point-helper.h>
#include <ns3/ipv4-address-helper.h>
@@ -163,11 +163,11 @@
StringValue ("ns3::FriisSpectrumPropagationLossModel"));
lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (m_isIdealRrc));
- Ptr<EpcHelper> epcHelper;
+ Ptr<PointToPointEpcHelper> epcHelper;
if (m_isEpcMode)
{
- epcHelper = CreateObject<EpcHelper> ();
+ epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
}
--- a/src/lte/test/lte-test-fdtbfq-ff-mac-scheduler.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/lte-test-fdtbfq-ff-mac-scheduler.cc Tue Nov 12 13:03:13 2013 +0100
@@ -49,7 +49,7 @@
#include <ns3/boolean.h>
#include <ns3/enum.h>
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/network-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
@@ -267,7 +267,7 @@
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
//LogComponentEnable ("FdTbfqFfMacScheduler", LOG_DEBUG);
@@ -515,7 +515,7 @@
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
Ptr<Node> pgw = epcHelper->GetPgwNode ();
--- a/src/lte/test/lte-test-pss-ff-mac-scheduler.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/lte-test-pss-ff-mac-scheduler.cc Tue Nov 12 13:03:13 2013 +0100
@@ -49,7 +49,7 @@
#include <ns3/boolean.h>
#include <ns3/enum.h>
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/network-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
@@ -268,7 +268,7 @@
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
//LogComponentEnable ("PssFfMacScheduler", LOG_DEBUG);
@@ -516,7 +516,7 @@
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
Ptr<Node> pgw = epcHelper->GetPgwNode ();
--- a/src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc Tue Nov 12 13:03:13 2013 +0100
@@ -49,7 +49,7 @@
#include <ns3/boolean.h>
#include <ns3/enum.h>
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/network-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
@@ -267,7 +267,7 @@
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
//LogComponentEnable ("TdTbfqFfMacScheduler", LOG_DEBUG);
@@ -515,7 +515,7 @@
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
Ptr<Node> pgw = epcHelper->GetPgwNode ();
--- a/src/lte/test/lte-test-ue-measurements.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/lte-test-ue-measurements.cc Tue Nov 12 13:03:13 2013 +0100
@@ -32,7 +32,7 @@
#include <ns3/mobility-helper.h>
#include <ns3/lte-helper.h>
-#include <ns3/epc-helper.h>
+#include <ns3/point-to-point-epc-helper.h>
#include <ns3/internet-stack-helper.h>
#include <ns3/point-to-point-helper.h>
#include <ns3/ipv4-address-helper.h>
@@ -1700,7 +1700,7 @@
NS_LOG_INFO (this << " " << GetName ());
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetAttribute ("PathlossModel",
StringValue ("ns3::FriisSpectrumPropagationLossModel"));
--- a/src/lte/test/test-lte-epc-e2e-data.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/test-lte-epc-e2e-data.cc Tue Nov 12 13:03:13 2013 +0100
@@ -24,7 +24,7 @@
#include "ns3/log.h"
#include "ns3/test.h"
#include "ns3/lte-helper.h"
-#include "ns3/epc-helper.h"
+#include "ns3/point-to-point-epc-helper.h"
#include "ns3/packet-sink-helper.h"
#include "ns3/udp-client-server-helper.h"
#include "ns3/udp-echo-helper.h"
@@ -116,7 +116,7 @@
Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetAttribute("PathlossModel",
--- a/src/lte/test/test-lte-handover-delay.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/test-lte-handover-delay.cc Tue Nov 12 13:03:13 2013 +0100
@@ -32,7 +32,7 @@
#include <ns3/ipv4-interface-container.h>
#include <ns3/lte-helper.h>
-#include <ns3/epc-helper.h>
+#include <ns3/point-to-point-epc-helper.h>
#include <ns3/internet-stack-helper.h>
#include <ns3/point-to-point-helper.h>
#include <ns3/ipv4-address-helper.h>
@@ -96,7 +96,7 @@
<< " handover time = " << m_handoverTime.GetSeconds () << "-----");
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetAttribute ("UseIdealRrc", BooleanValue(m_useIdealRrc));
--- a/src/lte/test/test-lte-handover-target.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/test-lte-handover-target.cc Tue Nov 12 13:03:13 2013 +0100
@@ -35,7 +35,7 @@
#include <ns3/ipv4-interface-container.h>
#include <ns3/lte-helper.h>
-#include <ns3/epc-helper.h>
+#include <ns3/point-to-point-epc-helper.h>
#include <ns3/internet-stack-helper.h>
#include <ns3/point-to-point-helper.h>
#include <ns3/ipv4-address-helper.h>
@@ -218,7 +218,7 @@
BooleanValue (false)); // disable control channel error model
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
- Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
+ Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
lteHelper->SetEpcHelper (epcHelper);
lteHelper->SetAttribute ("PathlossModel",
StringValue ("ns3::FriisSpectrumPropagationLossModel"));
--- a/src/lte/test/test-lte-x2-handover-measures.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/test-lte-x2-handover-measures.cc Tue Nov 12 13:03:13 2013 +0100
@@ -98,7 +98,7 @@
bool m_admitHo;
bool m_useIdealRrc;
Ptr<LteHelper> m_lteHelper;
- Ptr<EpcHelper> m_epcHelper;
+ Ptr<PointToPointEpcHelper> m_epcHelper;
struct BearerData
{
@@ -236,7 +236,7 @@
if (m_epc)
{
- m_epcHelper = CreateObject<EpcHelper> ();
+ m_epcHelper = CreateObject<PointToPointEpcHelper> ();
m_lteHelper->SetEpcHelper (m_epcHelper);
}
--- a/src/lte/test/test-lte-x2-handover.cc Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/test/test-lte-x2-handover.cc Tue Nov 12 13:03:13 2013 +0100
@@ -72,7 +72,7 @@
bool m_admitHo;
bool m_useIdealRrc;
Ptr<LteHelper> m_lteHelper;
- Ptr<EpcHelper> m_epcHelper;
+ Ptr<PointToPointEpcHelper> m_epcHelper;
struct BearerData
{
@@ -167,7 +167,7 @@
if (m_epc)
{
- m_epcHelper = CreateObject<EpcHelper> ();
+ m_epcHelper = CreateObject<PointToPointEpcHelper> ();
m_lteHelper->SetEpcHelper (m_epcHelper);
}
--- a/src/lte/wscript Sun Nov 10 16:53:04 2013 -0800
+++ b/src/lte/wscript Tue Nov 12 13:03:13 2013 +0100
@@ -40,6 +40,7 @@
'helper/lte-helper.cc',
'helper/lte-stats-calculator.cc',
'helper/epc-helper.cc',
+ 'helper/point-to-point-epc-helper.cc',
'helper/radio-bearer-stats-calculator.cc',
'helper/radio-bearer-stats-connector.cc',
'helper/phy-stats-calculator.cc',
@@ -193,6 +194,7 @@
'helper/lte-helper.h',
'helper/lte-stats-calculator.h',
'helper/epc-helper.h',
+ 'helper/point-to-point-epc-helper.h',
'helper/phy-stats-calculator.h',
'helper/mac-stats-calculator.h',
'helper/phy-tx-stats-calculator.h',