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 |
EPS flow ID structure. More... | |
Public Types | |
typedef void(* | RxTracedCallback) (Ptr< Packet > packet) |
TracedCallback signature for data Packet reception event. More... | |
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... | |
Public Member Functions | |
EpcEnbApplication (Ptr< Socket > lteSocket, Ptr< Socket > lteSocket6, uint16_t cellId) | |
Constructor. More... | |
~EpcEnbApplication () override | |
Destructor. More... | |
void | AddS1Interface (Ptr< Socket > s1uSocket, Ipv4Address enbS1uAddress, Ipv4Address sgwS1uAddress) |
Add a S1-U interface to the eNB. 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 () | |
~Application () override | |
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... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated 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... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () 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 () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () 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 errors. 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 () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Application | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Member Functions | |
void | DoDispose () override |
Destructor implementation. More... | |
Protected Member Functions inherited from ns3::Application | |
void | DoDispose () override |
Destructor implementation. More... | |
void | DoInitialize () override |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate () |
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 () |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | DoInitialContextSetupRequest (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< EpcS1apSapEnb::ErabToBeSetupItem > erabToBeSetupList) |
Initial Context Setup Request. More... | |
void | DoInitialUeMessage (uint64_t imsi, uint16_t rnti) |
Initial UE message function. More... | |
void | DoPathSwitchRequest (EpcEnbS1SapProvider::PathSwitchRequestParameters params) |
Path switch request function. More... | |
void | DoPathSwitchRequestAcknowledge (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< EpcS1apSapEnb::ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList) |
Path Switch Request Acknowledge. More... | |
void | DoReleaseIndication (uint64_t imsi, uint16_t rnti, uint8_t bearerId) |
This function accepts bearer id corresponding to a particular UE and schedules indication of bearer release towards MME. More... | |
void | DoUeContextRelease (uint16_t rnti) |
UE Context Release function. More... | |
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 |
cell ID More... | |
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... | |
Ptr< Socket > | m_lteSocket6 |
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... | |
TracedCallback< Ptr< Packet > > | m_rxLteSocketPktTrace |
Callback to trace RX (reception) data packets from LTE Socket. More... | |
TracedCallback< Ptr< Packet > > | m_rxS1uSocketPktTrace |
Callback to trace RX (reception) data packets from S1-U Socket. 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 > |
allow MemberEpcEnbS1SapProvider<EpcEnbApplication> class friend access More... | |
class | MemberEpcS1apSapEnb< EpcEnbApplication > |
allow MemberEpcS1apSapEnb<EpcEnbApplication> class friend access More... | |
Additional Inherited Members | |
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 () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. 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 50 of file epc-enb-application.h.
TracedCallback signature for data Packet reception event.
[in] | packet | The data packet sent from the internet. |
Definition at line 145 of file epc-enb-application.h.
ns3::EpcEnbApplication::EpcEnbApplication | ( | Ptr< Socket > | lteSocket, |
Ptr< Socket > | lteSocket6, | ||
uint16_t | cellId | ||
) |
Constructor.
lteSocket | the socket to be used to send/receive IPv4 packets to/from the LTE radio interface |
lteSocket6 | the socket to be used to send/receive IPv6 packets to/from the LTE radio interface |
cellId | the identifier of the eNB |
Definition at line 88 of file epc-enb-application.cc.
References m_lteSocket, m_lteSocket6, m_s1apSapEnb, m_s1SapProvider, ns3::MakeCallback(), MemberEpcEnbS1SapProvider< EpcEnbApplication >, MemberEpcS1apSapEnb< EpcEnbApplication >, NS_LOG_FUNCTION, RecvFromLteSocket(), and ns3::Socket::SetRecvCallback().
|
override |
void ns3::EpcEnbApplication::AddS1Interface | ( | Ptr< Socket > | s1uSocket, |
Ipv4Address | enbS1uAddress, | ||
Ipv4Address | sgwS1uAddress | ||
) |
Add a S1-U interface to the eNB.
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 |
Definition at line 105 of file epc-enb-application.cc.
References m_enbS1uAddress, m_s1uSocket, m_sgwS1uAddress, ns3::MakeCallback(), NS_LOG_FUNCTION, RecvFromS1uSocket(), and ns3::Socket::SetRecvCallback().
|
overrideprotectedvirtual |
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 78 of file epc-enb-application.cc.
References m_lteSocket, m_lteSocket6, m_s1apSapEnb, m_s1SapProvider, m_s1uSocket, and NS_LOG_FUNCTION.
|
private |
Initial Context Setup Request.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
erabToBeSetupList | the ERAB setup list |
Definition at line 209 of file epc-enb-application.cc.
References ns3::EpcEnbS1SapUser::DataRadioBearerSetupRequest(), ns3::EpcEnbS1SapUser::InitialContextSetupRequest(), m_imsiRntiMap, m_rbidTeidMap, m_s1SapUser, m_teidRbidMap, NS_ASSERT_MSG, NS_LOG_FUNCTION, and two-ray-to-three-gpp-ch-calibration::params.
|
private |
Initial UE message function.
imsi | the IMSI |
rnti | the RNTI |
Definition at line 147 of file epc-enb-application.cc.
References ns3::EpcS1apSapMme::InitialUeMessage(), m_cellId, m_imsiRntiMap, m_s1apSapMme, and NS_LOG_FUNCTION.
|
private |
Path switch request function.
params | PathSwitchRequestParameters |
Definition at line 156 of file epc-enb-application.cc.
References 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, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, and ns3::EpcS1apSapMme::PathSwitchRequest().
|
private |
Path Switch Request Acknowledge.
mmeUeS1Id | the MME UE S1 ID |
enbUeS1Id | the ENB UE S1 ID |
cgi | the CGI |
erabToBeSwitchedInUplinkList | the ERAB switched in uplink list |
Definition at line 244 of file epc-enb-application.cc.
References m_imsiRntiMap, m_s1SapUser, NS_ASSERT_MSG, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, and ns3::EpcEnbS1SapUser::PathSwitchRequestAcknowledge().
|
private |
This function accepts bearer id corresponding to a particular UE and schedules indication of bearer release towards MME.
imsi | maps to mmeUeS1Id |
rnti | maps to enbUeS1Id |
bearerId | Bearer Identity which is to be de-activated |
Definition at line 365 of file epc-enb-application.cc.
References ns3::EpcS1apSapMme::ErabToBeReleasedIndication::erabId, ns3::EpcS1apSapMme::ErabReleaseIndication(), m_s1apSapMme, and NS_LOG_FUNCTION.
|
private |
UE Context Release function.
rnti | the RNTI |
Definition at line 191 of file epc-enb-application.cc.
References m_rbidTeidMap, m_teidRbidMap, NS_LOG_FUNCTION, and NS_LOG_INFO.
EpcS1apSapEnb * ns3::EpcEnbApplication::GetS1apSapEnb | ( | ) |
Definition at line 141 of file epc-enb-application.cc.
References m_s1apSapEnb.
EpcEnbS1SapProvider * ns3::EpcEnbApplication::GetS1SapProvider | ( | ) |
Definition at line 129 of file epc-enb-application.cc.
References m_s1SapProvider.
|
static |
Get the type ID.
Definition at line 60 of file epc-enb-application.cc.
References m_rxLteSocketPktTrace, m_rxS1uSocketPktTrace, ns3::MakeTraceSourceAccessor(), and 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 262 of file epc-enb-application.cc.
References ns3::Packet::Copy(), ns3::EpsBearerTag::GetBid(), ns3::EpsBearerTag::GetRnti(), m_lteSocket, m_lteSocket6, m_rbidTeidMap, m_rxLteSocketPktTrace, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, 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 297 of file epc-enb-application.cc.
References ns3::Packet::Copy(), ns3::GtpuHeader::GetTeid(), m_cellId, m_rxS1uSocketPktTrace, m_s1uSocket, m_teidRbidMap, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_WARN, ns3::Socket::Recv(), ns3::Packet::RemoveHeader(), and SendToLteSocket().
Referenced by AddS1Interface().
|
private |
Send a packet to the UE via the LTE radio interface of the eNB.
packet | t |
rnti | maps to enbUeS1Id |
bid | the EPS Bearer Identifier |
Definition at line 319 of file epc-enb-application.cc.
References ns3::Packet::AddPacketTag(), ns3::Packet::CopyData(), ns3::Packet::GetSize(), m_lteSocket, m_lteSocket6, NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, 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 Endpoint Identifier |
Definition at line 350 of file epc-enb-application.cc.
References ns3::Packet::AddHeader(), ns3::GtpuHeader::GetSerializedSize(), ns3::Packet::GetSize(), m_gtpuUdpPort, m_s1uSocket, m_sgwS1uAddress, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Socket::SendTo(), ns3::GtpuHeader::SetLength(), 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 135 of file epc-enb-application.cc.
References m_s1apSapMme.
void ns3::EpcEnbApplication::SetS1SapUser | ( | EpcEnbS1SapUser * | s | ) |
Set the S1 SAP User.
s | the S1 SAP User |
Definition at line 123 of file epc-enb-application.cc.
References m_s1SapUser.
|
private |
internal method used for the actual setup of the S1 Bearer
teid | the Tunnel Endpoint Identifier |
rnti | maps to enbUeS1Id |
bid | the S1-U Bearer Identifier |
|
friend |
allow MemberEpcEnbS1SapProvider<EpcEnbApplication> class friend access
Definition at line 1 of file epc-enb-application.h.
Referenced by EpcEnbApplication().
|
friend |
allow MemberEpcS1apSapEnb<EpcEnbApplication> class friend access
Definition at line 1 of file epc-enb-application.h.
Referenced by EpcEnbApplication().
|
private |
cell ID
Definition at line 331 of file epc-enb-application.h.
Referenced by DoInitialUeMessage(), and RecvFromS1uSocket().
|
private |
address of the eNB for S1-U communications
Definition at line 279 of file epc-enb-application.h.
Referenced by AddS1Interface(), and DoPathSwitchRequest().
|
private |
UDP port to be used for GTP.
Definition at line 301 of file epc-enb-application.h.
Referenced by SendToS1uSocket().
|
private |
UE context info.
Definition at line 329 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 264 of file epc-enb-application.h.
Referenced by EpcEnbApplication(), DoDispose(), RecvFromLteSocket(), and SendToLteSocket().
raw packet socket to send and receive the packets to and from the LTE radio interface
Definition at line 269 of file epc-enb-application.h.
Referenced by EpcEnbApplication(), DoDispose(), RecvFromLteSocket(), and SendToLteSocket().
|
private |
map of maps telling for each RNTI and BID the corresponding S1-U TEID
Definition at line 290 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoPathSwitchRequest(), DoUeContextRelease(), and RecvFromLteSocket().
|
private |
Callback to trace RX (reception) data packets from LTE Socket.
Definition at line 336 of file epc-enb-application.h.
Referenced by GetTypeId(), and RecvFromLteSocket().
|
private |
Callback to trace RX (reception) data packets from S1-U Socket.
Definition at line 341 of file epc-enb-application.h.
Referenced by GetTypeId(), and RecvFromS1uSocket().
|
private |
ENB side of the S1-AP SAP.
Definition at line 323 of file epc-enb-application.h.
Referenced by EpcEnbApplication(), DoDispose(), and GetS1apSapEnb().
|
private |
MME side of the S1-AP SAP.
Definition at line 317 of file epc-enb-application.h.
Referenced by DoInitialUeMessage(), DoPathSwitchRequest(), DoReleaseIndication(), and SetS1apSapMme().
|
private |
Provider for the S1 SAP.
Definition at line 306 of file epc-enb-application.h.
Referenced by EpcEnbApplication(), DoDispose(), and GetS1SapProvider().
|
private |
User for the S1 SAP.
Definition at line 311 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 274 of file epc-enb-application.h.
Referenced by AddS1Interface(), DoDispose(), RecvFromS1uSocket(), and SendToS1uSocket().
|
private |
address of the SGW which terminates all S1-U tunnels
Definition at line 284 of file epc-enb-application.h.
Referenced by AddS1Interface(), and SendToS1uSocket().
|
private |
map telling for each S1-U TEID the corresponding RNTI,BID
Definition at line 296 of file epc-enb-application.h.
Referenced by DoInitialContextSetupRequest(), DoPathSwitchRequest(), DoUeContextRelease(), and RecvFromS1uSocket().