A Discrete-Event Network Simulator
API
epc-ue-nas.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef EPC_UE_NAS_H
22 #define EPC_UE_NAS_H
23 
24 
25 #include <ns3/object.h>
26 #include <ns3/lte-as-sap.h>
27 #include <ns3/epc-tft-classifier.h>
28 
29 namespace ns3 {
30 
31 
32 class EpcHelper;
33 
34 class EpcUeNas : public Object
35 {
38 public:
39 
43  EpcUeNas ();
44 
48  virtual ~EpcUeNas ();
49 
50  // inherited from Object
51  virtual void DoDispose (void);
56  static TypeId GetTypeId (void);
57 
58 
63  void SetDevice (Ptr<NetDevice> dev);
64 
70  void SetImsi (uint64_t imsi);
71 
76  void SetCsgId (uint32_t csgId);
77 
82  uint32_t GetCsgId () const;
83 
90 
97 
103  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
104 
110  void StartCellSelection (uint32_t dlEarfcn);
111 
117  void Connect ();
118 
129  void Connect (uint16_t cellId, uint32_t dlEarfcn);
130 
135  void Disconnect ();
136 
137 
144  void ActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
145 
153  bool Send (Ptr<Packet> p);
154 
155 
161  enum State
162  {
163  OFF = 0,
169  };
170 
174  State GetState () const;
175 
182  typedef void (* StateTracedCallback)
183  (const State oldState, const State newState);
184 
185 private:
186 
187  // LTE AS SAP methods
191  void DoNotifyConnectionFailed ();
198  void DoRecvData (Ptr<Packet> packet);
199 
200  // internal methods
206  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
211  void SwitchToState (State s);
212 
215 
222 
225 
227  uint64_t m_imsi;
228 
230  uint32_t m_csgId;
231 
236 
237  uint8_t m_bidCounter;
239 
241 
244  {
247  };
248 
249  std::list<BearerToBeActivated> m_bearersToBeActivatedList;
250 
251 };
252 
253 
254 } // namespace ns3
255 
256 #endif // EPC_UE_NAS_H
void SwitchToState(State s)
Switch the UE RRC to the given state.
Definition: epc-ue-nas.cc:284
void ActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate an EPS bearer.
Definition: epc-ue-nas.cc:187
Callback< void, Ptr< Packet > > m_forwardUpCallback
upward callback
Definition: epc-ue-nas.h:240
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
LteAsSapProvider * m_asSapProvider
LTE SAP provider.
Definition: epc-ue-nas.h:233
Callback template class.
Definition: callback.h:1176
void(* StateTracedCallback)(const State oldState, const State newState)
TracedCallback signature for state change events.
Definition: epc-ue-nas.h:183
classifies IP packets according to Traffic Flow Templates (TFTs)
void DoNotifyConnectionSuccessful()
Notify successful connection.
Definition: epc-ue-nas.cc:237
uint32_t GetCsgId() const
Definition: epc-ue-nas.cc:121
EpcUeNas()
Constructor.
Definition: epc-ue-nas.cc:60
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:41
State GetState() const
Definition: epc-ue-nas.cc:277
Ptr< NetDevice > m_device
The UE NetDevice.
Definition: epc-ue-nas.h:224
void DoNotifyConnectionReleased()
Notify connection released.
Definition: epc-ue-nas.cc:261
void StartCellSelection(uint32_t dlEarfcn)
Causes NAS to tell AS to find a suitable cell and camp to it.
Definition: epc-ue-nas.cc:149
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
LteAsSapUser * GetAsSapUser()
Definition: epc-ue-nas.cc:135
void SetCsgId(uint32_t csgId)
Definition: epc-ue-nas.cc:113
void SetDevice(Ptr< NetDevice > dev)
Definition: epc-ue-nas.cc:99
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition: lte-as-sap.h:230
uint64_t m_imsi
The unique UE identifier.
Definition: epc-ue-nas.h:227
EpcTftClassifier m_tftClassifier
tft classifier
Definition: epc-ue-nas.h:238
TracedCallback< State, State > m_stateTransitionCallback
The StateTransition trace source.
Definition: epc-ue-nas.h:221
State m_state
The current UE NAS state.
Definition: epc-ue-nas.h:214
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DoNotifyConnectionFailed()
Notify connection failed.
Definition: epc-ue-nas.cc:245
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:105
BearerToBeActivated structure.
Definition: epc-ue-nas.h:243
bool Send(Ptr< Packet > p)
Enqueue an IP packet on the proper bearer for uplink transmission.
Definition: epc-ue-nas.cc:206
void Disconnect()
instruct the NAS to disconnect
Definition: epc-ue-nas.cc:178
virtual ~EpcUeNas()
Destructor.
Definition: epc-ue-nas.cc:71
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
Definition: epc-ue-nas.cc:142
LteAsSapUser * m_asSapUser
LTE SAP user.
Definition: epc-ue-nas.h:235
void DoActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate EPS Bearer.
Definition: epc-ue-nas.cc:268
State
Definition of NAS states as per "LTE - From theory to practice", Section 3.2.3.2 "Connection Establis...
Definition: epc-ue-nas.h:161
void SetAsSapProvider(LteAsSapProvider *s)
Set the AS SAP provider to interact with the NAS entity.
Definition: epc-ue-nas.cc:128
static TypeId GetTypeId(void)
Get the type ID.
Definition: epc-ue-nas.cc:84
void Connect()
Causes NAS to tell AS to go to ACTIVE state.
Definition: epc-ue-nas.cc:156
A base class which provides memory management and object aggregation.
Definition: object.h:87
void SetImsi(uint64_t imsi)
Definition: epc-ue-nas.cc:106
a unique identifier for an interface.
Definition: type-id.h:58
void DoRecvData(Ptr< Packet > packet)
Receive data.
Definition: epc-ue-nas.cc:254
std::list< BearerToBeActivated > m_bearersToBeActivatedList
bearers to be activated list
Definition: epc-ue-nas.h:249
EpsBearer bearer
EPS bearer.
Definition: epc-ue-nas.h:245
uint8_t m_bidCounter
bid counter
Definition: epc-ue-nas.h:237
uint32_t m_csgId
Closed Subscriber Group identity.
Definition: epc-ue-nas.h:230
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-ue-nas.cc:77