OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanV
alue (false)); | 267 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanV
alue (false)); |
268 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanV
alue (false)); | 268 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanV
alue (false)); |
269 } | 269 } |
270 | 270 |
271 Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true)); | 271 Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true)); |
272 | 272 |
273 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); | 273 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
274 Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ()
; | 274 Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ()
; |
275 lteHelper->SetEpcHelper (epcHelper); | 275 lteHelper->SetEpcHelper (epcHelper); |
276 | 276 |
277 //LogComponentEnable ("FdTbfqFfMacScheduler", LOG_DEBUG); | 277 #if 0 |
| 278 LogComponentEnable ("FdTbfqFfMacScheduler", LOG_DEBUG); |
| 279 #endif |
278 | 280 |
279 Ptr<Node> pgw = epcHelper->GetPgwNode (); | 281 Ptr<Node> pgw = epcHelper->GetPgwNode (); |
280 | 282 |
281 // Create a single RemoteHost | 283 // Create a single RemoteHost |
282 NodeContainer remoteHostContainer; | 284 NodeContainer remoteHostContainer; |
283 remoteHostContainer.Create (1); | 285 remoteHostContainer.Create (1); |
284 Ptr<Node> remoteHost = remoteHostContainer.Get (0); | 286 Ptr<Node> remoteHost = remoteHostContainer.Get (0); |
285 InternetStackHelper internet; | 287 InternetStackHelper internet; |
286 internet.Install (remoteHostContainer); | 288 internet.Install (remoteHostContainer); |
287 | 289 |
(...skipping 13 matching lines...) Expand all Loading... |
301 Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRo
uting (remoteHost->GetObject<Ipv4> ()); | 303 Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRo
uting (remoteHost->GetObject<Ipv4> ()); |
302 remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask
("255.0.0.0"), 1); | 304 remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask
("255.0.0.0"), 1); |
303 | 305 |
304 //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010))
; | 306 //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010))
; |
305 //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); | 307 //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); |
306 //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanVal
ue (false)); | 308 //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanVal
ue (false)); |
307 //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanVal
ue (false)); | 309 //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanVal
ue (false)); |
308 | 310 |
309 //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteH
elper::RLC_UM_ALWAYS)); | 311 //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteH
elper::RLC_UM_ALWAYS)); |
310 | 312 |
311 // LogComponentDisableAll (LOG_LEVEL_ALL); | 313 #if 0 |
312 //LogComponentEnable ("LenaTestFdTbfqFfMacScheduler", LOG_LEVEL_ALL); | 314 LogComponentDisableAll (LOG_LEVEL_ALL); |
313 | 315 LogComponentEnable ("LenaTestFdTbfqFfMacScheduler", LOG_LEVEL_ALL); |
| 316 #endif |
| 317 |
314 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); | 318 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); |
315 | 319 |
316 // Create Nodes: eNodeB and UE | 320 // Create Nodes: eNodeB and UE |
317 NodeContainer enbNodes; | 321 NodeContainer enbNodes; |
318 NodeContainer ueNodes; | 322 NodeContainer ueNodes; |
319 enbNodes.Create (1); | 323 enbNodes.Create (1); |
320 ueNodes.Create (m_nUser); | 324 ueNodes.Create (m_nUser); |
321 | 325 |
322 // Install Mobility Model | 326 // Install Mobility Model |
323 MobilityHelper mobility; | 327 MobilityHelper mobility; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 478 } |
475 | 479 |
476 | 480 |
477 | 481 |
478 // --------------- T E S T - C A S E # 2 ------------------------------ | 482 // --------------- T E S T - C A S E # 2 ------------------------------ |
479 | 483 |
480 | 484 |
481 std::string· | 485 std::string· |
482 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) | 486 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) |
483 { | 487 { |
| 488 NS_UNUSED(nUser); |
484 std::ostringstream oss; | 489 std::ostringstream oss; |
485 oss << "distances (m) = [ " ; | 490 oss << "distances (m) = [ " ; |
486 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) | 491 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) |
487 { | 492 { |
488 oss << *it << " "; | 493 oss << *it << " "; |
489 } | 494 } |
490 oss << "]"; | 495 oss << "]"; |
491 return oss.str (); | 496 return oss.str (); |
492 } | 497 } |
493 | 498 |
494 | 499 |
495 LenaFdTbfqFfMacSchedulerTestCase2::LenaFdTbfqFfMacSchedulerTestCase2 (std::vecto
r<double> dist, std::vector<uint32_t> estThrFdTbfqDl, std::vector<uint16_t> pack
etSize, uint16_t interval,bool errorModelEnabled) | 500 LenaFdTbfqFfMacSchedulerTestCase2::LenaFdTbfqFfMacSchedulerTestCase2 (std::vecto
r<double> dist, std::vector<uint32_t> estThrFdTbfqDl, std::vector<uint16_t> pack
etSize, uint16_t interval,bool errorModelEnabled) |
496 : TestCase (BuildNameString (dist.size (), dist)), | 501 : TestCase (BuildNameString (static_cast<uint16_t>(dist.size ()), dist)), |
497 m_nUser (dist.size ()), | 502 m_nUser (static_cast<uint16_t>(dist.size ())), |
498 m_dist (dist), | 503 m_dist (dist), |
499 m_packetSize (packetSize), | 504 m_packetSize (packetSize), |
500 m_interval (interval), | 505 m_interval (interval), |
501 m_estThrFdTbfqDl (estThrFdTbfqDl), | 506 m_estThrFdTbfqDl (estThrFdTbfqDl), |
502 m_errorModelEnabled (errorModelEnabled) | 507 m_errorModelEnabled (errorModelEnabled) |
503 { | 508 { |
504 } | 509 } |
505 | 510 |
506 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () | 511 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () |
507 { | 512 { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 // Attach a UE to a eNB | 613 // Attach a UE to a eNB |
609 lteHelper->Attach (ueDevs, enbDevs.Get (0)); | 614 lteHelper->Attach (ueDevs, enbDevs.Get (0)); |
610 | 615 |
611 // Activate an EPS bearer on all UEs | 616 // Activate an EPS bearer on all UEs |
612 | 617 |
613 uint16_t mbrDl = 0; | 618 uint16_t mbrDl = 0; |
614 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 619 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
615 { | 620 { |
616 mbrDl = mbrDl + m_packetSize.at (u); | 621 mbrDl = mbrDl + m_packetSize.at (u); |
617 } | 622 } |
618 mbrDl = mbrDl / ueNodes.GetN (); | 623 mbrDl = static_cast<uint16_t>(mbrDl / ueNodes.GetN ()); |
619 | 624 |
620 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 625 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
621 { | 626 { |
622 Ptr<NetDevice> ueDevice = ueDevs.Get (u); | 627 Ptr<NetDevice> ueDevice = ueDevs.Get (u); |
623 GbrQosInformation qos; | 628 GbrQosInformation qos; |
624 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size | 629 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size |
625 qos.gbrUl = 0; | 630 qos.gbrUl = 0; |
626 qos.mbrDl = qos.gbrDl; | 631 qos.mbrDl = qos.gbrDl; |
627 qos.mbrUl = 0; | 632 qos.mbrUl = 0; |
628 ·· | 633 ·· |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 } | 698 } |
694 | 699 |
695 for (int i = 0; i < m_nUser; i++) | 700 for (int i = 0; i < m_nUser; i++) |
696 { | 701 { |
697 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrFdTbfqDl.at (i), m_estThrFdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; | 702 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrFdTbfqDl.at (i), m_estThrFdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; |
698 } | 703 } |
699 | 704 |
700 Simulator::Destroy (); | 705 Simulator::Destroy (); |
701 | 706 |
702 } | 707 } |
OLD | NEW |