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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Marco Miozzo <marco.miozzo@cttc.es>
18 */
19
20#ifndef LTE_HARQ_PHY_MODULE_H
21#define LTE_HARQ_PHY_MODULE_H
22
23#include <ns3/assert.h>
24#include <ns3/log.h>
25#include <ns3/simple-ref-count.h>
26
27#include <map>
28#include <math.h>
29#include <vector>
30
31namespace ns3
32{
33
34/// HarqProcessInfoElement_t structure
36{
37 double m_mi; ///< Mutual information
38 uint8_t m_rv; ///< Redundancy version
39 uint16_t m_infoBits; ///< info bits
40 uint16_t m_codeBits; ///< code bits
41};
42
43typedef std::vector<HarqProcessInfoElement_t>
44 HarqProcessInfoList_t; ///< HarqProcessInfoList_t typedef
45
46/**
47 * \ingroup lte
48 * \brief The LteHarqPhy class implements the HARQ functionalities related to PHY layer
49 *(i.e., decodification buffers for incremental redundancy management)
50 *
51 */
52class LteHarqPhy : public SimpleRefCount<LteHarqPhy>
53{
54 public:
55 LteHarqPhy();
57
58 /**
59 * \brief Subframe Indication function
60 * \param frameNo the frame number
61 * \param subframeNo the subframe number
62 */
63 void SubframeIndication(uint32_t frameNo, uint32_t subframeNo);
64
65 /**
66 * \brief Return the cumulated MI of the HARQ procId in case of retransmissions
67 * for DL (asynchronous)
68 * \param harqProcId the HARQ proc id
69 * \param layer layer no. (for MIMO spatial multiplexing)
70 * \return the MI accumulated
71 */
72 double GetAccumulatedMiDl(uint8_t harqProcId, uint8_t layer);
73
74 /**
75 * \brief Return the info of the HARQ procId in case of retransmissions
76 * for DL (asynchronous)
77 * \param harqProcId the HARQ proc id
78 * \param layer layer no. (for MIMO spatial multiplexing)
79 * \return the vector of the info related to HARQ proc Id
80 */
81 HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer);
82
83 /**
84 * \brief Return the cumulated MI of the HARQ procId in case of retransmissions
85 * for UL (synchronous)
86 * \param rnti the RNTI of the transmitter
87 * \return the MI accumulated
88 */
89 double GetAccumulatedMiUl(uint16_t rnti);
90
91 /**
92 * \brief Return the info of the HARQ procId in case of retransmissions
93 * for UL (asynchronous)
94 * \param rnti the RNTI of the transmitter
95 * \param harqProcId the HARQ proc id
96 * \return the vector of the info related to HARQ proc Id
97 */
98 HarqProcessInfoList_t GetHarqProcessInfoUl(uint16_t rnti, uint8_t harqProcId);
99
100 /**
101 * \brief Update the Info associated to the decodification of an HARQ process
102 * for DL (asynchronous)
103 * \param id the HARQ proc id
104 * \param layer layer no. (for MIMO spatial multiplexing)
105 * \param mi the new MI
106 * \param infoBytes the no. of bytes of info
107 * \param codeBytes the total no. of bytes txed
108 */
109 void UpdateDlHarqProcessStatus(uint8_t id,
110 uint8_t layer,
111 double mi,
112 uint16_t infoBytes,
113 uint16_t codeBytes);
114
115 /**
116 * \brief Reset the info associated to the decodification of an HARQ process
117 * for DL (asynchronous)
118 * \param id the HARQ proc id
119 */
120 void ResetDlHarqProcessStatus(uint8_t id);
121
122 /**
123 * \brief Update the MI value associated to the decodification of an HARQ process
124 * for DL (asynchronous)
125 * \param rnti the RNTI of the transmitter
126 * \param mi the new MI
127 * \param infoBytes the no. of bytes of info
128 * \param codeBytes the total no. of bytes txed
129 */
130 void UpdateUlHarqProcessStatus(uint16_t rnti,
131 double mi,
132 uint16_t infoBytes,
133 uint16_t codeBytes);
134
135 /**
136 * \brief Reset the info associated to the decodification of an HARQ process
137 * for DL (asynchronous)
138 * \param rnti the RNTI of the transmitter
139 * \param id the HARQ proc id
140 */
141 void ResetUlHarqProcessStatus(uint16_t rnti, uint8_t id);
142
143 /**
144 * \brief Clear the downlink HARQ buffer
145 *
146 * \param rnti the RNTI of the UE
147 */
148 void ClearDlHarqBuffer(uint16_t rnti);
149
150 private:
151 std::vector<std::vector<HarqProcessInfoList_t>>
152 m_miDlHarqProcessesInfoMap; ///< MI DL HARQ processes info map
153 std::map<uint16_t, std::vector<HarqProcessInfoList_t>>
154 m_miUlHarqProcessesInfoMap; ///< MI UL HARQ processes info map
155};
156
157} // namespace ns3
158
159#endif /* LTE_HARQ_PHY_MODULE_H */
The LteHarqPhy class implements the HARQ functionalities related to PHY layer (i.e....
Definition: lte-harq-phy.h:53
void ClearDlHarqBuffer(uint16_t rnti)
Clear the downlink HARQ buffer.
void SubframeIndication(uint32_t frameNo, uint32_t subframeNo)
Subframe Indication function.
Definition: lte-harq-phy.cc:51
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)
Definition: lte-harq-phy.cc:85
HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer)
Return the info of the HARQ procId in case of retransmissions for DL (asynchronous)
Definition: lte-harq-phy.cc:78
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.
Definition: lte-harq-phy.h:152
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.
Definition: lte-harq-phy.h:154
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)
Definition: lte-harq-phy.cc:65
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.
Definition: lte-harq-phy.h:44
HarqProcessInfoElement_t structure.
Definition: lte-harq-phy.h:36
uint16_t m_codeBits
code bits
Definition: lte-harq-phy.h:40
uint16_t m_infoBits
info bits
Definition: lte-harq-phy.h:39
uint8_t m_rv
Redundancy version.
Definition: lte-harq-phy.h:38
double m_mi
Mutual information.
Definition: lte-harq-phy.h:37