Measure the performance of different mac scheduler on LTE + EPC scenario

568 views
Skip to first unread message

Guido Iaquinti

unread,
Oct 4, 2012, 8:01:41 AM10/4/12
to ns-3-...@googlegroups.com

Hi, I've a problem with this scenario:





reproduced by this code (I hope! :P):

#include "ns3/lte-helper.h"
#include "ns3/epc-helper.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/internet-module.h"
#include "ns3/mobility-module.h"
#include "ns3/lte-module.h"
#include "ns3/applications-module.h"
#include "ns3/point-to-point-helper.h"
#include "ns3/config-store.h"
//#include "ns3/gtk-config-store.h"
#include "ns3/flow-monitor-helper.h"
//#include "eps-bearer.h"
using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("OurEpcModel");

int
main (int argc, char *argv[])
{

  uint16_t numberOfNodes = 2;
  uint16_t numberOfUENodes = 4;
  double simTime = 10.0;
  double distance = 60.0;

  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
  Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
  //lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
  lteHelper->SetEpcHelper (epcHelper);
 
  // Choose between different MacScheduler
  lteHelper->SetSchedulerType("ns3::PfFfMacScheduler");
  //lteHelper->SetSchedulerType("ns3::PssFfMacScheduler");
  //lteHelper->SetSchedulerType("ns3::TdTbfqFfMacScheduler");

  ConfigStore inputConfig;
  inputConfig.ConfigureDefaults();


  Ptr<Node> pgw = epcHelper->GetPgwNode ();

  // Create a single RemoteHost
  NodeContainer remoteHostContainer;
  remoteHostContainer.Create (1);
  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
  InternetStackHelper internet;
  internet.Install (remoteHostContainer);

  // Create the Internet
  PointToPointHelper p2ph;
  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
  Ipv4AddressHelper ipv4h;
  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
  // interface 0 is localhost, 1 is the p2p device
  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);

  Ipv4StaticRoutingHelper ipv4RoutingHelper;
  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);

  NodeContainer ueNodes;
  NodeContainer enbNodes;
  enbNodes.Create(numberOfNodes);
  ueNodes.Create(numberOfUENodes);

  // Install Mobility Model
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
  for (uint16_t i = 0; i < numberOfNodes; i++)
    {
      positionAlloc->Add (Vector(distance * i, 0, 0));
    }
  MobilityHelper mobility;
  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
  mobility.SetPositionAllocator(positionAlloc);
  mobility.Install(enbNodes);
  mobility.Install(ueNodes);

  // Install LTE Devices to the nodes
  NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice (enbNodes);
  NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);

  // Attach two UE per eNodeB
  lteHelper->Attach (ueLteDevs.Get(0), enbLteDevs.Get(0));
  lteHelper->Attach (ueLteDevs.Get(1), enbLteDevs.Get(0));
  lteHelper->Attach (ueLteDevs.Get(2), enbLteDevs.Get(1));
  lteHelper->Attach (ueLteDevs.Get(3), enbLteDevs.Get(1));
 
 
  // Install the IP stack on the UEs
  internet.Install (ueNodes);
  Ipv4InterfaceContainer ueIpIface;
  ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
 
 
  // Assign IP address to UEs, and install applications
  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
    {
      Ptr<Node> ueNode = ueNodes.Get (u);
      // Set the default gateway for the UE
      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
      ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
    }


  // SETTING DEL TFT

  Ptr<EpcTft> tftVIDEODOWN = Create<EpcTft> ();
  Ptr<EpcTft> tftVIDEOUP = Create<EpcTft> ();
  Ptr<EpcTft> tftHTTP = Create<EpcTft> ();
 
  
  EpcTft::PacketFilter PacketFilterB1;
  PacketFilterB1.localPortStart = 3478;
  PacketFilterB1.localPortEnd = 3478;
  tftVIDEODOWN->Add(PacketFilterB1);
 
  EpcTft::PacketFilter PacketFilterB2;
  PacketFilterB2.remotePortStart = 3478;
  PacketFilterB2.remotePortEnd = 3478;
  tftVIDEOUP->Add(PacketFilterB2);
 
  EpcTft::PacketFilter PacketFilterC;
  PacketFilterC.remotePortStart = 80;
  PacketFilterC.remotePortEnd = 80;
  tftHTTP->Add(PacketFilterC);
  PacketFilterC.localPortStart = 80;
  PacketFilterC.localPortEnd = 80;
  tftHTTP->Add(PacketFilterC);


  // Setting of Bearers
  enum EpsBearer::Qci q1 = EpsBearer::GBR_CONV_VOICE;
  enum EpsBearer::Qci q2 = EpsBearer::GBR_CONV_VIDEO;
  enum EpsBearer::Qci q3 = EpsBearer::GBR_NON_CONV_VIDEO;
  enum EpsBearer::Qci q4 = EpsBearer::GBR_CONV_VIDEO;
 
  EpsBearer bearer1 (q1);
  EpsBearer bearer2 (q2);
  EpsBearer bearer3 (q3);
  EpsBearer bearer4 (q4);
 

  lteHelper->ActivateEpsBearer (ueLteDevs.Get(0), bearer3, tftHTTP);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(1), bearer2, tftVIDEOUP);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(2), bearer4, tftVIDEODOWN);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(3), bearer1, EpcTft::Default ());


