RlcUmTxEntityBase.h Source File

Simu5G: RlcUmTxEntityBase.h Source File
Simu5G
RlcUmTxEntityBase.h
1//
2// Simu5G
3//
4// Authors: Giovanni Nardini, Giovanni Stea, Antonio Virdis (University of Pisa), 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_RLCUMTXENTITYBASE_H_
13#define _SIMU5G_RLCUMTXENTITYBASE_H_
14
15#include "simu5g/common/LteDefs.h"
16#include "simu5g/stack/rlc/RlcTxEntityBase.h"
17#include "simu5g/stack/rlc/LteRlcDefs.h"
18
19namespace simu5g {
20
21
22using namespace omnetpp;
23
40{
41 protected:
42
43 // Signals emitted by the concrete subclasses. Their static definitions live
44 // in RlcUmTxEntityBase.cc (a single translation unit) so registerSignal()
45 // ordering -- and therefore result recording -- stays stable across the split.
46 static simsignal_t rlcPduCreatedSignal_; // LTE: burst START/STOP tracking
47 static simsignal_t wastedGrantedBytesSignal_; // NR
48 static simsignal_t requestedPduSizeSignal_; // NR
49 static simsignal_t sentPduSizeSignal_; // NR
50 static simsignal_t receivedPacketFromUpperLayerSignal_; // NR
51 static simsignal_t sentPacketToLowerLayerSignal_; // NR
52
53 // Node id of the owner module
54 MacNodeId ownerNodeId_;
55
56 void initialize(int stage) override;
57 void handleMessage(cMessage *msg) override;
58
59 // Common helpers shared by the concrete subclasses.
60 virtual void dropBufferOverflow(inet::cPacket *pkt);
61 virtual void sendPduToMac(inet::Packet *pkt);
62
63 // --- mode-specific hooks, implemented by the concrete subclasses ---
64
65 // Mode-specific part of initialize() (buffers, timers, mode parameters).
66 virtual void initMode() {}
67
68 // Buffer an incoming SDU; returns false on overflow (LTE bounded queue).
69 virtual bool storeSdu(inet::Packet *pkt) = 0;
70
71 /*
72 * Hook invoked for an SDU arriving from the upper layer, before it is
73 * enqueued into the TX buffer. Returns true if the SDU was consumed by
74 * the hook, in which case the caller must neither enqueue it nor send a
75 * new-data indication to the MAC layer. The base never consumes an SDU;
76 * the D2D profile parks it while a mode switch drains the old-mode entity.
77 */
78 virtual bool interceptSdu(inet::Packet *pkt) { return false; }
79
80 /*
81 * Hook invoked after a PDU has been built, at the point where a TX buffer
82 * that has just drained must be signaled. Inert in the base; the D2D
83 * profile notifies the mode controller so the peer can resume its
84 * holding-buffer packets for the newly selected mode.
85 */
86 virtual void onTxBufferEmptied() {}
87
88 /*
89 * Whether the TX buffer holds no further SDU data. The buffer itself is
90 * mode-specific (LTE: SDU queue; NR: SO transmission buffer), so the
91 * predicate behind onTxBufferEmptied() is deferred to the subclass.
92 */
93 virtual bool isTxBufferEmpty() const = 0;
94
95 public:
96
102 virtual void handleSdu(inet::Packet *pkt);
103
109 void bufferSduAndNotifyMac(inet::Packet *pkt);
110
115 virtual void handleMacSduRequest(inet::Packet *pkt);
116
117 // rlcPduMake() creates a PDU of the specified size and sends it to MAC.
118 virtual void rlcPduMake(int pduSize) = 0;
119
120 // clear the TX buffer
121 virtual void clearQueue() = 0;
122};
123
124} //namespace
125
126#endif
Abstract base class for all RLC TX entities (UM, TM, AM).
Definition RlcTxEntityBase.h:29
Common shell of the RLC UM transmission entity.
Definition RlcUmTxEntityBase.h:40
virtual void handleSdu(inet::Packet *pkt)
void bufferSduAndNotifyMac(inet::Packet *pkt)
virtual void handleMacSduRequest(inet::Packet *pkt)
Definition AlertReceiver.h:24