A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-harq-phy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Marco Miozzo <marco.miozzo@cttc.es>
7 */
8
9#ifndef LTE_HARQ_PHY_MODULE_H
10#define LTE_HARQ_PHY_MODULE_H
11
12#include <ns3/assert.h>
13#include <ns3/log.h>
14#include <ns3/simple-ref-count.h>
15
16#include <map>
17#include <math.h>
18#include <vector>
19
20namespace ns3
21{
22
23/// HarqProcessInfoElement_t structure
25{
26 double m_mi; ///< Mutual information
27 uint8_t m_rv; ///< Redundancy version
28 uint16_t m_infoBits; ///< info bits
29 uint16_t m_codeBits; ///< code bits
30};
31
32typedef std::vector<HarqProcessInfoElement_t>
33 HarqProcessInfoList_t; ///< HarqProcessInfoList_t typedef
34
35/**
36 * \ingroup lte
37 * \brief The LteHarqPhy class implements the HARQ functionalities related to PHY layer
38 *(i.e., decodification buffers for incremental redundancy management)
39 *
40 */
41class LteHarqPhy : public SimpleRefCount<LteHarqPhy>
42{
43 public:
44 LteHarqPhy();
46
47 /**
48 * \brief Subframe Indication function
49 * \param frameNo the frame number
50 * \param subframeNo the subframe number
51 */
52 void SubframeIndication(uint32_t frameNo, uint32_t subframeNo);
53
54 /**
55 * \brief Return the cumulated MI of the HARQ procId in case of retransmissions
56 * for DL (asynchronous)
57 * \param harqProcId the HARQ proc id
58 * \param layer layer no. (for MIMO spatial multiplexing)
59 * \return the MI accumulated
60 */
61 double GetAccumulatedMiDl(uint8_t harqProcId, uint8_t layer);
62
63 /**
64 * \brief Return the info of the HARQ procId in case of retransmissions
65 * for DL (asynchronous)
66 * \param harqProcId the HARQ proc id
67 * \param layer layer no. (for MIMO spatial multiplexing)
68 * \return the vector of the info related to HARQ proc Id
69 */
70 HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer);
71
72 /**
73 * \brief Return the cumulated MI of the HARQ procId in case of retransmissions
74 * for UL (synchronous)
75 * \param rnti the RNTI of the transmitter
76 * \return the MI accumulated
77 */
78 double GetAccumulatedMiUl(uint16_t rnti);
79
80 /**
81 * \brief Return the info of the HARQ procId in case of retransmissions
82 * for UL (asynchronous)
83 * \param rnti the RNTI of the transmitter
84 * \param harqProcId the HARQ proc id
85 * \return the vector of the info related to HARQ proc Id
86 */
87 HarqProcessInfoList_t GetHarqProcessInfoUl(uint16_t rnti, uint8_t harqProcId);
88
89 /**
90 * \brief Update the Info associated to the decodification of an HARQ process
91 * for DL (asynchronous)
92 * \param id the HARQ proc id
93 * \param layer layer no. (for MIMO spatial multiplexing)
94 * \param mi the new MI
95 * \param infoBytes the no. of bytes of info
96 * \param codeBytes the total no. of bytes txed
97 */
98 void UpdateDlHarqProcessStatus(uint8_t id,
99 uint8_t layer,
100 double mi,
101 uint16_t infoBytes,
102 uint16_t codeBytes);
103
104 /**
105 * \brief Reset the info associated to the decodification of an HARQ process
106 * for DL (asynchronous)
107 * \param id the HARQ proc id
108 */
109 void ResetDlHarqProcessStatus(uint8_t id);
110
111 /**
112 * \brief Update the MI value associated to the decodification of an HARQ process
113 * for DL (asynchronous)
114 * \param rnti the RNTI of the transmitter
115 * \param mi the new MI
116 * \param infoBytes the no. of bytes of info
117 * \param codeBytes the total no. of bytes txed
118 */
119 void UpdateUlHarqProcessStatus(uint16_t rnti,
120 double mi,
121 uint16_t infoBytes,
122 uint16_t codeBytes);
123
124 /**
125 * \brief Reset the info associated to the decodification of an HARQ process
126 * for DL (asynchronous)
127 * \param rnti the RNTI of the transmitter
128 * \param id the HARQ proc id
129 */
130 void ResetUlHarqProcessStatus(uint16_t rnti, uint8_t id);
131
132 /**
133 * \brief Clear the downlink HARQ buffer
134 *
135 * \param rnti the RNTI of the UE
136 */
137 void ClearDlHarqBuffer(uint16_t rnti);
138
139 private:
140 std::vector<std::vector<HarqProcessInfoList_t>>
141 m_miDlHarqProcessesInfoMap; ///< MI DL HARQ processes info map
142 std::map<uint16_t, std::vector<HarqProcessInfoList_t>>
143 m_miUlHarqProcessesInfoMap; ///< MI UL HARQ processes info map
144};
145
146} // namespace ns3
147
148#endif /* LTE_HARQ_PHY_MODULE_H */
The LteHarqPhy class implements the HARQ functionalities related to PHY layer (i.e....
void ClearDlHarqBuffer(uint16_t rnti)
Clear the downlink HARQ buffer.
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Subframe Indication function.
void UpdateDlHarqProcessStatus(uint8_t id, uint8_t layer, double mi, uint16_t infoBytes, uint16_t codeBytes)
Update the Info associated to the decodification of an HARQ process for DL (asynchronous)
void UpdateUlHarqProcessStatus(uint16_t rnti, double mi, uint16_t infoBytes, uint16_t codeBytes)
Update the MI value associated to the decodification of an HARQ process for DL (asynchronous)
double GetAccumulatedMiUl(uint16_t rnti)
Return the cumulated MI of the HARQ procId in case of retransmissions for UL (synchronous)
HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer)
Return the info of the HARQ procId in case of retransmissions for DL (asynchronous)
HarqProcessInfoList_t GetHarqProcessInfoUl(uint16_t rnti, uint8_t harqProcId)
Return the info of the HARQ procId in case of retransmissions for UL (asynchronous)
std::vector< std::vector< HarqProcessInfoList_t > > m_miDlHarqProcessesInfoMap
MI DL HARQ processes info map.
void ResetDlHarqProcessStatus(uint8_t id)
Reset the info associated to the decodification of an HARQ process for DL (asynchronous)
std::map< uint16_t, std::vector< HarqProcessInfoList_t > > m_miUlHarqProcessesInfoMap
MI UL HARQ processes info map.
void ResetUlHarqProcessStatus(uint16_t rnti, uint8_t id)
Reset the info associated to the decodification of an HARQ process for DL (asynchronous)
double GetAccumulatedMiDl(uint8_t harqProcId, uint8_t layer)
Return the cumulated MI of the HARQ procId in case of retransmissions for DL (asynchronous)
A template-based reference counting class.
log2() macro definition; to deal with Bug 1467 .
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
HarqProcessInfoList_t typedef.
HarqProcessInfoElement_t structure.
uint16_t m_codeBits
code bits
uint16_t m_infoBits
info bits
uint8_t m_rv
Redundancy version.
double m_mi
Mutual information.