5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-gnb-net-device.h
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NR_GNB_NET_DEVICE_H
6#define NR_GNB_NET_DEVICE_H
7
8#include "nr-fh-control.h"
9#include "nr-net-device.h"
10
11#include "ns3/deprecated.h"
12#include "ns3/traced-callback.h"
13
14namespace ns3
15{
16
17class Packet;
18class PacketBurst;
19class Node;
20class NrGnbPhy;
21class NrGnbMac;
22class NrGnbRrc;
23class BandwidthPartGnb;
24class NrGnbComponentCarrierManager;
25class BwpManagerGnb;
26class NrMacScheduler;
27
35{
36 public:
37 static TypeId GetTypeId();
38
40
41 ~NrGnbNetDevice() override;
42
43 Ptr<NrMacScheduler> GetScheduler(uint8_t index) const;
44
45 Ptr<NrGnbMac> GetMac(uint8_t index) const;
46
47 Ptr<NrGnbPhy> GetPhy(uint8_t index) const;
48
49 Ptr<BwpManagerGnb> GetBwpManager() const;
50
51 uint16_t GetBwpId(uint8_t index) const;
52
56 uint16_t GetCellId() const;
57
61 std::vector<uint16_t> GetCellIds() const;
62
67 void SetCellId(uint16_t cellId);
68
69 uint16_t GetEarfcn(uint8_t index) const;
70
71 void SetRrc(Ptr<NrGnbRrc> rrc);
72
73 Ptr<NrGnbRrc> GetRrc();
74
75 void SetCcMap(const std::map<uint8_t, Ptr<BandwidthPartGnb>>& ccm);
76
81 uint32_t GetCcMapSize() const;
82
87 void SetNrFhControl(Ptr<NrFhControl> nrFh);
88
93 Ptr<NrFhControl> GetNrFhControl();
94
103 void RouteIngoingCtrlMsgs(const std::list<Ptr<NrControlMessage>>& msgList, uint8_t sourceBwpId);
104
110 void RouteOutgoingCtrlMsgs(const std::list<Ptr<NrControlMessage>>& msgList,
111 uint8_t sourceBwpId);
112
132 NS_DEPRECATED("Obsolete method")
133 void UpdateConfig();
134
157 void ConfigureCell();
158
163 bool IsCellConfigured() const;
164
170 uint16_t GetCellIdDlBandwidth(uint16_t cellId) const;
171
177 uint16_t GetCellIdUlBandwidth(uint16_t cellId) const;
178
184 uint32_t GetCellIdDlEarfcn(uint16_t cellId) const;
185
191 uint32_t GetCellIdUlEarfcn(uint16_t cellId) const;
192
193 protected:
194 void DoInitialize() override;
195
196 void DoDispose() override;
197 bool DoSend(Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber) override;
198
199 private:
200 Ptr<NrGnbRrc> m_rrc;
201
202 uint16_t m_cellId;
203
204 std::map<uint8_t, Ptr<BandwidthPartGnb>> m_ccMap;
206 Ptr<NrGnbComponentCarrierManager>
207 m_componentCarrierManager;
208 Ptr<NrFhControl> m_nrFhControl;
209
210 bool m_isCellConfigured{false};
211};
212
213} // namespace ns3
214
215#endif /* NR_GNB_NET_DEVICE_H */
The NrGnbNetDevice class.
void RouteOutgoingCtrlMsgs(const std::list< Ptr< NrControlMessage > > &msgList, uint8_t sourceBwpId)
Route the outgoing messages to the right BWP.
uint16_t GetCellIdDlBandwidth(uint16_t cellId) const
Get downlink bandwidth for a given physical cell Id.
void SetNrFhControl(Ptr< NrFhControl > nrFh)
Set the NrFhControl for this cell.
std::vector< uint16_t > GetCellIds() const
uint16_t GetCellId() const
void SetCellId(uint16_t cellId)
Set this gnb cell id.
void RouteIngoingCtrlMsgs(const std::list< Ptr< NrControlMessage > > &msgList, uint8_t sourceBwpId)
The gNB received a CTRL message list.
uint32_t GetCcMapSize() const
Get the size of the component carriers map.
bool IsCellConfigured() const
Return true if ConfigureCell() has been called.
uint32_t GetCellIdDlEarfcn(uint16_t cellId) const
Get uplink earfcn for a given physical cell Id.
uint16_t GetCellIdUlBandwidth(uint16_t cellId) const
Get uplink bandwidth for a given physical cell Id.
void UpdateConfig()
Update the RRC configuration after installation.
void ConfigureCell()
Update the RRC configuration after installation.
Ptr< NrFhControl > GetNrFhControl()
Get the NrFhControl for this cell.
uint32_t GetCellIdUlEarfcn(uint16_t cellId) const
Get uplink earfcn for a given physical cell Id.
The NrNetDevice class.