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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Manuel Requena <manuel.requena@cttc.es>
18 */
19
20#ifndef LTE_PDCP_H
21#define LTE_PDCP_H
22
23#include "lte-pdcp-sap.h"
24#include "lte-rlc-sap.h"
25
26#include "ns3/object.h"
27#include "ns3/trace-source-accessor.h"
28#include "ns3/traced-value.h"
29
30namespace ns3
31{
32
33/**
34 * LTE PDCP entity, see 3GPP TS 36.323
35 */
36class LtePdcp : public Object // SimpleRefCount<LtePdcp>
37{
38 /// allow LtePdcpSpecificLteRlcSapUser class friend access
40 /// allow LtePdcpSpecificLtePdcpSapProvider<LtePdcp> class friend access
42
43 public:
44 LtePdcp();
45 ~LtePdcp() override;
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
51 void DoDispose() override;
52
53 /**
54 *
55 *
56 * \param rnti
57 */
58 void SetRnti(uint16_t rnti);
59
60 /**
61 *
62 *
63 * \param lcId
64 */
65 void SetLcId(uint8_t lcId);
66
67 /**
68 *
69 *
70 * \param s the PDCP SAP user to be used by this LTE_PDCP
71 */
73
74 /**
75 *
76 *
77 * \return the PDCP SAP Provider interface offered to the RRC by this LTE_PDCP
78 */
80
81 /**
82 *
83 *
84 * \param s the RLC SAP Provider to be used by this LTE_PDCP
85 */
87
88 /**
89 *
90 *
91 * \return the RLC SAP User interface offered to the RLC by this LTE_PDCP
92 */
94
95 /// maximum PDCP SN
96 static const uint16_t MAX_PDCP_SN = 4096;
97
98 /**
99 * Status variables of the PDCP
100 */
101 struct Status
102 {
103 uint16_t txSn; ///< TX sequence number
104 uint16_t rxSn; ///< RX sequence number
105 };
106
107 /**
108 *
109 * \return the current status of the PDCP
110 */
111 Status GetStatus() const;
112
113 /**
114 * Set the status of the PDCP
115 *
116 * \param s
117 */
118 void SetStatus(Status s);
119
120 /**
121 * TracedCallback for PDU transmission event.
122 *
123 * \param [in] rnti The C-RNTI identifying the UE.
124 * \param [in] lcid The logical channel id corresponding to
125 * the sending RLC instance.
126 * \param [in] size Packet size.
127 */
128 typedef void (*PduTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t size);
129
130 /**
131 * TracedCallback signature for PDU receive event.
132 *
133 * \param [in] rnti The C-RNTI identifying the UE.
134 * \param [in] lcid The logical channel id corresponding to
135 * the sending RLC instance.
136 * \param [in] size Packet size.
137 * \param [in] delay Delay since packet sent, in ns..
138 */
139 typedef void (*PduRxTracedCallback)(const uint16_t rnti,
140 const uint8_t lcid,
141 const uint32_t size,
142 const uint64_t delay);
143
144 protected:
145 /**
146 * Interface provided to upper RRC entity
147 *
148 * \param params the TransmitPdcpSduParameters
149 */
151
152 LtePdcpSapUser* m_pdcpSapUser; ///< PDCP SAP user
153 LtePdcpSapProvider* m_pdcpSapProvider; ///< PDCP SAP provider
154
155 /**
156 * Interface provided to lower RLC entity
157 *
158 * \param p packet
159 */
160 virtual void DoReceivePdu(Ptr<Packet> p);
161
162 LteRlcSapUser* m_rlcSapUser; ///< RLC SAP user
163 LteRlcSapProvider* m_rlcSapProvider; ///< RLC SAP provider
164
165 uint16_t m_rnti; ///< RNTI
166 uint8_t m_lcid; ///< LCID
167
168 /**
169 * Used to inform of a PDU delivery to the RLC SAP provider.
170 * The parameters are RNTI, LCID and bytes delivered
171 */
173 /**
174 * Used to inform of a PDU reception from the RLC SAP user.
175 * The parameters are RNTI, LCID, bytes delivered and delivery delay in nanoseconds.
176 */
178
179 private:
180 /**
181 * State variables. See section 7.1 in TS 36.323
182 */
184 /**
185 * State variables. See section 7.1 in TS 36.323
186 */
188
189 /**
190 * Constants. See section 7.2 in TS 36.323
191 */
192 static const uint16_t m_maxPdcpSn = 4095;
193};
194
195} // namespace ns3
196
197#endif // LTE_PDCP_H
LTE PDCP entity, see 3GPP TS 36.323.
Definition: lte-pdcp.h:37
uint16_t m_rxSequenceNumber
State variables.
Definition: lte-pdcp.h:187
void SetLtePdcpSapUser(LtePdcpSapUser *s)
Definition: lte-pdcp.cc:130
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:139
LteRlcSapUser * GetLteRlcSapUser()
Definition: lte-pdcp.cc:151
static const uint16_t MAX_PDCP_SN
maximum PDCP SN
Definition: lte-pdcp.h:96
LtePdcpSapUser * m_pdcpSapUser
PDCP SAP user.
Definition: lte-pdcp.h:152
LtePdcpSapProvider * GetLtePdcpSapProvider()
Definition: lte-pdcp.cc:137
virtual void DoReceivePdu(Ptr< Packet > p)
Interface provided to lower RLC entity.
Definition: lte-pdcp.cc:209
LteRlcSapUser * m_rlcSapUser
RLC SAP user.
Definition: lte-pdcp.h:162
uint8_t m_lcid
LCID.
Definition: lte-pdcp.h:166
~LtePdcp() override
Definition: lte-pdcp.cc:85
uint16_t m_txSequenceNumber
State variables.
Definition: lte-pdcp.h:183
void SetStatus(Status s)
Set the status of the PDCP.
Definition: lte-pdcp.cc:167
virtual void DoTransmitPdcpSdu(LtePdcpSapProvider::TransmitPdcpSduParameters params)
Interface provided to upper RRC entity.
Definition: lte-pdcp.cc:176
LteRlcSapProvider * m_rlcSapProvider
RLC SAP provider.
Definition: lte-pdcp.h:163
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:177
static const uint16_t m_maxPdcpSn
Constants.
Definition: lte-pdcp.h:192
void SetRnti(uint16_t rnti)
Definition: lte-pdcp.cc:116
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:172
void(* PduTxTracedCallback)(uint16_t rnti, uint8_t lcid, uint32_t size)
TracedCallback for PDU transmission event.
Definition: lte-pdcp.h:128
LtePdcpSapProvider * m_pdcpSapProvider
PDCP SAP provider.
Definition: lte-pdcp.h:153
Status GetStatus() const
Definition: lte-pdcp.cc:158
void SetLteRlcSapProvider(LteRlcSapProvider *s)
Definition: lte-pdcp.cc:144
void DoDispose() override
Destructor implementation.
Definition: lte-pdcp.cc:108
void SetLcId(uint8_t lcId)
Definition: lte-pdcp.cc:123
uint16_t m_rnti
RNTI.
Definition: lte-pdcp.h:165
static TypeId GetTypeId()
Get the type ID.
Definition: lte-pdcp.cc:91
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
Definition: lte-pdcp-sap.h:36
Service Access Point (SAP) offered by the PDCP entity to the RRC entity See 3GPP 36....
Definition: lte-pdcp-sap.h:69
LtePdcpSpecificLtePdcpSapProvider class.
Definition: lte-pdcp-sap.h:94
LtePdcpSpecificLteRlcSapUser class.
Definition: lte-pdcp.cc:36
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:36
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:67
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Status variables of the PDCP.
Definition: lte-pdcp.h:102
uint16_t rxSn
RX sequence number.
Definition: lte-pdcp.h:104
uint16_t txSn
TX sequence number.
Definition: lte-pdcp.h:103
Parameters for LtePdcpSapProvider::TransmitPdcpSdu.
Definition: lte-pdcp-sap.h:44