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 13 matching lines...) Expand all Loading... |
303 Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRo
uting (remoteHost->GetObject<Ipv4> ()); | 301 Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRo
uting (remoteHost->GetObject<Ipv4> ()); |
304 remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask
("255.0.0.0"), 1); | 302 remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask
("255.0.0.0"), 1); |
305 | 303 |
306 //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010))
; | 304 //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010))
; |
307 //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); | 305 //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); |
308 //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanVal
ue (false)); | 306 //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanVal
ue (false)); |
309 //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanVal
ue (false)); | 307 //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanVal
ue (false)); |
310 | 308 |
311 //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteH
elper::RLC_UM_ALWAYS)); | 309 //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteH
elper::RLC_UM_ALWAYS)); |
312 | 310 |
313 #if 0 | 311 // LogComponentDisableAll (LOG_LEVEL_ALL); |
314 LogComponentDisableAll (LOG_LEVEL_ALL); | 312 //LogComponentEnable ("LenaTestFdTbfqFfMacScheduler", LOG_LEVEL_ALL); |
315 LogComponentEnable ("LenaTestFdTbfqFfMacScheduler", LOG_LEVEL_ALL); | 313 |
316 #endif | |
317 | |
318 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); | 314 lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumProp
agationLossModel")); |
319 | 315 |
320 // Create Nodes: eNodeB and UE | 316 // Create Nodes: eNodeB and UE |
321 NodeContainer enbNodes; | 317 NodeContainer enbNodes; |
322 NodeContainer ueNodes; | 318 NodeContainer ueNodes; |
323 enbNodes.Create (1); | 319 enbNodes.Create (1); |
324 ueNodes.Create (m_nUser); | 320 ueNodes.Create (m_nUser); |
325 | 321 |
326 // Install Mobility Model | 322 // Install Mobility Model |
327 MobilityHelper mobility; | 323 MobilityHelper mobility; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } | 474 } |
479 | 475 |
480 | 476 |
481 | 477 |
482 // --------------- T E S T - C A S E # 2 ------------------------------ | 478 // --------------- T E S T - C A S E # 2 ------------------------------ |
483 | 479 |
484 | 480 |
485 std::string· | 481 std::string· |
486 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) | 482 LenaFdTbfqFfMacSchedulerTestCase2::BuildNameString (uint16_t nUser, std::vector<
double> dist) |
487 { | 483 { |
488 NS_UNUSED(nUser); | 484 NS_UNUSED (nUser); |
489 std::ostringstream oss; | 485 std::ostringstream oss; |
490 oss << "distances (m) = [ " ; | 486 oss << "distances (m) = [ " ; |
491 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
) |
492 { | 488 { |
493 oss << *it << " "; | 489 oss << *it << " "; |
494 } | 490 } |
495 oss << "]"; | 491 oss << "]"; |
496 return oss.str (); | 492 return oss.str (); |
497 } | 493 } |
498 | 494 |
499 | 495 |
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 LenaFdTbfqFfMacSchedulerTestCase2::LenaFdTbfqFfMacSchedulerTestCase2 (std::vecto
r<double> dist, std::vector<uint32_t> estThrFdTbfqDl, std::vector<uint16_t> pack
etSize, uint16_t interval,bool errorModelEnabled) |
501 : TestCase (BuildNameString (static_cast<uint16_t>(dist.size ()), dist)), | 497 : TestCase (BuildNameString (static_cast<uint16_t> (dist.size ()), dist)), |
502 m_nUser (static_cast<uint16_t>(dist.size ())), | 498 m_nUser (static_cast<uint16_t> (dist.size ())), |
503 m_dist (dist), | 499 m_dist (dist), |
504 m_packetSize (packetSize), | 500 m_packetSize (packetSize), |
505 m_interval (interval), | 501 m_interval (interval), |
506 m_estThrFdTbfqDl (estThrFdTbfqDl), | 502 m_estThrFdTbfqDl (estThrFdTbfqDl), |
507 m_errorModelEnabled (errorModelEnabled) | 503 m_errorModelEnabled (errorModelEnabled) |
508 { | 504 { |
509 } | 505 } |
510 | 506 |
511 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () | 507 LenaFdTbfqFfMacSchedulerTestCase2::~LenaFdTbfqFfMacSchedulerTestCase2 () |
512 { | 508 { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // Attach a UE to a eNB | 609 // Attach a UE to a eNB |
614 lteHelper->Attach (ueDevs, enbDevs.Get (0)); | 610 lteHelper->Attach (ueDevs, enbDevs.Get (0)); |
615 | 611 |
616 // Activate an EPS bearer on all UEs | 612 // Activate an EPS bearer on all UEs |
617 | 613 |
618 uint16_t mbrDl = 0; | 614 uint16_t mbrDl = 0; |
619 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 615 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
620 { | 616 { |
621 mbrDl = mbrDl + m_packetSize.at (u); | 617 mbrDl = mbrDl + m_packetSize.at (u); |
622 } | 618 } |
623 mbrDl = static_cast<uint16_t>(mbrDl / ueNodes.GetN ()); | 619 mbrDl = static_cast<uint16_t> (mbrDl / ueNodes.GetN ()); |
624 | 620 |
625 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 621 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
626 { | 622 { |
627 Ptr<NetDevice> ueDevice = ueDevs.Get (u); | 623 Ptr<NetDevice> ueDevice = ueDevs.Get (u); |
628 GbrQosInformation qos; | 624 GbrQosInformation qos; |
629 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 |
630 qos.gbrUl = 0; | 626 qos.gbrUl = 0; |
631 qos.mbrDl = qos.gbrDl; | 627 qos.mbrDl = qos.gbrDl; |
632 qos.mbrUl = 0; | 628 qos.mbrUl = 0; |
633 ·· | 629 ·· |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 } | 694 } |
699 | 695 |
700 for (int i = 0; i < m_nUser; i++) | 696 for (int i = 0; i < m_nUser; i++) |
701 { | 697 { |
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 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrFdTbfqDl.at (i), m_estThrFdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; |
703 } | 699 } |
704 | 700 |
705 Simulator::Destroy (); | 701 Simulator::Destroy (); |
706 | 702 |
707 } | 703 } |
LEFT | RIGHT |