author | Nicola Baldo <nbaldo@cttc.es> |
Tue, 19 Apr 2011 17:32:20 +0200 | |
changeset 7976 | 541eee38ac12 |
parent 7952 | a15a8def979c |
child 8007 | 845888b95c15 |
permissions | -rw-r--r-- |
6705 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
|
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: Giuseppe Piro <g.piro@poliba.it> |
|
7886 | 19 |
* Author: Marco Miozzo <mmiozzo@cttc.es> : Update to FF API Architecture |
20 |
* Author: Nicola Baldo <nbaldo@cttc.es> : Integrated with new RRC and MAC architecture |
|
6705 | 21 |
*/ |
22 |
||
7897 | 23 |
#include <ns3/llc-snap-header.h> |
24 |
#include <ns3/simulator.h> |
|
25 |
#include <ns3/callback.h> |
|
26 |
#include <ns3/node.h> |
|
27 |
#include <ns3/packet.h> |
|
28 |
#include <ns3/lte-net-device.h> |
|
29 |
#include <ns3/packet-burst.h> |
|
30 |
#include <ns3/uinteger.h> |
|
31 |
#include <ns3/trace-source-accessor.h> |
|
32 |
#include <ns3/pointer.h> |
|
33 |
#include <ns3/enum.h> |
|
34 |
#include <ns3/lte-amc.h> |
|
35 |
#include <ns3/lte-enb-mac.h> |
|
36 |
#include <ns3/lte-enb-net-device.h> |
|
37 |
#include <ns3/lte-enb-rrc.h> |
|
38 |
#include <ns3/lte-ue-net-device.h> |
|
39 |
#include <ns3/lte-enb-phy.h> |
|
40 |
#include <ns3/ff-mac-scheduler.h> |
|
41 |
||
6705 | 42 |
|
7887 | 43 |
NS_LOG_COMPONENT_DEFINE ("LteEnbNetDevice"); |
6705 | 44 |
|
45 |
namespace ns3 { |
|
46 |
||
7887 | 47 |
NS_OBJECT_ENSURE_REGISTERED ( LteEnbNetDevice); |
6705 | 48 |
|
7887 | 49 |
uint16_t LteEnbNetDevice::m_cellIdCounter = 0; |
7886 | 50 |
|
7887 | 51 |
TypeId LteEnbNetDevice::GetTypeId (void) |
6705 | 52 |
{ |
53 |
static TypeId |
|
54 |
tid = |
|
7887 | 55 |
TypeId ("ns3::LteEnbNetDevice") |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
56 |
.SetParent<LteNetDevice> () |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
57 |
.AddConstructor<LteEnbNetDevice> () |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
58 |
.AddAttribute ("LteEnbRrc", |
7921 | 59 |
"The RRC associated to this EnbNetDevice", |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
60 |
PointerValue (), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
61 |
MakePointerAccessor (&LteEnbNetDevice::m_rrc), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
62 |
MakePointerChecker <LteEnbRrc> ()) |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
63 |
.AddAttribute ("LteEnbMac", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
64 |
"The MAC associated to this EnbNetDevice", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
65 |
PointerValue (), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
66 |
MakePointerAccessor (&LteEnbNetDevice::m_mac), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
67 |
MakePointerChecker <LteEnbMac> ()) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
68 |
.AddAttribute ("FfMacScheduler", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
69 |
"The scheduler associated to this EnbNetDevice", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
70 |
PointerValue (), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
71 |
MakePointerAccessor (&LteEnbNetDevice::m_scheduler), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
72 |
MakePointerChecker <FfMacScheduler> ()) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
73 |
.AddAttribute ("LteEnbPhy", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
74 |
"The PHY associated to this EnbNetDevice", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
75 |
PointerValue (), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
76 |
MakePointerAccessor (&LteEnbNetDevice::m_phy), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
77 |
MakePointerChecker <LteEnbPhy> ()) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
78 |
.AddAttribute ("UlBandwidth", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
79 |
"Uplink bandwidth in number of Resource Blocks", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
80 |
UintegerValue (25), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
81 |
MakeUintegerAccessor (&LteEnbNetDevice::SetUlBandwidth, |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
82 |
&LteEnbNetDevice::GetUlBandwidth), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
83 |
MakeUintegerChecker<uint8_t> ()) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
84 |
.AddAttribute ("DlBandwidth", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
85 |
"Downlink bandwidth in number of Resource Blocks", |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
86 |
UintegerValue (25), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
87 |
MakeUintegerAccessor (&LteEnbNetDevice::SetDlBandwidth, |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
88 |
&LteEnbNetDevice::GetDlBandwidth), |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
89 |
MakeUintegerChecker<uint8_t> ()) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
90 |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7887
diff
changeset
|
91 |
; |
6705 | 92 |
return tid; |
93 |
} |
|
94 |
||
7887 | 95 |
LteEnbNetDevice::LteEnbNetDevice (void) |
6705 | 96 |
{ |
97 |
NS_LOG_FUNCTION (this); |
|
7886 | 98 |
NS_FATAL_ERROR ("This constructor should not be called"); |
6705 | 99 |
} |
100 |
||
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7902
diff
changeset
|
101 |
LteEnbNetDevice::LteEnbNetDevice (Ptr<Node> node, Ptr<LteEnbPhy> phy, Ptr<LteEnbMac> mac, Ptr<FfMacScheduler> sched, Ptr<LteEnbRrc> rrc) |
6705 | 102 |
{ |
103 |
NS_LOG_FUNCTION (this); |
|
7906
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7902
diff
changeset
|
104 |
m_phy = phy; |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7902
diff
changeset
|
105 |
m_mac = mac; |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7902
diff
changeset
|
106 |
m_scheduler = sched; |
d58de34e41d3
MAC, RRC and Scheduler created by LenaHelper
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7902
diff
changeset
|
107 |
m_rrc = rrc; |
6705 | 108 |
SetNode (node); |
7944
f7e5e0540487
connection of SAPs moved from EnbNetDevice to LenaHelper
Nicola Baldo <nicola@baldo.biz>
parents:
7928
diff
changeset
|
109 |
NS_ASSERT_MSG (m_cellIdCounter < 65535, "max num eNBs exceeded"); |
f7e5e0540487
connection of SAPs moved from EnbNetDevice to LenaHelper
Nicola Baldo <nicola@baldo.biz>
parents:
7928
diff
changeset
|
110 |
m_cellId = ++m_cellIdCounter; |
6705 | 111 |
} |
112 |
||
7887 | 113 |
LteEnbNetDevice::~LteEnbNetDevice (void) |
6705 | 114 |
{ |
115 |
NS_LOG_FUNCTION (this); |
|
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
116 |
} |
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
117 |
|
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
118 |
void |
7887 | 119 |
LteEnbNetDevice::DoDispose () |
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
120 |
{ |
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
121 |
NS_LOG_FUNCTION (this); |
7886 | 122 |
|
7921 | 123 |
m_mac->Dispose (); |
124 |
m_mac = 0; |
|
125 |
||
126 |
m_scheduler->Dispose (); |
|
127 |
m_scheduler = 0; |
|
128 |
||
129 |
m_rrc->Dispose (); |
|
130 |
m_rrc = 0; |
|
131 |
||
132 |
m_phy->Dispose (); |
|
133 |
m_phy = 0; |
|
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
134 |
|
6709
4f3100141560
fixed some valgrind errors
Giuseppe Piro <g.piro@poliba.it>
parents:
6705
diff
changeset
|
135 |
LteNetDevice::DoDispose (); |
6705 | 136 |
} |
137 |
||
6710
3cd651349cb6
lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents:
6709
diff
changeset
|
138 |
|
6705 | 139 |
|
7886 | 140 |
Ptr<LteEnbMac> |
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
141 |
LteEnbNetDevice::GetMac (void) const |
6705 | 142 |
{ |
143 |
NS_LOG_FUNCTION (this); |
|
7886 | 144 |
return m_mac; |
6705 | 145 |
} |
146 |
||
147 |
||
7887 | 148 |
Ptr<LteEnbPhy> |
149 |
LteEnbNetDevice::GetPhy (void) const |
|
6705 | 150 |
{ |
151 |
NS_LOG_FUNCTION (this); |
|
7886 | 152 |
return m_phy; |
6705 | 153 |
} |
154 |
||
155 |
||
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
156 |
Ptr<LteEnbRrc> |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
157 |
LteEnbNetDevice::GetRrc () const |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
158 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
159 |
return m_rrc; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
160 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
161 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
162 |
uint16_t |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
163 |
LteEnbNetDevice::GetCellId () const |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
164 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
165 |
return m_cellId; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
166 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
167 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
168 |
uint8_t |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
169 |
LteEnbNetDevice::GetUlBandwidth () const |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
170 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
171 |
return m_ulBandwidth; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
172 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
173 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
174 |
void |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
175 |
LteEnbNetDevice::SetUlBandwidth (uint8_t bw) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
176 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
177 |
switch (bw) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
178 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
179 |
case 6: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
180 |
case 15: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
181 |
case 25: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
182 |
case 50: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
183 |
case 75: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
184 |
case 100: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
185 |
m_ulBandwidth = bw; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
186 |
break; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
187 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
188 |
default: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
189 |
NS_FATAL_ERROR ("invalid bandwidth value " << (uint16_t) bw); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
190 |
break; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
191 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
192 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
193 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
194 |
uint8_t |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
195 |
LteEnbNetDevice::GetDlBandwidth () const |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
196 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
197 |
return m_dlBandwidth; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
198 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
199 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
200 |
void |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
201 |
LteEnbNetDevice::SetDlBandwidth (uint8_t bw) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
202 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
203 |
switch (bw) |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
204 |
{ |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
205 |
case 6: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
206 |
case 15: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
207 |
case 25: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
208 |
case 50: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
209 |
case 75: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
210 |
case 100: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
211 |
m_dlBandwidth = bw; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
212 |
break; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
213 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
214 |
default: |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
215 |
NS_FATAL_ERROR ("invalid bandwidth value " << (uint16_t) bw); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
216 |
break; |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
217 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
218 |
} |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
219 |
|
7976
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
220 |
void |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
221 |
LteEnbNetDevice::DoStart (void) |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
222 |
{ |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
223 |
UpdateConfig (); |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
224 |
} |
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
225 |
|
541eee38ac12
fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents:
7952
diff
changeset
|
226 |
|
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
227 |
|
6705 | 228 |
bool |
7887 | 229 |
LteEnbNetDevice::DoSend (Ptr<Packet> packet, const Mac48Address& source, |
6705 | 230 |
const Mac48Address& dest, uint16_t protocolNumber) |
231 |
{ |
|
232 |
NS_LOG_FUNCTION (this << source << dest << protocolNumber); |
|
233 |
||
7886 | 234 |
NS_FATAL_ERROR ("IP connectivity not implemented yet"); |
235 |
||
6705 | 236 |
/* |
237 |
* The classification of traffic in DL is done by the PGW (not |
|
238 |
* by the eNB). |
|
239 |
* Hovever, the core network is not implemented yet. |
|
240 |
* For now the classification is managed by the eNB. |
|
241 |
*/ |
|
242 |
||
7886 | 243 |
// if (protocolNumber == 2048) |
244 |
// { |
|
245 |
// // it is an IP packet |
|
246 |
// } |
|
6705 | 247 |
|
7886 | 248 |
// if (protocolNumber != 2048 || bearer == 0) |
249 |
// { |
|
6705 | 250 |
|
7886 | 251 |
// } |
252 |
||
6705 | 253 |
|
7886 | 254 |
return true; |
255 |
} |
|
6705 | 256 |
|
257 |
||
258 |
void |
|
7887 | 259 |
LteEnbNetDevice::DoReceive (Ptr<Packet> p) |
6705 | 260 |
{ |
261 |
NS_LOG_FUNCTION (this << p); |
|
262 |
ForwardUp (p->Copy ()); |
|
263 |
} |
|
264 |
||
265 |
||
266 |
void |
|
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
267 |
LteEnbNetDevice::UpdateConfig (void) |
6705 | 268 |
{ |
269 |
NS_LOG_FUNCTION (this); |
|
7952
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
270 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
271 |
m_rrc->ConfigureCell (m_ulBandwidth, m_dlBandwidth); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
272 |
|
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
273 |
// WILD HACK - should use the PHY SAP instead. Probably should handle this through the RRC |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
274 |
m_phy->DoSetBandwidth (m_ulBandwidth, m_dlBandwidth); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
275 |
m_phy->DoSetCellId (m_cellId); |
a15a8def979c
attributes for ul & dl bandwidth at the eNB
Nicola Baldo <nbaldo@cttc.es>
parents:
7944
diff
changeset
|
276 |
|
6705 | 277 |
} |
278 |
||
279 |
||
280 |
} // namespace ns3 |