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