13#include <ns3/epc-helper.h>
14#include <ns3/fatal-error.h>
16#include <ns3/simulator.h>
28 m_asSapProvider(nullptr),
55 .AddTraceSource(
"StateTransition",
56 "fired upon every UE NAS state transition",
58 "ns3::EpcUeNas::StateTracedCallback");
155 NS_FATAL_ERROR(
"the necessary NAS signaling to activate a bearer after the initial context "
156 "has already been setup is not implemented");
179 auto bid = (uint8_t)(
id & 0x000000FF);
193 NS_LOG_WARN(
this <<
" NAS OFF, discarding packet");
287 return os <<
"ATTACHING";
289 return os <<
"IDLE_REGISTERED";
291 return os <<
"CONNECTING_TO_EPC";
293 return os <<
"ACTIVE";
295 return os <<
"NUM_STATES";
297 return os <<
"UNKNOWN(" <<
static_cast<uint32_t>(state) <<
")";
uint32_t Classify(Ptr< Packet > p, EpcTft::Direction direction, uint16_t protocolNumber)
classify an IP packet
void Add(Ptr< EpcTft > tft, uint32_t id)
add a TFT to the Classifier
void Delete(uint32_t id)
delete an existing TFT from the classifier
void SwitchToState(State s)
Switch the UE RRC to the given state.
friend class MemberLteAsSapUser< EpcUeNas >
allow MemberLteAsSapUser<EpcUeNas> class friend access
uint64_t m_imsi
The unique UE identifier.
State m_state
The current UE NAS state.
~EpcUeNas() override
Destructor.
void DoNotifyConnectionSuccessful()
Notify successful connection.
Callback< void, Ptr< Packet > > m_forwardUpCallback
upward callback
LteAsSapUser * m_asSapUser
LTE SAP user.
void SetDevice(Ptr< NetDevice > dev)
uint8_t m_bidCounter
bid counter
std::list< BearerToBeActivated > m_bearersToBeActivatedListForReconnection
bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE
TracedCallback< State, State > m_stateTransitionCallback
The StateTransition trace source.
void StartCellSelection(uint32_t dlEarfcn)
Causes NAS to tell AS to find a suitable cell and camp to it.
uint32_t m_csgId
Closed Subscriber Group identity.
LteAsSapUser * GetAsSapUser()
void DoActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate EPS Bearer.
State
Definition of NAS states as per "LTE - From theory to practice", Section 3.2.3.2 "Connection Establis...
void DoNotifyConnectionFailed()
Notify connection failed.
LteAsSapProvider * m_asSapProvider
LTE SAP provider.
static TypeId GetTypeId()
Get the type ID.
void Disconnect()
instruct the NAS to disconnect
EpcTftClassifier m_tftClassifier
tft classifier
void DoDispose() override
Destructor implementation.
void DoNotifyConnectionReleased()
Notify connection released.
void Connect()
Causes NAS to tell AS to go to ACTIVE state.
void SetImsi(uint64_t imsi)
Ptr< NetDevice > m_device
The UE NetDevice.
void SetAsSapProvider(LteAsSapProvider *s)
Set the AS SAP provider to interact with the NAS entity.
void SetCsgId(uint32_t csgId)
void ActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate an EPS bearer.
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
std::list< BearerToBeActivated > m_bearersToBeActivatedList
bearers to be activated list
void DoRecvData(Ptr< Packet > packet)
Receive data.
bool Send(Ptr< Packet > p, uint16_t protocolNumber)
Enqueue an IP packet on the proper bearer for uplink transmission.
uint32_t GetCsgId() const
This class contains the specification of EPS Bearers.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
virtual void SetCsgWhiteList(uint32_t csgId)=0
Set the selected Closed Subscriber Group subscription list to be used for cell selection.
virtual void Connect()=0
Tell the RRC entity to enter Connected mode.
virtual void StartCellSelection(uint32_t dlEarfcn)=0
Initiate Idle mode cell selection procedure.
virtual void Disconnect()=0
Tell the RRC entity to release the connection.
virtual void SendData(Ptr< Packet > packet, uint8_t bid)=0
Send a data packet.
virtual void ForceCampedOnEnb(uint16_t cellId, uint32_t dlEarfcn)=0
Force the RRC entity to stay camped on a certain eNodeB.
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ OFF
The PHY layer is switched off.
std::ostream & operator<<(std::ostream &os, const Angles &a)
BearerToBeActivated structure.
EpsBearer bearer
EPS bearer.