5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-control-messages.h
1// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef SRC_NR_MODEL_NR_CONTROL_MESSAGES_H_
6#define SRC_NR_MODEL_NR_CONTROL_MESSAGES_H_
7
8#include "nr-phy-mac-common.h"
9#include "nr-rrc-sap.h"
10
11#include <ns3/simple-ref-count.h>
12
13namespace ns3
14{
15
20enum LteNrTddSlotType : uint8_t
21{
22 DL = 0,
23 S = 1,
24 F = 2,
25 UL = 3,
26};
27
28std::ostream& operator<<(std::ostream& os, const LteNrTddSlotType& item);
29
38class NrControlMessage : public SimpleRefCount<NrControlMessage>
39{
40 public:
58
66 virtual ~NrControlMessage();
67
73
78 void SetSourceBwp(uint16_t bwpId);
79
85 uint16_t GetSourceBwp() const;
86
87 protected:
92 void SetMessageType(messageType type);
93
94 private:
95 messageType m_messageType;
96 int32_t m_bwpId{-1};
97};
98
107{
108 public:
112 NrSRMessage();
116 ~NrSRMessage() override;
117
122 void SetRNTI(uint16_t rnti);
123
128 uint16_t GetRNTI() const;
129
130 private:
131 uint16_t m_rnti{0};
132};
133
139{
140 public:
145 NrDlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci);
149 ~NrDlDciMessage() override;
150
155 std::shared_ptr<DciInfoElementTdma> GetDciInfoElement();
156
162 void SetKDelay(uint32_t delay);
169 uint32_t GetKDelay() const;
170
179 void SetK1Delay(uint32_t delay);
186 uint32_t GetK1Delay() const;
187
188 private:
189 uint32_t m_k;
191 uint32_t m_k1;
193 std::shared_ptr<DciInfoElementTdma> m_dciInfoElement;
194};
195
201{
202 public:
207 NrUlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci);
211 ~NrUlDciMessage() override;
212
217 std::shared_ptr<DciInfoElementTdma> GetDciInfoElement();
218
224 void SetKDelay(uint32_t delay);
231 uint32_t GetKDelay() const;
232
233 private:
234 uint32_t m_k;
236 std::shared_ptr<DciInfoElementTdma> m_dciInfoElement;
237};
238
244{
245 public:
253 ~NrDlCqiMessage() override;
254
259 void SetDlCqi(DlCqiInfo cqi);
265
266 private:
267 DlCqiInfo m_cqi;
268};
269
278{
279 public:
283 NrBsrMessage();
287 ~NrBsrMessage() override;
288
293 void SetBsr(MacCeElement bsr);
294
300
301 private:
302 MacCeElement m_bsr;
303};
304
305// ---------------------------------------------------------------------------
306
314{
315 public:
319 NrMibMessage();
320
326
332
333 private:
335};
336
337// ---------------------------------------------------------------------------
338
346{
347 public:
352
358
364
365 private:
367};
368
369// ---------------------------------------------------------------------------
370
377{
378 public:
383
387 ~NrRachPreambleMessage() override;
388
394 void SetRapId(uint32_t rapid);
395
400 uint32_t GetRapId() const;
401
402 private:
403 uint32_t m_rapId;
404};
405
406// ---------------------------------------------------------------------------
407
414{
415 public:
419 NrRarMessage();
420
424 ~NrRarMessage() override;
425
430 void SetRaRnti(uint16_t raRnti);
431
436 uint16_t GetRaRnti() const;
437
447
453 void AddRar(Rar rar);
454
459 std::list<Rar>::const_iterator RarListBegin() const;
460
465 std::list<Rar>::const_iterator RarListEnd() const;
466
467 private:
468 std::list<Rar> m_rarList;
469 uint16_t m_raRnti;
470};
471
480{
481 public:
489 ~NrDlHarqFeedbackMessage() override;
490
496
502
503 private:
504 DlHarqInfo m_dlHarqInfo;
505};
506
513{
514 public:
518 NrSrsMessage();
522 ~NrSrsMessage() override = default;
523};
524
525} // namespace ns3
526
527#endif /* SRC_NR_MODEL_NR_CONTROL_MESSAGES_H_ */
NrBsrMessage()
NrBsrMessage constructor.
MacCeElement GetBsr()
Get BSR information.
void SetBsr(MacCeElement bsr)
add a BSR feedback record into the message.
~NrBsrMessage() override
~NrBsrMessage
The NrControlMessage class.
virtual ~NrControlMessage()
~NrControlMessage
void SetSourceBwp(uint16_t bwpId)
Set the BWP in which this message has been generated.
messageType GetMessageType() const
Get the MessageType.
uint16_t GetSourceBwp() const
NrControlMessage()
NrControlMessage.
void SetMessageType(messageType type)
Set the MessageType.
messageType
The Message Type.
@ UL_DCI
The resources allocation map from the BS to the attached UEs (UL)
@ DL_HARQ
DL HARQ feedback.
@ RACH_PREAMBLE
Random Access Preamble.
@ MIB
Master Information Block.
@ SR
Scheduling Request: asking for space.
@ BSR
Buffer Status Report.
@ RAR
Random Access Response.
@ SIB1
System Information Block Type 1.
@ DL_DCI
The resources allocation map from the BS to the attached UEs (DL)
The message that represents a DL CQI message.
DlCqiInfo GetDlCqi()
Get the DlCqi in this message.
void SetDlCqi(DlCqiInfo cqi)
Set the DlCqi to transmit.
~NrDlCqiMessage() override
~NrDlCqiMessage
NrDlCqiMessage()
NrDlCqiMessage constructor.
The message that represents a DL DCI message.
std::shared_ptr< DciInfoElementTdma > GetDciInfoElement()
Get the DCI.
void SetK1Delay(uint32_t delay)
Set the delay (in slots) between DL Data reception and subframe to which it applies for Harq feedback...
~NrDlDciMessage() override
~NrDlDciMessage
uint32_t GetKDelay() const
Get the delay (in slots) between DCI reception and subframe to which it applies for reception/transmi...
uint32_t GetK1Delay() const
Get the delay (in slots) between DL Data reception and subframe to which it applies for Harq feedback...
void SetKDelay(uint32_t delay)
Set the delay (in slots) between DL DCI reception and subframe to which it applies for reception/tran...
void SetDlHarqFeedback(DlHarqInfo m)
add a DL HARQ feedback record into the message.
~NrDlHarqFeedbackMessage() override
~NrDlHarqFeedbackMessage
NrDlHarqFeedbackMessage()
NrDlHarqFeedbackMessage constructor.
DlHarqInfo GetDlHarqFeedback()
Get DL HARQ information.
Abstract model for broadcasting the Master Information Block (MIB) within the control channel (BCCH).
NrMibMessage()
Create a new instance of MIB control message.
NrRrcSap::MasterInformationBlock GetMib() const
Retrieve the MIB content from this control message.
void SetMib(NrRrcSap::MasterInformationBlock mib)
Replace the MIB content of this control message.
Abstract model for the Random Access Preamble.
NrRachPreambleMessage()
NrRachPreambleMessage constructor.
~NrRachPreambleMessage() override
~NrRachPreambleMessage
Abstract model for the MAC Random Access Response message.
std::list< Rar >::const_iterator RarListBegin() const
void SetRaRnti(uint16_t raRnti)
std::list< Rar >::const_iterator RarListEnd() const
NrRarMessage()
NrRarMessage constructor.
~NrRarMessage() override
~NrRarMessage
uint16_t GetRaRnti() const
NrSRMessage()
NrSRMessage constructor.
~NrSRMessage() override
~NrSRMessage
uint16_t GetRNTI() const
Get the RNTI of this message.
void SetRNTI(uint16_t rnti)
Set the RNTI to which this message is intended.
Abstract model for broadcasting the System Information Block Type 1 (SIB1) within the control channel...
NrSib1Message()
Create a new instance of SIB1 control message.
void SetSib1(NrRrcSap::SystemInformationBlockType1 sib1)
Replace the SIB1 content of this control message.
NrRrcSap::SystemInformationBlockType1 GetSib1() const
Retrieve the SIB1 content from this control message.
NrSrsMessage message.
NrSrsMessage()
NrDlHarqFeedbackMessage constructor.
~NrSrsMessage() override=default
~NrDlHarqFeedbackMessage
The message that represents a UL DCI message.
uint32_t GetKDelay() const
Get the delay (in slots) between UCI reception and subframe to which it applies for reception/transmi...
void SetKDelay(uint32_t delay)
Set the delay (in slots) between UCI reception and subframe to which it applies for reception/transmi...
~NrUlDciMessage() override
~NrUlDciMessage
std::shared_ptr< DciInfoElementTdma > GetDciInfoElement()
Get the DCI.
LteNrTddSlotType
Available TDD slot types. Ordering is important.
@ F
DL CTRL + DL DATA + UL DATA + UL CTRL.
@ S
DL CTRL + DL DATA + UL CTRL.
@ DL
DL CTRL + DL DATA.
@ UL
UL DATA + UL CTRL.
The DlCqiInfo struct.
A struct that contains info for the DL HARQ.
See section 4.3.14 macCEListElement.
NrBuildRarListElement_s rarPayload
RA Payload.
MasterInformationBlock structure.
Definition nr-rrc-sap.h:627
SystemInformationBlockType1 structure.
Definition nr-rrc-sap.h:634