PacketFlowObserverUe.h Source File

Simu5G: PacketFlowObserverUe.h Source File
Simu5G
PacketFlowObserverUe.h
1//
2// Simu5G
3//
4// Copyright (C) 2019-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_PacketFlowObserverUE_H_
14#define _LTE_PacketFlowObserverUE_H_
15
16#include "simu5g/common/LteCommon.h"
17#include "PacketFlowObserverBase.h"
18
19namespace simu5g {
20
21using namespace omnetpp;
22
23class LteRlcUmDataPdu;
24
29{
30 /*
31 * The node can have different active connections (DRB ID) at the same time, hence we need to
32 * maintain the status for each of them.
33 */
34 struct StatusDescriptor {
35 MacNodeId nodeId_; // destination node of this DRB ID
36 std::map<unsigned int, PdcpStatus> pdcpStatus_; // a PDCP PDU can be fragmented into many RLC that could be sent and acknowledged at different times (this prevents early removal on acknowledgment)
37 std::map<unsigned int, SequenceNumberSet> rlcPdusPerSdu_; // for each RLC SDU, stores the RLC PDUs where the former was fragmented
38 std::map<unsigned int, SequenceNumberSet> rlcSdusPerPdu_; // for each RLC PDU, stores the included RLC SDUs
39 std::map<unsigned int, SequenceNumberSet> macSdusPerPdu_; // for each MAC PDU, stores the included MAC SDUs (should be a 1:1 association)
40 std::vector<unsigned int> macPduPerProcess_; // for each HARQ process, stores the included MAC PDU
41 };
42
43 typedef std::map<DrbKey, StatusDescriptor> ConnectionMap;
44 ConnectionMap connectionMap_; // bearer (peer node + DRB ID) to the corresponding StatusDescriptor
45
46 Delay pdcpDelay;
47
48 protected:
49 void initialize(int stage) override;
50
51 virtual void initPdcpStatus(StatusDescriptor *desc, unsigned int pdcp, unsigned int sduHeaderSize, simtime_t& arrivalTime);
52 virtual void ensureMacPduMapping(MacNodeId peerId, const LteMacPdu *macPdu);
53 // return true if a structure for this DRB ID is present
54 bool hasDrbId(DrbKey drbKey) override;
55 // initialize a new structure for this DRB ID
56 void initDrbId(DrbKey drbKey, MacNodeId nodeId) override;
57 // reset the structure for this DRB ID
58 void clearDrbId(DrbKey drbKey) override;
59 // reset structures for all connections
60 void clearAllDrbIds() override;
61
62 public:
63 void insertPdcpSdu(inet::Packet *pdcpPkt) override;
64 void receivedPdcpSdu(inet::Packet *pdcpPkt) override { /*TODO*/ }
65 void insertRlcPdu(DrbKey drbKey, const LteRlcUmDataPdu *rlcPdu, RlcBurstStatus status) override;
66 void macPduArrived(MacNodeId peerId, const LteMacPdu *macPdu) override;
67 void discardMacPdu(MacNodeId peerId, const LteMacPdu *macPdu) override;
68 void discardRlcPdu(DrbKey drbKey, unsigned int rlcSno, bool fromMac = false) override;
69
70 virtual DiscardedPkts getDiscardedPkt();
71 virtual double getDelayStats();
72 virtual void resetDelayCounter();
73 virtual void clearStats();
74};
75
76} //namespace
77
78#endif
Definition LteTypes.h:191
Definition PacketFlowObserverBase.h:53
Definition PacketFlowObserverUe.h:29
void discardMacPdu(MacNodeId peerId, const LteMacPdu *macPdu) override
void receivedPdcpSdu(inet::Packet *pdcpPkt) override
Definition PacketFlowObserverUe.h:64
void discardRlcPdu(DrbKey drbKey, unsigned int rlcSno, bool fromMac=false) override
void insertRlcPdu(DrbKey drbKey, const LteRlcUmDataPdu *rlcPdu, RlcBurstStatus status) override
void insertPdcpSdu(inet::Packet *pdcpPkt) override
void macPduArrived(MacNodeId peerId, const LteMacPdu *macPdu) override
Definition AlertReceiver.h:24