22 #include "ns3/epc-gtpc-header.h"    23 #include "ns3/epc-mme-application.h"    32   : m_gtpcUdpPort (2123) 
   101   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   103   NS_ASSERT_MSG (it->second->bearerCounter < 11, 
"too many bearers already! " << it->second->bearerCounter);
   105   bearerInfo.
bearerId = ++(it->second->bearerCounter);
   106   bearerInfo.
tft = tft;
   107   bearerInfo.
bearer = bearer;
   108   it->second->bearersToBeActivated.push_back (bearerInfo);
   119   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   121   it->second->cellId = gci;
   129   mmeS11Fteid.
teid = imsi;
   133   std::list<GtpcCreateSessionRequestMessage::BearerContextToBeCreated> bearerContexts;
   134   for (std::list<BearerInfo>::iterator bit = it->second->bearersToBeActivated.begin ();
   135        bit != it->second->bearersToBeActivated.end ();
   140       bearerContext.
tft = bit->tft;
   142       bearerContexts.push_back (bearerContext);
   144   NS_LOG_DEBUG (
"BearerContextToBeCreated size = " << bearerContexts.size ());
   167   uint64_t imsi = mmeUeS1Id;
   168   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   170   NS_LOG_INFO (
"IMSI " << imsi << 
" old eNB: " << it->second->cellId << 
", new eNB: " << gci);
   171   it->second->cellId = gci;
   172   it->second->enbUeS1Id = enbUeS1Id;
   178   std::list<GtpcModifyBearerRequestMessage::BearerContextToBeModified> bearerContexts;
   179   for (
auto &erab : erabToBeSwitchedInDownlinkList)
   182                     " eNB " << erab.enbTransportLayerAddress <<
   183                     " TEID " << erab.enbTeid);
   188       bearerContext.
fteid.
addr = erab.enbTransportLayerAddress;
   190       bearerContexts.push_back (bearerContext);
   206   uint64_t imsi = mmeUeS1Id;
   207   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   211   std::list<GtpcDeleteBearerCommandMessage::BearerContext> bearerContexts;
   212   for (
auto &erab : erabToBeReleaseIndication)
   217       bearerContexts.push_back (bearerContext);
   219   msg.SetBearerContexts (bearerContexts);
   221   msg.ComputeMessageLength ();
   236       if (bit->bearerId == epsBearerId)
   281   uint64_t imsi = header.
GetTeid ();
   283   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   285   uint16_t cellId = it->second->cellId;
   286   uint16_t enbUeS1Id = it->second->enbUeS1Id;
   287   uint64_t mmeUeS1Id = it->second->mmeUeS1Id;
   288   NS_LOG_DEBUG (
"cellId " << cellId << 
" mmeUeS1Id " << mmeUeS1Id << 
" enbUeS1Id " << enbUeS1Id);
   289   std::map<uint16_t, Ptr<EnbInfo> >::iterator jt = 
m_enbInfoMap.find (cellId);
   295   std::list<EpcS1apSapEnb::ErabToBeSetupItem> erabToBeSetupList;
   296   std::list<GtpcCreateSessionResponseMessage::BearerContextCreated> bearerContexts =
   297     msg.GetBearerContextsCreated ();
   298   NS_LOG_DEBUG (
"BearerContextsCreated size = " << bearerContexts.size ());
   299   for (
auto &bearerContext : bearerContexts)
   302       erab.
erabId = bearerContext.epsBearerId;
   305       erab.
sgwTeid = bearerContext.fteid.teid;
   307       erabToBeSetupList.push_back (erab);
   310   NS_LOG_DEBUG (
"Send InitialContextSetupRequest to eNB " << jt->second->s1apSapEnb);
   311   jt->second->s1apSapEnb->InitialContextSetupRequest (mmeUeS1Id, enbUeS1Id, erabToBeSetupList);
   322   uint64_t imsi = header.
GetTeid ();
   324   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   326   uint16_t cellId = it->second->cellId;
   327   uint16_t enbUeS1Id = it->second->enbUeS1Id;
   328   uint64_t mmeUeS1Id = it->second->mmeUeS1Id;
   329   NS_LOG_DEBUG (
"cellId " << cellId << 
" mmeUeS1Id " << mmeUeS1Id << 
" enbUeS1Id " << enbUeS1Id);
   330   std::list<EpcS1apSapEnb::ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList; 
   331   std::map<uint16_t, Ptr<EnbInfo> >::iterator jt = 
m_enbInfoMap.find (cellId);
   334   NS_LOG_DEBUG (
"Send PathSwitchRequestAcknowledge to eNB " << jt->second->s1apSapEnb);
   335   jt->second->s1apSapEnb->PathSwitchRequestAcknowledge (enbUeS1Id, mmeUeS1Id, cellId, erabToBeSwitchedInUplinkList);
   342   uint64_t imsi = header.
GetTeid ();
   344   std::map<uint64_t, Ptr<UeInfo> >::iterator it = 
m_ueInfoMap.find (imsi);
   352   std::list<uint8_t> epsBearerIds;
   353   for (
auto &ebid : msg.GetEpsBearerIds ())
   355       epsBearerIds.push_back (ebid);
   364       if (it->second->cellId == 0)
 uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer. 
 
