A Discrete-Event Network Simulator
API
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 
31 namespace ns3
32 {
33 
36 {
37  double m_mi;
38  uint8_t m_rv;
39  uint16_t m_infoBits;
40  uint16_t m_codeBits;
41 };
42 
43 typedef std::vector<HarqProcessInfoElement_t>
45 
52 class LteHarqPhy : public SimpleRefCount<LteHarqPhy>
53 {
54  public:
55  LteHarqPhy();
56  ~LteHarqPhy();
57 
63  void SubframeIndication(uint32_t frameNo, uint32_t subframeNo);
64 
72  double GetAccumulatedMiDl(uint8_t harqProcId, uint8_t layer);
73 
81  HarqProcessInfoList_t GetHarqProcessInfoDl(uint8_t harqProcId, uint8_t layer);
82 
89  double GetAccumulatedMiUl(uint16_t rnti);
90 
98  HarqProcessInfoList_t GetHarqProcessInfoUl(uint16_t rnti, uint8_t harqProcId);
99 
109  void UpdateDlHarqProcessStatus(uint8_t id,
110  uint8_t layer,
111  double mi,
112  uint16_t infoBytes,
113  uint16_t codeBytes);
114 
120  void ResetDlHarqProcessStatus(uint8_t id);
121 
130  void UpdateUlHarqProcessStatus(uint16_t rnti,
131  double mi,
132  uint16_t infoBytes,
133  uint16_t codeBytes);
134 
141  void ResetUlHarqProcessStatus(uint16_t rnti, uint8_t id);
142 
148  void ClearDlHarqBuffer(uint16_t rnti);
149 
150  private:
151  std::vector<std::vector<HarqProcessInfoList_t>>
153  std::map<uint16_t, std::vector<HarqProcessInfoList_t>>
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