OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2011-2012 Centre Tecnologic de Telecomunicacions de Catalunya (
CTTC) |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Manuel Requena <manuel.requena@cttc.es> |
| 19 * Modified by: NIST |
| 20 */ |
| 21 |
| 22 #ifndef NIST_LTE_PDCP_H |
| 23 #define NIST_LTE_PDCP_H |
| 24 |
| 25 #include "ns3/traced-value.h" |
| 26 #include "ns3/trace-source-accessor.h" |
| 27 |
| 28 #include "ns3/object.h" |
| 29 |
| 30 #include "ns3/nist-lte-pdcp-sap.h" |
| 31 #include "ns3/nist-lte-rlc-sap.h" |
| 32 |
| 33 namespace ns3 { |
| 34 |
| 35 /** |
| 36 * LTE PDCP entity, see 3GPP TS 36.323 |
| 37 */ |
| 38 class NistLtePdcp : public Object // SimpleRefCount<NistLtePdcp> |
| 39 { |
| 40 friend class NistLtePdcpSpecificLteRlcSapUser; |
| 41 friend class NistLtePdcpSpecificLtePdcpSapProvider<NistLtePdcp>; |
| 42 public: |
| 43 NistLtePdcp (); |
| 44 virtual ~NistLtePdcp (); |
| 45 static TypeId GetTypeId (void); |
| 46 virtual void DoDispose (); |
| 47 |
| 48 /** |
| 49 * |
| 50 * |
| 51 * \param rnti |
| 52 */ |
| 53 void SetRnti (uint16_t rnti); |
| 54 |
| 55 /** |
| 56 * |
| 57 * |
| 58 * \param lcId |
| 59 */ |
| 60 void SetLcId (uint8_t lcId); |
| 61 |
| 62 /** |
| 63 * Sets the source L2 Id for sidelink identification of the PDCP entity |
| 64 * \param src |
| 65 */ |
| 66 void SetSourceL2Id (uint32_t src); |
| 67 ··· |
| 68 /** |
| 69 * Sets the source L2 Id for sidelink identification of the PDCP entity |
| 70 * \param src |
| 71 */ |
| 72 void SetDestinationL2Id (uint32_t dst); |
| 73 · |
| 74 /** |
| 75 * |
| 76 * |
| 77 * \param s the PDCP SAP user to be used by this LTE_PDCP |
| 78 */ |
| 79 void SetNistLtePdcpSapUser (NistLtePdcpSapUser * s); |
| 80 |
| 81 /** |
| 82 * |
| 83 * |
| 84 * \return the PDCP SAP Provider interface offered to the RRC by this LTE_PDCP |
| 85 */ |
| 86 NistLtePdcpSapProvider* GetNistLtePdcpSapProvider (); |
| 87 |
| 88 /** |
| 89 * |
| 90 * |
| 91 * \param s the RLC SAP Provider to be used by this LTE_PDCP |
| 92 */ |
| 93 void SetNistLteRlcSapProvider (NistLteRlcSapProvider * s); |
| 94 |
| 95 /** |
| 96 * |
| 97 * |
| 98 * \return the RLC SAP User interface offered to the RLC by this LTE_PDCP |
| 99 */ |
| 100 NistLteRlcSapUser* GetNistLteRlcSapUser (); |
| 101 |
| 102 static const uint16_t MAX_PDCP_SN = 4096; |
| 103 |
| 104 /** |
| 105 * NistStatus variables of the PDCP |
| 106 *· |
| 107 */ |
| 108 struct NistStatus |
| 109 { |
| 110 uint16_t txSn; ///< TX sequence number |
| 111 uint16_t rxSn; ///< RX sequence number |
| 112 }; |
| 113 |
| 114 /**· |
| 115 *· |
| 116 * \return the current status of the PDCP |
| 117 */ |
| 118 NistStatus GetNistStatus (); |
| 119 |
| 120 /** |
| 121 * Set the status of the PDCP |
| 122 *· |
| 123 * \param s· |
| 124 */ |
| 125 void SetNistStatus (NistStatus s); |
| 126 |
| 127 /** |
| 128 * TracedCallback for PDU transmission event. |
| 129 * |
| 130 * \param [in] rnti The C-RNTI identifying the UE. |
| 131 * \param [in] lcid The logical channel id corresponding to |
| 132 * the sending RLC instance. |
| 133 * \param [in] size Packet size. |
| 134 */ |
| 135 typedef void (* PduTxTracedCallback) |
| 136 (const uint16_t rnti, const uint8_t lcid, const uint32_t size); |
| 137 |
| 138 /** |
| 139 * TracedCallback signature for PDU receive event. |
| 140 * |
| 141 * \param [in] rnti The C-RNTI identifying the UE. |
| 142 * \param [in] lcid The logical channel id corresponding to |
| 143 * the sending RLC instance. |
| 144 * \param [in] size Packet size. |
| 145 * \param [in] delay Delay since packet sent, in ns.. |
| 146 */ |
| 147 typedef void (* PduRxTracedCallback) |
| 148 (const uint16_t rnti, const uint8_t lcid, |
| 149 const uint32_t size, const uint64_t delay); |
| 150 |
| 151 protected: |
| 152 // Interface provided to upper RRC entity |
| 153 virtual void DoTransmitPdcpSdu (Ptr<Packet> p); |
| 154 |
| 155 NistLtePdcpSapUser* m_pdcpSapUser; |
| 156 NistLtePdcpSapProvider* m_pdcpSapProvider; |
| 157 |
| 158 // Interface provided to lower RLC entity |
| 159 virtual void DoReceivePdu (Ptr<Packet> p); |
| 160 |
| 161 NistLteRlcSapUser* m_rlcSapUser; |
| 162 NistLteRlcSapProvider* m_rlcSapProvider; |
| 163 |
| 164 uint16_t m_rnti; |
| 165 uint8_t m_lcid; |
| 166 /* Additional identifier for sidelink */ |
| 167 uint32_t m_srcL2Id; /**< Source L2 ID (24 bits) */ |
| 168 uint32_t m_dstL2Id; /**< Destination L2 ID (24 bits) */ |
| 169 ···· |
| 170 /** |
| 171 * Used to inform of a PDU delivery to the RLC SAP provider. |
| 172 * The parameters are RNTI, LCID and bytes delivered |
| 173 */ |
| 174 TracedCallback<uint16_t, uint8_t, uint32_t> m_txPdu; |
| 175 /** |
| 176 * Used to inform of a PDU reception from the RLC SAP user. |
| 177 * The parameters are RNTI, LCID, bytes delivered and delivery delay in nanose
conds.· |
| 178 */ |
| 179 TracedCallback<uint16_t, uint8_t, uint32_t, uint64_t> m_rxPdu; |
| 180 |
| 181 private: |
| 182 /** |
| 183 * State variables. See section 7.1 in TS 36.323 |
| 184 */ |
| 185 uint16_t m_txSequenceNumber; |
| 186 uint16_t m_rxSequenceNumber; |
| 187 |
| 188 /** |
| 189 * Constants. See section 7.2 in TS 36.323 |
| 190 */ |
| 191 static const uint16_t m_maxPdcpSn = 4095; |
| 192 |
| 193 }; |
| 194 |
| 195 |
| 196 } // namespace ns3 |
| 197 |
| 198 #endif // NIST_LTE_PDCP_H |
OLD | NEW |