void RemoveBearer(Ptr< UeInfo > ueInfo, uint8_t epsBearerId)
This Function erases all contexts of bearer from MME side. 
 
Hold info on an EPS bearer to be activated. 
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
 
EpcS1apSapEnb * s1apSapEnb
EpcS1apSapEnb. 
 
MME side of the S1-AP Service Access Point (SAP), provides the MME methods to be called when an S1-AP...
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
 
Ptr< EpcTft > tft
traffic flow template 
 
Ipv4Address m_mmeS11Addr
IPv4 address of the MME S11 interface. 
 
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
 
void DoRecvDeleteBearerRequest(GtpcHeader &header, Ptr< Packet > packet)
Process GTP-C Delete Bearer Request message. 
 
void SetBearerContextsToBeCreated(std::list< BearerContextToBeCreated > bearerContexts)
 
std::map< uint64_t, Ptr< UeInfo > > m_ueInfoMap
UeInfo stored by IMSI. 
 
uint64_t mmeUeS1Id
mmeUeS1Id 
 
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
void RecvFromS11Socket(Ptr< Socket > socket)
Reads the S11 messages from a socket. 
 
void DoErabReleaseIndication(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabToBeReleasedIndication > erabToBeReleaseIndication)
Process ERAB Release Indication received from an eNB. 
 
uint16_t m_gtpcUdpPort
UDP port for GTP-C protocol. Fixed by the standard to port 2123. 
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
 
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate. 
 
void SetUliEcgi(uint32_t uliEcgi)
 
Ipv4Address s1uAddr
IP address of the S1-U interface. 
 
void AddEnb(uint16_t ecgi, Ipv4Address enbS1UAddr, EpcS1apSapEnb *enbS1apSap)
Add a new eNB to the MME. 
 
EpsBearer bearer
bearer QOS characteristics 
 
EpcMmeApplication()
Constructor. 
 
void DoInitialUeMessage(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t imsi, uint16_t ecgi)
Process the S1 Initial UE Message received from an eNB. 
 
uint8_t epsBearerId
EPS bearer ID. 
 
void DoInitialContextSetupResponse(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapMme::ErabSetupItem > erabSetupList)
Process the S1 Initial Context Setup Response received from an eNB. 
 
Ptr< Socket > m_s11Socket
Socket to send/receive messages in the S11 interface. 
 
void SetSenderCpFteid(GtpcHeader::Fteid_t fteid)
 
eNB side of the S1-AP Service Access Point (SAP), provides the eNB methods to be called when an S1-AP...
 
void SetImsi(uint8_t imsi)
 
void SetEpsBearerIds(std::list< uint8_t > epsBearerIds)
 
void DoRecvCreateSessionResponse(GtpcHeader &header, Ptr< Packet > packet)
Process GTP-C Create Session Response message. 
 
EpcS1apSapMme * GetS1apSapMme()
 
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer. 
 
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
 
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read. 
 
uint16_t bearerCounter
bearer counter 
 
std::map< uint16_t, Ptr< EnbInfo > > m_enbInfoMap
EnbInfo stored by EGCI. 
 
static TypeId GetTypeId(void)
Get the type ID. 
 
void AddUe(uint64_t imsi)
Add a new UE to the MME. 
 
Ipv4Address transportLayerAddress
transport layer address 
 
uint64_t imsi
UE identifier. 
 
uint8_t epsBearerId
EPS bearer ID. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
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. 
 
virtual void DoDispose()
Destructor implementation. 
 
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket. 
 
virtual ~EpcMmeApplication()
Destructor. 
 
void DoRecvModifyBearerResponse(GtpcHeader &header, Ptr< Packet > packet)
Process GTP-C Modify Bearer Response message. 
 
EpsBearer erabLevelQosParameters
Level QOS parameters. 
 
Ipv4Address m_sgwS11Addr
IPv4 address of the SGW S11 interface. 
 
std::list< BearerInfo > bearersToBeActivated
list of bearers to be activated 
 
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. 
 
This class contains the specification of EPS Bearers. 
 
GtpcHeader::Fteid_t fteid
FTEID. 
 
void SetImsi(uint64_t imsi)
 
EpcS1apSapMme * m_s1apSapMme
EpcS1apSapMme. 
 
Ipv4 addresses are stored in host order in this class. 
 
EpsBearer bearerLevelQos
bearer QOS level 
 
void SetUliEcgi(uint32_t uliEcgi)
 
This application implements the Mobility Management Entity (MME) according to the 3GPP TS 23...
 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
 
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)=0
Send data to a specified peer. 
 
uint8_t bearerId
bearer ID 
 
Template for the implementation of the EpcS1apSapMme as a member of an owner class of type C to which...
 
A base class which provides memory management and object aggregation. 
 
ErabToBeSetupItem structure. 
 
a unique identifier for an interface. 
 
void AddSgw(Ipv4Address sgwS11Addr, Ipv4Address mmeS11Addr, Ptr< Socket > mmeS11Socket)
Add a new SGW to the MME. 
 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
 
void SetBearerContextsToBeModified(std::list< BearerContextToBeModified > bearerContexts)
 
void AddHeader(const Header &header)
Add header to this packet. 
 
uint8_t m_epsBearerId
EPS bearer ID. 
 
Ptr< EpcTft > tft
traffic flow template