A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
171 
172 private:
173 
174  // LTE AS SAP methods
176  void DoNotifyConnectionFailed ();
178  void DoRecvData (Ptr<Packet> packet);
179 
180  // internal methods
181  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
182  void SwitchToState (State s);
183 
185 
187 
189 
190  uint64_t m_imsi;
191 
192  uint32_t m_csgId;
193 
196 
197  uint8_t m_bidCounter;
199 
201 
203  {
206  };
207 
208  std::list<BearerToBeActivated> m_bearersToBeActivatedList;
209 
210 };
211 
212 
213 } // namespace ns3
214 
215 #endif // EPC_UE_NAS_H
void SwitchToState(State s)
Definition: epc-ue-nas.cc:283
void ActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate an EPS bearer.
Definition: epc-ue-nas.cc:182
Callback< void, Ptr< Packet > > m_forwardUpCallback
Definition: epc-ue-nas.h:200
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
LteAsSapProvider * m_asSapProvider
Definition: epc-ue-nas.h:194
Callback template class.
Definition: callback.h:924
classifies IP packets accoding to Traffic Flow Templates (TFTs)
void DoNotifyConnectionSuccessful()
Definition: epc-ue-nas.cc:232
void StartCellSelection(uint16_t dlEarfcn)
Causes NAS to tell AS to find a suitable cell and camp to it.
Definition: epc-ue-nas.cc:144
EpcUeNas()
Constructor.
Definition: epc-ue-nas.cc:57
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
Definition: epc-ue-nas.h:188
void DoNotifyConnectionReleased()
Definition: epc-ue-nas.cc:260
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
State GetState() const
Definition: epc-ue-nas.cc:276
LteAsSapUser * GetAsSapUser()
Definition: epc-ue-nas.cc:130
void SetCsgId(uint32_t csgId)
Definition: epc-ue-nas.cc:108
void SetDevice(Ptr< NetDevice > dev)
Definition: epc-ue-nas.cc:94
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
Ptr< SampleEmitter > s
uint64_t m_imsi
Definition: epc-ue-nas.h:190
EpcTftClassifier m_tftClassifier
Definition: epc-ue-nas.h:198
TracedCallback< State, State > m_stateTransitionCallback
Definition: epc-ue-nas.h:186
uint32_t GetCsgId() const
Definition: epc-ue-nas.cc:116
void DoNotifyConnectionFailed()
Definition: epc-ue-nas.cc:240
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:201
void Disconnect()
instruct the NAS to disconnect
Definition: epc-ue-nas.cc:173
virtual ~EpcUeNas()
Destructor.
Definition: epc-ue-nas.cc:68
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
Definition: epc-ue-nas.cc:137
LteAsSapUser * m_asSapUser
Definition: epc-ue-nas.h:195
void DoActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Definition: epc-ue-nas.cc:267
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:123
static TypeId GetTypeId(void)
Definition: epc-ue-nas.cc:81
void Connect()
Causes NAS to tell AS to go to ACTIVE state.
Definition: epc-ue-nas.cc:151
a base class which provides memory management and object aggregation
Definition: object.h:64
void SetImsi(uint64_t imsi)
Definition: epc-ue-nas.cc:101
a unique identifier for an interface.
Definition: type-id.h:49
void DoRecvData(Ptr< Packet > packet)
Definition: epc-ue-nas.cc:253
std::list< BearerToBeActivated > m_bearersToBeActivatedList
Definition: epc-ue-nas.h:208
uint8_t m_bidCounter
Definition: epc-ue-nas.h:197
uint32_t m_csgId
Definition: epc-ue-nas.h:192
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: epc-ue-nas.cc:74