A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::EpcMmeApplication Class Reference

This application implements the Mobility Management Entity (MME) according to the 3GPP TS 23.401 document. More...

#include "epc-mme-application.h"

+ Inheritance diagram for ns3::EpcMmeApplication:
+ Collaboration diagram for ns3::EpcMmeApplication:

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.
 
EpcS1apSapMmeGetS1apSapMme ()
 
- Public Member Functions inherited from ns3::Application
 Application ()
 
 ~Application () override
 
virtual int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this Application object.
 
Ptr< NodeGetNode () 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< ObjectGetObject () 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< ObjectGetObject (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.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- 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.
 
SimpleRefCountoperator= (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, bool permissive=false) 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.
 
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< Socketm_s11Socket
 Socket to send/receive messages in the S11 interface.
 
EpcS1apSapMmem_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 DoInitialize () override
 Initialize() implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
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< Nodem_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.
 

Detailed Description

This application implements the Mobility Management Entity (MME) according to the 3GPP TS 23.401 document.

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:

  • Bearer management functions including dedicated bearer establishment
  • NAS signalling
  • Tunnel Management messages

Others functions enumerated in section 4.4.2 of 3GPP TS 23.401 are not supported.

Definition at line 39 of file epc-mme-application.h.

Constructor & Destructor Documentation

◆ EpcMmeApplication()

ns3::EpcMmeApplication::EpcMmeApplication ( )

Constructor.

Definition at line 24 of file epc-mme-application.cc.

References m_s1apSapMme, MemberEpcS1apSapMme< EpcMmeApplication >, and NS_LOG_FUNCTION.

◆ ~EpcMmeApplication()

ns3::EpcMmeApplication::~EpcMmeApplication ( )
override

Destructor.

Definition at line 31 of file epc-mme-application.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddBearer()

uint8_t ns3::EpcMmeApplication::AddBearer ( uint64_t imsi,
Ptr< EpcTft > tft,
EpsBearer bearer )

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.

Parameters
imsiUE identifier
tfttraffic flow template of the bearer
bearerQoS characteristics of the bearer
Returns
bearer ID

Definition at line 92 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.

◆ AddEnb()

void ns3::EpcMmeApplication::AddEnb ( uint16_t ecgi,
Ipv4Address enbS1UAddr,
EpcS1apSapEnb * enbS1apSap )

Add a new eNB to the MME.

Parameters
ecgiE-UTRAN Cell Global ID, the unique identifier of the eNodeB
enbS1UAddrIPv4 address of the eNB for S1-U communications
enbS1apSapthe eNB side of the S1-AP SAP

Definition at line 70 of file epc-mme-application.cc.

References ns3::Create(), m_enbInfoMap, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ AddSgw()

void ns3::EpcMmeApplication::AddSgw ( Ipv4Address sgwS11Addr,
Ipv4Address mmeS11Addr,
Ptr< Socket > mmeS11Socket )

Add a new SGW to the MME.

Parameters
sgwS11AddrIPv4 address of the SGW S11 interface
mmeS11AddrIPv4 address of the MME S11 interface
mmeS11Socketsocket of the MME S11 interface

Definition at line 60 of file epc-mme-application.cc.

References m_mmeS11Addr, m_s11Socket, m_sgwS11Addr, ns3::MakeCallback(), NS_LOG_FUNCTION, RecvFromS11Socket(), and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

◆ AddUe()

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.

Parameters
imsithe unique identifier of the UE

Definition at line 81 of file epc-mme-application.cc.

References ns3::Create(), m_ueInfoMap, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::EpcMmeApplication::DoDispose ( )
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::Application.

Definition at line 37 of file epc-mme-application.cc.

References m_s1apSapMme, and NS_LOG_FUNCTION.

◆ DoErabReleaseIndication()

void ns3::EpcMmeApplication::DoErabReleaseIndication ( uint64_t mmeUeS1Id,
uint16_t enbUeS1Id,
std::list< EpcS1apSapMme::ErabToBeReleasedIndication > erabToBeReleaseIndication )
private

Process ERAB Release Indication received from an eNB.

Parameters
mmeUeS1Idthe MME UE S1 ID
enbUeS1Idthe ENB UE S1 ID
erabToBeReleaseIndicationthe ERAB to be release indication list

Definition at line 206 of file epc-mme-application.cc.

References ns3::GtpcHeader::ComputeMessageLength(), ns3::Create(), 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().

+ Here is the call graph for this function:

◆ DoInitialContextSetupResponse()

void ns3::EpcMmeApplication::DoInitialContextSetupResponse ( uint64_t mmeUeS1Id,
uint16_t enbUeS1Id,
std::list< EpcS1apSapMme::ErabSetupItem > erabSetupList )
private

Process the S1 Initial Context Setup Response received from an eNB.

Parameters
mmeUeS1Idthe MME UE S1 ID
enbUeS1Idthe ENB UE S1 ID
erabSetupListthe ERAB setup list

Definition at line 154 of file epc-mme-application.cc.

References NS_FATAL_ERROR, and NS_LOG_FUNCTION.

◆ DoInitialUeMessage()

void ns3::EpcMmeApplication::DoInitialUeMessage ( uint64_t mmeUeS1Id,
uint16_t enbUeS1Id,
uint64_t imsi,
uint16_t ecgi )
private

◆ DoPathSwitchRequest()

void ns3::EpcMmeApplication::DoPathSwitchRequest ( uint64_t enbUeS1Id,
uint64_t mmeUeS1Id,
uint16_t cgi,
std::list< EpcS1apSapMme::ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList )
private

◆ DoRecvCreateSessionResponse()

void ns3::EpcMmeApplication::DoRecvCreateSessionResponse ( GtpcHeader & header,
Ptr< Packet > packet )
private

Process GTP-C Create Session Response message.

Parameters
headerthe GTP-C header
packetthe packet containing the message

Definition at line 283 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRecvDeleteBearerRequest()

void ns3::EpcMmeApplication::DoRecvDeleteBearerRequest ( GtpcHeader & header,
Ptr< Packet > packet )
private

Process GTP-C Delete Bearer Request message.

Parameters
headerthe GTP-C header
packetthe packet containing the message

Definition at line 348 of file epc-mme-application.cc.

References ns3::GtpcHeader::ComputeMessageLength(), ns3::Create(), 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRecvModifyBearerResponse()

void ns3::EpcMmeApplication::DoRecvModifyBearerResponse ( GtpcHeader & header,
Ptr< Packet > packet )
private

Process GTP-C Modify Bearer Response message.

Parameters
headerthe GTP-C header
packetthe packet containing the message

Definition at line 320 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetS1apSapMme()

EpcS1apSapMme * ns3::EpcMmeApplication::GetS1apSapMme ( )
Returns
the MME side of the S1-AP SAP

Definition at line 54 of file epc-mme-application.cc.

References m_s1apSapMme.

◆ GetTypeId()

TypeId ns3::EpcMmeApplication::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 44 of file epc-mme-application.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ RecvFromS11Socket()

void ns3::EpcMmeApplication::RecvFromS11Socket ( Ptr< Socket > socket)
private

Reads the S11 messages from a socket.

Parameters
socketthe socket

Definition at line 253 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveBearer()

void ns3::EpcMmeApplication::RemoveBearer ( Ptr< UeInfo > ueInfo,
uint8_t epsBearerId )
private

This Function erases all contexts of bearer from MME side.

Parameters
ueInfoUE information pointer
epsBearerIdBearer Id which need to be removed corresponding to UE

Definition at line 236 of file epc-mme-application.cc.

References NS_LOG_FUNCTION.

Referenced by DoRecvDeleteBearerRequest().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ MemberEpcS1apSapMme< EpcMmeApplication >

friend class MemberEpcS1apSapMme< EpcMmeApplication >
friend

allow MemberEpcS1apSapMme<EpcMme> class friend access

Definition at line 1 of file epc-mme-application.h.

Referenced by EpcMmeApplication().

Member Data Documentation

◆ m_enbInfoMap

std::map<uint16_t, Ptr<EnbInfo> > ns3::EpcMmeApplication::m_enbInfoMap
private

EnbInfo stored by EGCI.

Definition at line 225 of file epc-mme-application.h.

Referenced by AddEnb(), DoRecvCreateSessionResponse(), and DoRecvModifyBearerResponse().

◆ m_gtpcUdpPort

uint16_t ns3::EpcMmeApplication::m_gtpcUdpPort
private

UDP port for GTP-C protocol. Fixed by the standard to port 2123.

Definition at line 232 of file epc-mme-application.h.

Referenced by DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().

◆ m_mmeS11Addr

Ipv4Address ns3::EpcMmeApplication::m_mmeS11Addr
private

IPv4 address of the MME S11 interface.

Definition at line 230 of file epc-mme-application.h.

Referenced by AddSgw(), and DoInitialUeMessage().

◆ m_s11Socket

Ptr<Socket> ns3::EpcMmeApplication::m_s11Socket
private

Socket to send/receive messages in the S11 interface.

Definition at line 229 of file epc-mme-application.h.

Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), DoRecvDeleteBearerRequest(), and RecvFromS11Socket().

◆ m_s1apSapMme

EpcS1apSapMme* ns3::EpcMmeApplication::m_s1apSapMme
private

EpcS1apSapMme.

Definition at line 227 of file epc-mme-application.h.

Referenced by EpcMmeApplication(), DoDispose(), and GetS1apSapMme().

◆ m_sgwS11Addr

Ipv4Address ns3::EpcMmeApplication::m_sgwS11Addr
private

IPv4 address of the SGW S11 interface.

Definition at line 231 of file epc-mme-application.h.

Referenced by AddSgw(), DoErabReleaseIndication(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoRecvDeleteBearerRequest().

◆ m_ueInfoMap

std::map<uint64_t, Ptr<UeInfo> > ns3::EpcMmeApplication::m_ueInfoMap
private

The documentation for this class was generated from the following files: