5G-LENA nr-v3.0-33-g7aea1e4
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-phy-sap.h
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2019 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#ifndef NR_PHY_SAP_H
8#define NR_PHY_SAP_H
9
10#include "beam-id.h"
11#include "nr-control-messages.h"
12#include "nr-mac-sched-sap.h"
13#include "nr-phy-mac-common.h"
14
15#include <ns3/packet-burst.h>
16
17namespace ns3
18{
19
20class NrControlMessage;
21
38{
39 public:
43 virtual ~NrPhySapProvider();
44
55 virtual void SendMacPdu(const Ptr<Packet>& p,
56 const SfnSf& sfn,
57 uint8_t symStart,
58 uint16_t rnti) = 0;
59
67 virtual void SendControlMessage(Ptr<NrControlMessage> msg) = 0;
68
74 virtual void SendRachPreamble(uint8_t PreambleId, uint8_t Rnti) = 0;
75
83 virtual void SetSlotAllocInfo(const SlotAllocInfo& slotAllocInfo) = 0;
84
89 virtual void NotifyConnectionSuccessful() = 0;
90
98 virtual BeamId GetBeamId(uint8_t rnti) const = 0;
99
108 virtual Ptr<const SpectrumModel> GetSpectrumModel() = 0;
109
114 virtual uint16_t GetBwpId() const = 0;
115
120 virtual uint16_t GetCellId() const = 0;
121
127 virtual uint32_t GetSymbolsPerSlot() const = 0;
128
133 virtual Time GetSlotPeriod() const = 0;
134
139 virtual uint32_t GetRbNum() const = 0;
140};
141
157{
158 public:
163 {
164 }
165
171 virtual void ReceivePhyPdu(Ptr<Packet> p) = 0;
172
177 virtual void ReceiveControlMessage(Ptr<NrControlMessage> msg) = 0;
178
183 virtual void SetCurrentSfn(const SfnSf& sfn) = 0;
184
190 virtual void SlotDlIndication(const SfnSf& sfn, LteNrTddSlotType slotType) = 0;
191
197 virtual void SlotUlIndication(const SfnSf& sfn, LteNrTddSlotType slotType) = 0;
198
199 // We do a DL and then manually add an UL CTRL if it's an S slot.
200 // virtual void SlotSIndication (const SfnSf &sfn) = 0;
201 // We do UL and then DL to model an F slot.
202 // virtual void SlotFIndication (const SfnSf &sfn) = 0;
203
209
215 virtual void ReceiveRachPreamble(uint32_t raId) = 0;
216
222 virtual void UlHarqFeedback(UlHarqInfo params) = 0;
223
229 virtual void BeamChangeReport(BeamId beamId, uint8_t rnti) = 0;
230
237 virtual uint32_t GetNumRbPerRbg() const = 0;
238
243 virtual std::shared_ptr<DciInfoElementTdma> GetDlCtrlDci() const = 0;
244
249 virtual std::shared_ptr<DciInfoElementTdma> GetUlCtrlDci() const = 0;
250
255 virtual uint8_t GetDlCtrlSymbols() const = 0;
256};
257
268{
269 public:
274 {
275 }
276
282 virtual void ReceivePhyPdu(Ptr<Packet> p) = 0;
283
288 virtual void ReceiveControlMessage(Ptr<NrControlMessage> msg) = 0;
289
294 virtual void SlotIndication(SfnSf s) = 0;
295
300 virtual uint8_t GetNumHarqProcess() const = 0;
301};
302
303} // namespace ns3
304
305#endif /* NR_PHY_SAP_H */
Representation of a beam id.
Definition beam-id.h:28
SAP interface between the ENB PHY and the ENB MAC.
Definition nr-phy-sap.h:157
virtual void ReceiveControlMessage(Ptr< NrControlMessage > msg)=0
Receive SendLteControlMessage (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 std::shared_ptr< DciInfoElementTdma > GetDlCtrlDci() const =0
Retrieve a dci for a DL CTRL allocation.
virtual ~NrGnbPhySapUser()
~NrGnbPhySapUser
Definition nr-phy-sap.h:162
SAP interface between the MAC and the PHY.
Definition nr-phy-sap.h:38
virtual Time GetSlotPeriod() const =0
Retrieve the slot period.
virtual ~NrPhySapProvider()
~NrPhySapProvider
Definition nr-phy-sap.cc:12
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 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:268
virtual ~NrUePhySapUser()
~NrUePhySapUser
Definition nr-phy-sap.h:273
virtual uint8_t GetNumHarqProcess() const =0
Retrieve the number of HARQ processes configured.
virtual void ReceiveControlMessage(Ptr< NrControlMessage > msg)=0
Receive SendLteControlMessage (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:34
LteNrTddSlotType
Available TDD slot types. Ordering is important.
The SlotAllocInfo struct.
A struct that contains info for the UL HARQ.