RlcAmTxEntityBase.h Source File

Simu5G: RlcAmTxEntityBase.h Source File
Simu5G
RlcAmTxEntityBase.h
1//
2// Simu5G
3//
4// Authors: 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_RLCAMTXENTITYBASE_H_
13#define _SIMU5G_RLCAMTXENTITYBASE_H_
14
15#include <inet/common/packet/Packet.h>
16
17#include "simu5g/common/LteControlInfo.h"
18#include "simu5g/stack/rlc/RlcTxEntityBase.h"
19
20namespace simu5g {
21
22using namespace omnetpp;
23
41{
42 protected:
43
44 // Signals emitted by the concrete subclasses (both LTE and NR). Their
45 // static definitions live in RlcAmTxEntityBase.cc (a single translation
46 // unit) so registerSignal() ordering -- and therefore result recording --
47 // stays stable across the split.
48 static simsignal_t wastedGrantedBytesSignal_;
49 static simsignal_t enqueuedSduSizeSignal_;
50 static simsignal_t enqueuedSduRateSignal_;
51 static simsignal_t requestedPduSizeSignal_;
52 static simsignal_t txWindowOccupationSignal_;
53 static simsignal_t txWindowFullSignal_;
54 static simsignal_t retransmissionPduSignal_;
55 static simsignal_t receivedPacketFromUpperLayerSignal_;
56 static simsignal_t sentPacketToLowerLayerSignal_;
57
58 // Copy of the flow control info of the SDU/fragment currently being
59 // processed; stamped onto outgoing PDUs and new-data notifications by the
60 // concrete subclasses.
61 FlowControlInfo *lteInfo_ = nullptr;
62
63 // Radio-link-failure state (TS 36.322 5.2.1 / TS 38.322 5.3.2): set once a unit
64 // of this entity's ARQ (an SDU for NR, an AMD PDU for LTE) reaches
65 // maxRtxThreshold_ retransmissions. Initialized by the concrete subclasses from
66 // their maxRtxThreshold parameter.
67 bool radioLinkFailureDetected_ = false;
68 unsigned int maxRtxThreshold_ = 0;
69
77
78 ~RlcAmTxEntityBase() override { delete lteInfo_; }
79
80 public:
81
82 // Enqueue an upper-layer SDU into the transmission buffer
83 virtual void enque(inet::Packet *sdu) = 0;
84
85 // Send buffered PDUs until the requested grant size is reached
86 virtual void sendPdus(int size) = 0;
87
88 // Buffer a control (STATUS) PDU for transmission
89 virtual void bufferControlPdu(cPacket *pkt) = 0;
90
91 // Receive a control (STATUS) message from the AM receiver
92 virtual void handleControlPacket(cPacket *pkt) = 0;
93
94 // Pending data volume (bytes not yet sent to the MAC), used for buffer
95 // status reporting
96 virtual unsigned int getPendingDataVolume() const = 0;
97
98 // The split threshold weighs the same pending data volume the buffer status reports.
99 int64_t getBufferOccupancy() const override { return (int64_t)getPendingDataVolume(); }
100};
101
102} //namespace
103
104#endif
Common shell of the RLC AM transmission entity.
Definition RlcAmTxEntityBase.h:41
virtual void declareRadioLinkFailure()
Abstract base class for all RLC TX entities (UM, TM, AM).
Definition RlcTxEntityBase.h:29
Definition AlertReceiver.h:24