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 //LogComponentEnable ("TdTbfqFfMacScheduler", LOG_DEBUG); | 277 #if 0 |
| 278 LogComponentEnable ("TdTbfqFfMacScheduler", 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 ("LenaTestTdTbfqFfMacScheduler", LOG_LEVEL_ALL); | 314 LogComponentDisableAll (LOG_LEVEL_ALL); |
313 | 315 LogComponentEnable ("LenaTestTdTbfqFfMacScheduler", 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 { | 376 { |
373 Ptr<NetDevice> ueDevice = ueDevs.Get (u); | 377 Ptr<NetDevice> ueDevice = ueDevs.Get (u); |
374 GbrQosInformation qos; | 378 GbrQosInformation qos; |
375 qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) * 8; // bit/s, cons
idering IP, UDP, RLC, PDCP header size | 379 qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) * 8; // bit/s, cons
idering IP, UDP, RLC, PDCP header size |
376 qos.gbrUl = 0; | 380 qos.gbrUl = 0; |
377 qos.mbrDl = qos.gbrDl; | 381 qos.mbrDl = qos.gbrDl; |
378 qos.mbrUl = 0; | 382 qos.mbrUl = 0; |
379 ······ | 383 ······ |
380 enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; | 384 enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; |
381 EpsBearer bearer (q, qos); | 385 EpsBearer bearer (q, qos); |
382 lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default (
)); | 386 lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default (
)); |
383 } | 387 } |
384 | 388 |
385 // Install downlink and uplink applications | 389 // Install downlink and uplink applications |
386 uint16_t dlPort = 1234; | 390 uint16_t dlPort = 1234; |
387 uint16_t ulPort = 2000; | 391 uint16_t ulPort = 2000; |
388 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), dlPort)); | 392 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), dlPort)); |
389 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), ulPort)); | |
390 ApplicationContainer clientApps; | 393 ApplicationContainer clientApps; |
391 ApplicationContainer serverApps; | 394 ApplicationContainer serverApps; |
392 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive packets
from UEs | 395 |
393 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 396 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
394 { | 397 { |
395 ++ulPort; | 398 ++ulPort; |
| 399 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), ulPort)); |
| 400 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive pack
ets from UEs |
396 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive
packets from remotehost | 401 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive
packets from remotehost |
397 | 402 |
398 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink pac
kets generator | 403 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink pac
kets generator |
399 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); | 404 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); |
400 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 405 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
401 dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize)); | 406 dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize)); |
402 | 407 |
403 UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink p
ackets generator | 408 UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink p
ackets generator |
404 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); | 409 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); |
405 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 410 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 { | 625 { |
621 Ptr<NetDevice> ueDevice = ueDevs.Get (u); | 626 Ptr<NetDevice> ueDevice = ueDevs.Get (u); |
622 GbrQosInformation qos; | 627 GbrQosInformation qos; |
623 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size | 628 qos.gbrDl = (mbrDl + 32) * (1000 / m_interval) * 8; // bit/s, considering
IP, UDP, RLC, PDCP header size |
624 qos.gbrUl = 0; | 629 qos.gbrUl = 0; |
625 qos.mbrDl = qos.gbrDl; | 630 qos.mbrDl = qos.gbrDl; |
626 qos.mbrUl = 0; | 631 qos.mbrUl = 0; |
627 ·· | 632 ·· |
628 enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; | 633 enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; |
629 EpsBearer bearer (q, qos); | 634 EpsBearer bearer (q, qos); |
630 lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default (
)); | 635 lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default (
)); |
631 } | 636 } |
632 | 637 |
633 | 638 |
634 // Install downlink and uplink applications | 639 // Install downlink and uplink applications |
635 uint16_t dlPort = 1234; | 640 uint16_t dlPort = 1234; |
636 uint16_t ulPort = 2000; | 641 uint16_t ulPort = 2000; |
637 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), dlPort)); | 642 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), dlPort)); |
638 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddres
s (Ipv4Address::GetAny (), ulPort)); | |
639 ApplicationContainer clientApps; | 643 ApplicationContainer clientApps; |
640 ApplicationContainer serverApps; | 644 ApplicationContainer serverApps; |
641 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive packets
from UEs | 645 |
642 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) | 646 for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
643 { | 647 { |
644 ++ulPort; | 648 ++ulPort; |
| 649 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAd
dress (Ipv4Address::GetAny (), ulPort)); |
| 650 serverApps.Add (ulPacketSinkHelper.Install (remoteHost)); // receive pack
ets from UEs |
645 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive
packets from remotehost | 651 serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get (u))); // receive
packets from remotehost |
646 | 652 |
647 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink pac
kets generator | 653 UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort); // uplink pac
kets generator |
648 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); | 654 dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); |
649 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 655 dlClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
650 dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize.at (u))); | 656 dlClient.SetAttribute ("PacketSize", UintegerValue (m_packetSize.at (u))); |
651 | 657 |
652 UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink p
ackets generator | 658 UdpClientHelper ulClient (remoteHostAddr, ulPort); // downlink p
ackets generator |
653 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); | 659 ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds (m_interval))); |
654 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); | 660 ulClient.SetAttribute ("MaxPackets", UintegerValue (1000000)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 } | 697 } |
692 | 698 |
693 for (int i = 0; i < m_nUser; i++) | 699 for (int i = 0; i < m_nUser; i++) |
694 { | 700 { |
695 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrTdTbfqDl.at (i), m_estThrTdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; | 701 NS_TEST_ASSERT_MSG_EQ_TOL ((double)dlDataRxed.at (i) / statsDuration, m_es
tThrTdTbfqDl.at (i), m_estThrTdTbfqDl.at (i) * tolerance, " Unfair Throughput!")
; |
696 } | 702 } |
697 | 703 |
698 Simulator::Destroy (); | 704 Simulator::Destroy (); |
699 | 705 |
700 } | 706 } |
LEFT | RIGHT |