This application is installed inside eNBs and provides the bridge functionality for user data plane packets between the radio interface and the S1-U interface. More...
#include <epc-enb-application.h>
Classes | |
struct | EpsFlowId_t |
Public Member Functions | |
EpcEnbApplication (Ptr< Socket > lteSocket, Ptr< Socket > s1uSocket, Ipv4Address enbS1uAddress, Ipv4Address sgwS1uAddress, uint16_t cellId) | |
Constructor. More... | |
virtual | ~EpcEnbApplication (void) |
Destructor. More... | |
EpcS1apSapEnb * | GetS1apSapEnb () |
EpcEnbS1SapProvider * | GetS1SapProvider () |
void | RecvFromLteSocket (Ptr< Socket > socket) |
Method to be assigned to the recv callback of the LTE socket. More... | |
void | RecvFromS1uSocket (Ptr< Socket > socket) |
Method to be assigned to the recv callback of the S1-U socket. More... | |
void | SetS1apSapMme (EpcS1apSapMme *s) |
Set the MME side of the S1-AP SAP. More... | |
void | SetS1SapUser (EpcEnbS1SapUser *s) |
Set the S1 SAP User. More... | |
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 () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
Run the DoDispose methods of this object and all the objects aggregated to it. More... | |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
This method calls the virtual DoInitialize method on all the objects aggregated to this object. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. 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 |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Noop. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
void | DoDispose (void) |
This method is called by Object::Dispose or by the object's destructor, whichever comes first. More... | |
Protected Member Functions inherited from ns3::Application | |
virtual void | DoInitialize (void) |
This method is called only once by Object::Initialize. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | NotifyNewAggregate (void) |
This method is invoked whenever two sets of objects are aggregated together. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
This method is invoked once all member attributes have been initialized. More... | |
Private Member Functions | |
void | DoInitialContextSetupRequest (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapEnb::ErabToBeSetupItem > erabToBeSetupList) |
void | DoInitialUeMessage (uint64_t imsi, uint16_t rnti) |
void | DoPathSwitchRequest (EpcEnbS1SapProvider::PathSwitchRequestParameters params) |
void | DoPathSwitchRequestAcknowledge (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< EpcS1apSapEnb::ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList) |
void | DoUeContextRelease (uint16_t rnti) |
void | SendToLteSocket (Ptr< Packet > packet, uint16_t rnti, uint8_t bid) |
Send a packet to the UE via the LTE radio interface of the eNB. More... | |
void | SendToS1uSocket (Ptr< Packet > packet, uint32_t teid) |
Send a packet to the SGW via the S1-U interface. More... | |
void | SetupS1Bearer (uint32_t teid, uint16_t rnti, uint8_t bid) |
internal method used for the actual setup of the S1 Bearer More... | |
Private Attributes | |
uint16_t | m_cellId |
Ipv4Address | m_enbS1uAddress |
address of the eNB for S1-U communications More... | |
uint16_t | m_gtpuUdpPort |
UDP port to be used for GTP. More... | |
std::map< uint64_t, uint16_t > | m_imsiRntiMap |
UE context info. More... | |
Ptr< Socket > | m_lteSocket |
raw packet socket to send and receive the packets to and from the LTE radio interface More... | |
std::map< uint16_t, std::map < uint8_t, uint32_t > > | m_rbidTeidMap |
map of maps telling for each RNTI and BID the corresponding S1-U TEID More... | |
EpcS1apSapEnb * | m_s1apSapEnb |
ENB side of the S1-AP SAP. More... | |
EpcS1apSapMme * | m_s1apSapMme |
MME side of the S1-AP SAP. More... | |
EpcEnbS1SapProvider * | m_s1SapProvider |
Provider for the S1 SAP. More... | |
EpcEnbS1SapUser * | m_s1SapUser |
User for the S1 SAP. More... | |
Ptr< Socket > | m_s1uSocket |
UDP socket to send and receive GTP-U the packets to and from the S1-U interface. More... | |
Ipv4Address | m_sgwS1uAddress |
address of the SGW which terminates all S1-U tunnels More... | |
std::map< uint32_t, EpsFlowId_t > | m_teidRbidMap |
map telling for each S1-U TEID the corresponding RNTI,BID More... | |
Friends | |
class | MemberEpcEnbS1SapProvider< EpcEnbApplication > |
class | MemberEpcS1apSapEnb< EpcEnbApplication > |
Additional Inherited Members | |
Protected Attributes inherited from ns3::Application | |
Ptr< Node > | m_node |
EventId | m_startEvent |
The simulation time that the appliacation will end. More... | |
Time | m_startTime |
The node that this application is installed on. More... | |
EventId | m_stopEvent |
The event that will fire at m_startTime to start the application. More... | |
Time | m_stopTime |
The simulation time that the appliacation will start. More... | |
This application is installed inside eNBs and provides the bridge functionality for user data plane packets between the radio interface and the S1-U interface.
Definition at line 49 of file epc-enb-application.h.
ns3::EpcEnbApplication::EpcEnbApplication | ( | Ptr< Socket > | lteSocket, |
Ptr< Socket > | s1uSocket, | ||
Ipv4Address | enbS1uAddress, | ||
Ipv4Address | sgwS1uAddress, | ||
uint16_t | cellId | ||
) |
Constructor.
lteSocket | the socket to be used to send/receive packets to/from the LTE radio interface |
s1uSocket | the socket to be used to send/receive packets to/from the S1-U interface connected with the SGW |
enbS1uAddress | the IPv4 address of the S1-U interface of this eNB |
sgwS1uAddress | the IPv4 address at which this eNB will be able to reach its SGW for S1-U communications |
cellId | the identifier of the enb |
Definition at line 82 of file epc-enb-application.cc.
References m_lteSocket, m_s1apSapEnb, m_s1SapProvider, m_s1uSocket, ns3::MakeCallback(), NS_LOG_FUNCTION, RecvFromLteSocket(), RecvFromS1uSocket(), and ns3::Socket::SetRecvCallback().
|
virtual |
|
protectedvirtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden 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 72 of file epc-enb-application.cc.
References m_lteSocket, m_s1apSapEnb, m_s1SapProvider, m_s1uSocket, and NS_LOG_FUNCTION.
|
private |
Definition at line 196 of file epc-enb-application.cc.
References ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters::bearer, ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters::bearerId, ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequest(), ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters::gtpTeid, m_imsiRntiMap, m_rbidTeidMap, m_s1SapUser, m_teidRbidMap, NS_ASSERT_MSG, NS_LOG_FUNCTION, and ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters::rnti.
|
private |
Definition at line 133 of file epc-enb-application.cc.
References ns3::EpcS1apSapMme::InitialUeMessage(), m_cellId, m_imsiRntiMap, m_s1apSapMme, and NS_LOG_FUNCTION.
|
private |
Definition at line 142 of file epc-enb-application.cc.
References ns3::EpcEnbS1SapProvider::PathSwitchRequestParameters::bearersToBeSwitched, ns3::EpcEnbS1SapProvider::PathSwitchRequestParameters::cellId, ns3::EpcS1apSapMme::ErabSwitchedInDownlinkItem::enbTeid, ns3::EpcS1apSapMme::ErabSwitchedInDownlinkItem::enbTransportLayerAddress, ns3::EpcS1apSapMme::ErabSwitchedInDownlinkItem::erabId, ns3::EpcEnbApplication::EpsFlowId_t::m_bid, m_enbS1uAddress, m_imsiRntiMap, m_rbidTeidMap, ns3::EpcEnbApplication::EpsFlowId_t::m_rnti, m_s1apSapMme, m_teidRbidMap, ns3::EpcEnbS1SapProvider::PathSwitchRequestParameters::mmeUeS1Id, NS_LOG_FUNCTION, ns3::EpcS1apSapMme::PathSwitchRequest(), and ns3::EpcEnbS1SapProvider::PathSwitchRequestParameters::rnti.
|
private |
Definition at line 227 of file epc-enb-application.cc.
References m_imsiRntiMap, m_s1SapUser, NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::EpcEnbS1SapUser::PathSwitchRequestAcknowledge(), and ns3::EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters::rnti.
|
private |
Definition at line 178 of file epc-enb-application.cc.
References m_rbidTeidMap, m_teidRbidMap, and NS_LOG_FUNCTION.
EpcS1apSapEnb * ns3::EpcEnbApplication::GetS1apSapEnb | ( | ) |
Definition at line 127 of file epc-enb-application.cc.
References m_s1apSapEnb.
EpcEnbS1SapProvider * ns3::EpcEnbApplication::GetS1SapProvider | ( | ) |
Definition at line 114 of file epc-enb-application.cc.
References m_s1SapProvider.
|
static |
Definition at line 64 of file epc-enb-application.cc.
References ns3::TypeId::SetParent().
Method to be assigned to the recv callback of the LTE socket.
It is called when the eNB receives a data packet from the radio interface that is to be forwarded to the SGW.
socket | pointer to the LTE socket |
Definition at line 241 of file epc-enb-application.cc.
References ns3::EpsBearerTag::GetBid(), ns3::EpsBearerTag::GetRnti(), m_lteSocket, m_rbidTeidMap, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, NS_LOG_WARN, ns3::Socket::Recv(), ns3::Packet::RemovePacketTag(), and SendToS1uSocket().
Referenced by EpcEnbApplication().
Method to be assigned to the recv callback of the S1-U socket.
It is called when the eNB receives a data packet from the SGW that is to be forwarded to the UE.
socket | pointer to the S1-U socket |
Definition at line 273 of file epc-enb-application.cc.
References ns3::GtpuHeader::GetTeid(), m_s1uSocket, m_teidRbidMap, NS_ASSERT, NS_LOG_FUNCTION, ns3::Socket::Recv(), ns3::Packet::RemoveHeader(), ns3::Packet::RemovePacketTag(), and SendToLteSocket().
Referenced by EpcEnbApplication().
|
private |
Send a packet to the UE via the LTE radio interface of the eNB.
packet | t |
bid | the EPS Bearer IDentifier |
Definition at line 293 of file epc-enb-application.cc.
References ns3::Packet::AddPacketTag(), ns3::Packet::GetSize(), m_lteSocket, NS_ASSERT, NS_LOG_FUNCTION, and ns3::Socket::Send().
Referenced by RecvFromS1uSocket().
Send a packet to the SGW via the S1-U interface.
packet | packet to be sent |
teid | the Tunnel Enpoint IDentifier |
Definition at line 304 of file epc-enb-application.cc.
References ns3::Packet::AddHeader(), ns3::Packet::GetSize(), m_gtpuUdpPort, m_s1uSocket, m_sgwS1uAddress, NS_LOG_FUNCTION, ns3::Socket::SendTo(), and ns3::GtpuHeader::SetTeid().
Referenced by RecvFromLteSocket().
void ns3::EpcEnbApplication::SetS1apSapMme | ( | EpcS1apSapMme * | s | ) |
Set the MME side of the S1-AP SAP.
s | the MME side of the S1-AP SAP |
Definition at line 120 of file epc-enb-application.cc.
References m_s1apSapMme, and s.
void ns3::EpcEnbApplication::SetS1SapUser | ( | EpcEnbS1SapUser * | s | ) |
Set the S1 SAP User.
s | the S1 SAP User |
Definition at line 107 of file epc-enb-application.cc.
References m_s1SapUser, and s.
|
private |
internal method used for the actual setup of the S1 Bearer
teid | |
rnti | |
bid |
|
friend |
Definition at line 52 of file epc-enb-application.h.
|
friend |
Definition at line 53 of file epc-enb-application.h.
|
private |
Definition at line 245 of file epc-enb-application.h.
Referenced by DoInitialUeMessage().
|
private |
address of the eNB for S1-U communications
Definition at line 193 of file epc-enb-application.h.
Referenced by DoPathSwitchRequest().
|
private |
UDP port to be used for GTP.
Definition at line 215 of file epc-enb-application.h.
Referenced by SendToS1uSocket().
|
private |
UE context info.
Definition at line 243 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoInitialUeMessage(), DoPathSwitchRequest(), and DoPathSwitchRequestAcknowledge().
raw packet socket to send and receive the packets to and from the LTE radio interface
Definition at line 183 of file epc-enb-application.h.
Referenced by DoDispose(), EpcEnbApplication(), RecvFromLteSocket(), and SendToLteSocket().
|
private |
map of maps telling for each RNTI and BID the corresponding S1-U TEID
Definition at line 204 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoPathSwitchRequest(), DoUeContextRelease(), and RecvFromLteSocket().
|
private |
ENB side of the S1-AP SAP.
Definition at line 237 of file epc-enb-application.h.
Referenced by DoDispose(), EpcEnbApplication(), and GetS1apSapEnb().
|
private |
MME side of the S1-AP SAP.
Definition at line 231 of file epc-enb-application.h.
Referenced by DoInitialUeMessage(), DoPathSwitchRequest(), and SetS1apSapMme().
|
private |
Provider for the S1 SAP.
Definition at line 220 of file epc-enb-application.h.
Referenced by DoDispose(), EpcEnbApplication(), and GetS1SapProvider().
|
private |
User for the S1 SAP.
Definition at line 225 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoPathSwitchRequestAcknowledge(), and SetS1SapUser().
UDP socket to send and receive GTP-U the packets to and from the S1-U interface.
Definition at line 188 of file epc-enb-application.h.
Referenced by DoDispose(), EpcEnbApplication(), RecvFromS1uSocket(), and SendToS1uSocket().
|
private |
address of the SGW which terminates all S1-U tunnels
Definition at line 198 of file epc-enb-application.h.
Referenced by SendToS1uSocket().
|
private |
map telling for each S1-U TEID the corresponding RNTI,BID
Definition at line 210 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoPathSwitchRequest(), DoUeContextRelease(), and RecvFromS1uSocket().