5G-LENA nr-v3.1-14-g738b08bc
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
10#include <ns3/ff-mac-common.h>
11#include <ns3/lte-rrc-sap.h>
12#include <ns3/simple-ref-count.h>
13
14namespace ns3
15{
16
21enum LteNrTddSlotType : uint8_t
22{
23 DL = 0,
24 S = 1,
25 F = 2,
26 UL = 3,
27};
28
29std::ostream& operator<<(std::ostream& os, const LteNrTddSlotType& item);
30
39class NrControlMessage : public SimpleRefCount<NrControlMessage>
40{
41 public:
59
67 virtual ~NrControlMessage();
68
74
79 void SetSourceBwp(uint16_t bwpId);
80
86 uint16_t GetSourceBwp() const;
87
88 protected:
93 void SetMessageType(messageType type);
94
95 private:
96 messageType m_messageType;
97 int32_t m_bwpId{-1};
98};
99
108{
109 public:
113 NrSRMessage();
117 ~NrSRMessage() override;
118
123 void SetRNTI(uint16_t rnti);
124
129 uint16_t GetRNTI() const;
130
131 private:
132 uint16_t m_rnti{0};
133};
134
140{
141 public:
146 NrDlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci);
150 ~NrDlDciMessage() override;
151
156 std::shared_ptr<DciInfoElementTdma> GetDciInfoElement();
157
163 void SetKDelay(uint32_t delay);
170 uint32_t GetKDelay() const;
171
180 void SetK1Delay(uint32_t delay);
187 uint32_t GetK1Delay() const;
188
189 private:
190 uint32_t m_k;
192 uint32_t m_k1;
194 std::shared_ptr<DciInfoElementTdma> m_dciInfoElement;
195};
196
202{
203 public:
208 NrUlDciMessage(const std::shared_ptr<DciInfoElementTdma>& dci);
212 ~NrUlDciMessage() override;
213
218 std::shared_ptr<DciInfoElementTdma> GetDciInfoElement();
219
225 void SetKDelay(uint32_t delay);
232 uint32_t GetKDelay() const;
233
234 private:
235 uint32_t m_k;
237 std::shared_ptr<DciInfoElementTdma> m_dciInfoElement;
238};
239
245{
246 public:
254 ~NrDlCqiMessage() override;
255
260 void SetDlCqi(DlCqiInfo cqi);
266
267 private:
268 DlCqiInfo m_cqi;
269};
270
279{
280 public:
284 NrBsrMessage();
288 ~NrBsrMessage() override;
289
294 void SetBsr(MacCeElement bsr);
295
301
302 private:
303 MacCeElement m_bsr;
304};
305
306// ---------------------------------------------------------------------------
307
315{
316 public:
320 NrMibMessage();
321
326 void SetMib(LteRrcSap::MasterInformationBlock mib);
327
332 LteRrcSap::MasterInformationBlock GetMib() const;
333
334 private:
335 LteRrcSap::MasterInformationBlock m_mib;
336};
337
338// ---------------------------------------------------------------------------
339
347{
348 public:
353
358 void SetSib1(LteRrcSap::SystemInformationBlockType1 sib1);
359
364 LteRrcSap::SystemInformationBlockType1 GetSib1() const;
365
366 private:
367 LteRrcSap::SystemInformationBlockType1 m_sib1;
368};
369
370// ---------------------------------------------------------------------------
371
378{
379 public:
384
388 ~NrRachPreambleMessage() override;
389
395 void SetRapId(uint32_t rapid);
396
401 uint32_t GetRapId() const;
402
403 private:
404 uint32_t m_rapId;
405};
406
407// ---------------------------------------------------------------------------
408
415{
416 public:
420 NrRarMessage();
421
425 ~NrRarMessage() override;
426
431 void SetRaRnti(uint16_t raRnti);
432
437 uint16_t GetRaRnti() const;
438
443 struct Rar
444 {
445 uint8_t rapId;
446 BuildRarListElement_s rarPayload;
447 };
448
454 void AddRar(Rar rar);
455
460 std::list<Rar>::const_iterator RarListBegin() const;
461
466 std::list<Rar>::const_iterator RarListEnd() const;
467
468 private:
469 std::list<Rar> m_rarList;
470 uint16_t m_raRnti;
471};
472
481{
482 public:
490 ~NrDlHarqFeedbackMessage() override;
491
497
503
504 private:
505 DlHarqInfo m_dlHarqInfo;
506};
507
514{
515 public:
519 NrSrsMessage();
523 ~NrSrsMessage() override = default;
524};
525
526} // namespace ns3
527
528#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).
LteRrcSap::MasterInformationBlock GetMib() const
Retrieve the MIB content from this control message.
void SetMib(LteRrcSap::MasterInformationBlock mib)
Replace the MIB content of this control message.
NrMibMessage()
Create a new instance of MIB 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(LteRrcSap::SystemInformationBlockType1 sib1)
Replace the SIB1 content of this control message.
LteRrcSap::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.
BuildRarListElement_s rarPayload
RA Payload.