5G-LENA nr-v3.1-69-g2dd513a7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-phy-sap.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_PHY_SAP_H
6#define NR_PHY_SAP_H
7
8#include "beam-id.h"
9#include "nr-control-messages.h"
10#include "nr-mac-sched-sap.h"
11#include "nr-phy-mac-common.h"
12
13#include <ns3/packet-burst.h>
14
15namespace ns3
16{
17
18class NrControlMessage;
19
36{
37 public:
41 virtual ~NrPhySapProvider() = default;
42
53 virtual void SendMacPdu(const Ptr<Packet>& p,
54 const SfnSf& sfn,
55 uint8_t symStart,
56 uint16_t rnti) = 0;
57
65 virtual void SendControlMessage(Ptr<NrControlMessage> msg) = 0;
66
72 virtual void SendRachPreamble(uint8_t PreambleId, uint8_t Rnti) = 0;
73
81 virtual void SetSlotAllocInfo(const SlotAllocInfo& slotAllocInfo) = 0;
82
87 virtual void NotifyConnectionSuccessful() = 0;
88
96 virtual BeamId GetBeamId(uint8_t rnti) const = 0;
97
106 virtual Ptr<const SpectrumModel> GetSpectrumModel() = 0;
107
112 virtual uint16_t GetBwpId() const = 0;
113
118 virtual uint16_t GetCellId() const = 0;
119
125 virtual uint32_t GetSymbolsPerSlot() const = 0;
126
131 virtual Time GetSlotPeriod() const = 0;
132
137 virtual uint32_t GetRbNum() const = 0;
138};
139
155{
156 public:
160 virtual ~NrGnbPhySapUser() = default;
161
167 virtual void ReceivePhyPdu(Ptr<Packet> p) = 0;
168
173 virtual void ReceiveControlMessage(Ptr<NrControlMessage> msg) = 0;
174
179 virtual void SetCurrentSfn(const SfnSf& sfn) = 0;
180
186 virtual void SlotDlIndication(const SfnSf& sfn, LteNrTddSlotType slotType) = 0;
187
193 virtual void SlotUlIndication(const SfnSf& sfn, LteNrTddSlotType slotType) = 0;
194
195 // We do a DL and then manually add an UL CTRL if it's an S slot.
196 // virtual void SlotSIndication (const SfnSf &sfn) = 0;
197 // We do UL and then DL to model an F slot.
198 // virtual void SlotFIndication (const SfnSf &sfn) = 0;
199
205
211 virtual void ReceiveRachPreamble(uint32_t raId) = 0;
212
218 virtual void UlHarqFeedback(UlHarqInfo params) = 0;
219
225 virtual void BeamChangeReport(BeamId beamId, uint8_t rnti) = 0;
226
233 virtual uint32_t GetNumRbPerRbg() const = 0;
234
239 virtual std::shared_ptr<DciInfoElementTdma> GetDlCtrlDci() const = 0;
240
245 virtual std::shared_ptr<DciInfoElementTdma> GetUlCtrlDci() const = 0;
246
251 virtual uint8_t GetDlCtrlSymbols() const = 0;
252};
253
264{
265 public:
270 {
271 }
272
278 virtual void ReceivePhyPdu(Ptr<Packet> p) = 0;
279
284 virtual void ReceiveControlMessage(Ptr<NrControlMessage> msg) = 0;
285
290 virtual void SlotIndication(SfnSf s) = 0;
291
296 virtual uint8_t GetNumHarqProcess() const = 0;
297};
298
299} // namespace ns3
300
301#endif /* NR_PHY_SAP_H */
Representation of a beam id.
Definition beam-id.h:26
SAP interface between the gNB PHY and the gNB MAC.
Definition nr-phy-sap.h:155
virtual void ReceiveControlMessage(Ptr< NrControlMessage > msg)=0
Receive SendNrControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual void SlotUlIndication(const SfnSf &sfn, LteNrTddSlotType slotType)=0
Trigger MAC layer to generate an UL slot for the SfnSf indicated.
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Notify the MAC of the reception of a new PHY-PDU.
virtual void UlCqiReport(NrMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi)=0
Returns to MAC level the UL-CQI evaluated.
virtual void BeamChangeReport(BeamId beamId, uint8_t rnti)=0
Called by the PHY to notify MAC that beam has changed. Not in any standard.
virtual void UlHarqFeedback(UlHarqInfo params)=0
Notify the HARQ on the UL transmission status.
virtual void SetCurrentSfn(const SfnSf &sfn)=0
Set the current Sfn. The state machine has advanced by one slot.
virtual uint32_t GetNumRbPerRbg() const =0
PHY requests information from MAC. While MAC normally act as user of PHY services,...
virtual uint8_t GetDlCtrlSymbols() const =0
Retrieve the DL CTRL symbols.
virtual void ReceiveRachPreamble(uint32_t raId)=0
Notify the reception of a RACH preamble on the PRACH.
virtual void SlotDlIndication(const SfnSf &sfn, LteNrTddSlotType slotType)=0
Trigger MAC layer to generate a DL slot for the SfnSf indicated.
virtual std::shared_ptr< DciInfoElementTdma > GetUlCtrlDci() const =0
Retrieve a dci for a UL CTRL allocation.
virtual ~NrGnbPhySapUser()=default
~NrGnbPhySapUser
virtual std::shared_ptr< DciInfoElementTdma > GetDlCtrlDci() const =0
Retrieve a dci for a DL CTRL allocation.
SAP interface between the MAC and the PHY.
Definition nr-phy-sap.h:36
virtual Time GetSlotPeriod() const =0
Retrieve the slot period.
virtual BeamId GetBeamId(uint8_t rnti) const =0
Get the beam ID from the RNTI specified. Not in any standard.
virtual void SendMacPdu(const Ptr< Packet > &p, const SfnSf &sfn, uint8_t symStart, uint16_t rnti)=0
Send a Mac PDU.
virtual uint16_t GetCellId() const =0
Retrieve the cell id.
virtual Ptr< const SpectrumModel > GetSpectrumModel()=0
Retrieve the spectrum model used by the PHY layer.
virtual uint32_t GetRbNum() const =0
Retrieve the number of resource blocks.
virtual void SendControlMessage(Ptr< NrControlMessage > msg)=0
Send a control message.
virtual void NotifyConnectionSuccessful()=0
Notify PHY about the successful RRC connection establishment.
virtual uint32_t GetSymbolsPerSlot() const =0
Retrieve the number of symbols in one slot.
virtual void SetSlotAllocInfo(const SlotAllocInfo &slotAllocInfo)=0
Set a SlotAllocInfo inside the PHY allocations.
virtual ~NrPhySapProvider()=default
~NrPhySapProvider
virtual uint16_t GetBwpId() const =0
Retrieve the bandwidth part id.
virtual void SendRachPreamble(uint8_t PreambleId, uint8_t Rnti)=0
Send the RACH preamble.
SAP interface between the UE PHY and the UE MAC.
Definition nr-phy-sap.h:264
virtual ~NrUePhySapUser()
~NrUePhySapUser
Definition nr-phy-sap.h:269
virtual uint8_t GetNumHarqProcess() const =0
Retrieve the number of HARQ processes configured.
virtual void ReceiveControlMessage(Ptr< NrControlMessage > msg)=0
Receive SendNrControlMessage (PDCCH map, CQI feedbacks) using the ideal control channel.
virtual void ReceivePhyPdu(Ptr< Packet > p)=0
Notify the MAC of the reception of a new PHY-PDU.
virtual void SlotIndication(SfnSf s)=0
Trigger the indication of a new slot for the MAC.
The SfnSf class.
Definition sfnsf.h:32
LteNrTddSlotType
Available TDD slot types. Ordering is important.
The SlotAllocInfo struct.
A struct that contains info for the UL HARQ.