author | Manuel Requena <manuel.requena@cttc.es> |
Tue, 26 Mar 2013 10:41:49 +0100 | |
changeset 10019 | 6efd95740e39 |
parent 9596 | 4f09f4b739ac |
child 9703 | 681f35b212ff |
permissions | -rw-r--r-- |
7886 | 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 |
*/ |
|
20 |
||
21 |
#ifndef LTE_RLC_H |
|
22 |
#define LTE_RLC_H |
|
23 |
||
24 |
#include <ns3/simple-ref-count.h> |
|
25 |
#include <ns3/packet.h> |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
26 |
#include "ns3/uinteger.h" |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
27 |
#include "ns3/traced-value.h" |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
28 |
#include "ns3/trace-source-accessor.h" |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
29 |
#include "ns3/nstime.h" |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
30 |
|
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
31 |
#include "ns3/object.h" |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
32 |
|
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
33 |
#include "ns3/lte-rlc-sap.h" |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
34 |
#include "ns3/lte-mac-sap.h" |
7886 | 35 |
|
36 |
namespace ns3 { |
|
37 |
||
38 |
||
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
39 |
// class LteRlcSapProvider; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
40 |
// class LteRlcSapUser; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
41 |
// |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
42 |
// class LteMacSapProvider; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
43 |
// class LteMacSapUser; |
7886 | 44 |
|
45 |
/** |
|
46 |
* This abstract base class defines the API to interact with the Radio Link Control |
|
47 |
* (LTE_RLC) in LTE, see 3GPP TS 36.322 |
|
48 |
* |
|
49 |
*/ |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
50 |
class LteRlc : public Object // SimpleRefCount<LteRlc> |
7886 | 51 |
{ |
52 |
friend class LteRlcSpecificLteMacSapUser; |
|
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
53 |
friend class LteRlcSpecificLteRlcSapProvider<LteRlc>; |
7886 | 54 |
public: |
55 |
LteRlc (); |
|
56 |
virtual ~LteRlc (); |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
57 |
static TypeId GetTypeId (void); |
9596
4f09f4b739ac
Add Dispose to LteRlc
Manuel Requena <manuel.requena@cttc.es>
parents:
9497
diff
changeset
|
58 |
virtual void DoDispose (); |
7886 | 59 |
|
60 |
/** |
|
61 |
* |
|
62 |
* |
|
63 |
* \param rnti |
|
64 |
*/ |
|
8374
5a07200122a6
coding style and rnti issue
Manuel Requena <manuel.requena@cttc.es>
parents:
8364
diff
changeset
|
65 |
void SetRnti (uint16_t rnti); |
7886 | 66 |
|
67 |
/** |
|
68 |
* |
|
69 |
* |
|
70 |
* \param lcId |
|
71 |
*/ |
|
72 |
void SetLcId (uint8_t lcId); |
|
73 |
||
74 |
/** |
|
75 |
* |
|
76 |
* |
|
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
77 |
* \param s the RLC SAP user to be used by this LTE_RLC |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
78 |
*/ |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
79 |
void SetLteRlcSapUser (LteRlcSapUser * s); |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
80 |
|
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
81 |
/** |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
82 |
* |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
83 |
* |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
84 |
* \param s the RLC SAP Provider interface offered to the PDCP by this LTE_RLC |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
85 |
*/ |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
86 |
LteRlcSapProvider* GetLteRlcSapProvider (); |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
87 |
|
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
88 |
/** |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
89 |
* |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
90 |
* |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
91 |
* \param s the MAC SAP Provider to be used by this LTE_RLC |
7886 | 92 |
*/ |
93 |
void SetLteMacSapProvider (LteMacSapProvider * s); |
|
94 |
||
95 |
/** |
|
96 |
* |
|
97 |
* |
|
98 |
* \param s the MAC SAP User interface offered to the MAC by this LTE_RLC |
|
99 |
*/ |
|
100 |
LteMacSapUser* GetLteMacSapUser (); |
|
101 |
||
102 |
||
103 |
||
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
104 |
// TODO MRE What is the sense to duplicate all the interfaces here??? |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8374
diff
changeset
|
105 |
// NB to avoid the use of multiple inheritance |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8374
diff
changeset
|
106 |
|
7886 | 107 |
protected: |
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
108 |
// Interface forwarded by LteRlcSapProvider |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
109 |
virtual void DoTransmitPdcpPdu (Ptr<Packet> p) = 0; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
110 |
|
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
111 |
LteRlcSapUser* m_rlcSapUser; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
112 |
LteRlcSapProvider* m_rlcSapProvider; |
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
113 |
|
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
114 |
// Interface forwarded by LteMacSapUser |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
8714
diff
changeset
|
115 |
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId) = 0; |
7886 | 116 |
virtual void DoNotifyHarqDeliveryFailure () = 0; |
117 |
virtual void DoReceivePdu (Ptr<Packet> p) = 0; |
|
118 |
||
119 |
LteMacSapUser* m_macSapUser; |
|
120 |
LteMacSapProvider* m_macSapProvider; |
|
121 |
||
122 |
uint16_t m_rnti; |
|
123 |
uint8_t m_lcid; |
|
124 |
||
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
125 |
/** |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
126 |
* Used to inform of a PDU delivery to the MAC SAP provider |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
127 |
*/ |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
128 |
TracedCallback<uint16_t, uint8_t, uint32_t> m_txPdu; |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
129 |
/** |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
130 |
* Used to inform of a PDU reception from the MAC SAP user |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
131 |
*/ |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
132 |
TracedCallback<uint16_t, uint8_t, uint32_t, uint64_t> m_rxPdu; |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
133 |
|
7886 | 134 |
}; |
135 |
||
136 |
||
137 |
||
138 |
/** |
|
139 |
* LTE_RLC Saturation Mode (SM): simulation-specific mode used for |
|
140 |
* experiments that do not need to consider the layers above the LTE_RLC. |
|
141 |
* The LTE_RLC SM, unlike the standard LTE_RLC modes, it does not provide |
|
142 |
* data delivery services to upper layers; rather, it just generates a |
|
143 |
* new LTE_RLC PDU whenever the MAC notifies a transmission opportunity. |
|
144 |
* |
|
145 |
*/ |
|
146 |
class LteRlcSm : public LteRlc |
|
147 |
{ |
|
148 |
public: |
|
149 |
LteRlcSm (); |
|
150 |
virtual ~LteRlcSm (); |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7886
diff
changeset
|
151 |
static TypeId GetTypeId (void); |
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9451
diff
changeset
|
152 |
virtual void DoStart (); |
9451
116fd6ad4640
cancel pending events upon RLC disposal
Nicola Baldo <nbaldo@cttc.es>
parents:
9351
diff
changeset
|
153 |
virtual void DoDispose (); |
7886 | 154 |
|
8364
0d7da39de404
Add new RLC interfaces to the generic RLC entity
Manuel Requena <manuel.requena@cttc.es>
parents:
8090
diff
changeset
|
155 |
virtual void DoTransmitPdcpPdu (Ptr<Packet> p); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
8714
diff
changeset
|
156 |
virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId); |
7886 | 157 |
virtual void DoNotifyHarqDeliveryFailure (); |
158 |
virtual void DoReceivePdu (Ptr<Packet> p); |
|
159 |
||
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9451
diff
changeset
|
160 |
|
7886 | 161 |
|
8425
1c3cdeda035c
make RlcSm send repeated buffer status reports
Nicola Baldo <nbaldo@cttc.es>
parents:
8389
diff
changeset
|
162 |
private: |
1c3cdeda035c
make RlcSm send repeated buffer status reports
Nicola Baldo <nbaldo@cttc.es>
parents:
8389
diff
changeset
|
163 |
void ReportBufferStatus (); |
1c3cdeda035c
make RlcSm send repeated buffer status reports
Nicola Baldo <nbaldo@cttc.es>
parents:
8389
diff
changeset
|
164 |
|
7886 | 165 |
}; |
166 |
||
167 |
||
168 |
||
169 |
||
170 |
// /** |
|
171 |
// * Implements LTE_RLC Transparent Mode (TM), see 3GPP TS 36.322 |
|
172 |
// * |
|
173 |
// */ |
|
174 |
// class LteRlcTm : public LteRlc |
|
175 |
// { |
|
176 |
// public: |
|
177 |
// virtual ~LteRlcTm (); |
|
178 |
||
179 |
// }; |
|
180 |
||
181 |
||
182 |
// /** |
|
183 |
// * Implements LTE_RLC Unacknowledged Mode (UM), see 3GPP TS 36.322 |
|
184 |
// * |
|
185 |
// */ |
|
186 |
// class LteRlcUm : public LteRlc |
|
187 |
// { |
|
188 |
// public: |
|
189 |
// virtual ~LteRlcUm (); |
|
190 |
||
191 |
// }; |
|
192 |
||
193 |
// /** |
|
194 |
// * Implements LTE_RLC Acknowledged Mode (AM), see 3GPP TS 36.322 |
|
195 |
// * |
|
196 |
// */ |
|
197 |
||
198 |
// class LteRlcAm : public LteRlc |
|
199 |
// { |
|
200 |
// public: |
|
201 |
// virtual ~LteRlcAm (); |
|
202 |
// }; |
|
203 |
||
204 |
||
205 |
||
206 |
||
207 |
||
208 |
} // namespace ns3 |
|
209 |
||
210 |
#endif // LTE_RLC_H |