A Discrete-Event Network Simulator
API
lte-test-tdtbfq-ff-mac-scheduler.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Marco Miozzo <marco.miozzo@cttc.es>,
18  * Nicola Baldo <nbaldo@cttc.es>
19  * Dizhi Zhou <dizhi.zhou@gmail.com>
20  */
21 
23 
24 #include "ns3/double.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/ipv4-global-routing-helper.h"
27 #include "ns3/network-module.h"
28 #include "ns3/packet-sink-helper.h"
29 #include "ns3/point-to-point-epc-helper.h"
30 #include "ns3/point-to-point-helper.h"
31 #include "ns3/radio-bearer-stats-calculator.h"
32 #include "ns3/string.h"
33 #include "ns3/udp-client-server-helper.h"
34 #include <ns3/boolean.h>
35 #include <ns3/constant-position-mobility-model.h>
36 #include <ns3/enum.h>
37 #include <ns3/eps-bearer.h>
38 #include <ns3/ff-mac-scheduler.h>
39 #include <ns3/log.h>
40 #include <ns3/lte-enb-net-device.h>
41 #include <ns3/lte-enb-phy.h>
42 #include <ns3/lte-helper.h>
43 #include <ns3/lte-ue-net-device.h>
44 #include <ns3/lte-ue-phy.h>
45 #include <ns3/lte-ue-rrc.h>
46 #include <ns3/mobility-helper.h>
47 #include <ns3/net-device-container.h>
48 #include <ns3/node-container.h>
49 #include <ns3/object.h>
50 #include <ns3/packet.h>
51 #include <ns3/ptr.h>
52 #include <ns3/simulator.h>
53 #include <ns3/spectrum-error-model.h>
54 #include <ns3/spectrum-interference.h>
55 #include <ns3/test.h>
56 
57 #include <iostream>
58 #include <sstream>
59 #include <string>
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) *
84  // 1000 byte/sec -> 232000 byte/rate
85  // Total 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),
96  TestCase::EXTENSIVE);
97  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(3, 0, 232000, 232000, 200, 1, errorModel),
98  TestCase::EXTENSIVE);
99  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(6, 0, 232000, 232000, 200, 1, errorModel),
100  TestCase::EXTENSIVE);
101  // AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,183000,185000,200,1,errorModel));//
102  // simulation time = 1.5, otherwise, ul test will fail
103 
104  // DOWNLINK - DISTANCE 4800 -> MCS 22 -> Itbs 20 (from table 7.1.7.2.1-1 of 36.213)
105  // Traffic info
106  // UDP traffic: payload size = 200 bytes, interval = 1 ms
107  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
108  // byte/sec -> 232000 byte/rate
109  // Total bandwidth: 24 PRB at Itbs 20 -> 1383 -> 1383000 byte/sec
110  // 1 user -> 903000 * 1 = 232000 < 1383000 -> throughput = 232000 byte/sec
111  // 3 user -> 232000 * 3 = 696000 < 1383000 -> througphut = 232000 byte/sec
112  // 6 user -> 232000 * 6 = 1392000 > 1383000 -> throughput = 1383000 / 6 = 230500 byte/sec
113  // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput = 1383000 / 12 = 115250 byte/sec
114  // UPLINK - DISTANCE 4800 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
115  // 1 user -> 25 PRB at Itbs 13 -> 807 -> 807000 > 232000 -> throughput = 232000 bytes/sec
116  // 3 users -> 8 PRB at Itbs 13 -> 253 -> 253000 > 232000 -> throughput = 232000 bytes/sec
117  // 6 users -> 4 PRB at Itbs 13 -> 125 -> 125000 < 232000 -> throughput = 125000 bytes/sec
118  // after the patch enforcing min 3 PRBs per UE:
119  // 12 users -> 3 PRB at Itbs 13 -> 93 bytes * 8/12 UE/TTI -> 62000 < 232000 -> throughput =
120  // 62000 bytes/sec
121  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(1, 4800, 232000, 232000, 200, 1, errorModel),
122  TestCase::EXTENSIVE);
123  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(3, 4800, 232000, 232000, 200, 1, errorModel),
124  TestCase::EXTENSIVE);
125  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(6, 4800, 230500, 125000, 200, 1, errorModel),
126  TestCase::EXTENSIVE);
127  // AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,4800,115250,62000,200,1,errorModel));
128  // // simulation time = 1.5, otherwise, ul test will fail
129 
130  // DOWNLINK - DISTANCE 6000 -> MCS 20 -> Itbs 18 (from table 7.1.7.2.1-1 of 36.213)
131  // Traffic info
132  // UDP traffic: payload size = 200 bytes, interval = 1 ms
133  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
134  // byte/sec -> 232000 byte/rate
135  // Total bandwidth: 24 PRB at Itbs 18 -> 1191 -> 1191000 byte/sec
136  // 1 user -> 903000 * 1 = 232000 < 1191000 -> throughput = 232000 byte/sec
137  // 3 user -> 232000 * 3 = 696000 < 1191000 -> througphut = 232000 byte/sec
138  // 6 user -> 232000 * 6 = 1392000 > 1191000 -> throughput = 1191000 / 6 = 198500 byte/sec
139  // 12 user -> 232000 * 12 = 2784000 > 1191000 -> throughput = 1191000 / 12 = 99250 byte/sec
140 
141  // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
142  // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000 bytes/sec
143  // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 < 232000 -> throughput = 201000 bytes/sec
144  // 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
145  // after the patch enforcing min 3 PRBs per UE:
146  // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 < 232000 -> throughput =
147  // 48667 bytes/sec
148  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(1, 6000, 232000, 232000, 200, 1, errorModel),
149  TestCase::EXTENSIVE);
150  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(3, 6000, 232000, 201000, 200, 1, errorModel),
151  TestCase::EXTENSIVE);
152  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(6, 6000, 198500, 97000, 200, 1, errorModel),
153  TestCase::EXTENSIVE);
154  // AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,6000,99250,48667,200,1, errorModel));
155  // // simulation time = 1.5, otherwise, ul test will fail
156 
157  // DOWNLINK - DISTANCE 10000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
158  // Traffic info
159  // UDP traffic: payload size = 200 bytes, interval = 1 ms
160  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
161  // byte/sec -> 232000 byte/rate
162  // Total bandwidth: 24 PRB at Itbs 13 -> 775 -> 775000 byte/sec
163  // 1 user -> 903000 * 1 = 232000 < 775000 -> throughput = 232000 byte/sec
164  // 3 user -> 232000 * 3 = 696000 < 775000 -> througphut = 232000 byte/sec
165  // 6 user -> 232000 * 6 = 1392000 > 775000 -> throughput = 775000 / 6 = 129166 byte/sec
166  // 12 user -> 232000 * 12 = 2784000 > 775000 -> throughput = 775000 / 12 = 64583 byte/sec
167  // UPLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
168  // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 > 232000 -> throughput = 232000 bytes/sec
169  // 3 users -> 8 PRB at Itbs 8 -> 137 -> 137000 < 232000 -> throughput = 137000 bytes/sec
170  // 6 users -> 4 PRB at Itbs 8 -> 67 -> 67000 < 232000 -> throughput = 67000 bytes/sec
171  // after the patch enforcing min 3 PRBs per UE:
172  // 12 users -> 3 PRB at Itbs 8 -> 49 bytes * 8/12 UE/TTI -> 32667 < 232000 -> throughput = 32667
173  // bytes/sec
174  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(1, 10000, 232000, 232000, 200, 1, errorModel),
175  TestCase::EXTENSIVE);
176  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(3, 10000, 232000, 137000, 200, 1, errorModel),
177  TestCase::EXTENSIVE);
178  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(6, 10000, 129166, 67000, 200, 1, errorModel),
179  TestCase::EXTENSIVE);
180  // AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1
181  // (12,10000,64583,32667,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will
182  // fail
183 
184  // DOWNLINK - DISTANCE 100000 -> CQI == 0 -> out of range -> 0 bytes/sec
185  // UPLINK - DISTANCE 100000 -> CQI == 0 -> out of range -> 0 bytes/sec
186  AddTestCase(new LenaTdTbfqFfMacSchedulerTestCase1(1, 100000, 0, 0, 200, 1, errorModel),
187  TestCase::QUICK);
188 
189  // Test Case 2: homogeneous flow test in TDTBFQ (different distance)
190  // Traffic1 info
191  // UDP traffic: payload size = 100 bytes, interval = 1 ms
192  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
193  // byte/sec -> 132000 byte/rate
194  // Maximum throughput = 4 / ( 1/2196000 + 1/1383000 + 1/1191000 + 1/775000 ) = 1209000 byte/s
195  // 132000 * 4 = 528000 < 1209000 -> estimated throughput in downlink = 132000 byte/sec
196  std::vector<double> dist1;
197  dist1.push_back(0); // User 0 distance --> MCS 28
198  dist1.push_back(4800); // User 1 distance --> MCS 22
199  dist1.push_back(6000); // User 2 distance --> MCS 20
200  dist1.push_back(10000); // User 3 distance --> MCS 14
201  std::vector<uint16_t> packetSize1;
202  packetSize1.push_back(100);
203  packetSize1.push_back(100);
204  packetSize1.push_back(100);
205  packetSize1.push_back(100);
206  std::vector<uint32_t> estThrTdTbfqDl1;
207  estThrTdTbfqDl1.push_back(132000); // User 0 estimated TTI throughput from TDTBFQ
208  estThrTdTbfqDl1.push_back(132000); // User 1 estimated TTI throughput from TDTBFQ
209  estThrTdTbfqDl1.push_back(132000); // User 2 estimated TTI throughput from TDTBFQ
210  estThrTdTbfqDl1.push_back(132000); // User 3 estimated TTI throughput from TDTBFQ
211  AddTestCase(
212  new LenaTdTbfqFfMacSchedulerTestCase2(dist1, estThrTdTbfqDl1, packetSize1, 1, errorModel),
213  TestCase::EXTENSIVE);
214 
215  // Traffic2 info
216  // UDP traffic: payload size = 300 bytes, interval = 1 ms
217  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
218  // byte/sec -> 332000 byte/rate
219  // Maximum throughput = 4 / ( 1/2196000 + 1/1383000 + 1/1191000 + 1/775000 ) = 1209000 byte/s
220  // 332000 * 4 = 1328000 > 1209000 -> estimated throughput in downlink = 1209000 / 4 = 302500
221  // byte/sec
222  std::vector<double> dist2;
223  dist2.push_back(0); // User 0 distance --> MCS 28
224  dist2.push_back(4800); // User 1 distance --> MCS 22
225  dist2.push_back(6000); // User 2 distance --> MCS 20
226  dist2.push_back(10000); // User 3 distance --> MCS 14
227  std::vector<uint16_t> packetSize2;
228  packetSize2.push_back(300);
229  packetSize2.push_back(300);
230  packetSize2.push_back(300);
231  packetSize2.push_back(300);
232  std::vector<uint32_t> estThrTdTbfqDl2;
233  estThrTdTbfqDl2.push_back(302500); // User 0 estimated TTI throughput from TDTBFQ
234  estThrTdTbfqDl2.push_back(302500); // User 1 estimated TTI throughput from TDTBFQ
235  estThrTdTbfqDl2.push_back(302500); // User 2 estimated TTI throughput from TDTBFQ
236  estThrTdTbfqDl2.push_back(302500); // User 3 estimated TTI throughput from TDTBFQ
237  AddTestCase(
238  new LenaTdTbfqFfMacSchedulerTestCase2(dist2, estThrTdTbfqDl2, packetSize2, 1, errorModel),
239  TestCase::EXTENSIVE);
240 
241  // Test Case 3: heterogeneous flow test in TDTBFQ
242  // UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
243  // UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000
244  // byte/sec -> [132000, 232000, 332000] byte/rate
245  // Maximum throughput = 3 / ( 1/2196000 + 1/1383000 + 1/1191000 ) = 1486666 byte/s
246  // 132000 + 232000 + 332000 = 696000 < 1486666 -> estimated throughput in downlink = [132000,
247  // 232000, 332000] byte/sec
248  std::vector<double> dist3;
249  dist3.push_back(0); // User 0 distance --> MCS 28
250  dist3.push_back(4800); // User 1 distance --> MCS 22
251  dist3.push_back(6000); // User 2 distance --> MCS 20
252  std::vector<uint16_t> packetSize3;
253  packetSize3.push_back(100);
254  packetSize3.push_back(200);
255  packetSize3.push_back(300);
256  std::vector<uint32_t> estThrTdTbfqDl3;
257  estThrTdTbfqDl3.push_back(132000); // User 0 estimated TTI throughput from TDTBFQ
258  estThrTdTbfqDl3.push_back(232000); // User 1 estimated TTI throughput from TDTBFQ
259  estThrTdTbfqDl3.push_back(332000); // User 2 estimated TTI throughput from TDTBFQ
260  AddTestCase(
261  new LenaTdTbfqFfMacSchedulerTestCase2(dist3, estThrTdTbfqDl3, packetSize3, 1, errorModel),
262  TestCase::QUICK);
263 }
264 
270 
271 // --------------- T E S T - C A S E # 1 ------------------------------
272 
273 std::string
275 {
276  std::ostringstream oss;
277  oss << nUser << " UEs, distance " << dist << " m";
278  return oss.str();
279 }
280 
282  double dist,
283  double thrRefDl,
284  double thrRefUl,
285  uint16_t packetSize,
286  uint16_t interval,
287  bool errorModelEnabled)
288  : TestCase(BuildNameString(nUser, dist)),
289  m_nUser(nUser),
290  m_dist(dist),
291  m_packetSize(packetSize),
292  m_interval(interval),
293  m_thrRefDl(thrRefDl),
294  m_thrRefUl(thrRefUl),
295  m_errorModelEnabled(errorModelEnabled)
296 {
297 }
298 
300 {
301 }
302 
303 void
305 {
306  NS_LOG_FUNCTION(this << GetName());
307 
308  if (!m_errorModelEnabled)
309  {
310  Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
311  Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
312  }
313 
314  Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
315  Config::SetDefault("ns3::MacStatsCalculator::DlOutputFilename",
316  StringValue(CreateTempDirFilename("DlMacStats.txt")));
317  Config::SetDefault("ns3::MacStatsCalculator::UlOutputFilename",
318  StringValue(CreateTempDirFilename("UlMacStats.txt")));
319  Config::SetDefault("ns3::RadioBearerStatsCalculator::DlRlcOutputFilename",
320  StringValue(CreateTempDirFilename("DlRlcStats.txt")));
321  Config::SetDefault("ns3::RadioBearerStatsCalculator::UlRlcOutputFilename",
322  StringValue(CreateTempDirFilename("UlRlcStats.txt")));
323 
324  Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
325  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper>();
326  lteHelper->SetEpcHelper(epcHelper);
327 
328  // LogComponentEnable ("TdTbfqFfMacScheduler", LOG_DEBUG);
329 
330  Ptr<Node> pgw = epcHelper->GetPgwNode();
331 
332  // Create a single RemoteHost
333  NodeContainer remoteHostContainer;
334  remoteHostContainer.Create(1);
335  Ptr<Node> remoteHost = remoteHostContainer.Get(0);
337  internet.Install(remoteHostContainer);
338 
339  // Create the Internet
340  PointToPointHelper p2ph;
341  p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
342  p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
343  p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.001)));
344  NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
345  Ipv4AddressHelper ipv4h;
346  ipv4h.SetBase("1.0.0.0", "255.0.0.0");
347  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
348  // interface 0 is localhost, 1 is the p2p device
349  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
350 
351  Ipv4StaticRoutingHelper ipv4RoutingHelper;
352  Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
353  ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
354  remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);
355 
356  // Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
357  // Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
358  // Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
359  // Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
360 
361  // Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue
362  // (LteHelper::RLC_UM_ALWAYS));
363 
364  // LogComponentDisableAll (LOG_LEVEL_ALL);
365  // LogComponentEnable ("LenaTestTdTbfqFfMacScheduler", LOG_LEVEL_ALL);
366 
367  lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisSpectrumPropagationLossModel"));
368 
369  // Create Nodes: eNodeB and UE
370  NodeContainer enbNodes;
371  NodeContainer ueNodes;
372  enbNodes.Create(1);
373  ueNodes.Create(m_nUser);
374 
375  // Install Mobility Model
377  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
378  mobility.Install(enbNodes);
379  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
380  mobility.Install(ueNodes);
381 
382  // Create Devices and install them in the Nodes (eNB and UE)
383  NetDeviceContainer enbDevs;
384  NetDeviceContainer ueDevs;
385  lteHelper->SetSchedulerType("ns3::TdTbfqFfMacScheduler");
386  lteHelper->SetSchedulerAttribute("UlCqiFilter", EnumValue(FfMacScheduler::SRS_UL_CQI));
387  enbDevs = lteHelper->InstallEnbDevice(enbNodes);
388  ueDevs = lteHelper->InstallUeDevice(ueNodes);
389 
390  Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
391  Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy();
392  enbPhy->SetAttribute("TxPower", DoubleValue(30.0));
393  enbPhy->SetAttribute("NoiseFigure", DoubleValue(5.0));
394 
395  // Set UEs' position and power
396  for (int i = 0; i < m_nUser; i++)
397  {
400  mm->SetPosition(Vector(m_dist, 0.0, 0.0));
401  Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get(i)->GetObject<LteUeNetDevice>();
402  Ptr<LteUePhy> uePhy = lteUeDev->GetPhy();
403  uePhy->SetAttribute("TxPower", DoubleValue(23.0));
404  uePhy->SetAttribute("NoiseFigure", DoubleValue(9.0));
405  }
406 
407  // Install the IP stack on the UEs
408  internet.Install(ueNodes);
409  Ipv4InterfaceContainer ueIpIface;
410  ueIpIface = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
411 
412  // Assign IP address to UEs
413  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
414  {
415  Ptr<Node> ueNode = ueNodes.Get(u);
416  // Set the default gateway for the UE
417  Ptr<Ipv4StaticRouting> ueStaticRouting =
418  ipv4RoutingHelper.GetStaticRouting(ueNode->GetObject<Ipv4>());
419  ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
420  }
421 
422  // Attach a UE to a eNB
423  lteHelper->Attach(ueDevs, enbDevs.Get(0));
424 
425  // Activate an EPS bearer on all UEs
426  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
427  {
428  Ptr<NetDevice> ueDevice = ueDevs.Get(u);
429  GbrQosInformation qos;
430  qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) *
431  8; // bit/s, considering IP, UDP, RLC, PDCP header size
432  qos.gbrUl = 0;
433  qos.mbrDl = qos.gbrDl;
434  qos.mbrUl = 0;
435 
436  EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
437  EpsBearer bearer(q, qos);
438  lteHelper->ActivateDedicatedEpsBearer(ueDevice, bearer, EpcTft::Default());
439  }
440 
441  // Install downlink and uplink applications
442  uint16_t dlPort = 1234;
443  uint16_t ulPort = 2000;
444  PacketSinkHelper dlPacketSinkHelper("ns3::UdpSocketFactory",
445  InetSocketAddress(Ipv4Address::GetAny(), dlPort));
448 
449  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
450  {
451  ++ulPort;
452  PacketSinkHelper ulPacketSinkHelper("ns3::UdpSocketFactory",
453  InetSocketAddress(Ipv4Address::GetAny(), ulPort));
454  serverApps.Add(ulPacketSinkHelper.Install(remoteHost)); // receive packets from UEs
455  serverApps.Add(
456  dlPacketSinkHelper.Install(ueNodes.Get(u))); // receive packets from remotehost
457 
458  UdpClientHelper dlClient(ueIpIface.GetAddress(u), dlPort); // uplink packets generator
459  dlClient.SetAttribute("Interval", TimeValue(MilliSeconds(m_interval)));
460  dlClient.SetAttribute("MaxPackets", UintegerValue(1000000));
461  dlClient.SetAttribute("PacketSize", UintegerValue(m_packetSize));
462 
463  UdpClientHelper ulClient(remoteHostAddr, ulPort); // downlink packets generator
464  ulClient.SetAttribute("Interval", TimeValue(MilliSeconds(m_interval)));
465  ulClient.SetAttribute("MaxPackets", UintegerValue(1000000));
466  ulClient.SetAttribute("PacketSize", UintegerValue(m_packetSize));
467 
468  clientApps.Add(dlClient.Install(remoteHost));
469  clientApps.Add(ulClient.Install(ueNodes.Get(u)));
470  }
471 
472  serverApps.Start(Seconds(0.001));
473  clientApps.Start(Seconds(0.040));
474 
475  double statsStartTime = 0.040; // need to allow for RRC connection establishment + SRS
476  double statsDuration = 1;
477  double tolerance = 0.1;
478  Simulator::Stop(Seconds(statsStartTime + statsDuration - 0.0001));
479 
480  lteHelper->EnableRlcTraces();
481  lteHelper->EnableMacTraces();
482  Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats();
483  rlcStats->SetAttribute("StartTime", TimeValue(Seconds(statsStartTime)));
484  rlcStats->SetAttribute("EpochDuration", TimeValue(Seconds(statsDuration)));
485 
486  Simulator::Run();
487 
492  NS_LOG_INFO("DL - Test with " << m_nUser << " user(s) at distance " << m_dist);
493  std::vector<uint64_t> dlDataRxed;
494  for (int i = 0; i < m_nUser; i++)
495  {
496  // get the imsi
497  uint64_t imsi = ueDevs.Get(i)->GetObject<LteUeNetDevice>()->GetImsi();
498  // get the lcId
499  uint8_t lcId = 4;
500  uint64_t data = rlcStats->GetDlRxData(imsi, lcId);
501  dlDataRxed.push_back(data);
502  NS_LOG_INFO("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at(i)
503  << " thr " << (double)dlDataRxed.at(i) / statsDuration << " ref "
504  << m_thrRefDl);
505  }
506 
507  for (int i = 0; i < m_nUser; i++)
508  {
509  NS_TEST_ASSERT_MSG_EQ_TOL((double)dlDataRxed.at(i) / statsDuration,
510  m_thrRefDl,
511  m_thrRefDl * tolerance,
512  " Unfair Throughput!");
513  }
514 
519  NS_LOG_INFO("UL - Test with " << m_nUser << " user(s) at distance " << m_dist);
520  std::vector<uint64_t> ulDataRxed;
521  for (int i = 0; i < m_nUser; i++)
522  {
523  // get the imsi
524  uint64_t imsi = ueDevs.Get(i)->GetObject<LteUeNetDevice>()->GetImsi();
525  // get the lcId
526  uint8_t lcId = 4;
527  ulDataRxed.push_back(rlcStats->GetUlRxData(imsi, lcId));
528  NS_LOG_INFO("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)ulDataRxed.at(i)
529  << " thr " << (double)ulDataRxed.at(i) / statsDuration << " ref "
530  << m_thrRefUl);
531  }
532 
533  for (int i = 0; i < m_nUser; i++)
534  {
535  NS_TEST_ASSERT_MSG_EQ_TOL((double)ulDataRxed.at(i) / statsDuration,
536  m_thrRefUl,
537  m_thrRefUl * tolerance,
538  " Unfair Throughput!");
539  }
540  Simulator::Destroy();
541 }
542 
543 // --------------- T E S T - C A S E # 2 ------------------------------
544 
545 std::string
546 LenaTdTbfqFfMacSchedulerTestCase2::BuildNameString(uint16_t nUser, std::vector<double> dist)
547 {
548  std::ostringstream oss;
549  oss << "distances (m) = [ ";
550  for (auto it = dist.begin(); it != dist.end(); ++it)
551  {
552  oss << *it << " ";
553  }
554  oss << "]";
555  return oss.str();
556 }
557 
559  std::vector<double> dist,
560  std::vector<uint32_t> estThrTdTbfqDl,
561  std::vector<uint16_t> packetSize,
562  uint16_t interval,
563  bool errorModelEnabled)
564  : TestCase(BuildNameString(dist.size(), dist)),
565  m_nUser(dist.size()),
566  m_dist(dist),
567  m_packetSize(packetSize),
568  m_interval(interval),
569  m_estThrTdTbfqDl(estThrTdTbfqDl),
570  m_errorModelEnabled(errorModelEnabled)
571 {
572 }
573 
575 {
576 }
577 
578 void
580 {
581  if (!m_errorModelEnabled)
582  {
583  Config::SetDefault("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue(false));
584  Config::SetDefault("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue(false));
585  }
586 
587  Config::SetDefault("ns3::LteHelper::UseIdealRrc", BooleanValue(true));
588  Config::SetDefault("ns3::MacStatsCalculator::DlOutputFilename",
589  StringValue(CreateTempDirFilename("DlMacStats.txt")));
590  Config::SetDefault("ns3::MacStatsCalculator::UlOutputFilename",
591  StringValue(CreateTempDirFilename("UlMacStats.txt")));
592  Config::SetDefault("ns3::RadioBearerStatsCalculator::DlRlcOutputFilename",
593  StringValue(CreateTempDirFilename("DlRlcStats.txt")));
594  Config::SetDefault("ns3::RadioBearerStatsCalculator::UlRlcOutputFilename",
595  StringValue(CreateTempDirFilename("UlRlcStats.txt")));
596 
597  Ptr<LteHelper> lteHelper = CreateObject<LteHelper>();
598  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper>();
599  lteHelper->SetEpcHelper(epcHelper);
600 
601  Ptr<Node> pgw = epcHelper->GetPgwNode();
602 
603  // Create a single RemoteHost
604  NodeContainer remoteHostContainer;
605  remoteHostContainer.Create(1);
606  Ptr<Node> remoteHost = remoteHostContainer.Get(0);
608  internet.Install(remoteHostContainer);
609 
610  // Create the Internet
611  PointToPointHelper p2ph;
612  p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
613  p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
614  p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.001)));
615  NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
616  Ipv4AddressHelper ipv4h;
617  ipv4h.SetBase("1.0.0.0", "255.0.0.0");
618  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
619  // interface 0 is localhost, 1 is the p2p device
620  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
621 
622  Ipv4StaticRoutingHelper ipv4RoutingHelper;
623  Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
624  ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
625  remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"), Ipv4Mask("255.0.0.0"), 1);
626 
627  // LogComponentDisableAll (LOG_LEVEL_ALL);
628  // LogComponentEnable ("LenaTestTdTbfqFfMacScheduler", LOG_LEVEL_ALL);
629 
630  lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisSpectrumPropagationLossModel"));
631 
632  // Create Nodes: eNodeB and UE
633  NodeContainer enbNodes;
634  NodeContainer ueNodes;
635  enbNodes.Create(1);
636  ueNodes.Create(m_nUser);
637 
638  // Install Mobility Model
640  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
641  mobility.Install(enbNodes);
642  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
643  mobility.Install(ueNodes);
644 
645  // Create Devices and install them in the Nodes (eNB and UE)
646  NetDeviceContainer enbDevs;
647  NetDeviceContainer ueDevs;
648  lteHelper->SetSchedulerType("ns3::TdTbfqFfMacScheduler");
649  enbDevs = lteHelper->InstallEnbDevice(enbNodes);
650  ueDevs = lteHelper->InstallUeDevice(ueNodes);
651 
652  Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get(0)->GetObject<LteEnbNetDevice>();
653  Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy();
654  enbPhy->SetAttribute("TxPower", DoubleValue(30.0));
655  enbPhy->SetAttribute("NoiseFigure", DoubleValue(5.0));
656 
657  // Set UEs' position and power
658  for (int i = 0; i < m_nUser; i++)
659  {
662  mm->SetPosition(Vector(m_dist.at(i), 0.0, 0.0));
663  Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get(i)->GetObject<LteUeNetDevice>();
664  Ptr<LteUePhy> uePhy = lteUeDev->GetPhy();
665  uePhy->SetAttribute("TxPower", DoubleValue(23.0));
666  uePhy->SetAttribute("NoiseFigure", DoubleValue(9.0));
667  }
668 
669  // Install the IP stack on the UEs
670  internet.Install(ueNodes);
671  Ipv4InterfaceContainer ueIpIface;
672  ueIpIface = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
673 
674  // Assign IP address to UEs
675  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
676  {
677  Ptr<Node> ueNode = ueNodes.Get(u);
678  // Set the default gateway for the UE
679  Ptr<Ipv4StaticRouting> ueStaticRouting =
680  ipv4RoutingHelper.GetStaticRouting(ueNode->GetObject<Ipv4>());
681  ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
682  }
683 
684  // Attach a UE to a eNB
685  lteHelper->Attach(ueDevs, enbDevs.Get(0));
686 
687  // Activate an EPS bearer on all UEs
688 
689  uint16_t mbrDl = 0;
690  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
691  {
692  mbrDl = mbrDl + m_packetSize.at(u);
693  }
694  mbrDl = mbrDl / ueNodes.GetN();
695 
696  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
697  {
698  Ptr<NetDevice> ueDevice = ueDevs.Get(u);
699  GbrQosInformation qos;
700  qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) *
701  8; // bit/s, considering IP, UDP, RLC, PDCP header size
702  qos.gbrUl = 0;
703  qos.mbrDl = qos.gbrDl;
704  qos.mbrUl = 0;
705 
706  EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
707  EpsBearer bearer(q, qos);
708  lteHelper->ActivateDedicatedEpsBearer(ueDevice, bearer, EpcTft::Default());
709  }
710 
711  // Install downlink and uplink applications
712  uint16_t dlPort = 1234;
713  uint16_t ulPort = 2000;
714  PacketSinkHelper dlPacketSinkHelper("ns3::UdpSocketFactory",
715  InetSocketAddress(Ipv4Address::GetAny(), dlPort));
718 
719  for (uint32_t u = 0; u < ueNodes.GetN(); ++u)
720  {
721  ++ulPort;
722  PacketSinkHelper ulPacketSinkHelper("ns3::UdpSocketFactory",
723  InetSocketAddress(Ipv4Address::GetAny(), ulPort));
724  serverApps.Add(ulPacketSinkHelper.Install(remoteHost)); // receive packets from UEs
725  serverApps.Add(
726  dlPacketSinkHelper.Install(ueNodes.Get(u))); // receive packets from remotehost
727 
728  UdpClientHelper dlClient(ueIpIface.GetAddress(u), dlPort); // uplink packets generator
729  dlClient.SetAttribute("Interval", TimeValue(MilliSeconds(m_interval)));
730  dlClient.SetAttribute("MaxPackets", UintegerValue(1000000));
731  dlClient.SetAttribute("PacketSize", UintegerValue(m_packetSize.at(u)));
732 
733  UdpClientHelper ulClient(remoteHostAddr, ulPort); // downlink packets generator
734  ulClient.SetAttribute("Interval", TimeValue(MilliSeconds(m_interval)));
735  ulClient.SetAttribute("MaxPackets", UintegerValue(1000000));
736  ulClient.SetAttribute("PacketSize", UintegerValue(m_packetSize.at(u)));
737 
738  clientApps.Add(dlClient.Install(remoteHost));
739  clientApps.Add(ulClient.Install(ueNodes.Get(u)));
740  }
741 
742  serverApps.Start(Seconds(0.001));
743  clientApps.Start(Seconds(0.040));
744 
745  double statsStartTime = 0.040; // need to allow for RRC connection establishment + SRS
746  double statsDuration = 1.0;
747  double tolerance = 0.1;
748  Simulator::Stop(Seconds(statsStartTime + statsDuration - 0.0001));
749 
750  lteHelper->EnableRlcTraces();
751  Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats();
752  rlcStats->SetAttribute("StartTime", TimeValue(Seconds(statsStartTime)));
753  rlcStats->SetAttribute("EpochDuration", TimeValue(Seconds(statsDuration)));
754 
755  Simulator::Run();
756 
761  NS_LOG_INFO("DL - Test with " << m_nUser << " user(s)");
762  std::vector<uint64_t> dlDataRxed;
763  for (int i = 0; i < m_nUser; i++)
764  {
765  // get the imsi
766  uint64_t imsi = ueDevs.Get(i)->GetObject<LteUeNetDevice>()->GetImsi();
767  // get the lcId
768  uint8_t lcId = 4;
769  dlDataRxed.push_back(rlcStats->GetDlRxData(imsi, lcId));
770  NS_LOG_INFO("\tUser " << i << " dist " << m_dist.at(i) << " imsi " << imsi << " bytes rxed "
771  << (double)dlDataRxed.at(i) << " thr "
772  << (double)dlDataRxed.at(i) / statsDuration << " ref "
773  << m_estThrTdTbfqDl.at(i));
774  }
775 
776  for (int i = 0; i < m_nUser; i++)
777  {
778  NS_TEST_ASSERT_MSG_EQ_TOL((double)dlDataRxed.at(i) / statsDuration,
779  m_estThrTdTbfqDl.at(i),
780  m_estThrTdTbfqDl.at(i) * tolerance,
781  " Unfair Throughput!");
782  }
783 
784  Simulator::Destroy();
785 }
This system test program creates different test cases with a single eNB and several UEs,...
double m_thrRefUl
the UL throughput reference
bool m_errorModelEnabled
whether the error model is enabled
double m_thrRefDl
the DL throughput reference
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_packetSize
the packet size in bytes
LenaTdTbfqFfMacSchedulerTestCase1(uint16_t nUser, double dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval, bool errorModelEnabled)
Constructor.
static std::string BuildNameString(uint16_t nUser, double dist)
Builds the test name string based on provided parameter values.
Lena TdTbfq Ff Mac Scheduler Test Case 2.
std::vector< uint16_t > m_packetSize
the packet size in bytes
std::vector< double > m_dist
the distance between nodes
uint16_t m_interval
the packet interval time in ms
bool m_errorModelEnabled
whether the error model is enabled
std::vector< uint32_t > m_estThrTdTbfqDl
the estimated downlink throughput
void DoRun() override
Implementation to actually run this TestCase.
LenaTdTbfqFfMacSchedulerTestCase2(std::vector< double > dist, std::vector< uint32_t > estThrTdTbfqDl, std::vector< uint16_t > packetSize, uint16_t interval, bool errorModelEnabled)
Constructor.
static std::string BuildNameString(uint16_t nUser, std::vector< double > dist)
Builds the test name string based on provided parameter values.
Test suite for TdTbfqFfMacScheduler test.
holds a vector of ns3::Application pointers.
Mobility model for which the current position does not change once it has been set and until it is se...
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
Hold variables of type enum.
Definition: enum.h:62
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
an Inet address class
aggregate IP/TCP/UDP functionality to existing Nodes.
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:42
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:80
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:257
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() 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:285
Ptr< RadioBearerStatsCalculator > GetRlcStats()
Definition: lte-helper.cc:1701
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:306
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:485
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:292
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:1039
void EnableRlcTraces()
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:1558
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:500
void EnableMacTraces()
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1659
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:1154
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.
Ptr< Node > GetPgwNode() const override
Get the PGW node.
Ipv4Address GetUeDefaultGatewayAddress() override
Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices) override
Assign IPv4 addresses to UE devices.
keep track of a set of node pointers.
uint32_t GetN() 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:204
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Definition: object.h:471
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:56
encapsulates test code
Definition: test.h:1060
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:301
std::string CreateTempDirFilename(std::string filename)
Construct the full path to a file in a temporary directory.
Definition: test.cc:438
std::string GetName() const
Definition: test.cc:373
A suite of tests to run.
Definition: test.h:1256
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:45
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:890
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#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:275
static LenaTestTdTbfqFfMacSchedulerSuite lenaTestTdTbfqFfMacSchedulerSuite
Static variable for test initialization.
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
Definition: data-rate.h:327
#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:337
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
serverApps
Definition: first.py:54
clientApps
Definition: first.py:64
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mobility
Definition: third.py:105
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
Packet size generated at the AP.