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 {
37 public:
38 
42  EpcUeNas ();
43 
47  virtual ~EpcUeNas ();
48 
49  // inherited from Object
50  virtual void DoDispose (void);
51  static TypeId GetTypeId (void);
52 
53 
58  void SetDevice (Ptr<NetDevice> dev);
59 
65  void SetImsi (uint64_t imsi);
66 
71  void SetCsgId (uint32_t csgId);
72 
77  uint32_t GetCsgId () const;
78 
85 
92 
98  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
99 
105  void StartCellSelection (uint16_t dlEarfcn);
106 
112  void Connect ();
113 
124  void Connect (uint16_t cellId, uint16_t dlEarfcn);
125 
130  void Disconnect ();
131 
132 
139  void ActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
140 
148  bool Send (Ptr<Packet> p);
149 
150 
156  enum State
157  {
158  OFF = 0,
164  };
165 
169  State GetState () const;
170 
177  typedef void (* StateTracedCallback)
178  (const State oldState, const State newState);
179 
180 private:
181 
182  // LTE AS SAP methods
184  void DoNotifyConnectionFailed ();
186  void DoRecvData (Ptr<Packet> packet);
187 
188  // internal methods
189  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
194  void SwitchToState (State s);
195 
198 
205 
208 
210  uint64_t m_imsi;
211 
213  uint32_t m_csgId;
214 
217 
218  uint8_t m_bidCounter;
220 
222 
224  {
227  };
228 
229  std::list<BearerToBeActivated> m_bearersToBeActivatedList;
230 
231 };
232 
233 
234 } // namespace ns3
235 
236 #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
Definition: epc-ue-nas.h:221
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
LteAsSapProvider * m_asSapProvider
Definition: epc-ue-nas.h:215
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:178
classifies IP packets accoding to Traffic Flow Templates (TFTs)
void DoNotifyConnectionSuccessful()
Definition: epc-ue-nas.cc:237
void StartCellSelection(uint16_t dlEarfcn)
Causes NAS to tell AS to find a suitable cell and camp to it.
Definition: epc-ue-nas.cc:149
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
Ptr< NetDevice > m_device
The UE NetDevice.
Definition: epc-ue-nas.h:207
void DoNotifyConnectionReleased()
Definition: epc-ue-nas.cc:261
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
State GetState() const
Definition: epc-ue-nas.cc:277
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:225
uint64_t m_imsi
The unique UE identifier.
Definition: epc-ue-nas.h:210
EpcTftClassifier m_tftClassifier
Definition: epc-ue-nas.h:219
TracedCallback< State, State > m_stateTransitionCallback
The StateTransition trace source.
Definition: epc-ue-nas.h:204
uint32_t GetCsgId() const
Definition: epc-ue-nas.cc:121
State m_state
The current UE NAS state.
Definition: epc-ue-nas.h:197
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DoNotifyConnectionFailed()
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
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
Definition: epc-ue-nas.h:216
void DoActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
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:156
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)
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)
Definition: epc-ue-nas.cc:254
std::list< BearerToBeActivated > m_bearersToBeActivatedList
Definition: epc-ue-nas.h:229
uint8_t m_bidCounter
Definition: epc-ue-nas.h:218
uint32_t m_csgId
Closed Subscriber Group identity.
Definition: epc-ue-nas.h:213
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-ue-nas.cc:77