//Servers and clients connections

  UdpEchoServerHelper ServerHTTP (80);     
  ApplicationContainer serverAppsHTTP = ServerHTTP.Install (remoteHost);

  UdpEchoServerHelper ueServerVIDEO (3478);     
  ApplicationContainer serverAppsVIDEO = ueServerVIDEO.Install (ueNodes.Get(2));

// UE(0) client - RemoteHost Server
  UdpEchoClientHelper ClientHTTP (remoteHostAddr, 80);
  ClientHTTP.SetAttribute ("MaxPackets", UintegerValue (2));
  ClientHTTP.SetAttribute ("Interval", TimeValue (Seconds (0.01)));
  ClientHTTP.SetAttribute ("PacketSize", UintegerValue (1024));
  ApplicationContainer clientAppsHTTP = ClientHTTP.Install (ueNodes.Get (0));

// UE(1) client - UE(2) Server
  UdpEchoClientHelper ueClientVIDEO (ueIpIface.GetAddress(2), 3478);
  ueClientVIDEO.SetAttribute ("MaxPackets", UintegerValue (2));
  ueClientVIDEO.SetAttribute ("Interval", TimeValue (Seconds (0.01)));
  ueClientVIDEO.SetAttribute ("PacketSize", UintegerValue (1024));
  ApplicationContainer clientAppsVIDEO = ueClientVIDEO.Install (ueNodes.Get (1));

  serverAppsHTTP.Start (Seconds (0.01));
  serverAppsVIDEO.Start (Seconds (0.01));
 
  clientAppsHTTP.Start (Seconds (0.01));
  clientAppsVIDEO.Start (Seconds (0.01));
 
  lteHelper->EnableTraces ();
 
  // Tracing
  p2ph.EnablePcapAll("output");
  Ptr<FlowMonitor> flowmon;
  FlowMonitorHelper flowmonHelper;
  flowmon = flowmonHelper.Install (ueNodes);
  flowmon = flowmonHelper.Install (remoteHostContainer);
 
  Simulator::Stop(Seconds(simTime));
  Simulator::Run();

  flowmon->SerializeToXmlFile ("LTE", false, false);

  Simulator::Destroy();
  return 0;

}



The image scenario is very helpful and contain all of the information below, but there's a little "text" summary:

- 2 x eNB with 2 UE each
- 1 x remote host
- 1 x SGW/PGW

-  1x UDP HTTP flush (port 80) from UE(0) [ip 7.0.0.2] ----> RemoteHost [ip 1.0.0.2]
-  1x UDP VIDEO flush (port 3478) from UE(1) [ip 7.0.0.3] ----> UE(2) [ip 7.0.0.4]

I've set (I think it could not be the right way to do this) some TFTfilters to assign each packet on different bearers
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(0), bearer3, tftHTTP);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(1), bearer2, tftVIDEOUP);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(2), bearer4, tftVIDEODOWN);
  lteHelper->ActivateEpsBearer (ueLteDevs.Get(3), bearer1, EpcTft::Default ());

and with this simple scenario it works. But when I add another UDP (VOIP) flush from UE(3) [ip 7.0.0.5] ---> RemoteHost [ip 1.0.0.2] the VIDEO packets (between UE(1) and UE(2)) are strangely dropped.

So: What is the correct way to add this VOIP flush to my current scenario?

I'm improving this scenario to test the performance with different mac scheduler. Can you provide suggestion to do that? Is my code suitable for it?

Many thanks for your help

Guido

Alice Rizk

unread,
Apr 9, 2015, 1:13:44 PM4/9/15
to ns-3-...@googlegroups.com, guido.i...@gmail.com, alice...@hotmail.com
hey,

does ur script writen above test the effect of changing the QCI EpcBearer values between GBR_CONV_VOICE, GBR_CONV_VIDEO..... ??


Reply all
Reply to author
Forward
0 new messages