LteHarqProcessRx.h Source File

Simu5G: LteHarqProcessRx.h Source File
Simu5G
LteHarqProcessRx.h
1//
2// Simu5G
3//
4// Copyright (C) 2012-2021 Giovanni Nardini, Giovanni Stea, Antonio Virdis et al. (University of Pisa)
5// Copyright (C) 2022-2026 Giovanni Nardini, Giovanni Stea et al. (University of Pisa)
6//
7// This file is part of a software released under the license included in file
8// "license.pdf". Please read LICENSE and README files before using it.
9// The above files and the present reference are part of the software itself,
10// and cannot be removed from it.
11//
12
13#ifndef _LTE_LTEHARQPROCESSRX_H_
14#define _LTE_LTEHARQPROCESSRX_H_
15
16#include "simu5g/common/LteCommon.h"
17
18namespace simu5g {
19
20using namespace omnetpp;
21
22typedef std::pair<unsigned char, RxHarqPduStatus> RxUnitStatus;
23typedef std::vector<std::vector<RxUnitStatus>> RxBufferStatus;
24
25class LteMacBase;
26class LteMacPdu;
27class LteHarqFeedback;
28class Binder;
29
39// TODO: check the number of UL/DL processes, UE, ENB
40// TODO: statistics for drops (add member?)
42{
43 protected:
45 std::vector<inet::Packet *> pdu_;
46
48 std::vector<RxHarqPduStatus> status_;
49
51 std::vector<inet::simtime_t> rxTime_;
52
53 // reception status of buffered PDUs
54 std::vector<bool> result_;
55
57 unsigned char acid_;
58
60 opp_component_ptr<LteMacBase> macOwner_;
61
63 opp_component_ptr<Binder> binder_;
64
66 unsigned char transmissions_ = 0;
67
68 unsigned char maxHarqRtx_;
69
71 unsigned short harqFbEvaluationTimer_;
72
73 public:
74
81 LteHarqProcessRx(unsigned char acid, LteMacBase *owner, Binder *binder);
82
88 virtual void insertPdu(Codeword cw, inet::Packet *);
89
98 virtual bool isEvaluated(Codeword cw);
99
105 virtual inet::Packet *createFeedback(Codeword cw);
106
112 virtual bool isCorrect(Codeword cw);
113
119 virtual int64_t getByteLength(Codeword cw);
120
124 virtual RxHarqPduStatus getUnitStatus(Codeword cw)
125 {
126 return status_.at(cw);
127 }
128
132
133 virtual std::vector<RxUnitStatus> getProcessStatus();
139 virtual inet::Packet *extractPdu(Codeword cw);
140
144 virtual void purgeCorruptedPdu(Codeword cw);
145
149 virtual void resetCodeword(Codeword cw);
150
154 virtual unsigned int getNumHarqUnits()
155 {
156 return MAX_CODEWORDS;
157 }
158
164 bool isEmpty();
165
171 virtual CwList emptyUnitsIds();
172
180
181 virtual bool isHarqProcessActive();
182
183 virtual ~LteHarqProcessRx();
184};
185
186} //namespace
187
188#endif
189
Definition Binder.h:48
virtual CwList emptyUnitsIds()
virtual void insertPdu(Codeword cw, inet::Packet *)
virtual bool isCorrect(Codeword cw)
LteHarqProcessRx(unsigned char acid, LteMacBase *owner, Binder *binder)
virtual bool isEvaluated(Codeword cw)
unsigned char acid_
H-ARQ process identifier.
Definition LteHarqProcessRx.h:57
unsigned short harqFbEvaluationTimer_
Number of slots for sending back HARQ Feedback.
Definition LteHarqProcessRx.h:71
virtual void purgeCorruptedPdu(Codeword cw)
virtual inet::Packet * extractPdu(Codeword cw)
virtual unsigned int getNumHarqUnits()
Definition LteHarqProcessRx.h:154
opp_component_ptr< Binder > binder_
reference to the binder
Definition LteHarqProcessRx.h:63
std::vector< inet::simtime_t > rxTime_
reception time timestamp
Definition LteHarqProcessRx.h:51
virtual int64_t getByteLength(Codeword cw)
virtual bool isHarqProcessActive()
virtual std::vector< RxUnitStatus > getProcessStatus()
virtual inet::Packet * createFeedback(Codeword cw)
virtual void resetCodeword(Codeword cw)
std::vector< inet::Packet * > pdu_
contained PDUs
Definition LteHarqProcessRx.h:45
unsigned char transmissions_
Number of (re)transmissions for current PDU (N.B.: values are 1,2,3,4)
Definition LteHarqProcessRx.h:66
virtual RxHarqPduStatus getUnitStatus(Codeword cw)
Definition LteHarqProcessRx.h:124
opp_component_ptr< LteMacBase > macOwner_
MAC module to manage errors (endSimulation)
Definition LteHarqProcessRx.h:60
std::vector< RxHarqPduStatus > status_
current status for each codeword
Definition LteHarqProcessRx.h:48
MAC Layer.
Definition LteMacBase.h:80
Definition AlertReceiver.h:24
unsigned short Codeword
Codeword.
Definition LteCommon.h:202