OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2011 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: Nicola Baldo <nbaldo@cttc.es> |
| 19 * Modified by: NIST |
| 20 */ |
| 21 |
| 22 #ifndef NIST_LTE_RLC_H |
| 23 #define NIST_LTE_RLC_H |
| 24 |
| 25 #include <ns3/simple-ref-count.h> |
| 26 #include <ns3/packet.h> |
| 27 #include "ns3/uinteger.h" |
| 28 #include "ns3/traced-value.h" |
| 29 #include "ns3/trace-source-accessor.h" |
| 30 #include "ns3/nstime.h" |
| 31 |
| 32 #include "ns3/object.h" |
| 33 |
| 34 #include "ns3/nist-lte-rlc-sap.h" |
| 35 #include "ns3/nist-lte-mac-sap.h" |
| 36 |
| 37 namespace ns3 { |
| 38 |
| 39 |
| 40 // class NistLteRlcSapProvider; |
| 41 // class NistLteRlcSapUser; |
| 42 //· |
| 43 // class NistLteMacSapProvider; |
| 44 // class NistLteMacSapUser; |
| 45 |
| 46 /** |
| 47 * This abstract base class defines the API to interact with the Radio Link Cont
rol |
| 48 * (LTE_RLC) in LTE, see 3GPP TS 36.322 |
| 49 * |
| 50 */ |
| 51 class NistLteRlc : public Object // SimpleRefCount<NistLteRlc> |
| 52 { |
| 53 friend class NistLteRlcSpecificLteMacSapUser; |
| 54 friend class NistLteRlcSpecificLteRlcSapProvider<NistLteRlc>; |
| 55 public: |
| 56 NistLteRlc (); |
| 57 virtual ~NistLteRlc (); |
| 58 static TypeId GetTypeId (void); |
| 59 virtual void DoDispose (); |
| 60 |
| 61 /** |
| 62 * |
| 63 * |
| 64 * \param rnti |
| 65 */ |
| 66 void SetRnti (uint16_t rnti); |
| 67 |
| 68 /** |
| 69 * |
| 70 * |
| 71 * \param lcId |
| 72 */ |
| 73 void SetLcId (uint8_t lcId); |
| 74 |
| 75 /** |
| 76 * Sets the source L2 Id for sidelink identification of the PDCP entity |
| 77 * \param src |
| 78 */ |
| 79 void SetSourceL2Id (uint32_t src); |
| 80 ·· |
| 81 /** |
| 82 * Sets the destination L2 Id for sidelink identification of the PDCP entity |
| 83 * \param src |
| 84 */ |
| 85 void SetDestinationL2Id (uint32_t dst); |
| 86 ·· |
| 87 /** |
| 88 * |
| 89 * |
| 90 * \param s the RLC SAP user to be used by this LTE_RLC |
| 91 */ |
| 92 void SetNistLteRlcSapUser (NistLteRlcSapUser * s); |
| 93 |
| 94 /** |
| 95 * |
| 96 * |
| 97 * \return the RLC SAP Provider interface offered to the PDCP by this LTE_RLC |
| 98 */ |
| 99 NistLteRlcSapProvider* GetNistLteRlcSapProvider (); |
| 100 |
| 101 /** |
| 102 * |
| 103 * |
| 104 * \param s the MAC SAP Provider to be used by this LTE_RLC |
| 105 */ |
| 106 void SetNistLteMacSapProvider (NistLteMacSapProvider * s); |
| 107 |
| 108 /** |
| 109 * |
| 110 * |
| 111 * \return the MAC SAP User interface offered to the MAC by this LTE_RLC |
| 112 */ |
| 113 NistLteMacSapUser* GetNistLteMacSapUser (); |
| 114 |
| 115 |
| 116 /** |
| 117 * TracedCallback signature for NotifyTxOpportunity events. |
| 118 * |
| 119 * \param [in] rnti C-RNTI scheduled. |
| 120 * \param [in] lcid The logical channel id corresponding to |
| 121 * the sending RLC instance. |
| 122 * \param [in] bytes The number of bytes to transmit |
| 123 */ |
| 124 typedef void (* NotifyTxTracedCallback) |
| 125 (const uint16_t rnti, const uint8_t lcid, const uint32_t bytes); |
| 126 |
| 127 /** |
| 128 * TracedCallback signature for |
| 129 * |
| 130 * \param [in] rnti C-RNTI scheduled. |
| 131 * \param [in] lcid The logical channel id corresponding to |
| 132 * the sending RLC instance. |
| 133 * \param [in] bytes The packet size. |
| 134 * \param [in] delay Delay since sender timestamp, in ns. |
| 135 */ |
| 136 typedef void (* ReceiveTracedCallback) |
| 137 (const uint16_t rnti, const uint8_t lcid, |
| 138 const uint32_t bytes, const uint64_t delay); |
| 139 |
| 140 /// \todo MRE What is the sense to duplicate all the interfaces here??? |
| 141 // NB to avoid the use of multiple inheritance |
| 142 ·· |
| 143 protected: |
| 144 // Interface forwarded by NistLteRlcSapProvider |
| 145 virtual void DoTransmitPdcpPdu (Ptr<Packet> p) = 0; |
| 146 |
| 147 NistLteRlcSapUser* m_rlcSapUser; |
| 148 NistLteRlcSapProvider* m_rlcSapProvider; |
| 149 |
| 150 // Interface forwarded by NistLteMacSapUser |
| 151 virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t har
qId) = 0; |
| 152 virtual void DoNotifyHarqDeliveryFailure () = 0; |
| 153 virtual void DoReceivePdu (Ptr<Packet> p) = 0; |
| 154 |
| 155 NistLteMacSapUser* m_macSapUser; |
| 156 NistLteMacSapProvider* m_macSapProvider; |
| 157 |
| 158 uint16_t m_rnti; |
| 159 uint8_t m_lcid; |
| 160 /* Additional identifier for sidelink */ |
| 161 uint32_t m_srcL2Id; /**< Source L2 ID (24 bits) */ |
| 162 uint32_t m_dstL2Id; /**< Destination L2 ID (24 bits) */ |
| 163 |
| 164 /** |
| 165 * Used to inform of a PDU delivery to the MAC SAP provider |
| 166 */ |
| 167 TracedCallback<uint16_t, uint8_t, uint32_t> m_txPdu; |
| 168 /** |
| 169 * Used to inform of a PDU reception from the MAC SAP user |
| 170 */ |
| 171 TracedCallback<uint16_t, uint8_t, uint32_t, uint64_t> m_rxPdu; |
| 172 |
| 173 }; |
| 174 |
| 175 |
| 176 |
| 177 /** |
| 178 * LTE_RLC Saturation Mode (SM): simulation-specific mode used for |
| 179 * experiments that do not need to consider the layers above the LTE_RLC. |
| 180 * The LTE_RLC SM, unlike the standard LTE_RLC modes, it does not provide |
| 181 * data delivery services to upper layers; rather, it just generates a |
| 182 * new LTE_RLC PDU whenever the MAC notifies a transmission opportunity. |
| 183 * |
| 184 */ |
| 185 class NistLteRlcSm : public NistLteRlc |
| 186 { |
| 187 public: |
| 188 NistLteRlcSm (); |
| 189 virtual ~NistLteRlcSm (); |
| 190 static TypeId GetTypeId (void); |
| 191 virtual void DoInitialize (); |
| 192 virtual void DoDispose (); |
| 193 |
| 194 virtual void DoTransmitPdcpPdu (Ptr<Packet> p); |
| 195 virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t har
qId); |
| 196 virtual void DoNotifyHarqDeliveryFailure (); |
| 197 virtual void DoReceivePdu (Ptr<Packet> p); |
| 198 |
| 199 |
| 200 |
| 201 private: |
| 202 void ReportBufferNistStatus (); |
| 203 |
| 204 }; |
| 205 |
| 206 |
| 207 |
| 208 |
| 209 // /** |
| 210 // * Implements LTE_RLC Transparent Mode (TM), see 3GPP TS 36.322 |
| 211 // * |
| 212 // */ |
| 213 // class NistLteRlcTm : public NistLteRlc |
| 214 // { |
| 215 // public: |
| 216 // virtual ~NistLteRlcTm (); |
| 217 |
| 218 // }; |
| 219 |
| 220 |
| 221 // /** |
| 222 // * Implements LTE_RLC Unacknowledged Mode (UM), see 3GPP TS 36.322 |
| 223 // * |
| 224 // */ |
| 225 // class NistLteRlcUm : public NistLteRlc |
| 226 // { |
| 227 // public: |
| 228 // virtual ~NistLteRlcUm (); |
| 229 |
| 230 // }; |
| 231 |
| 232 // /** |
| 233 // * Implements LTE_RLC Acknowledged Mode (AM), see 3GPP TS 36.322 |
| 234 // * |
| 235 // */ |
| 236 |
| 237 // class NistLteRlcAm : public NistLteRlc |
| 238 // { |
| 239 // public: |
| 240 // virtual ~NistLteRlcAm (); |
| 241 // }; |
| 242 |
| 243 |
| 244 |
| 245 |
| 246 |
| 247 } // namespace ns3 |
| 248 |
| 249 #endif // NIST_LTE_RLC_H |
OLD | NEW |