A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-pdcp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#ifndef LTE_PDCP_H
10#define LTE_PDCP_H
11
12#include "lte-pdcp-sap.h"
13#include "lte-rlc-sap.h"
14
15#include "ns3/object.h"
16#include "ns3/trace-source-accessor.h"
17#include "ns3/traced-value.h"
18
19namespace ns3
20{
21
22/**
23 * LTE PDCP entity, see 3GPP TS 36.323
24 */
25class LtePdcp : public Object // SimpleRefCount<LtePdcp>
26{
27 /// allow LtePdcpSpecificLteRlcSapUser class friend access
29 /// allow LtePdcpSpecificLtePdcpSapProvider<LtePdcp> class friend access
31
32 public:
33 LtePdcp();
34 ~LtePdcp() override;
35 /**
36 * \brief Get the type ID.
37 * \return the object TypeId
38 */
39 static TypeId GetTypeId();
40 void DoDispose() override;
41
42 /**
43 *
44 *
45 * \param rnti
46 */
47 void SetRnti(uint16_t rnti);
48
49 /**
50 *
51 *
52 * \param lcId
53 */
54 void SetLcId(uint8_t lcId);
55
56 /**
57 *
58 *
59 * \param s the PDCP SAP user to be used by this LTE_PDCP
60 */
62
63 /**
64 *
65 *
66 * \return the PDCP SAP Provider interface offered to the RRC by this LTE_PDCP
67 */
69
70 /**
71 *
72 *
73 * \param s the RLC SAP Provider to be used by this LTE_PDCP
74 */
76
77 /**
78 *
79 *
80 * \return the RLC SAP User interface offered to the RLC by this LTE_PDCP
81 */
83
84 /// maximum PDCP SN
85 static const uint16_t MAX_PDCP_SN = 4096;
86
87 /**
88 * Status variables of the PDCP
89 */
90 struct Status
91 {
92 uint16_t txSn; ///< TX sequence number
93 uint16_t rxSn; ///< RX sequence number
94 };
95
96 /**
97 *
98 * \return the current status of the PDCP
99 */
100 Status GetStatus() const;
101
102 /**
103 * Set the status of the PDCP
104 *
105 * \param s
106 */
107 void SetStatus(Status s);
108
109 /**
110 * TracedCallback for PDU transmission event.
111 *
112 * \param [in] rnti The C-RNTI identifying the UE.
113 * \param [in] lcid The logical channel id corresponding to
114 * the sending RLC instance.
115 * \param [in] size Packet size.
116 */
117 typedef void (*PduTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t size);
118
119 /**
120 * TracedCallback signature for PDU receive event.
121 *
122 * \param [in] rnti The C-RNTI identifying the UE.
123 * \param [in] lcid The logical channel id corresponding to
124 * the sending RLC instance.
125 * \param [in] size Packet size.
126 * \param [in] delay Delay since packet sent, in ns..
127 */
128 typedef void (*PduRxTracedCallback)(const uint16_t rnti,
129 const uint8_t lcid,
130 const uint32_t size,
131 const uint64_t delay);
132
133 protected:
134 /**
135 * Interface provided to upper RRC entity
136 *
137 * \param params the TransmitPdcpSduParameters
138 */
140
141 LtePdcpSapUser* m_pdcpSapUser; ///< PDCP SAP user
142 LtePdcpSapProvider* m_pdcpSapProvider; ///< PDCP SAP provider
143
144 /**
145 * Interface provided to lower RLC entity
146 *
147 * \param p packet
148 */
149 virtual void DoReceivePdu(Ptr<Packet> p);
150
151 LteRlcSapUser* m_rlcSapUser; ///< RLC SAP user
152 LteRlcSapProvider* m_rlcSapProvider; ///< RLC SAP provider
153
154 uint16_t m_rnti; ///< RNTI
155 uint8_t m_lcid; ///< LCID
156
157 /**
158 * Used to inform of a PDU delivery to the RLC SAP provider.
159 * The parameters are RNTI, LCID and bytes delivered
160 */
162 /**
163 * Used to inform of a PDU reception from the RLC SAP user.
164 * The parameters are RNTI, LCID, bytes delivered and delivery delay in nanoseconds.
165 */
167
168 private:
169 /**
170 * State variables. See section 7.1 in TS 36.323
171 */
173 /**
174 * State variables. See section 7.1 in TS 36.323
175 */
177
178 /**
179 * Constants. See section 7.2 in TS 36.323
180 */
181 static const uint16_t m_maxPdcpSn = 4095;
182};
183
184} // namespace ns3
185
186#endif // LTE_PDCP_H
LTE PDCP entity, see 3GPP TS 36.323.
Definition lte-pdcp.h:26
uint16_t m_rxSequenceNumber
State variables.
Definition lte-pdcp.h:176
void SetLtePdcpSapUser(LtePdcpSapUser *s)
Definition lte-pdcp.cc:119
void(* PduRxTracedCallback)(const uint16_t rnti, const uint8_t lcid, const uint32_t size, const uint64_t delay)
TracedCallback signature for PDU receive event.
Definition lte-pdcp.h:128
LteRlcSapUser * GetLteRlcSapUser()
Definition lte-pdcp.cc:140
static const uint16_t MAX_PDCP_SN
maximum PDCP SN
Definition lte-pdcp.h:85
LtePdcpSapUser * m_pdcpSapUser
PDCP SAP user.
Definition lte-pdcp.h:141
LtePdcpSapProvider * GetLtePdcpSapProvider()
Definition lte-pdcp.cc:126
virtual void DoReceivePdu(Ptr< Packet > p)
Interface provided to lower RLC entity.
Definition lte-pdcp.cc:198
LteRlcSapUser * m_rlcSapUser
RLC SAP user.
Definition lte-pdcp.h:151
uint8_t m_lcid
LCID.
Definition lte-pdcp.h:155
~LtePdcp() override
Definition lte-pdcp.cc:74
uint16_t m_txSequenceNumber
State variables.
Definition lte-pdcp.h:172
void SetStatus(Status s)
Set the status of the PDCP.
Definition lte-pdcp.cc:156
virtual void DoTransmitPdcpSdu(LtePdcpSapProvider::TransmitPdcpSduParameters params)
Interface provided to upper RRC entity.
Definition lte-pdcp.cc:165
LteRlcSapProvider * m_rlcSapProvider
RLC SAP provider.
Definition lte-pdcp.h:152
TracedCallback< uint16_t, uint8_t, uint32_t, uint64_t > m_rxPdu
Used to inform of a PDU reception from the RLC SAP user.
Definition lte-pdcp.h:166
static const uint16_t m_maxPdcpSn
Constants.
Definition lte-pdcp.h:181
void SetRnti(uint16_t rnti)
Definition lte-pdcp.cc:105
TracedCallback< uint16_t, uint8_t, uint32_t > m_txPdu
Used to inform of a PDU delivery to the RLC SAP provider.
Definition lte-pdcp.h:161
void(* PduTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t size)
TracedCallback for PDU transmission event.
Definition lte-pdcp.h:117
LtePdcpSapProvider * m_pdcpSapProvider
PDCP SAP provider.
Definition lte-pdcp.h:142
Status GetStatus() const
Definition lte-pdcp.cc:147
void SetLteRlcSapProvider(LteRlcSapProvider *s)
Definition lte-pdcp.cc:133
void DoDispose() override
Destructor implementation.
Definition lte-pdcp.cc:97
void SetLcId(uint8_t lcId)
Definition lte-pdcp.cc:112
uint16_t m_rnti
RNTI.
Definition lte-pdcp.h:154
static TypeId GetTypeId()
Get the type ID.
Definition lte-pdcp.cc:80
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
LtePdcpSpecificLtePdcpSapProvider class.
LtePdcpSpecificLteRlcSapUser class.
Definition lte-pdcp.cc:25
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36....
Definition lte-rlc-sap.h:25
Service Access Point (SAP) offered by the UM-RLC and AM-RLC entities to the PDCP entity See 3GPP 36....
Definition lte-rlc-sap.h:56
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Status variables of the PDCP.
Definition lte-pdcp.h:91
uint16_t rxSn
RX sequence number.
Definition lte-pdcp.h:93
uint16_t txSn
TX sequence number.
Definition lte-pdcp.h:92
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.