This application implements the Mobility Management Entity (MME) according to the 3GPP TS 23.401 document. More...
#include "epc-mme-application.h"
Classes | |
struct | BearerInfo |
Hold info on an EPS bearer to be activated. More... | |
struct | EnbInfo |
Hold info on an ENB. More... | |
struct | UeInfo |
Hold info on a UE. More... | |
Public Member Functions | |
EpcMmeApplication () | |
Constructor. | |
~EpcMmeApplication () override | |
Destructor. | |
uint8_t | AddBearer (uint64_t imsi, Ptr< EpcTft > tft, EpsBearer bearer) |
Add an EPS bearer to the list of bearers to be activated for this UE. | |
void | AddEnb (uint16_t ecgi, Ipv4Address enbS1UAddr, EpcS1apSapEnb *enbS1apSap) |
Add a new eNB to the MME. | |
void | AddSgw (Ipv4Address sgwS11Addr, Ipv4Address mmeS11Addr, Ptr< Socket > mmeS11Socket) |
Add a new SGW to the MME. | |
void | AddUe (uint64_t imsi) |
Add a new UE to the MME. | |
void | DoDispose () override |
Destructor implementation. | |
EpcS1apSapMme * | GetS1apSapMme () |
Public Member Functions inherited from ns3::Application | |
Application () | |
~Application () override | |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
void | SetStartTime (Time start) |
Specify application start time. | |
void | SetStopTime (Time stop) |
Specify application stop time. | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. | |
~Object () override | |
Destructor. | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. | |
void | Dispose () |
Dispose of this Object. | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. | |
bool | IsInitialized () const |
Check if the object has been initialized. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Private Member Functions | |
void | DoErabReleaseIndication (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabToBeReleasedIndication > erabToBeReleaseIndication) |
Process ERAB Release Indication received from an eNB. | |
void | DoInitialContextSetupResponse (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabSetupItem > erabSetupList) |
Process the S1 Initial Context Setup Response received from an eNB. | |
void | DoInitialUeMessage (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t imsi, uint16_t ecgi) |
Process the S1 Initial UE Message received from an eNB. | |
void | DoPathSwitchRequest (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< EpcS1apSapMme::ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList) |
Process the S1 Path Switch Request received from an eNB. | |
void | DoRecvCreateSessionResponse (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Create Session Response message. | |
void | DoRecvDeleteBearerRequest (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Delete Bearer Request message. | |
void | DoRecvModifyBearerResponse (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Modify Bearer Response message. | |
void | RecvFromS11Socket (Ptr< Socket > socket) |
Reads the S11 messages from a socket. | |
void | RemoveBearer (Ptr< UeInfo > ueInfo, uint8_t epsBearerId) |
This Function erases all contexts of bearer from MME side. | |
Private Attributes | |
std::map< uint16_t, Ptr< EnbInfo > > | m_enbInfoMap |
EnbInfo stored by EGCI. | |
uint16_t | m_gtpcUdpPort |
UDP port for GTP-C protocol. Fixed by the standard to port 2123. | |
Ipv4Address | m_mmeS11Addr |
IPv4 address of the MME S11 interface. | |
Ptr< Socket > | m_s11Socket |
Socket to send/receive messages in the S11 interface. | |
EpcS1apSapMme * | m_s1apSapMme |
EpcS1apSapMme. | |
Ipv4Address | m_sgwS11Addr |
IPv4 address of the SGW S11 interface. | |
std::map< uint64_t, Ptr< UeInfo > > | m_ueInfoMap |
UeInfo stored by IMSI. | |
Friends | |
class | MemberEpcS1apSapMme< EpcMmeApplication > |
allow MemberEpcS1apSapMme<EpcMme> class friend access | |
Additional Inherited Members | |
Public Types inherited from ns3::Application | |
typedef void(* | DelayAddressCallback) (const Time &delay, const Address &from) |
Common callback signature for packet delay and address. | |
typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
Common signature used by callbacks to application's state transition trace source. | |
Protected Member Functions inherited from ns3::Application | |
void | DoDispose () override |
Destructor implementation. | |
void | DoInitialize () override |
Initialize() implementation. | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoDispose () |
Destructor implementation. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Protected Attributes inherited from ns3::Application | |
Ptr< Node > | m_node |
The node that this application is installed on. | |
EventId | m_startEvent |
The event that will fire at m_startTime to start the application. | |
Time | m_startTime |
The simulation time that the application will start. | |
EventId | m_stopEvent |
The event that will fire at m_stopTime to end the application. | |
Time | m_stopTime |
The simulation time that the application will end. | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
This application implements the Mobility Management Entity (MME) according to the 3GPP TS 23.401 document.
Introspection did not find any typical Config paths.
This Application implements the MME side of the S1-MME interface between the MME node and the eNB nodes and the MME side of the S11 interface between the MME node and the SGW node. It supports the following functions and messages:
Others functions enumerated in section 4.4.2 of 3GPP TS 23.401 are not supported.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 240 bytes (on a 64-bit architecture).
Definition at line 50 of file epc-mme-application.h.
ns3::EpcMmeApplication::EpcMmeApplication | ( | ) |
Constructor.
Definition at line 35 of file epc-mme-application.cc.
References m_s1apSapMme, MemberEpcS1apSapMme< EpcMmeApplication >, and NS_LOG_FUNCTION.
|
override |
Add an EPS bearer to the list of bearers to be activated for this UE.
The bearer will be activated when the UE enters the ECM connected state.
imsi | UE identifier |
tft | traffic flow template of the bearer |
bearer | QoS characteristics of the bearer |
Definition at line 103 of file epc-mme-application.cc.
References ns3::EpcMmeApplication::BearerInfo::bearer, ns3::EpcMmeApplication::BearerInfo::bearerId, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_FUNCTION, and ns3::EpcMmeApplication::BearerInfo::tft.
void ns3::EpcMmeApplication::AddEnb | ( | uint16_t | ecgi, |
Ipv4Address | enbS1UAddr, | ||
EpcS1apSapEnb * | enbS1apSap | ||
) |
Add a new eNB to the MME.
ecgi | E-UTRAN Cell Global ID, the unique identifier of the eNodeB |
enbS1UAddr | IPv4 address of the eNB for S1-U communications |
enbS1apSap | the eNB side of the S1-AP SAP |
Definition at line 81 of file epc-mme-application.cc.
References m_enbInfoMap, and NS_LOG_FUNCTION.
void ns3::EpcMmeApplication::AddSgw | ( | Ipv4Address | sgwS11Addr, |
Ipv4Address | mmeS11Addr, | ||
Ptr< Socket > | mmeS11Socket | ||
) |
Add a new SGW to the MME.
sgwS11Addr | IPv4 address of the SGW S11 interface |
mmeS11Addr | IPv4 address of the MME S11 interface |
mmeS11Socket | socket of the MME S11 interface |
Definition at line 71 of file epc-mme-application.cc.
References m_mmeS11Addr, m_s11Socket, m_sgwS11Addr, ns3::MakeCallback(), NS_LOG_FUNCTION, RecvFromS11Socket(), and ns3::Socket::SetRecvCallback().
void ns3::EpcMmeApplication::AddUe | ( | uint64_t | imsi | ) |
Add a new UE to the MME.
This is the equivalent of storing the UE credentials before the UE is ever turned on.
imsi | the unique identifier of the UE |
Definition at line 92 of file epc-mme-application.cc.
References m_ueInfoMap, and NS_LOG_FUNCTION.
|
overridevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 48 of file epc-mme-application.cc.
References m_s1apSapMme, and NS_LOG_FUNCTION.
|
private |
Process ERAB Release Indication received from an eNB.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
erabToBeReleaseIndication | the ERAB to be release indication list |
Definition at line 217 of file epc-mme-application.cc.
References ns3::GtpcHeader::ComputeMessageLength(), ns3::GtpcDeleteBearerCommandMessage::BearerContext::m_epsBearerId, m_gtpcUdpPort, m_s11Socket, m_sgwS11Addr, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Socket::SendTo(), ns3::GtpcDeleteBearerCommandMessage::SetBearerContexts(), and ns3::GtpcHeader::SetTeid().
|
private |
Process the S1 Initial Context Setup Response received from an eNB.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
erabSetupList | the ERAB setup list |
Definition at line 165 of file epc-mme-application.cc.
References NS_FATAL_ERROR, and NS_LOG_FUNCTION.
|
private |
Process the S1 Initial UE Message received from an eNB.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
imsi | the IMSI |
ecgi | the ECGI |
Definition at line 121 of file epc-mme-application.cc.
References ns3::GtpcHeader::Fteid_t::addr, ns3::GtpcCreateSessionRequestMessage::BearerContextToBeCreated::bearerLevelQos, ns3::GtpcHeader::ComputeMessageLength(), ns3::GtpcCreateSessionRequestMessage::BearerContextToBeCreated::epsBearerId, ns3::GtpcHeader::Fteid_t::interfaceType, m_gtpcUdpPort, m_mmeS11Addr, m_s11Socket, m_sgwS11Addr, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::GtpcHeader::S11_MME_GTPC, ns3::Socket::SendTo(), ns3::GtpcCreateSessionRequestMessage::SetBearerContextsToBeCreated(), ns3::GtpcCreateSessionRequestMessage::SetImsi(), ns3::GtpcCreateSessionRequestMessage::SetSenderCpFteid(), ns3::GtpcHeader::SetTeid(), ns3::GtpcCreateSessionRequestMessage::SetUliEcgi(), ns3::GtpcHeader::Fteid_t::teid, and ns3::GtpcCreateSessionRequestMessage::BearerContextToBeCreated::tft.
|
private |
Process the S1 Path Switch Request received from an eNB.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
cgi | the CGI |
erabToBeSwitchedInDownlinkList | the ERAB to be switched in downlink list |
Definition at line 175 of file epc-mme-application.cc.
References ns3::GtpcHeader::Fteid_t::addr, ns3::GtpcHeader::ComputeMessageLength(), ns3::GtpcModifyBearerRequestMessage::BearerContextToBeModified::epsBearerId, ns3::GtpcModifyBearerRequestMessage::BearerContextToBeModified::fteid, ns3::GtpcHeader::Fteid_t::interfaceType, m_gtpcUdpPort, m_s11Socket, m_sgwS11Addr, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::GtpcHeader::S1U_ENB_GTPU, ns3::Socket::SendTo(), ns3::GtpcModifyBearerRequestMessage::SetBearerContextsToBeModified(), ns3::GtpcModifyBearerRequestMessage::SetImsi(), ns3::GtpcHeader::SetTeid(), ns3::GtpcModifyBearerRequestMessage::SetUliEcgi(), and ns3::GtpcHeader::Fteid_t::teid.
|
private |
Process GTP-C Create Session Response message.
header | the GTP-C header |
packet | the packet containing the message |
Definition at line 294 of file epc-mme-application.cc.
References ns3::EpcS1apSapEnb::ErabToBeSetupItem::erabId, ns3::EpcS1apSapEnb::ErabToBeSetupItem::erabLevelQosParameters, ns3::GtpcCreateSessionResponseMessage::GetBearerContextsCreated(), ns3::GtpcHeader::GetTeid(), m_enbInfoMap, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::EpcS1apSapEnb::ErabToBeSetupItem::sgwTeid, and ns3::EpcS1apSapEnb::ErabToBeSetupItem::transportLayerAddress.
Referenced by RecvFromS11Socket().
|
private |
Process GTP-C Delete Bearer Request message.
header | the GTP-C header |
packet | the packet containing the message |
Definition at line 359 of file epc-mme-application.cc.
References ns3::GtpcHeader::ComputeMessageLength(), ns3::GtpcDeleteBearerRequestMessage::GetEpsBearerIds(), ns3::GtpcHeader::GetTeid(), m_gtpcUdpPort, m_s11Socket, m_sgwS11Addr, m_ueInfoMap, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, RemoveBearer(), ns3::Socket::SendTo(), ns3::GtpcDeleteBearerResponseMessage::SetEpsBearerIds(), and ns3::GtpcHeader::SetTeid().
Referenced by RecvFromS11Socket().
|
private |
Process GTP-C Modify Bearer Response message.
header | the GTP-C header |
packet | the packet containing the message |
Definition at line 331 of file epc-mme-application.cc.
References ns3::GtpcModifyBearerResponseMessage::GetCause(), ns3::GtpcHeader::GetTeid(), m_enbInfoMap, m_ueInfoMap, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::GtpcIes::REQUEST_ACCEPTED.
Referenced by RecvFromS11Socket().
EpcS1apSapMme * ns3::EpcMmeApplication::GetS1apSapMme | ( | ) |
Definition at line 65 of file epc-mme-application.cc.
References m_s1apSapMme.
|
static |
Get the type ID.
Definition at line 55 of file epc-mme-application.cc.
References ns3::TypeId::SetParent().
Reads the S11 messages from a socket.
socket | the socket |
Definition at line 264 of file epc-mme-application.cc.
References ns3::GtpcHeader::CreateSessionResponse, ns3::GtpcHeader::DeleteBearerRequest, DoRecvCreateSessionResponse(), DoRecvDeleteBearerRequest(), DoRecvModifyBearerResponse(), ns3::GtpcHeader::GetMessageType(), m_s11Socket, ns3::GtpcHeader::ModifyBearerResponse, NS_ASSERT, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by AddSgw().
This Function erases all contexts of bearer from MME side.
ueInfo | UE information pointer |
epsBearerId | Bearer Id which need to be removed corresponding to UE |
Definition at line 247 of file epc-mme-application.cc.
References NS_LOG_FUNCTION.
Referenced by DoRecvDeleteBearerRequest().
|
friend |
allow MemberEpcS1apSapMme<EpcMme> class friend access
Definition at line 1 of file epc-mme-application.h.
Referenced by EpcMmeApplication().
EnbInfo stored by EGCI.
Definition at line 236 of file epc-mme-application.h.
Referenced by AddEnb(), DoRecvCreateSessionResponse(), and DoRecvModifyBearerResponse().
|
private |
UDP port for GTP-C protocol. Fixed by the standard to port 2123.
Definition at line 243 of file epc-mme-application.h.
Referenced by DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().
|
private |
IPv4 address of the MME S11 interface.
Definition at line 241 of file epc-mme-application.h.
Referenced by AddSgw(), and DoInitialUeMessage().
Socket to send/receive messages in the S11 interface.
Definition at line 240 of file epc-mme-application.h.
Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), DoRecvDeleteBearerRequest(), and RecvFromS11Socket().
|
private |
Definition at line 238 of file epc-mme-application.h.
Referenced by EpcMmeApplication(), DoDispose(), and GetS1apSapMme().
|
private |
IPv4 address of the SGW S11 interface.
Definition at line 242 of file epc-mme-application.h.
Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().
UeInfo stored by IMSI.
Definition at line 214 of file epc-mme-application.h.
Referenced by AddBearer(), AddUe(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), DoRecvCreateSessionResponse(), DoRecvDeleteBearerRequest(), and DoRecvModifyBearerResponse().