Error while trying to add the X2 Interface

232 views
Skip to first unread message

Umair Masood

unread,
Sep 25, 2013, 11:19:56 AM9/25/13
to ns-3-...@googlegroups.com
Hi.. I am getting a termination error while trying to add the X2 interface with signal SIGSEGV. Below is the code:#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/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-phy.h>
#include <ns3/ff-mac-common.h>
#include <ns3/lte-control-messages.h>
#include <ns3/lte-amc.h>
#include <ns3/lte-ue-phy-sap.h>
#include <ns3/lte-ue-cphy-sap.h>
#include <ns3/ptr.h>
#include <ns3/lte-amc.h>
#include <ns3/lte-ue-phy.h>
#include <ns3/phy-stats-calculator.h>
#include <ns3/mobility-building-info.h>
#include <ns3/buildings-propagation-loss-model.h>
#include <ns3/building.h>
#include <ns3/lte-enb-rrc.h>
#include <iomanip>
#include <string>
#include<ns3/epc-x2-header.h>
#include<ns3/epc-x2-sap.h>
#include </usr/include/c++/4.6/bits/stl_vector.h>

using namespace ns3;

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

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


// Create a LteHelper Object
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();

// Create Node Objects for eNB(s) and UEs
NodeContainer enbNodes;
enbNodes.Create (2);

NodeContainer ueNodes1,ueNodes2;
ueNodes1.Create(1);
ueNodes2.Create(1);

// Configure the Mobility model for the eNB(s)
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector(0.0,0.0,0.0));
positionAlloc->Add (Vector(100.0,0.0,0.0));
MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.SetPositionAllocator(positionAlloc);
mobility.Install(enbNodes);

//Position of Ue attached to eNB1
MobilityHelper ue1mobility;
ue1mobility.SetPositionAllocator("ns3::UniformDiscPositionAllocator", "X", DoubleValue(0.0), "Y", DoubleValue(0.0), "rho", DoubleValue(50.0)); 
ue1mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
ue1mobility.Install(ueNodes1);

MobilityHelper ue2mobility;
ue2mobility.SetPositionAllocator("ns3::UniformDiscPositionAllocator", "X", DoubleValue(100.0), "Y", DoubleValue(0.0), "rho", DoubleValue(50.0)); 
ue2mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
ue2mobility.Install(ueNodes2);


// Install an LTE protocol stack on the eNB(s)
NetDeviceContainer enbDevs;
enbDevs = lteHelper->InstallEnbDevice (enbNodes);

// Install an LTE protocol stack on the UEs
NetDeviceContainer ueDevs1, ueDevs2;
ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);

// Attach the Ues to an eNB.This will configure each UE according to the eNB configuration, and create an RRC connection between them
lteHelper->Attach (ueDevs1, enbDevs.Get(0));
lteHelper->Attach (ueDevs2, enbDevs.Get(1));



//Activate an EPS Bearer including te setup of the Radio Bearer between an eNB and its attached UE

enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
EpsBearer bearer (q);
lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);

//Add X2 interface between two eNBs
lteHelper->AddX2Interface (enbNodes);



// Set the stop time
Simulator::Stop (Seconds (0.05));
lteHelper->EnablePhyTraces();
lteHelper->EnableMacTraces();
lteHelper->EnableRlcTraces();
lteHelper->EnablePdcpTraces();


// Run the simulation
Simulator::Run();

// Cleanup and exit
Simulator::Destroy ();
return 0;
}

Actual Error : Waf: Entering directory `/home/mimoon/workspace/ns-allinone-3.18/ns-3.18/build'
Waf: Leaving directory `/home/mimoon/workspace/ns-allinone-3.18/ns-3.18/build'
'build' finished successfully (2.248s)
Command ['/home/mimoon/workspace/ns-allinone-3.18/ns-3.18/build/scratch/example'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

Please kindly help .

Konstantinos

unread,
Sep 25, 2013, 11:25:21 AM9/25/13
to ns-3-...@googlegroups.com
Hi Umair,

Please refrain from posting your code in plain text in your message, it makes it very difficult to follow.

The compiler give you an output that there is a segmentation error. 
Follow the command to run your scenario under debugger to find where the problem happens.

Also have a look at this

Regards,
K.

Umair Masood

unread,
Sep 25, 2013, 11:53:41 AM9/25/13
to ns-3-...@googlegroups.com
How do we add the code except for the plain text ? Is there any other way to make it look more like the eclispe ?

Konstantinos

unread,
Sep 25, 2013, 11:59:15 AM9/25/13
to ns-3-...@googlegroups.com
you can use http://pastebin.com/

But generally, do not paste complete code in the text, you can attach it as a file.
Only small code snippets should be inline the text.

Umair Masood

unread,
Sep 25, 2013, 12:16:43 PM9/25/13
to ns-3-...@googlegroups.com
Ok thanks , but I guess the insight debugger is no longer in use now since it has been replaced by gdb-doc. So I installed it, but I can't see any error msgs since it is a command line debugger without any graphical interface. Any comments about that?


On Wednesday, September 25, 2013 5:19:56 PM UTC+2, Umair Masood wrote:

Konstantinos

unread,
Sep 25, 2013, 12:21:35 PM9/25/13
to ns-3-...@googlegroups.com
You can search for tutorials online.

Umair Masood

unread,
Sep 25, 2013, 12:31:31 PM9/25/13
to ns-3-...@googlegroups.com
I find another debugger (ddd) with a graphical interface. It has found the problem, but it is quite difficult to fix it because it is in src/network/utils/data-rate.cc:185. and this piece of code is from ns-3 develops. There is no such SIGSEGV error if I remove the X2 interface , but when I add it , the error occurs.
The error is as follows:
Program received signal SIGSEGV , Segmentation fault.
0x00007fff12bc740 in ns3::DataRateValue::DataRateValue<this=0x7fffffffd0c0, value=...> at .. src/network/utils/date-rate.cc:185.
Any suggestions how to fix it ?


On Wednesday, September 25, 2013 5:19:56 PM UTC+2, Umair Masood wrote:

Nicola Baldo

unread,
Oct 17, 2013, 8:37:30 AM10/17/13
to ns-3-...@googlegroups.com
You're right, the EPC is needed to add an X2 interface.
FYI, I've just pushed to lena-dev changeset 440310f834b8 to make ns-3 abort with a meaningful error message in this case.

Umair Masood

unread,
Sep 27, 2013, 3:54:45 AM9/27/13
to ns-3-...@googlegroups.com
The problem is solved. Basically for X2  interface you need to Install the point to point devices in the Enbs and then connect them via point to point link. So, in brief for X2 interface EPC should be used.


On Wednesday, September 25, 2013 5:19:56 PM UTC+2, Umair Masood wrote:

Pakkhu

unread,
Jun 30, 2016, 5:56:47 PM6/30/16
to ns-3-users
Sir can u just help me out with this code. Because I am getting many errors. I have tried to solve it using epc and point to point helper. I have also used ActivateDedicatedEpsBearer because in case of EPC we cannot use ActivateDataRadioBearer. Please solve this problem as soon as possible.

Thanking you



 

Please kindly help .
Reply all
Reply to author
Forward
0 new messages