A Discrete-Event Network Simulator
API
ns3::EpcUeNas Class Reference


More...

#include "epc-ue-nas.h"

+ Inheritance diagram for ns3::EpcUeNas:
+ Collaboration diagram for ns3::EpcUeNas:

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. More...
 

Public Member Functions

 EpcUeNas ()
 Constructor. More...
 
virtual ~EpcUeNas ()
 Destructor. More...
 
void ActivateEpsBearer (EpsBearer bearer, Ptr< EpcTft > tft)
 Activate an EPS bearer. More...
 
void Connect ()
 Causes NAS to tell AS to go to ACTIVE state. More...
 
void Connect (uint16_t cellId, uint32_t dlEarfcn)
 Causes NAS to tell AS to camp to a specific cell and go to ACTIVE state. More...
 
void Disconnect ()
 instruct the NAS to disconnect More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
LteAsSapUserGetAsSapUser ()
 
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. More...
 
void SetAsSapProvider (LteAsSapProvider *s)
 Set the AS SAP provider to interact with the NAS entity. More...
 
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 More...
 
void SetImsi (uint64_t imsi)
 
void StartCellSelection (uint32_t dlEarfcn)
 Causes NAS to tell AS to find a suitable cell and camp to it. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object. More...
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) 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)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. 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
 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 erros. 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 (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void DoActivateEpsBearer (EpsBearer bearer, Ptr< EpcTft > tft)
 Activate EPS Bearer. More...
 
void DoNotifyConnectionFailed ()
 Notify connection failed. More...
 
void DoNotifyConnectionReleased ()
 Notify connection released. More...
 
void DoNotifyConnectionSuccessful ()
 Notify successful connection. More...
 
void DoRecvData (Ptr< Packet > packet)
 Receive data. More...
 
void SwitchToState (State s)
 Switch the UE RRC to the given state. More...
 

Private Attributes

LteAsSapProviderm_asSapProvider
 LTE SAP provider. More...
 
LteAsSapUserm_asSapUser
 LTE SAP user. More...
 
std::list< BearerToBeActivatedm_bearersToBeActivatedList
 bearers to be activated list More...
 
std::list< BearerToBeActivatedm_bearersToBeActivatedListForReconnection
 bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE More...
 
uint8_t m_bidCounter
 bid counter More...
 
uint32_t m_csgId
 Closed Subscriber Group identity. More...
 
Ptr< NetDevicem_device
 The UE NetDevice. More...
 
Callback< void, Ptr< Packet > > m_forwardUpCallback
 upward callback More...
 
uint64_t m_imsi
 The unique UE identifier. More...
 
State m_state
 The current UE NAS state. More...
 
TracedCallback< State, Statem_stateTransitionCallback
 The StateTransition trace source. More...
 
EpcTftClassifier m_tftClassifier
 tft classifier More...
 

Friends

class MemberLteAsSapUser< EpcUeNas >
 allow MemberLteAsSapUser<EpcUeNas> class friend access More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 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 (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description


Config Paths

ns3::EpcUeNas is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::LteNetDevice/$ns3::LteUeNetDevice/EpcUeNas"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::LteUeNetDevice/EpcUeNas"

No Attributes are defined for this type.

TraceSources

Size of this type is 240 bytes (on a 64-bit architecture).

Definition at line 34 of file epc-ue-nas.h.

Member Typedef Documentation

◆ StateTracedCallback

typedef void(* ns3::EpcUeNas::StateTracedCallback) (const State oldState, const State newState)

TracedCallback signature for state change events.

Parameters
[in]oldStateThe old State.
[in]newStatethe new State.

Definition at line 184 of file epc-ue-nas.h.

Member Enumeration Documentation

◆ 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 162 of file epc-ue-nas.h.

Constructor & Destructor Documentation

◆ EpcUeNas()

ns3::EpcUeNas::EpcUeNas ( )

Constructor.

Definition at line 60 of file epc-ue-nas.cc.

References m_asSapUser, and NS_LOG_FUNCTION.

◆ ~EpcUeNas()

ns3::EpcUeNas::~EpcUeNas ( )
virtual

Destructor.

Definition at line 71 of file epc-ue-nas.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ ActivateEpsBearer()

void ns3::EpcUeNas::ActivateEpsBearer ( EpsBearer  bearer,
Ptr< EpcTft tft 
)

Activate an EPS bearer.

Parameters
bearerthe characteristics of the bearer to be created
tftthe TFT identifying the traffic that will go on this bearer

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

+ Here is the caller graph for this function:

◆ Connect() [1/2]

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 156 of file epc-ue-nas.cc.

References ns3::LteAsSapProvider::Connect(), m_asSapProvider, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Connect() [2/2]

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.

Parameters
cellIdthe id of the eNB to camp on
dlEarfcnthe 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 165 of file epc-ue-nas.cc.

References ns3::LteAsSapProvider::Connect(), ns3::LteAsSapProvider::ForceCampedOnEnb(), m_asSapProvider, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Disconnect()

void ns3::EpcUeNas::Disconnect ( )

instruct the NAS to disconnect

Definition at line 178 of file epc-ue-nas.cc.

References ns3::LteAsSapProvider::Disconnect(), m_asSapProvider, NS_LOG_FUNCTION, OFF, and SwitchToState().

Referenced by DoNotifyConnectionReleased().

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

◆ DoActivateEpsBearer()

void ns3::EpcUeNas::DoActivateEpsBearer ( EpsBearer  bearer,
Ptr< EpcTft tft 
)
private

Activate EPS Bearer.

Parameters
bearerthe EPS bearer
tftthe EPC TFT

Definition at line 278 of file epc-ue-nas.cc.

References ns3::EpcTftClassifier::Add(), m_bidCounter, m_tftClassifier, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by SwitchToState().

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

◆ DoDispose()

void ns3::EpcUeNas::DoDispose ( void  )
virtual

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 77 of file epc-ue-nas.cc.

References m_asSapUser, and NS_LOG_FUNCTION.

◆ DoNotifyConnectionFailed()

void ns3::EpcUeNas::DoNotifyConnectionFailed ( )
private

Notify connection failed.

Definition at line 246 of file epc-ue-nas.cc.

References ns3::LteAsSapProvider::Connect(), m_asSapProvider, NS_LOG_FUNCTION, and ns3::Simulator::ScheduleNow().

+ Here is the call graph for this function:

◆ DoNotifyConnectionReleased()

void ns3::EpcUeNas::DoNotifyConnectionReleased ( )
private

Notify connection released.

Definition at line 262 of file epc-ue-nas.cc.

References ns3::EpcTftClassifier::Delete(), Disconnect(), m_bearersToBeActivatedList, m_bearersToBeActivatedListForReconnection, m_bidCounter, m_tftClassifier, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoNotifyConnectionSuccessful()

void ns3::EpcUeNas::DoNotifyConnectionSuccessful ( )
private

Notify successful connection.

Definition at line 238 of file epc-ue-nas.cc.

References ACTIVE, NS_LOG_FUNCTION, and SwitchToState().

+ Here is the call graph for this function:

◆ DoRecvData()

void ns3::EpcUeNas::DoRecvData ( Ptr< Packet packet)
private

Receive data.

Parameters
packetthe packet

Definition at line 255 of file epc-ue-nas.cc.

References m_forwardUpCallback, and NS_LOG_FUNCTION.

◆ GetAsSapUser()

LteAsSapUser * ns3::EpcUeNas::GetAsSapUser ( )
Returns
the AS SAP user exported by this RRC

Definition at line 135 of file epc-ue-nas.cc.

References m_asSapUser, and NS_LOG_FUNCTION.

◆ GetCsgId()

uint32_t ns3::EpcUeNas::GetCsgId ( ) const
Returns
csgId Closed Subscriber Group identity

Definition at line 121 of file epc-ue-nas.cc.

References m_csgId, and NS_LOG_FUNCTION.

◆ GetState()

EpcUeNas::State ns3::EpcUeNas::GetState ( void  ) const
Returns
The current state

Definition at line 287 of file epc-ue-nas.cc.

References m_state, and NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::EpcUeNas::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 84 of file epc-ue-nas.cc.

References m_stateTransitionCallback, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ Send()

bool ns3::EpcUeNas::Send ( Ptr< Packet p,
uint16_t  protocolNumber 
)

Enqueue an IP packet on the proper bearer for uplink transmission.

Parameters
pthe packet
protocolNumberthe protocol number of the packet
Returns
true if successful, false if an error occurred

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

+ Here is the call graph for this function:

◆ SetAsSapProvider()

void ns3::EpcUeNas::SetAsSapProvider ( LteAsSapProvider s)

Set the AS SAP provider to interact with the NAS entity.

Parameters
sthe AS SAP provider

Definition at line 128 of file epc-ue-nas.cc.

References m_asSapProvider, and NS_LOG_FUNCTION.

◆ SetCsgId()

void ns3::EpcUeNas::SetCsgId ( uint32_t  csgId)
Parameters
csgIdClosed Subscriber Group identity

Definition at line 113 of file epc-ue-nas.cc.

References m_asSapProvider, m_csgId, NS_LOG_FUNCTION, and ns3::LteAsSapProvider::SetCsgWhiteList().

+ Here is the call graph for this function:

◆ SetDevice()

void ns3::EpcUeNas::SetDevice ( Ptr< NetDevice dev)
Parameters
devthe UE NetDevice

Definition at line 99 of file epc-ue-nas.cc.

References m_device, and NS_LOG_FUNCTION.

◆ SetForwardUpCallback()

void ns3::EpcUeNas::SetForwardUpCallback ( Callback< void, Ptr< Packet > >  cb)

set the callback used to forward data packets up the stack

Parameters
cbthe callback

Definition at line 142 of file epc-ue-nas.cc.

References m_forwardUpCallback, and NS_LOG_FUNCTION.

◆ SetImsi()

void ns3::EpcUeNas::SetImsi ( uint64_t  imsi)
Parameters
imsithe unique UE identifier

Definition at line 106 of file epc-ue-nas.cc.

References m_imsi, and NS_LOG_FUNCTION.

◆ StartCellSelection()

void ns3::EpcUeNas::StartCellSelection ( uint32_t  dlEarfcn)

Causes NAS to tell AS to find a suitable cell and camp to it.

Parameters
dlEarfcnthe DL frequency of the eNB

Definition at line 149 of file epc-ue-nas.cc.

References m_asSapProvider, NS_LOG_FUNCTION, and ns3::LteAsSapProvider::StartCellSelection().

+ Here is the call graph for this function:

◆ SwitchToState()

void ns3::EpcUeNas::SwitchToState ( State  s)
private

Switch the UE RRC to the given state.

Parameters
sthe destination state

Definition at line 294 of file epc-ue-nas.cc.

References ACTIVE, DoActivateEpsBearer(), m_bearersToBeActivatedList, m_imsi, m_state, m_stateTransitionCallback, NS_LOG_FUNCTION, NS_LOG_INFO, and ns3::ToString().

Referenced by Disconnect(), and DoNotifyConnectionSuccessful().

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

Friends And Related Function Documentation

◆ MemberLteAsSapUser< EpcUeNas >

friend class MemberLteAsSapUser< EpcUeNas >
friend

allow MemberLteAsSapUser<EpcUeNas> class friend access

Definition at line 37 of file epc-ue-nas.h.

Member Data Documentation

◆ m_asSapProvider

LteAsSapProvider* ns3::EpcUeNas::m_asSapProvider
private

LTE SAP provider.

Definition at line 234 of file epc-ue-nas.h.

Referenced by Connect(), Disconnect(), DoNotifyConnectionFailed(), Send(), SetAsSapProvider(), SetCsgId(), and StartCellSelection().

◆ m_asSapUser

LteAsSapUser* ns3::EpcUeNas::m_asSapUser
private

LTE SAP user.

Definition at line 236 of file epc-ue-nas.h.

Referenced by DoDispose(), EpcUeNas(), and GetAsSapUser().

◆ m_bearersToBeActivatedList

std::list<BearerToBeActivated> ns3::EpcUeNas::m_bearersToBeActivatedList
private

bearers to be activated list

Definition at line 250 of file epc-ue-nas.h.

Referenced by ActivateEpsBearer(), DoNotifyConnectionReleased(), and SwitchToState().

◆ m_bearersToBeActivatedListForReconnection

std::list<BearerToBeActivated> ns3::EpcUeNas::m_bearersToBeActivatedListForReconnection
private

bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE

Definition at line 257 of file epc-ue-nas.h.

Referenced by ActivateEpsBearer(), and DoNotifyConnectionReleased().

◆ m_bidCounter

uint8_t ns3::EpcUeNas::m_bidCounter
private

bid counter

Definition at line 238 of file epc-ue-nas.h.

Referenced by DoActivateEpsBearer(), and DoNotifyConnectionReleased().

◆ m_csgId

uint32_t ns3::EpcUeNas::m_csgId
private

Closed Subscriber Group identity.

Definition at line 231 of file epc-ue-nas.h.

Referenced by GetCsgId(), and SetCsgId().

◆ m_device

Ptr<NetDevice> ns3::EpcUeNas::m_device
private

The UE NetDevice.

Definition at line 225 of file epc-ue-nas.h.

Referenced by SetDevice().

◆ m_forwardUpCallback

Callback<void, Ptr<Packet> > ns3::EpcUeNas::m_forwardUpCallback
private

upward callback

Definition at line 241 of file epc-ue-nas.h.

Referenced by DoRecvData(), and SetForwardUpCallback().

◆ m_imsi

uint64_t ns3::EpcUeNas::m_imsi
private

The unique UE identifier.

Definition at line 228 of file epc-ue-nas.h.

Referenced by SetImsi(), and SwitchToState().

◆ m_state

State ns3::EpcUeNas::m_state
private

The current UE NAS state.

Definition at line 215 of file epc-ue-nas.h.

Referenced by ActivateEpsBearer(), GetState(), Send(), and SwitchToState().

◆ m_stateTransitionCallback

TracedCallback<State, State> ns3::EpcUeNas::m_stateTransitionCallback
private

The StateTransition trace source.

Fired upon every UE NAS state transition. Exporting old state and new state.

Todo:
This should be a TracedValue

Definition at line 222 of file epc-ue-nas.h.

Referenced by GetTypeId(), and SwitchToState().

◆ m_tftClassifier

EpcTftClassifier ns3::EpcUeNas::m_tftClassifier
private

tft classifier

Definition at line 239 of file epc-ue-nas.h.

Referenced by DoActivateEpsBearer(), DoNotifyConnectionReleased(), and Send().


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