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
29namespace ns3 {
30
31
32class EpcHelper;
33
34class EpcUeNas : public Object
35{
37 friend class MemberLteAsSapUser<EpcUeNas>;
38public:
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
154 bool Send (Ptr<Packet> p, uint16_t protocolNumber);
155
156
162 enum State
163 {
164 OFF = 0,
170 };
171
175 State GetState () const;
176
183 typedef void (* StateTracedCallback)
184 (const State oldState, const State newState);
185
186private:
187
188 // LTE AS SAP methods
199 void DoRecvData (Ptr<Packet> packet);
200
201 // internal methods
207 void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
212 void SwitchToState (State s);
213
216
223
226
228 uint64_t m_imsi;
229
232
237
238 uint8_t m_bidCounter;
240
242
245 {
248 };
249
250 std::list<BearerToBeActivated> m_bearersToBeActivatedList;
251
257 std::list<BearerToBeActivated> m_bearersToBeActivatedListForReconnection;
258
259};
260
261
262} // namespace ns3
263
264#endif // EPC_UE_NAS_H
Callback template class.
Definition: callback.h:1279
Base helper class to handle the creation of the EPC entities.
Definition: epc-helper.h:50
classifies IP packets according to Traffic Flow Templates (TFTs)
void SwitchToState(State s)
Switch the UE RRC to the given state.
Definition: epc-ue-nas.cc:294
static TypeId GetTypeId(void)
Get the type ID.
Definition: epc-ue-nas.cc:84
uint64_t m_imsi
The unique UE identifier.
Definition: epc-ue-nas.h:228
State m_state
The current UE NAS state.
Definition: epc-ue-nas.h:215
void DoNotifyConnectionSuccessful()
Notify successful connection.
Definition: epc-ue-nas.cc:238
Callback< void, Ptr< Packet > > m_forwardUpCallback
upward callback
Definition: epc-ue-nas.h:241
LteAsSapUser * m_asSapUser
LTE SAP user.
Definition: epc-ue-nas.h:236
void SetDevice(Ptr< NetDevice > dev)
Definition: epc-ue-nas.cc:99
uint8_t m_bidCounter
bid counter
Definition: epc-ue-nas.h:238
std::list< BearerToBeActivated > m_bearersToBeActivatedListForReconnection
bearers to be activated list maintained and to be used for reconnecting an out-of-sync UE
Definition: epc-ue-nas.h:257
TracedCallback< State, State > m_stateTransitionCallback
The StateTransition trace source.
Definition: epc-ue-nas.h:222
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
State GetState() const
Definition: epc-ue-nas.cc:287
uint32_t m_csgId
Closed Subscriber Group identity.
Definition: epc-ue-nas.h:231
EpcUeNas()
Constructor.
Definition: epc-ue-nas.cc:60
LteAsSapUser * GetAsSapUser()
Definition: epc-ue-nas.cc:135
void DoActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate EPS Bearer.
Definition: epc-ue-nas.cc:278
State
Definition of NAS states as per "LTE - From theory to practice", Section 3.2.3.2 "Connection Establis...
Definition: epc-ue-nas.h:163
void DoNotifyConnectionFailed()
Notify connection failed.
Definition: epc-ue-nas.cc:246
LteAsSapProvider * m_asSapProvider
LTE SAP provider.
Definition: epc-ue-nas.h:234
void Disconnect()
instruct the NAS to disconnect
Definition: epc-ue-nas.cc:178
EpcTftClassifier m_tftClassifier
tft classifier
Definition: epc-ue-nas.h:239
void DoNotifyConnectionReleased()
Notify connection released.
Definition: epc-ue-nas.cc:262
virtual void DoDispose(void)
Destructor implementation.
Definition: epc-ue-nas.cc:77
void Connect()
Causes NAS to tell AS to go to ACTIVE state.
Definition: epc-ue-nas.cc:156
void SetImsi(uint64_t imsi)
Definition: epc-ue-nas.cc:106
Ptr< NetDevice > m_device
The UE NetDevice.
Definition: epc-ue-nas.h:225
void SetAsSapProvider(LteAsSapProvider *s)
Set the AS SAP provider to interact with the NAS entity.
Definition: epc-ue-nas.cc:128
void SetCsgId(uint32_t csgId)
Definition: epc-ue-nas.cc:113
virtual ~EpcUeNas()
Destructor.
Definition: epc-ue-nas.cc:71
void ActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Activate an EPS bearer.
Definition: epc-ue-nas.cc:187
void(* StateTracedCallback)(const State oldState, const State newState)
TracedCallback signature for state change events.
Definition: epc-ue-nas.h:184
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
set the callback used to forward data packets up the stack
Definition: epc-ue-nas.cc:142
std::list< BearerToBeActivated > m_bearersToBeActivatedList
bearers to be activated list
Definition: epc-ue-nas.h:250
void DoRecvData(Ptr< Packet > packet)
Receive data.
Definition: epc-ue-nas.cc:255
bool Send(Ptr< Packet > p, uint16_t protocolNumber)
Enqueue an IP packet on the proper bearer for uplink transmission.
Definition: epc-ue-nas.cc:207
uint32_t GetCsgId() const
Definition: epc-ue-nas.cc:121
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:40
This class implements the Access Stratum (AS) Service Access Point (SAP), i.e., the interface between...
Definition: lte-as-sap.h:104
Template for the implementation of the LteAsSapUser as a member of an owner class of type C to which ...
Definition: lte-as-sap.h:229
A base class which provides memory management and object aggregation.
Definition: object.h:88
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
BearerToBeActivated structure.
Definition: epc-ue-nas.h:245
EpsBearer bearer
EPS bearer.
Definition: epc-ue-nas.h:246