LEFT | RIGHT |
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 #if 0 | 277 //LogComponentEnable ("FdTbfqFfMacScheduler", LOG_DEBUG); |
278 LogComponentEnable ("FdTbfqFfMacScheduler", LOG_DEBUG); | |
279 #endif | |
280 | 278 |
281 Ptr<Node> pgw = epcHelper->GetPgwNode (); | 279 Ptr<Node> pgw = epcHelper->GetPgwNode (); |
282 | 280 |
283 // Create a single RemoteHost | 281 // Create a single RemoteHost |
284 NodeContainer remoteHostContainer; | 282 NodeContainer remoteHostContainer; |
285 remoteHostContainer.Create (1); | 283 remoteHostContainer.Create (1); |
286 Ptr<Node> remoteHost = remoteHostContainer.Get (0); | 284 Ptr<Node> remoteHost = remoteHostContainer.Get (0); |
287 InternetStackHelper internet; | 285 InternetStackHelper internet; |
288 internet.Install (remoteHostContainer); | 286 internet.Install (remoteHostContainer); |
289 | 287 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 474 } |
477 | 475 |
478 | 476 |
479 | 477 |
480 // --------------- T E S T - C A S E # 2 ------------------------------ | 478 // --------------- T E S T - C A S E # 2 ------------------------------ |
481 | 479 |
482 | 480 |
483 std::string· | 481 std::string· |
484 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) | 482 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) |
485 { | 483 { |
486 NS_UNUSED(nUser); | 484 NS_UNUSED (nUser); |
487 std::ostringstream oss; | 485 std::ostringstream oss; |
488 oss << "distances (m) = [ " ; | 486 oss << "distances (m) = [ " ; |
489 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) | 487 for (std::vector<double>::iterator it = dist.begin (); it != dist.end (); ++it
) |
490 { | 488 { |
491 oss << *it << " "; | 489 oss << *it << " "; |
492 } | 490 } |
493 oss << "]"; | 491 oss << "]"; |
494 return oss.str (); | 492 return oss.str (); |
495 } | 493 } |
496 | 494 |
497 | 495 |
498 LenaFdTbfqFfMacSchedulerTestCase2::LenaFdTbfqFfMacSchedulerTestCase2 (std::vecto
r<double> dist, std::vector<uint32_t> estThrFdTbfqDl, std::vector<uint16_t> pack
etSize, uint16_t interval,bool errorModelEnabled) | 496 LenaFdTbfqFfMacSchedulerTestCase2::LenaFdTbfqFfMacSchedulerTestCase2 (std::vecto
r<double> dist, std::vector<uint32_t> estThrFdTbfqDl, std::vector<uint16_t> pack
etSize, uint16_t interval,bool errorModelEnabled) |
499 : TestCase (BuildNameString (static_cast<uint16_t>(dist.size ()), dist)), | 497 : TestCase (BuildNameString (static_cast<uint16_t> (dist.size ()), dist)), |
500 m_nUser (static_cast<uint16_t>(dist.size ())), | 498 m_nUser (static_cast<uint16_t> (dist.size ())), |
501 m_dist (dist), | 499 m_dist (dist), |
502 m_packetSize (packetSize), | 500 m_packetSize (packetSize), |
503 m_interval (interval), | 501 m_interval (interval), |
504 m_estThrFdTbfqDl (estThrFdTbfqDl), | 502 m_estThrFdTbfqDl (estThrFdTbfqDl), |
505 m_errorModelEnabled (errorModelEnabled) | 503 m_errorModelEnabled (errorModelEnabled) |
506 { | 504 { |
507 } | 505 } |
508 | 506 |
509 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () | 507 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () |
510 { | 508 { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 // Attach a UE to a eNB | 609 // Attach a UE to a eNB |
612 lteHelper->Attach (ueDevs, enbDevs.Get (0)); | 610 lteHelper->Attach (ueDevs, enbDevs.Get (0)); |
613 | 611 |
614 // Activate an EPS bearer on all UEs | 612 // Activate an EPS bearer on all UEs |
615 | 613 |
616 uint16_t mbrDl = 0; | 614 uint16_t mbrDl = 0; |
617 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 615 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
618 { | 616 { |
619 mbrDl = mbrDl + m_packetSize.at (u); | 617 mbrDl = mbrDl + m_packetSize.at (u); |
620 } | 618 } |
621 mbrDl = static_cast<uint16_t>(mbrDl / ueNodes.GetN ()); | 619 mbrDl = static_cast<uint16_t> (mbrDl / ueNodes.GetN ()); |
622 | 620 |
623 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 621 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
624 { | 622 { |
625 Ptr<NetDevice> ueDevice = ueDevs.Get (u); | 623 Ptr<NetDevice> ueDevice = ueDevs.Get (u); |
626 GbrQosInformation qos; | 624 GbrQosInformation qos; |
627 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size | 625 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size |
628 qos.gbrUl = 0; | 626 qos.gbrUl = 0; |
629 qos.mbrDl = qos.gbrDl; | 627 qos.mbrDl = qos.gbrDl; |
630 qos.mbrUl = 0; | 628 qos.mbrUl = 0; |
631 ·· | 629 ·· |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 } | 694 } |
697 | 695 |
698 for (int i = 0; i < m_nUser; i++) | 696 for (int i = 0; i < m_nUser; i++) |
699 { | 697 { |
700 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrFdTbfqDl.at (i), m_estThrFdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; | 698 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrFdTbfqDl.at (i), m_estThrFdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; |
701 } | 699 } |
702 | 700 |
703 Simulator::Destroy (); | 701 Simulator::Destroy (); |
704 | 702 |
705 } | 703 } |
LEFT | RIGHT |