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. More... | |
virtual | ~EpcMmeApplication () |
Destructor. More... | |
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. More... | |
void | AddEnb (uint16_t ecgi, Ipv4Address enbS1UAddr, EpcS1apSapEnb *enbS1apSap) |
Add a new eNB to the MME. More... | |
void | AddSgw (Ipv4Address sgwS11Addr, Ipv4Address mmeS11Addr, Ptr< Socket > mmeS11Socket) |
Add a new SGW to the MME. More... | |
void | AddUe (uint64_t imsi) |
Add a new UE to the MME. More... | |
virtual void | DoDispose () |
Destructor implementation. More... | |
EpcS1apSapMme * | GetS1apSapMme () |
Public Member Functions inherited from ns3::Application | |
Application () | |
virtual | ~Application () |
Ptr< Node > | GetNode () const |
void | SetNode (Ptr< Node > node) |
void | SetStartTime (Time start) |
Specify application start time. More... | |
void | SetStopTime (Time stop) |
Specify application stop time. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
void | DoErabReleaseIndication (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabToBeReleasedIndication > erabToBeReleaseIndication) |
Process ERAB Release Indication received from an eNB. More... | |
void | DoInitialContextSetupResponse (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabSetupItem > erabSetupList) |
Process the S1 Initial Context Setup Response received from an eNB. More... | |
void | DoInitialUeMessage (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t imsi, uint16_t ecgi) |
Process the S1 Initial UE Message received from an eNB. More... | |
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. More... | |
void | DoRecvCreateSessionResponse (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Create Session Response message. More... | |
void | DoRecvDeleteBearerRequest (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Delete Bearer Request message. More... | |
void | DoRecvModifyBearerResponse (GtpcHeader &header, Ptr< Packet > packet) |
Process GTP-C Modify Bearer Response message. More... | |
void | RecvFromS11Socket (Ptr< Socket > socket) |
Reads the S11 messages from a socket. More... | |
void | RemoveBearer (Ptr< UeInfo > ueInfo, uint8_t epsBearerId) |
This Function erases all contexts of bearer from MME side. More... | |
Private Attributes | |
std::map< uint16_t, Ptr< EnbInfo > > | m_enbInfoMap |
EnbInfo stored by EGCI. More... | |
uint16_t | m_gtpcUdpPort |
UDP port for GTP-C protocol. Fixed by the standard to port 2123. More... | |
Ipv4Address | m_mmeS11Addr |
IPv4 address of the MME S11 interface. More... | |
Ptr< Socket > | m_s11Socket |
Socket to send/receive messages in the S11 interface. More... | |
EpcS1apSapMme * | m_s1apSapMme |
EpcS1apSapMme. More... | |
Ipv4Address | m_sgwS11Addr |
IPv4 address of the SGW S11 interface. More... | |
std::map< uint64_t, Ptr< UeInfo > > | m_ueInfoMap |
UeInfo stored by IMSI. More... | |
Friends | |
class | MemberEpcS1apSapMme< EpcMmeApplication > |
allow MemberEpcS1apSapMme<EpcMme> class friend access More... | |
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. More... | |
typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
Common signature used by callbacks to application's state transition trace source. More... | |
Protected Member Functions inherited from ns3::Application | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Protected Attributes inherited from ns3::Application | |
Ptr< Node > | m_node |
The node that this application is installed on. More... | |
EventId | m_startEvent |
The event that will fire at m_startTime to start the application. More... | |
Time | m_startTime |
The simulation time that the application will start. More... | |
EventId | m_stopEvent |
The event that will fire at m_stopTime to end the application. More... | |
Time | m_stopTime |
The simulation time that the application will end. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
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 46 of file epc-mme-application.h.
ns3::EpcMmeApplication::EpcMmeApplication | ( | ) |
Constructor.
Definition at line 31 of file epc-mme-application.cc.
References m_s1apSapMme, MemberEpcS1apSapMme< EpcMmeApplication >, and NS_LOG_FUNCTION.
|
virtual |
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 98 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 76 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 66 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 87 of file epc-mme-application.cc.
References m_ueInfoMap, and NS_LOG_FUNCTION.
|
virtual |
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::Application.
Definition at line 43 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 203 of file epc-mme-application.cc.
References ns3::Packet::AddHeader(), 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 157 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 116 of file epc-mme-application.cc.
References ns3::Packet::AddHeader(), 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 164 of file epc-mme-application.cc.
References ns3::Packet::AddHeader(), 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 278 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::Packet::RemoveHeader(), 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 339 of file epc-mme-application.cc.
References ns3::Packet::AddHeader(), 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::Packet::RemoveHeader(), 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 315 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, ns3::Packet::RemoveHeader(), and ns3::GtpcIes::REQUEST_ACCEPTED.
Referenced by RecvFromS11Socket().
EpcS1apSapMme * ns3::EpcMmeApplication::GetS1apSapMme | ( | ) |
Definition at line 60 of file epc-mme-application.cc.
References m_s1apSapMme.
|
static |
Get the type ID.
Definition at line 50 of file epc-mme-application.cc.
References ns3::TypeId::SetParent().
Reads the S11 messages from a socket.
socket | the socket |
Definition at line 248 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, NS_LOG_FUNCTION, ns3::Packet::PeekHeader(), and ns3::Socket::Recv().
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 230 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 227 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 235 of file epc-mme-application.h.
Referenced by DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().
|
private |
IPv4 address of the MME S11 interface.
Definition at line 233 of file epc-mme-application.h.
Referenced by AddSgw(), and DoInitialUeMessage().
Socket to send/receive messages in the S11 interface.
Definition at line 232 of file epc-mme-application.h.
Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), DoRecvDeleteBearerRequest(), and RecvFromS11Socket().
|
private |
Definition at line 230 of file epc-mme-application.h.
Referenced by EpcMmeApplication(), DoDispose(), and GetS1apSapMme().
|
private |
IPv4 address of the SGW S11 interface.
Definition at line 234 of file epc-mme-application.h.
Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().
UeInfo stored by IMSI.
Definition at line 205 of file epc-mme-application.h.
Referenced by AddBearer(), AddUe(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), DoRecvCreateSessionResponse(), DoRecvDeleteBearerRequest(), and DoRecvModifyBearerResponse().