A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ue-net-device.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Giuseppe Piro <g.piro@poliba.it>
18 * Nicola Baldo <nbaldo@cttc.es>
19 * Modified by:
20 * Danilo Abrignani <danilo.abrignani@unibo.it> (Carrier Aggregation - GSoC 2015)
21 * Biljana Bojovic <biljana.bojovic@cttc.es> (Carrier Aggregation)
22 */
23
24#ifndef LTE_UE_NET_DEVICE_H
25#define LTE_UE_NET_DEVICE_H
26
28#include "lte-net-device.h"
29
30#include "ns3/event-id.h"
31#include "ns3/nstime.h"
32#include "ns3/traced-callback.h"
33
34#include <map>
35#include <vector>
36
37namespace ns3
38{
39
40class Packet;
41class PacketBurst;
42class Node;
43class LtePhy;
44class LteUePhy;
45class LteEnbNetDevice;
46class LteUeMac;
47class LteUeRrc;
48class EpcUeNas;
49class EpcTft;
50class LteUeComponentCarrierManager;
51
52/**
53 * \ingroup lte
54 * The LteUeNetDevice class implements the UE net device
55 */
57{
58 public:
59 /**
60 * \brief Get the type ID.
61 * \return the object TypeId
62 */
63 static TypeId GetTypeId();
64
66 ~LteUeNetDevice() override;
67 void DoDispose() override;
68
69 // inherited from NetDevice
70 bool Send(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber) override;
71
72 /**
73 * \brief Get the MAC.
74 * \return the LTE UE MAC
75 */
76 Ptr<LteUeMac> GetMac() const;
77
78 /**
79 * \brief Get the RRC.
80 * \return the LTE UE RRC
81 */
82 Ptr<LteUeRrc> GetRrc() const;
83
84 /**
85 * \brief Get the Phy.
86 * \return the LTE UE Phy
87 */
88 Ptr<LteUePhy> GetPhy() const;
89
90 /**
91 * \brief Get the NAS.
92 * \return the LTE UE NAS
93 */
94 Ptr<EpcUeNas> GetNas() const;
95
96 /**
97 * \brief Get the componentn carrier manager.
98 * \return the LTE UE component carrier manager
99 */
101
102 /**
103 * \brief Get the IMSI.
104 * \return the IMSI
105 */
106 uint64_t GetImsi() const;
107
108 /**
109 * \return the downlink carrier frequency (EARFCN)
110 *
111 * Note that real-life handset typically supports more than one EARFCN, but
112 * the sake of simplicity we assume only one EARFCN is supported.
113 */
114 uint32_t GetDlEarfcn() const;
115
116 /**
117 * \param earfcn the downlink carrier frequency (EARFCN)
118 *
119 * Note that real-life handset typically supports more than one EARFCN, but
120 * the sake of simplicity we assume only one EARFCN is supported.
121 */
122 void SetDlEarfcn(uint32_t earfcn);
123
124 /**
125 * \brief Returns the CSG ID the UE is currently a member of.
126 * \return the Closed Subscriber Group identity
127 */
128 uint32_t GetCsgId() const;
129
130 /**
131 * \brief Enlist the UE device as a member of a particular CSG.
132 * \param csgId the intended Closed Subscriber Group identity
133 *
134 * UE is associated with a single CSG identity, and thus becoming a member of
135 * this particular CSG. As a result, the UE may gain access to cells which
136 * belong to this CSG. This does not revoke the UE's access to non-CSG cells.
137 *
138 * \note This restriction only applies to initial cell selection and
139 * EPC-enabled simulation.
140 */
141 void SetCsgId(uint32_t csgId);
142
143 /**
144 * \brief Set the target eNB where the UE is registered
145 * \param enb
146 */
148
149 /**
150 * \brief Get the target eNB where the UE is registered
151 * \return the pointer to the enb
152 */
154
155 /**
156 * \brief Set the ComponentCarrier Map for the UE
157 * \param ccm the map of ComponentCarrierUe
158 */
159 void SetCcMap(std::map<uint8_t, Ptr<ComponentCarrierUe>> ccm);
160
161 /**
162 * \brief Get the ComponentCarrier Map for the UE
163 * \returns the map of ComponentCarrierUe
164 */
165 std::map<uint8_t, Ptr<ComponentCarrierUe>> GetCcMap();
166
167 protected:
168 // inherited from Object
169 void DoInitialize() override;
170
171 private:
172 bool m_isConstructed; ///< is constructed?
173
174 /**
175 * \brief Propagate attributes and configuration to sub-modules.
176 *
177 * Several attributes (e.g., the IMSI) are exported as the attributes of the
178 * LteUeNetDevice from a user perspective, but are actually used also in other
179 * sub-modules (the RRC, the PHY, etc.). This method takes care of updating
180 * the configuration of all these sub-modules so that their copy of attribute
181 * values are in sync with the one in the LteUeNetDevice.
182 */
183 void UpdateConfig();
184
186
187 Ptr<LteUeRrc> m_rrc; ///< the RRC
188 Ptr<EpcUeNas> m_nas; ///< the NAS
190
191 uint64_t m_imsi; ///< the IMSI
192
193 uint32_t m_dlEarfcn; /**< downlink carrier frequency */
194
195 uint32_t m_csgId; ///< the CSG ID
196
197 std::map<uint8_t, Ptr<ComponentCarrierUe>> m_ccMap; ///< CC map
198
199}; // end of class LteUeNetDevice
200
201} // namespace ns3
202
203#endif /* LTE_UE_NET_DEVICE_H */
a polymophic address class
Definition: address.h:101
LteNetDevice provides basic implementation for all LTE network devices.
The LteUeNetDevice class implements the UE net device.
uint32_t m_csgId
the CSG ID
void DoInitialize() override
Initialize() implementation.
Ptr< LteUeRrc > m_rrc
the RRC
uint64_t m_imsi
the IMSI
static TypeId GetTypeId()
Get the type ID.
void UpdateConfig()
Propagate attributes and configuration to sub-modules.
std::map< uint8_t, Ptr< ComponentCarrierUe > > m_ccMap
CC map.
Ptr< LteUeComponentCarrierManager > GetComponentCarrierManager() const
Get the componentn carrier manager.
Ptr< LteEnbNetDevice > GetTargetEnb()
Get the target eNB where the UE is registered.
Ptr< LteUeRrc > GetRrc() const
Get the RRC.
Ptr< EpcUeNas > GetNas() const
Get the NAS.
uint64_t GetImsi() const
Get the IMSI.
void SetCsgId(uint32_t csgId)
Enlist the UE device as a member of a particular CSG.
Ptr< LteUeComponentCarrierManager > m_componentCarrierManager
the component carrier manager
Ptr< LteUePhy > GetPhy() const
Get the Phy.
uint32_t m_dlEarfcn
downlink carrier frequency
void SetDlEarfcn(uint32_t earfcn)
Ptr< LteUeMac > GetMac() const
Get the MAC.
Ptr< EpcUeNas > m_nas
the NAS
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
std::map< uint8_t, Ptr< ComponentCarrierUe > > GetCcMap()
Get the ComponentCarrier Map for the UE.
void SetTargetEnb(Ptr< LteEnbNetDevice > enb)
Set the target eNB where the UE is registered.
void DoDispose() override
Destructor implementation.
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierUe > > ccm)
Set the ComponentCarrier Map for the UE.
uint32_t GetDlEarfcn() const
Ptr< LteEnbNetDevice > m_targetEnb
target ENB
uint32_t GetCsgId() const
Returns the CSG ID the UE is currently a member of.
bool m_isConstructed
is constructed?
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.