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