error: ‘class ns3::LteHelper’ has no member named ‘ActivateEpsBearer’

1,739 views
Skip to first unread message

Dmitry Zvikhachevskiy

unread,
Feb 9, 2013, 9:02:09 AM2/9/13
to ns-3-...@googlegroups.com
Hello,

after simulation I got this result.
I really do not understand how i can fix it.
anyone knows?

thanks

dmitry@dmitry-OptiPlex-990:~/lena$ ./waf --run scratch/lena-simple-epc
Waf: Entering directory `/home/dmitry/lena/build'
[ 736/1872] cxx: scratch/lena-simple-epc.cc -> build/scratch/lena-simple-epc.cc.2.o
../scratch/lena-simple-epc.cc: In function ‘int main(int, char**)’:
../scratch/lena-simple-epc.cc:135:14: error: ‘class ns3::LteHelper’ has no member named ‘ActivateEpsBearer’
../scratch/lena-simple-epc.cc:200:62: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]
../scratch/lena-simple-epc.cc:207:62: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/dmitry/lena/build'

Zoraze Ali

unread,
Feb 9, 2013, 9:36:31 AM2/9/13
to ns-3-...@googlegroups.com
Hi ,

which simulator are you using ns3.16 or lena?

Regards,
Zoraze

Dmitry Zvikhachevskiy

unread,
Feb 9, 2013, 9:47:05 AM2/9/13
to ns-3-...@googlegroups.com
Lena


суббота, 9 февраля 2013 г., 14:36:31 UTC пользователь Zoraze Ali написал:

Zoraze Ali

unread,
Feb 9, 2013, 10:02:37 AM2/9/13
to ns-3-...@googlegroups.com
Ok then , so here is the thing . ActivateEpsBearer is not the part of LTEHELPER anymore, in LENA when you attach ues to enb by default it will activate the default Eps bearer ( see Attach function implementation in file lte-helper.cc in lena) if you are using EPC. 

so if i am not wrong you are running ns code on Lena , you do not need to activate Eps Bearer yourself anymore . And if you wish to activate any certain type of Bearer then see the function LteHelper::ActivateDedicatedEpsBearer .

for more information see the Lena examples in lte module .

Regards,
Zoraze

Dmitry Zvikhachevskiy

unread,
Feb 9, 2013, 10:07:05 AM2/9/13
to ns-3-...@googlegroups.com
the code is - .

it is wrong?

#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/flow-monitor-module.h"
//#include "ns3/gtk-config-store.h"

using namespace ns3;

/**
 * Sample simulation script for LTE+EPC. It instantiates several eNodeB,
 * attaches one UE per eNodeB starts a flow for each UE to  and from a remote host.
 * It also  starts yet another flow between each UE pair.
 */
NS_LOG_COMPONENT_DEFINE ("EpcFirstExample");
int
main (int argc, char *argv[])
{

  uint16_t numberOfNodes = 1;
  double simTime = 5.0;
  double distance = 60.0;
  double interPacketInterval = 100;

  // Command line arguments
  CommandLine cmd;
  cmd.AddValue("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes);
  cmd.AddValue("simTime", "Total duration of the simulation [s])", simTime);
  cmd.AddValue("distance", "Distance between eNBs [m]", distance);
  cmd.AddValue("interPacketInterval", "Inter packet interval [ms])", interPacketInterval);
  cmd.Parse(argc, argv);

  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
  Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
  lteHelper->SetEpcHelper (epcHelper);
  lteHelper->SetSchedulerType("ns3::RrFfMacScheduler");

  ConfigStore inputConfig;
  inputConfig.ConfigureDefaults();

  // parse again so you can override default values from the command line
  cmd.Parse(argc, argv);

  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(numberOfNodes);

  // 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 one UE per eNodeB
  for (uint16_t i = 0; i < numberOfNodes; i++)
      {
        lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(i));
      }

  // 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);
    }
  lteHelper->ActivateEpsBearer (ueLteDevs, EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), EpcTft::Default ());


  // Install and start applications on UEs and remote host
  uint16_t dlPort = 1234;
  uint16_t ulPort = 2000;
  uint16_t otherPort = 3000;
  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
  PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
  ApplicationContainer clientApps;
  ApplicationContainer serverApps;
  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
    {
      ++ulPort;
      ++otherPort;
      serverApps.Add (dlPacketSinkHelper.Install (ueNodes.Get(u)));
      serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
      serverApps.Add (packetSinkHelper.Install (ueNodes.Get(u)));

      UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort);
      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));

      UdpClientHelper ulClient (remoteHostAddr, ulPort);
      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));

      UdpClientHelper client (ueIpIface.GetAddress (u), otherPort);
      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
      client.SetAttribute ("MaxPackets", UintegerValue(1000000));

      clientApps.Add (dlClient.Install (remoteHost));
      clientApps.Add (ulClient.Install (ueNodes.Get(u)));
      if (u+1 < ueNodes.GetN ())
        {
          clientApps.Add (client.Install (ueNodes.Get(u+1)));
        }
      else
        {
          clientApps.Add (client.Install (ueNodes.Get(0)));
        }
    }
  serverApps.Start (Seconds (0.01));
  clientApps.Start (Seconds (0.01));
//  lteHelper->EnableTraces ();
  // Uncomment to enable PCAP tracing
  //p2ph.EnablePcapAll("lena-epc-first");

  FlowMonitorHelper flowmon;
  Ptr<FlowMonitor> monitor;
  monitor = flowmon.Install(ueNodes);
//  monitor = flowmon.Install(enbNodes);
  monitor = flowmon.Install(remoteHost);

  Simulator::Stop(Seconds(simTime));
  Simulator::Run();

  monitor->CheckForLostPackets ();

  Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier> (flowmon.GetClassifier ());
  std::map<FlowId, FlowMonitor::FlowStats> stats = monitor->GetFlowStats ();
  for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin (); i != stats.end (); ++i)
    {
      Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow (i->first);
      if (t.sourceAddress=="1.0.0.2" & t.destinationAddress=="7.0.0.2" )
      {
          NS_LOG_DEBUG ("Flow " << i->first  << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")");
          if (i->second.rxPackets > 0){
              std::cout <<"Delay Down = " << i->second.delaySum.GetSeconds() / i->second.rxPackets << "\n";
          }
      }
      if (t.sourceAddress=="7.0.0.2" & t.destinationAddress=="1.0.0.2" )
      {
          NS_LOG_DEBUG ("Flow " << i->first  << " (" << t.sourceAddress << " -> " << t.destinationAddress << ")");
          if (i->second.rxPackets > 0){
              std::cout <<"Delay Up = " << i->second.delaySum.GetSeconds() / i->second.rxPackets <<"\n";
          }
      }
    }


  /*GtkConfigStore config;
  config.ConfigureAttributes();*/
//  monitor->SerializeToXmlFile("EPC_test.flowmon", true, true);

  Simulator::Destroy();
  return 0;

}



суббота, 9 февраля 2013 г., 15:02:37 UTC пользователь Zoraze Ali написал:

Zoraze Ali

unread,
Feb 9, 2013, 4:51:53 PM2/9/13
to ns-3-...@googlegroups.com
Hi

Its not according to lena requirements. ok do the following

comment this line in code  lteHelper->ActivateEpsBearer (ueLteDevs, EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), EpcTft::Default ());

and attach ues after // Assign IP address to UEs, and install applications ( i mean after the for loop of that ).

and yeah please see example lena-simple-epc.cc of lte module of lena and compare it with your code , you will see the difference.

Regards,
Zoraze

Dmitry Zvikhachevskiy

unread,
Feb 10, 2013, 8:13:50 PM2/10/13
to ns-3-...@googlegroups.com
thanks, i changed everything .
but i have this error

../scratch/1.cc: In function ‘int main(int, char**)’:
../scratch/1.cc:200:62: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]
../scratch/1.cc:207:62: error: suggest parentheses around comparison in operand of ‘&’ [-Werror=parentheses]

cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/dmitry/lena/build'

lena-simple-epc.cc in an lena/examples is working.
I am traing to get throughput as a result. I am using flowMonitor. after adding flowMonitor it is not working.
can you halp me?


it is lena-simple-epc.cc script after adding flowMonitor


#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/lte-module.h"
#include "ns3/config-store.h"
#include "ns3/radio-bearer-stats-calculator.h"
#include "ns3/lte-global-pathloss-database.h"
#include "ns3/flow-monitor-module.h"
#include <iomanip>
#include <string>
#include <ns3/flow-monitor-helper.h>
#include <ns3/log.h>
#include <signal.h>

using namespace ns3;


NS_LOG_COMPONENT_DEFINE ("LenaPathlossTraces");




int main (int argc, char *argv[])
{
  double enbDist = 20.0;
  double radius = 10.0;
  uint32_t numUes = 1;
double simTime = 5.0;

  CommandLine cmd;
  cmd.AddValue ("enbDist", "distance between the two eNBs", enbDist);
  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
  cmd.AddValue ("numUes", "how many UEs are attached to each eNB", numUes);
  cmd.Parse (argc, argv);

  ConfigStore inputConfig;
  inputConfig.ConfigureDefaults ();


  // parse again so you can override default values from the command line
  cmd.Parse (argc, argv);

  // determine the string tag that identifies this simulation run
  // this tag is then appended to all filenames

  IntegerValue runValue;
  GlobalValue::GetValueByName ("RngRun", runValue);

  std::ostringstream tag;
  tag  << "_enbDist" << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
       << "_radius"  << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
       << "_numUes"  << std::setw (3) << std::setfill ('0')  << numUes
       << "_rngRun"  << std::setw (3) << std::setfill ('0')  << runValue.Get () ;


  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();


  // NOTE: the PropagationLoss trace source of the SpectrumChannel
  // works only for single-frequency path loss model. 
  // e.g., it will work with the following models:
  // ns3::FriisPropagationLossModel,
  // ns3::TwoRayGroundPropagationLossModel,
  // ns3::LogDistancePropagationLossModel,
  // ns3::ThreeLogDistancePropagationLossModel,
  // ns3::NakagamiPropagationLossModel
  // ns3::BuildingsPropagationLossModel
  // etc.
  // but it WON'T work if you ONLY use SpectrumPropagationLossModels such as:
  // ns3::FriisSpectrumPropagationLossModel
  // ns3::ConstantSpectrumPropagationLossModel
  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::Cost231PropagationLossModel"));
 

  // Create Nodes: eNodeB and UE
  NodeContainer enbNodes;
  NodeContainer ueNodes1, ueNodes2;
  enbNodes.Create (2);
  ueNodes1.Create (numUes);
  ueNodes2.Create (numUes);

  // Position of eNBs

  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
  positionAlloc->Add (Vector (enbDist, 0.0, 0.0));
  MobilityHelper enbMobility;
  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  enbMobility.SetPositionAllocator (positionAlloc);
  enbMobility.Install (enbNodes);

  // Position of UEs attached to eNB 1
  MobilityHelper ue1mobility;
  ue1mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
                                    "X", DoubleValue (0.0),
                                    "Y", DoubleValue (0.0),
                                    "rho", DoubleValue (radius));
  ue1mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  ue1mobility.Install (ueNodes1);

  // Position of UEs attached to eNB 2
  MobilityHelper ue2mobility;
  ue2mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
                                    "X", DoubleValue (enbDist),
                                    "Y", DoubleValue (0.0),
                                    "rho", DoubleValue (radius));
  ue2mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  ue2mobility.Install (ueNodes2);

  // Create Devices and install them in the Nodes (eNB and UE)
  NetDeviceContainer enbDevs;
  NetDeviceContainer ueDevs1;
  NetDeviceContainer ueDevs2;
  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);

  // Attach UEs to a eNB
  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
  lteHelper->Attach (ueDevs2, enbDevs.Get (1));

  // Activate an EPS bearer on all UEs
  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
  EpsBearer bearer (q);
  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);

  Simulator::Stop (Seconds (0.5));

  // Insert RLC Performance Calculator
  std::string dlOutFname = "DlRlcStats";
  dlOutFname.append (tag.str ());
  std::string ulOutFname = "UlRlcStats";
  ulOutFname.append (tag.str ());

  lteHelper->EnableMacTraces ();
  lteHelper->EnableRlcTraces ();



  // keep track of all path loss values in two centralized objects
  DownlinkLteGlobalPathlossDatabase dlPathlossDb;
  UplinkLteGlobalPathlossDatabase ulPathlossDb;
  // we rely on the fact that LteHelper creates the DL channel object first, then the UL channel object,
  // hence the former will have index 0 and the latter 1
  Config::Connect ("/ChannelList/0/PathLoss",
                   MakeCallback (&DownlinkLteGlobalPathlossDatabase::UpdatePathloss, &dlPathlossDb));
  Config::Connect ("/ChannelList/1/PathLoss",
                    MakeCallback (&UplinkLteGlobalPathlossDatabase::UpdatePathloss, &ulPathlossDb));
FlowMonitorHelper flowmon;
 Ptr<FlowMonitor> Monitor;
 Monitor = flowmon.InstallAll();


  Monitor->SetAttribute("DelayBinWidth", DoubleValue (0.001));

  Monitor->SetAttribute("JitterBinWidth", DoubleValue (0.001));

  Monitor->SetAttribute("PacketSizeBinWidth", DoubleValue (20));

  Monitor->SerializeToXmlFile("results.xml", true, true);

Simulator::Stop(Seconds(simTime));
  Simulator::Run ();
//string xmlFileName = "flow-monitor-output.xml"
Monitor->SerializeToXmlFile ("results.xml",false,false);

  // print the pathloss values at the end of the simulation
  std::cout << std::endl << "Downlink pathloss:" << std::endl;
  dlPathlossDb.Print ();
  std::cout << std::endl << "Uplink pathloss:" << std::endl;
  ulPathlossDb.Print ();


  Simulator::Destroy ();
  return 0;
}


error is -

Waf: Leaving directory `/home/dmitry/lena/build'
'build' finished successfully (3.899s)
Command ['/home/dmitry/lena/build/scratch/lena'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").



суббота, 9 февраля 2013 г., 21:51:53 UTC пользователь Zoraze Ali написал:

Iru

unread,
Jul 2, 2014, 2:53:15 AM7/2/14
to ns-3-...@googlegroups.com
Hello,

I'm sorry that I re-opened this discussion.

I need to establish two default bearers and one dedicated bearer. 
How can I achieve that ? I have the same problem that I cannot use the ActiveEpsBearer. 

P.S : I'm using the dce. 
Thanks in advance.

IRU

Konstantinos

unread,
Jul 2, 2014, 5:26:32 AM7/2/14
to ns-3-...@googlegroups.com
There are four methods in the LTE helper you can use for that purpose. 
Study the API.

void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer)
 Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.More...
 
void ActivateDataRadioBearer (PtrNetDevice > ueDevice, EpsBearer bearer)
 Activate a Data Radio Bearer for a simplified LTE-only simulation without EPC. More...
 
void ActivateDedicatedEpsBearer (NetDeviceContainer ueDevices, EpsBearer bearer, Ptr<EpcTft > tft)
 Activate a dedicated EPS bearer on a given set of UE devices. More...
void ActivateDedicatedEpsBearer (PtrNetDevice > ueDevice, EpsBearer bearer, Ptr<EpcTft > tft)
 Activate a dedicated EPS bearer on a given UE device. More...

Reply all
Reply to author
Forward
0 new messages