NrRlcUmRxEntity.h Source File

Simu5G: NrRlcUmRxEntity.h Source File
Simu5G
NrRlcUmRxEntity.h
1//
2// Simu5G
3//
4// Authors: Esteban Egea Lopez (Universidad Politecnica de Cartagena), Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _SIMU5G_NRRLCUMRXENTITY_H_
13#define _SIMU5G_NRRLCUMRXENTITY_H_
14
15#include <set>
16#include <deque>
17
18#include "simu5g/stack/rlc/um/RlcUmRxEntityBase.h"
19#include "simu5g/stack/rlc/um/NrRlcUmDataPdu.h"
20#include "simu5g/stack/rlc/um/RlcUmReceptionBuffer.h"
21
22namespace simu5g {
23
24using namespace omnetpp;
25
26class LteMacBase;
27
36{
37 protected:
38 // The SO reassembly buffer.
39 RlcUmReceptionBuffer *sduBuffer = nullptr;
40 int UM_Window_Size = 2048;
41 cMessage *t_ReassemblyTimer = nullptr;
42 simtime_t t_Reassembly;
43 unsigned long totalRcvdBytesNr_ = 0;
44
45 // Duplicate detection for complete SDUs (which carry no RLC SN); snoMainPacket
46 // values delivered within the last t_Reassembly window, for discarding HARQ-
47 // re-delivered duplicate TBs. See enque().
48 std::set<unsigned int> recentCompleteSduSet_;
49 std::deque<std::pair<simtime_t, unsigned int>> recentCompleteSduQueue_;
50
51 unsigned int totalPduRcvdBytes_ = 0;
52
53 // Emit this bearer's delay and throughput statistics for a received PDU or a
54 // delivered SDU, in the D2D or the infrastructure variant.
55 virtual void emitRxStatistics(bool perPdu, double throughput, simtime_t delay);
56
57 public:
58 ~NrRlcUmRxEntity() override;
59
60 void enque(cPacket *pkt) override;
61 bool isEmpty() const override;
62
63 void handleMessage(cMessage *msg) override;
64
65 protected:
66 void initMode(LteMacBase *mac) override;
67
68 private:
69 virtual void handlePDUInReceivedBuffer(inet::Ptr<NrRlcUmDataPdu> pdu, unsigned int tsn);
70 virtual void toPdcpNr(inet::Packet *rlcSdu);
71};
72
73} //namespace
74
75#endif
MAC Layer.
Definition LteMacBase.h:80
NR (TS 38.322) RLC UM receiving entity.
Definition NrRlcUmRxEntity.h:36
Common shell of the RLC UM receiving entity.
Definition RlcUmRxEntityBase.h:38
Definition AlertReceiver.h:24