A Discrete-Event Network Simulator
API
lte-test-tdtbfq-ff-mac-scheduler.cc
Go to the documentation of this file.
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: Marco Miozzo <marco.miozzo@cttc.es>,
19  * Nicola Baldo <nbaldo@cttc.es>
20  * Dizhi Zhou <dizhi.zhou@gmail.com>
21  */
22 
23 #include <iostream>
24 #include <sstream>
25 #include <string>
26 
27 #include <ns3/object.h>
28 #include <ns3/spectrum-interference.h>
29 #include <ns3/spectrum-error-model.h>
30 #include <ns3/log.h>
31 #include <ns3/test.h>
32 #include <ns3/simulator.h>
33 #include <ns3/packet.h>
34 #include <ns3/ptr.h>
35 #include "ns3/radio-bearer-stats-calculator.h"
36 #include <ns3/constant-position-mobility-model.h>
37 #include <ns3/ff-mac-scheduler.h>
38 #include <ns3/eps-bearer.h>
39 #include <ns3/node-container.h>
40 #include <ns3/mobility-helper.h>
41 #include <ns3/net-device-container.h>
42 #include <ns3/lte-ue-net-device.h>
43 #include <ns3/lte-enb-net-device.h>
44 #include <ns3/lte-ue-rrc.h>
45 #include <ns3/lte-helper.h>
46 #include "ns3/string.h"
47 #include "ns3/double.h"
48 #include <ns3/lte-enb-phy.h>
49 #include <ns3/lte-ue-phy.h>
50 #include <ns3/boolean.h>
51 #include <ns3/enum.h>
52 
53 #include "ns3/point-to-point-epc-helper.h"
54 #include "ns3/network-module.h"
55 #include "ns3/ipv4-global-routing-helper.h"
56 #include "ns3/internet-module.h"
57 #include "ns3/applications-module.h"
58 #include "ns3/point-to-point-helper.h"
59 
61 
62 using namespace ns3;
63 
64 NS_LOG_COMPONENT_DEFINE ("LenaTestTdTbfqFfMacScheduler");
65 
67  : TestSuite ("lte-tdtbfq-ff-mac-scheduler", SYSTEM)
68 {
69  NS_LOG_INFO ("creating LenaTestTdTbfqFfMacSchedulerSuite");
70 
71  bool errorModel = false;
72 
73  // General config
74  // Traffic: UDP traffic with fixed rate
75  // Token generation rate = traffic rate
76  // RLC header length = 2 bytes, PDCP header = 2 bytes
77  // Simulation time = 1.0 sec
78  // Throughput in this file is calculated in RLC layer
79 
80  //Test Case 1: homogeneous flow test in TDTBFQ (same distance)
81  // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2 13)
82  // Traffic info
83  // UDP traffic: payload size = 200 bytes, interval = 1 ms
84  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate
85  // Totol bandwidth: 24 PRB at Itbs 26 -> 2196 -> 2196000 byte/sec
86  // 1 user -> 232000 * 1 = 232000 < 2196000 -> throughput = 232000 byte/sec
87  // 3 user -> 232000 * 3 = 696000 < 2196000 -> througphut = 232000 byte/sec
88  // 6 user -> 232000 * 6 = 139200 < 2196000 -> throughput = 232000 byte/sec
89  // 12 user -> 232000 * 12 = 2784000 > 2196000 -> throughput = 2196000 / 12 = 183000 byte/sec
90  // UPLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2 13)
91  // 1 user -> 25 PRB at Itbs 26 -> 2292 -> 2292000 > 232000 -> throughput = 232000 bytes/sec
92  // 3 users -> 8 PRB at Itbs 26 -> 749 -> 749000 > 232000 -> throughput = 232000 bytes/sec
93  // 6 users -> 4 PRB at Itbs 26 -> 373 -> 373000 > 232000 -> throughput = 232000 bytes/sec
94  // 12 users -> 2 PRB at Itbs 26 -> 185 -> 185000 < 232000 -> throughput = 185000 bytes/sec
95  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
96  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
97  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
98  //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,183000,185000,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
99 
100  // DOWNLINK - DISTANCE 4800 -> MCS 22 -> Itbs 20 (from table 7.1.7.2.1-1 of 36.213)
101  // Traffic info
102  // UDP traffic: payload size = 200 bytes, interval = 1 ms
103  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate
104  // Totol bandwidth: 24 PRB at Itbs 20 -> 1383 -> 1383000 byte/sec
105  // 1 user -> 903000 * 1 = 232000 < 1383000 -> throughput = 232000 byte/sec
106  // 3 user -> 232000 * 3 = 696000 < 1383000 -> througphut = 232000 byte/sec
107  // 6 user -> 232000 * 6 = 1392000 > 1383000 -> throughput = 1383000 / 6 = 230500 byte/sec
108  // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput = 1383000 / 12 = 115250 byte/sec
109  // UPLINK - DISTANCE 4800 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
110  // 1 user -> 25 PRB at Itbs 13 -> 807 -> 807000 > 232000 -> throughput = 232000 bytes/sec
111  // 3 users -> 8 PRB at Itbs 13 -> 253 -> 253000 > 232000 -> throughput = 232000 bytes/sec
112  // 6 users -> 4 PRB at Itbs 13 -> 125 -> 125000 < 232000 -> throughput = 125000 bytes/sec
113  // after the patch enforcing min 3 PRBs per UE:
114  // 12 users -> 3 PRB at Itbs 13 -> 93 bytes * 8/12 UE/TTI -> 62000 < 232000 -> throughput = 62000 bytes/sec
115  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,4800,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
116  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,4800,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
117  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,4800,230500,125000,200,1,errorModel), TestCase::EXTENSIVE);
118  //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,4800,115250,62000,200,1,errorModel)); // simulation time = 1.5, otherwise, ul test will fail
119 
120  // DOWNLINK - DISTANCE 6000 -> MCS 20 -> Itbs 18 (from table 7.1.7.2.1-1 of 36.213)
121  // Traffic info
122  // UDP traffic: payload size = 200 bytes, interval = 1 ms
123  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate
124  // Totol bandwidth: 24 PRB at Itbs 18 -> 1191 -> 1191000 byte/sec
125  // 1 user -> 903000 * 1 = 232000 < 1191000 -> throughput = 232000 byte/sec
126  // 3 user -> 232000 * 3 = 696000 < 1191000 -> througphut = 232000 byte/sec
127  // 6 user -> 232000 * 6 = 1392000 > 1191000 -> throughput = 1191000 / 6 = 198500 byte/sec
128  // 12 user -> 232000 * 12 = 2784000 > 1191000 -> throughput = 1191000 / 12 = 99250 byte/sec
129 
130  // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
131  // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000 bytes/sec
132  // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 < 232000 -> throughput = 201000 bytes/sec
133  // 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
134  // after the patch enforcing min 3 PRBs per UE:
135  // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 < 232000 -> throughput = 48667 bytes/sec
136  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,6000,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
137  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,6000,232000,201000,200,1,errorModel), TestCase::EXTENSIVE);
138  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,6000,198500,97000,200,1,errorModel), TestCase::EXTENSIVE);
139  //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,6000,99250,48667,200,1, errorModel)); // simulation time = 1.5, otherwise, ul test will fail
140 
141  // DOWNLINK - DISTANCE 10000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
142  // Traffic info
143  // UDP traffic: payload size = 200 bytes, interval = 1 ms
144  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate
145  // Totol bandwidth: 24 PRB at Itbs 13 -> 775 -> 775000 byte/sec
146  // 1 user -> 903000 * 1 = 232000 < 775000 -> throughput = 232000 byte/sec
147  // 3 user -> 232000 * 3 = 696000 < 775000 -> througphut = 232000 byte/sec
148  // 6 user -> 232000 * 6 = 1392000 > 775000 -> throughput = 775000 / 6 = 129166 byte/sec
149  // 12 user -> 232000 * 12 = 2784000 > 775000 -> throughput = 775000 / 12 = 64583 byte/sec
150  // UPLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
151  // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 > 232000 -> throughput = 232000 bytes/sec
152  // 3 users -> 8 PRB at Itbs 8 -> 137 -> 137000 < 232000 -> throughput = 137000 bytes/sec
153  // 6 users -> 4 PRB at Itbs 8 -> 67 -> 67000 < 232000 -> throughput = 67000 bytes/sec
154  // after the patch enforcing min 3 PRBs per UE:
155  // 12 users -> 3 PRB at Itbs 8 -> 49 bytes * 8/12 UE/TTI -> 32667 < 232000 -> throughput = 32667 bytes/sec
156  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,10000,232000,232000,200,1,errorModel), TestCase::EXTENSIVE);
157  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,10000,232000,137000,200,1,errorModel), TestCase::EXTENSIVE);
158  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,10000,129166,67000,200,1,errorModel), TestCase::EXTENSIVE);
159  //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,10000,64583,32667,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
160 
161  // DOWNLINK - DISTANCE 100000 -> CQI == 0 -> out of range -> 0 bytes/sec
162  // UPLINK - DISTANCE 100000 -> CQI == 0 -> out of range -> 0 bytes/sec
163  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,100000,0,0,200,1,errorModel), TestCase::QUICK);
164 
165  // Test Case 2: homogeneous flow test in TDTBFQ (different distance)
166  // Traffic1 info
167  // UDP traffic: payload size = 100 bytes, interval = 1 ms
168  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 132000 byte/rate
169  // Maximum throughput = 4 / ( 1/2196000 + 1/1383000 + 1/1191000 + 1/775000 ) = 1209000 byte/s
170  // 132000 * 4 = 528000 < 1209000 -> estimated throughput in downlink = 132000 byte/sec
171  std::vector<double> dist1;
172  dist1.push_back (0); // User 0 distance --> MCS 28
173  dist1.push_back (4800); // User 1 distance --> MCS 22
174  dist1.push_back (6000); // User 2 distance --> MCS 20
175  dist1.push_back (10000); // User 3 distance --> MCS 14
176  std::vector<uint16_t> packetSize1;
177  packetSize1.push_back (100);
178  packetSize1.push_back (100);
179  packetSize1.push_back (100);
180  packetSize1.push_back (100);
181  std::vector<uint32_t> estThrTdTbfqDl1;
182  estThrTdTbfqDl1.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
183  estThrTdTbfqDl1.push_back (132000); // User 1 estimated TTI throughput from TDTBFQ
184  estThrTdTbfqDl1.push_back (132000); // User 2 estimated TTI throughput from TDTBFQ
185  estThrTdTbfqDl1.push_back (132000); // User 3 estimated TTI throughput from TDTBFQ
186  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist1,estThrTdTbfqDl1,packetSize1,1,errorModel), TestCase::EXTENSIVE);
187 
188  // Traffic2 info
189  // UDP traffic: payload size = 300 bytes, interval = 1 ms
190  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 332000 byte/rate
191  // Maximum throughput = 4 / ( 1/2196000 + 1/1383000 + 1/1191000 + 1/775000 ) = 1209000 byte/s
192  // 332000 * 4 = 1328000 > 1209000 -> estimated throughput in downlink = 1209000 / 4 = 302500 byte/sec
193  std::vector<double> dist2;
194  dist2.push_back (0); // User 0 distance --> MCS 28
195  dist2.push_back (4800); // User 1 distance --> MCS 22
196  dist2.push_back (6000); // User 2 distance --> MCS 20
197  dist2.push_back (10000); // User 3 distance --> MCS 14
198  std::vector<uint16_t> packetSize2;
199  packetSize2.push_back (300);
200  packetSize2.push_back (300);
201  packetSize2.push_back (300);
202  packetSize2.push_back (300);
203  std::vector<uint32_t> estThrTdTbfqDl2;
204  estThrTdTbfqDl2.push_back (302500); // User 0 estimated TTI throughput from TDTBFQ
205  estThrTdTbfqDl2.push_back (302500); // User 1 estimated TTI throughput from TDTBFQ
206  estThrTdTbfqDl2.push_back (302500); // User 2 estimated TTI throughput from TDTBFQ
207  estThrTdTbfqDl2.push_back (302500); // User 3 estimated TTI throughput from TDTBFQ
208  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist2,estThrTdTbfqDl2,packetSize2,1,errorModel), TestCase::EXTENSIVE);
209 
210  // Test Case 3: heterogeneous flow test in TDTBFQ
211  // UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
212  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> [132000, 232000, 332000] byte/rate
213  // Maximum throughput = 3 / ( 1/2196000 + 1/1383000 + 1/1191000 ) = 1486666 byte/s
214  // 132000 + 232000 + 332000 = 696000 < 1486666 -> estimated throughput in downlink = [132000, 232000, 332000] byte/sec
215  std::vector<double> dist3;
216  dist3.push_back (0); // User 0 distance --> MCS 28
217  dist3.push_back (4800); // User 1 distance --> MCS 22
218  dist3.push_back (6000); // User 2 distance --> MCS 20
219  std::vector<uint16_t> packetSize3;
220  packetSize3.push_back (100);
221  packetSize3.push_back (200);
222  packetSize3.push_back (300);
223  std::vector<uint32_t> estThrTdTbfqDl3;
224  estThrTdTbfqDl3.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
225  estThrTdTbfqDl3.push_back (232000); // User 1 estimated TTI throughput from TDTBFQ
226  estThrTdTbfqDl3.push_back (332000); // User 2 estimated TTI throughput from TDTBFQ
227  AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist3,estThrTdTbfqDl3,packetSize3,1,errorModel), TestCase::QUICK);
228 
229 }
230 
232 
233 // --------------- T E S T - C A S E # 1 ------------------------------
234 
235 
236 std::string
238 {
239  std::ostringstream oss;
240  oss << nUser << " UEs, distance " << dist << " m";
241  return oss.str ();
242 }
243 
244 
245 LenaTdTbfqFfMacSchedulerTestCase1::LenaTdTbfqFfMacSchedulerTestCase1 (uint16_t nUser, double dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval,bool errorModelEnabled)
246  : TestCase (BuildNameString (nUser, dist)),
247  m_nUser (nUser),
248  m_dist (dist),
249  m_packetSize (packetSize),
250  m_interval (interval),
251  m_thrRefDl (thrRefDl),
252  m_thrRefUl (thrRefUl),
253  m_errorModelEnabled (errorModelEnabled)
254 {
255 }
256 
258 {
259 }
260 
261 void
263 {
264  NS_LOG_FUNCTION (this << GetName ());
265 
266  if (!m_errorModelEnabled)
267  {
268  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
269  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
270  }
271 
272  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
273  Config::SetDefault ("ns3::MacStatsCalculator::DlOutputFilename", StringValue (CreateTempDirFilename ("DlMacStats.txt")));
274  Config::SetDefault ("ns3::MacStatsCalculator::UlOutputFilename", StringValue (CreateTempDirFilename ("UlMacStats.txt")));
275  Config::SetDefault ("ns3::RadioBearerStatsCalculator::DlRlcOutputFilename", StringValue (CreateTempDirFilename ("DlRlcStats.txt")));
276  Config::SetDefault ("ns3::RadioBearerStatsCalculator::UlRlcOutputFilename", StringValue (CreateTempDirFilename ("UlRlcStats.txt")));
277 
278  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
279  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
280  lteHelper->SetEpcHelper (epcHelper);
281 
282  //LogComponentEnable ("TdTbfqFfMacScheduler", LOG_DEBUG);
283 
284  Ptr<Node> pgw = epcHelper->GetPgwNode ();
285 
286  // Create a single RemoteHost
287  NodeContainer remoteHostContainer;
288  remoteHostContainer.Create (1);
289  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
290  InternetStackHelper internet;
291  internet.Install (remoteHostContainer);
292 
293  // Create the Internet
294  PointToPointHelper p2ph;
295  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
296  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
297  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.001)));
298  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
299  Ipv4AddressHelper ipv4h;
300  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
301  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
302  // interface 0 is localhost, 1 is the p2p device
303  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
304 
305  Ipv4StaticRoutingHelper ipv4RoutingHelper;
306  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
307  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
308 
309  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
310  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
311  //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
312  //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
313 
314  //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
315 
316 // LogComponentDisableAll (LOG_LEVEL_ALL);
317  //LogComponentEnable ("LenaTestTdTbfqFfMacScheduler", LOG_LEVEL_ALL);
318 
319  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
320 
321  // Create Nodes: eNodeB and UE
322  NodeContainer enbNodes;
323  NodeContainer ueNodes;
324  enbNodes.Create (1);
325  ueNodes.Create (m_nUser);
326 
327  // Install Mobility Model
329  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
330  mobility.Install (enbNodes);
331  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
332  mobility.Install (ueNodes);
333 
334  // Create Devices and install them in the Nodes (eNB and UE)
335  NetDeviceContainer enbDevs;
336  NetDeviceContainer ueDevs;
337  lteHelper->SetSchedulerType ("ns3::TdTbfqFfMacScheduler");
338  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::SRS_UL_CQI));
339  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
340  ueDevs = lteHelper->InstallUeDevice (ueNodes);
341 
342 
343  Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
344  Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
345  enbPhy->SetAttribute ("TxPower", DoubleValue (30.0));
346  enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
347 
348  // Set UEs' position and power
349  for (int i = 0; i < m_nUser; i++)
350  {
352  mm->SetPosition (Vector (m_dist, 0.0, 0.0));
353  Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (i)->GetObject<LteUeNetDevice> ();
354  Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
355  uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
356  uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
357  }
358 
359  // Install the IP stack on the UEs
360  internet.Install (ueNodes);
361  Ipv4InterfaceContainer ueIpIface;
362  ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
363 
364  // Assign IP address to UEs
365  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
366  {
367  Ptr<Node> ueNode = ueNodes.Get (u);
368  // Set the default gateway for the UE
369  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
370  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
371  }
372 
373  // Attach a UE to a eNB
374  lteHelper->Attach (ueDevs, enbDevs.Get (0));
375 
376  // Activate an EPS bearer on all UEs
377  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
378  {
379  Ptr<NetDevice> ueDevice = ueDevs.Get (u);
380  GbrQosInformation qos;
381  qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) * 8; // bit/s, considering IP, UDP, RLC, PDCP header size
382  qos.gbrUl = 0;
383  qos.mbrDl = qos.gbrDl;
384  qos.mbrUl = 0;
385 
386  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
387  EpsBearer bearer (q, qos);
388  lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());
389  }
390 
391  // Install downlink and uplink applications
392  uint16_t dlPort = 1234;
393  uint16_t ulPort = 2000;
394  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
397 
398  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
399  {
400  ++ulPort;
401  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
402  serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive packets from UEs
403  serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive packets from remotehost
404 
405  UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink packets generator
406  dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval)));
407  dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000));
408  dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize));
409 
410  UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink packets generator
411  ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval)));
412  ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000));
413  ulClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize));
414 
415  clientApps.Add (dlClient.Install (remoteHost));
416  clientApps.Add (ulClient.Install (ueNodes.Get (u)));
417  }
418 
419  serverApps.Start (Seconds (0.001));
420  clientApps.Start (Seconds (0.040));
421 
422  double statsStartTime = 0.040; // need to allow for RRC connection establishment + SRS
423  double statsDuration = 1;
424  double tolerance = 0.1;
425  Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
426 
427  lteHelper->EnableRlcTraces ();
428  lteHelper->EnableMacTraces ();
429  Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
430  rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
431  rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
432 
433  Simulator::Run ();
434 
439  NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s) at distance " << m_dist);
440  std::vector <uint64_t> dlDataRxed;
441  for (int i = 0; i < m_nUser; i++)
442  {
443  // get the imsi
444  uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi ();
445  // get the lcId
446  uint8_t lcId = 4;
447  uint64_t data = rlcStats->GetDlRxData (imsi, lcId);
448  dlDataRxed.push_back (data);
449  NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " thr " << (double)dlDataRxed.at (i) / statsDuration << " ref " << m_thrRefDl);
450  }
451 
452  for (int i = 0; i < m_nUser; i++)
453  {
454  NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_thrRefDl, m_thrRefDl * tolerance, " Unfair Throughput!");
455  }
456 
461  NS_LOG_INFO ("UL - Test with " << m_nUser << " user(s) at distance " << m_dist);
462  std::vector <uint64_t> ulDataRxed;
463  for (int i = 0; i < m_nUser; i++)
464  {
465  // get the imsi
466  uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi ();
467  // get the lcId
468  uint8_t lcId = 4;
469  ulDataRxed.push_back (rlcStats->GetUlRxData (imsi, lcId));
470  NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)ulDataRxed.at (i) << " thr " << (double)ulDataRxed.at (i) / statsDuration << " ref " << m_thrRefUl);
471  }
472 
473  for (int i = 0; i < m_nUser; i++)
474  {
475  NS_TEST_ASSERT_MSG_EQ_TOL ((double)ulDataRxed.at (i) / statsDuration, m_thrRefUl, m_thrRefUl * tolerance, " Unfair Throughput!");
476  }
477  Simulator::Destroy ();
478 
479 }
480 
481 
482 
483 // --------------- T E S T - C A S E # 2 ------------------------------
484 
485 
486 std::string
487 LenaTdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<double> dist)
488 {
489  std::ostringstream oss;
490  oss << "distances (m) = [ " ;
491  for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it)
492  {
493  oss << *it << " ";
494  }
495  oss << "]";
496  return oss.str ();
497 }
498 
499 
500 LenaTdTbfqFfMacSchedulerTestCase2::LenaTdTbfqFfMacSchedulerTestCase2 (std::vector<double> dist, std::vector<uint32_t> estThrTdTbfqDl, std::vector<uint16_t> packetSize, uint16_t interval,bool errorModelEnabled)
501  : TestCase (BuildNameString (dist.size (), dist)),
502  m_nUser (dist.size ()),
503  m_dist (dist),
504  m_packetSize (packetSize),
505  m_interval (interval),
506  m_estThrTdTbfqDl (estThrTdTbfqDl),
507  m_errorModelEnabled (errorModelEnabled)
508 {
509 }
510 
512 {
513 }
514 
515 void
517 {
518 
519  if (!m_errorModelEnabled)
520  {
521  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
522  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
523  }
524 
525  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
526  Config::SetDefault ("ns3::MacStatsCalculator::DlOutputFilename", StringValue (CreateTempDirFilename ("DlMacStats.txt")));
527  Config::SetDefault ("ns3::MacStatsCalculator::UlOutputFilename", StringValue (CreateTempDirFilename ("UlMacStats.txt")));
528  Config::SetDefault ("ns3::RadioBearerStatsCalculator::DlRlcOutputFilename", StringValue (CreateTempDirFilename ("DlRlcStats.txt")));
529  Config::SetDefault ("ns3::RadioBearerStatsCalculator::UlRlcOutputFilename", StringValue (CreateTempDirFilename ("UlRlcStats.txt")));
530 
531  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
532  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
533  lteHelper->SetEpcHelper (epcHelper);
534 
535  Ptr<Node> pgw = epcHelper->GetPgwNode ();
536 
537  // Create a single RemoteHost
538  NodeContainer remoteHostContainer;
539  remoteHostContainer.Create (1);
540  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
541  InternetStackHelper internet;
542  internet.Install (remoteHostContainer);
543 
544  // Create the Internet
545  PointToPointHelper p2ph;
546  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
547  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
548  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.001)));
549  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
550  Ipv4AddressHelper ipv4h;
551  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
552  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
553  // interface 0 is localhost, 1 is the p2p device
554  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
555 
556  Ipv4StaticRoutingHelper ipv4RoutingHelper;
557  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
558  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
559 
560 
561 // LogComponentDisableAll (LOG_LEVEL_ALL);
562  //LogComponentEnable ("LenaTestTdTbfqFfMacScheduler", LOG_LEVEL_ALL);
563 
564  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
565 
566  // Create Nodes: eNodeB and UE
567  NodeContainer enbNodes;
568  NodeContainer ueNodes;
569  enbNodes.Create (1);
570  ueNodes.Create (m_nUser);
571 
572  // Install Mobility Model
574  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
575  mobility.Install (enbNodes);
576  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
577  mobility.Install (ueNodes);
578 
579  // Create Devices and install them in the Nodes (eNB and UE)
580  NetDeviceContainer enbDevs;
581  NetDeviceContainer ueDevs;
582  lteHelper->SetSchedulerType ("ns3::TdTbfqFfMacScheduler");
583  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
584  ueDevs = lteHelper->InstallUeDevice (ueNodes);
585 
586  Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
587  Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
588  enbPhy->SetAttribute ("TxPower", DoubleValue (30.0));
589  enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
590 
591  // Set UEs' position and power
592  for (int i = 0; i < m_nUser; i++)
593  {
595  mm->SetPosition (Vector (m_dist.at (i), 0.0, 0.0));
596  Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (i)->GetObject<LteUeNetDevice> ();
597  Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
598  uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
599  uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
600  }
601 
602  // Install the IP stack on the UEs
603  internet.Install (ueNodes);
604  Ipv4InterfaceContainer ueIpIface;
605  ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
606 
607  // Assign IP address to UEs
608  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
609  {
610  Ptr<Node> ueNode = ueNodes.Get (u);
611  // Set the default gateway for the UE
612  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
613  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
614  }
615 
616  // Attach a UE to a eNB
617  lteHelper->Attach (ueDevs, enbDevs.Get (0));
618 
619  // Activate an EPS bearer on all UEs
620 
621  uint16_t mbrDl = 0;
622  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
623  {
624  mbrDl = mbrDl + m_packetSize.at (u);
625  }
626  mbrDl = mbrDl / ueNodes.GetN ();
627 
628  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
629  {
630  Ptr<NetDevice> ueDevice = ueDevs.Get (u);
631  GbrQosInformation qos;
632  qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering IP, UDP, RLC, PDCP header size
633  qos.gbrUl = 0;
634  qos.mbrDl = qos.gbrDl;
635  qos.mbrUl = 0;
636 
637  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
638  EpsBearer bearer (q, qos);
639  lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());
640  }
641 
642 
643  // Install downlink and uplink applications
644  uint16_t dlPort = 1234;
645  uint16_t ulPort = 2000;
646  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
649 
650  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
651  {
652  ++ulPort;
653  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
654  serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive packets from UEs
655  serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive packets from remotehost
656 
657  UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink packets generator
658  dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval)));
659  dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000));
660  dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize.at (u)));
661 
662  UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink packets generator
663  ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval)));
664  ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000));
665  ulClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize.at (u)));
666 
667  clientApps.Add (dlClient.Install (remoteHost));
668  clientApps.Add (ulClient.Install (ueNodes.Get (u)));
669  }
670 
671  serverApps.Start (Seconds (0.001));
672  clientApps.Start (Seconds (0.040));
673 
674  double statsStartTime = 0.040; // need to allow for RRC connection establishment + SRS
675  double statsDuration = 1.0;
676  double tolerance = 0.1;
677  Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
678 
679  lteHelper->EnableRlcTraces ();
680  Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
681  rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
682  rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
683 
684 
685  Simulator::Run ();
686 
691  NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s)");
692  std::vector <uint64_t> dlDataRxed;
693  for (int i = 0; i < m_nUser; i++)
694  {
695  // get the imsi
696  uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi ();
697  // get the lcId
698  uint8_t lcId = 4;
699  dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
700  NS_LOG_INFO ("\tUser " << i << " dist " << m_dist.at (i) << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " thr " << (double)dlDataRxed.at (i) / statsDuration << " ref " << m_estThrTdTbfqDl.at (i));
701  }
702 
703  for (int i = 0; i < m_nUser; i++)
704  {
705  NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_estThrTdTbfqDl.at (i), m_estThrTdTbfqDl.at (i) * tolerance, " Unfair Throughput!");
706  }
707 
708  Simulator::Destroy ();
709 
710 }
holds a vector of ns3::Application pointers.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
bool m_errorModelEnabled
whether the error model is enabled
an Inet address class
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
AttributeValue implementation for Boolean.
Definition: boolean.h:36
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:474
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
static std::string BuildNameString(uint16_t nUser, double dist)
Builds the test name string based on provided parameter values.
Hold variables of type string.
Definition: string.h:41
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:269
static const uint32_t packetSize
Test suite for TdTbfqFfMacScheduler test.
A suite of tests to run.
Definition: test.h:1343
Mobility model for which the current position does not change once it has been set and until it is se...
serverApps
Definition: first.py:52
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:961
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1297
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1436
std::vector< uint32_t > m_estThrTdTbfqDl
the estimated downlink throughput
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
uint16_t m_interval
the packet interval time in ms
aggregate IP/TCP/UDP functionality to existing Nodes.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
Build a set of PointToPointNetDevice objects.
encapsulates test code
Definition: test.h:1153
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
LenaTdTbfqFfMacSchedulerTestCase2(std::vector< double > dist, std::vector< uint32_t > estThrTdTbfqDl, std::vector< uint16_t > packetSize, uint16_t interval, bool errorModelEnabled)
Constructor.
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:1069
ApplicationContainer Install(NodeContainer c)
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:279
mobility
Definition: third.py:108
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
Class for representing data rates.
Definition: data-rate.h:88
double m_dist
the distance between nodes
uint16_t m_interval
the interval time in ms
virtual void DoRun(void)
Implementation to actually run this TestCase.
Hold variables of type enum.
Definition: enum.h:54
Lena TdTbfq Ff Mac Scheduler Test Case 2.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
AttributeValue implementation for Time.
Definition: nstime.h:1353
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
uint64_t GetDlRxData(uint64_t imsi, uint8_t lcid)
Gets the number of received downlink data bytes.
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:293
uint8_t data[writeSize]
double m_thrRefDl
the DL throughput reference
holds a vector of ns3::NetDevice pointers
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:42
std::vector< uint16_t > m_packetSize
the packet size in bytes
static LenaTestTdTbfqFfMacSchedulerSuite lenaTestTdTbfqFfMacSchedulerSuite
Ptr< LteEnbPhy > GetPhy(void) const
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition: test.h:378
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:76
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
std::vector< double > m_dist
the distance between nodes
This system test program creates different test cases with a single eNB and several UEs...
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:45
Ptr< LteUePhy > GetPhy(void) const
Get the Phy.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
void SetPosition(const Vector &position)
double m_thrRefUl
the UL throughput reference
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1573
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:489
static std::string BuildNameString(uint16_t nUser, std::vector< double > dist)
Builds the test name string based on provided parameter values.
Helper class used to assign positions and mobility models to nodes.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
uint64_t GetUlRxData(uint64_t imsi, uint8_t lcid)
Gets the number of received uplink data bytes.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
std::string GetName(void) const
Definition: test.cc:370
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
Definition: lte-helper.cc:272
Helper class that adds ns3::Ipv4StaticRouting objects.
bool m_errorModelEnabled
whether the error model is enabled
AttributeValue implementation for DataRate.
Definition: data-rate.h:298
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
Definition: test.cc:430
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
clientApps
Definition: first.py:61
uint16_t m_packetSize
the packet size in bytes
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1530
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:44
LenaTdTbfqFfMacSchedulerTestCase1(uint16_t nUser, double dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval, bool errorModelEnabled)
Constructor.
3GPP TS 36.413 9.2.1.18 GBR QoS Information
Definition: eps-bearer.h:35
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
The eNodeB device implementation.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
The LteUeNetDevice class implements the UE net device.