#include "epc-ue-nas.h"
Classes | |
struct | BearerToBeActivated |
BearerToBeActivated structure. More... | |
Public Types | |
enum | State { OFF = 0 , ATTACHING , IDLE_REGISTERED , CONNECTING_TO_EPC , ACTIVE , NUM_STATES } |
Definition of NAS states as per "LTE - From theory to practice", Section 3.2.3.2 "Connection Establishment and Release". More... | |
typedef void(* | StateTracedCallback) (const State oldState, const State newState) |
TracedCallback signature for state change events. | |
Public Member Functions | |
EpcUeNas () | |
Constructor. | |
~EpcUeNas () override | |
Destructor. | |
void | ActivateEpsBearer (EpsBearer bearer, Ptr< EpcTft > tft) |
Activate an EPS bearer. | |
void | Connect () |
Causes NAS to tell AS to go to ACTIVE state. | |
void | Connect (uint16_t cellId, uint32_t dlEarfcn) |
Causes NAS to tell AS to camp to a specific cell and go to ACTIVE state. | |
void | Disconnect () |
instruct the NAS to disconnect | |
void | DoDispose () override |
Destructor implementation. | |
LteAsSapUser * | GetAsSapUser () |
uint32_t | GetCsgId () const |
State | GetState () const |
bool | Send (Ptr< Packet > p, uint16_t protocolNumber) |
Enqueue an IP packet on the proper bearer for uplink transmission. | |
void | SetAsSapProvider (LteAsSapProvider *s) |
Set the AS SAP provider to interact with the NAS entity. | |
void | SetCsgId (uint32_t csgId) |
void | SetDevice (Ptr< NetDevice > dev) |
void | SetForwardUpCallback (Callback< void, Ptr< Packet > > cb) |
set the callback used to forward data packets up the stack | |
void | SetImsi (uint64_t imsi) |
void | StartCellSelection (uint32_t dlEarfcn) |
Causes NAS to tell AS to find a suitable cell and camp to it. | |
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< Object > | GetObject () 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< Object > | GetObject (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. | |
SimpleRefCount & | operator= (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::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 | DoActivateEpsBearer (EpsBearer bearer, Ptr< EpcTft > tft) |
Activate EPS Bearer. | |
void | DoNotifyConnectionFailed () |
Notify connection failed. | |
void | DoNotifyConnectionReleased () |
Notify connection released. | |
void | DoNotifyConnectionSuccessful () |
Notify successful connection. | |
void | DoRecvData (Ptr< Packet > packet) |
Receive data. | |
void | SwitchToState (State s) |
Switch the UE RRC to the given state. | |
Private Attributes | |
LteAsSapProvider * | m_asSapProvider |
LTE SAP provider. | |
LteAsSapUser * | m_asSapUser |
LTE SAP user. | |
std::list< BearerToBeActivated > | m_bearersToBeActivatedList |
bearers to be activated list | |
std::list< BearerToBeActivated > | m_bearersToBeActivatedListForReconnection |
bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE | |
uint8_t | m_bidCounter |
bid counter | |
uint32_t | m_csgId |
Closed Subscriber Group identity. | |
Ptr< NetDevice > | m_device |
The UE NetDevice. | |
Callback< void, Ptr< Packet > > | m_forwardUpCallback |
upward callback | |
uint64_t | m_imsi |
The unique UE identifier. | |
State | m_state |
The current UE NAS state. | |
TracedCallback< State, State > | m_stateTransitionCallback |
The StateTransition trace source. | |
EpcTftClassifier | m_tftClassifier |
tft classifier | |
Friends | |
class | MemberLteAsSapUser< EpcUeNas > |
allow MemberLteAsSapUser<EpcUeNas> class friend access | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. | |
virtual void | DoInitialize () |
Initialize() implementation. | |
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. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
ns3::EpcUeNas is accessible through the following paths with Config::Set and Config::Connect:
No Attributes are defined for this type.
Group: Lte
Size of this type is 288 bytes (on a 64-bit architecture).
Definition at line 25 of file epc-ue-nas.h.
TracedCallback signature for state change events.
[in] | oldState | The old State. |
[in] | newState | the new State. |
Definition at line 171 of file epc-ue-nas.h.
enum ns3::EpcUeNas::State |
Definition of NAS states as per "LTE - From theory to practice", Section 3.2.3.2 "Connection Establishment and Release".
Enumerator | |
---|---|
OFF | |
ATTACHING | |
IDLE_REGISTERED | |
CONNECTING_TO_EPC | |
ACTIVE | |
NUM_STATES |
Definition at line 150 of file epc-ue-nas.h.
ns3::EpcUeNas::EpcUeNas | ( | ) |
Constructor.
Definition at line 25 of file epc-ue-nas.cc.
References m_asSapUser, MemberLteAsSapUser< EpcUeNas >, and NS_LOG_FUNCTION.
|
override |
Activate an EPS bearer.
bearer | the characteristics of the bearer to be created |
tft | the TFT identifying the traffic that will go on this bearer |
Definition at line 149 of file epc-ue-nas.cc.
References ACTIVE, ns3::EpcUeNas::BearerToBeActivated::bearer, m_bearersToBeActivatedList, m_bearersToBeActivatedListForReconnection, m_state, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::EpcUeNas::BearerToBeActivated::tft.
Referenced by ns3::NoBackhaulEpcHelper::DoActivateEpsBearerForUe().
void ns3::EpcUeNas::Connect | ( | ) |
Causes NAS to tell AS to go to ACTIVE state.
The end result is equivalent with EMM Registered + ECM Connected states.
Definition at line 120 of file epc-ue-nas.cc.
References ns3::LteAsSapProvider::Connect(), m_asSapProvider, and NS_LOG_FUNCTION.
void ns3::EpcUeNas::Connect | ( | uint16_t | cellId, |
uint32_t | dlEarfcn ) |
Causes NAS to tell AS to camp to a specific cell and go to ACTIVE state.
cellId | the id of the eNB to camp on |
dlEarfcn | the DL frequency of the eNB |
The end result is equivalent with EMM Registered + ECM Connected states. Since RRC Idle Mode cell selection is not supported yet, we force the UE RRC to be camped on a specific eNB.
Definition at line 129 of file epc-ue-nas.cc.
References ns3::LteAsSapProvider::Connect(), ns3::LteAsSapProvider::ForceCampedOnEnb(), m_asSapProvider, and NS_LOG_FUNCTION.
void ns3::EpcUeNas::Disconnect | ( | ) |
instruct the NAS to disconnect
Definition at line 141 of file epc-ue-nas.cc.
References ns3::LteAsSapProvider::Disconnect(), m_asSapProvider, NS_LOG_FUNCTION, OFF, and SwitchToState().
Referenced by DoNotifyConnectionReleased().
Activate EPS Bearer.
bearer | the EPS bearer |
tft | the EPC TFT |
Definition at line 239 of file epc-ue-nas.cc.
References ns3::EpcTftClassifier::Add(), m_bidCounter, m_tftClassifier, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by SwitchToState().
|
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::Object.
Definition at line 41 of file epc-ue-nas.cc.
References m_asSapUser, and NS_LOG_FUNCTION.
|
private |
Notify connection failed.
Definition at line 207 of file epc-ue-nas.cc.
References ns3::LteAsSapProvider::Connect(), m_asSapProvider, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().
|
private |
Notify connection released.
Definition at line 223 of file epc-ue-nas.cc.
References ns3::EpcTftClassifier::Delete(), Disconnect(), m_bearersToBeActivatedList, m_bearersToBeActivatedListForReconnection, m_bidCounter, m_tftClassifier, and NS_LOG_FUNCTION.
|
private |
Notify successful connection.
Definition at line 199 of file epc-ue-nas.cc.
References ACTIVE, NS_LOG_FUNCTION, and SwitchToState().
Receive data.
packet | the packet |
Definition at line 216 of file epc-ue-nas.cc.
References m_forwardUpCallback, and NS_LOG_FUNCTION.
LteAsSapUser * ns3::EpcUeNas::GetAsSapUser | ( | ) |
Definition at line 99 of file epc-ue-nas.cc.
References m_asSapUser, and NS_LOG_FUNCTION.
uint32_t ns3::EpcUeNas::GetCsgId | ( | ) | const |
Definition at line 85 of file epc-ue-nas.cc.
References m_csgId, and NS_LOG_FUNCTION.
EpcUeNas::State ns3::EpcUeNas::GetState | ( | ) | const |
Definition at line 248 of file epc-ue-nas.cc.
References m_state, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 48 of file epc-ue-nas.cc.
References m_stateTransitionCallback, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
Enqueue an IP packet on the proper bearer for uplink transmission.
p | the packet |
protocolNumber | the protocol number of the packet |
Definition at line 170 of file epc-ue-nas.cc.
References ACTIVE, ns3::EpcTftClassifier::Classify(), m_asSapProvider, m_state, m_tftClassifier, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::LteAsSapProvider::SendData(), and ns3::EpcTft::UPLINK.
void ns3::EpcUeNas::SetAsSapProvider | ( | LteAsSapProvider * | s | ) |
Set the AS SAP provider to interact with the NAS entity.
s | the AS SAP provider |
Definition at line 92 of file epc-ue-nas.cc.
References m_asSapProvider, and NS_LOG_FUNCTION.
void ns3::EpcUeNas::SetCsgId | ( | uint32_t | csgId | ) |
csgId | Closed Subscriber Group identity |
Definition at line 77 of file epc-ue-nas.cc.
References m_asSapProvider, m_csgId, NS_LOG_FUNCTION, and ns3::LteAsSapProvider::SetCsgWhiteList().
dev | the UE NetDevice |
Definition at line 63 of file epc-ue-nas.cc.
References m_device, and NS_LOG_FUNCTION.
set the callback used to forward data packets up the stack
cb | the callback |
Definition at line 106 of file epc-ue-nas.cc.
References m_forwardUpCallback, and NS_LOG_FUNCTION.
void ns3::EpcUeNas::SetImsi | ( | uint64_t | imsi | ) |
imsi | the unique UE identifier |
Definition at line 70 of file epc-ue-nas.cc.
References m_imsi, and NS_LOG_FUNCTION.
void ns3::EpcUeNas::StartCellSelection | ( | uint32_t | dlEarfcn | ) |
Causes NAS to tell AS to find a suitable cell and camp to it.
dlEarfcn | the DL frequency of the eNB |
Definition at line 113 of file epc-ue-nas.cc.
References m_asSapProvider, NS_LOG_FUNCTION, and ns3::LteAsSapProvider::StartCellSelection().
|
private |
Switch the UE RRC to the given state.
s | the destination state |
Definition at line 255 of file epc-ue-nas.cc.
References ACTIVE, DoActivateEpsBearer(), m_bearersToBeActivatedList, m_imsi, m_state, m_stateTransitionCallback, NS_LOG_FUNCTION, and NS_LOG_INFO.
Referenced by Disconnect(), and DoNotifyConnectionSuccessful().
|
friend |
allow MemberLteAsSapUser<EpcUeNas> class friend access
Definition at line 252 of file epc-ue-nas.h.
Referenced by EpcUeNas().
|
private |
LTE SAP provider.
Definition at line 220 of file epc-ue-nas.h.
Referenced by Connect(), Connect(), Disconnect(), DoNotifyConnectionFailed(), Send(), SetAsSapProvider(), SetCsgId(), and StartCellSelection().
|
private |
LTE SAP user.
Definition at line 222 of file epc-ue-nas.h.
Referenced by EpcUeNas(), DoDispose(), and GetAsSapUser().
|
private |
bearers to be activated list
Definition at line 236 of file epc-ue-nas.h.
Referenced by ActivateEpsBearer(), DoNotifyConnectionReleased(), and SwitchToState().
|
private |
bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE
Definition at line 243 of file epc-ue-nas.h.
Referenced by ActivateEpsBearer(), and DoNotifyConnectionReleased().
|
private |
bid counter
Definition at line 224 of file epc-ue-nas.h.
Referenced by DoActivateEpsBearer(), and DoNotifyConnectionReleased().
|
private |
Closed Subscriber Group identity.
Definition at line 217 of file epc-ue-nas.h.
Referenced by GetCsgId(), and SetCsgId().
upward callback
Definition at line 227 of file epc-ue-nas.h.
Referenced by DoRecvData(), and SetForwardUpCallback().
|
private |
The unique UE identifier.
Definition at line 214 of file epc-ue-nas.h.
Referenced by SetImsi(), and SwitchToState().
|
private |
The current UE NAS state.
Definition at line 201 of file epc-ue-nas.h.
Referenced by ActivateEpsBearer(), GetState(), Send(), and SwitchToState().
|
private |
The StateTransition
trace source.
Fired upon every UE NAS state transition. Exporting old state and new state.
Definition at line 208 of file epc-ue-nas.h.
Referenced by GetTypeId(), and SwitchToState().
|
private |
tft classifier
Definition at line 225 of file epc-ue-nas.h.
Referenced by DoActivateEpsBearer(), DoNotifyConnectionReleased(), and Send().