NS-3 LTE / UE Handover when using different frequency for each eNodeB sector

2,417 views
Skip to first unread message

Mehdi

unread,
Nov 6, 2013, 11:32:50 AM11/6/13
to ns-3-...@googlegroups.com
Hello,
I noticed a strange behaviour during handovers and I want to know if the problem come from my scenario or if it is a limitation of the LTE library implementation.
I set up N eNodeB on a grid, and for each eNodeB I uses 3 antennas (actually I create 3 eNodeB at each point and rotate the antenna by 0, 120 and 240 degrees).
Then I add a UE that walk in a straight line in the grid.
When I use the same EARFCN for all eNodeB, the handover is done correctly and the UE is attached to the closest eNodeB at each instant.

The problem occurs when I use a different EARFCN for each sector.
In that case, the UE is not always attached to the closest eNodeB and I suspect that the handover is only done between sectors that share the same EARFCN.

My question is the following: is the handover algorithm only working for cells that have the same frequency ?
I tried to force the handover myself by calculating every 5 second the closest eNodeB and triggering the handover manually but the algorithm overrides my choice and switch back to the previous eNodeB.
In addition, during the brief amount of time that the UE is attached to the handpicked eNodeB, the throughtput is equal to 0, as if the transmission could not take place (even though the signal is supposed to be stronger !)

Thanks.

PS: I intentionally don't post any code. If needed I can create a simplified scenario to highlight the behaviour.

Mehdi

unread,
Nov 7, 2013, 5:00:43 AM11/7/13
to ns-3-...@googlegroups.com

Since there is still no answer, here is a simplified scenario (the code is attached to this post):
6 eNode B aligned along the X axis, separated by 250 meters, with isotropic antennas.
1 UE, initially attached to the eNode B n°1, that starts at (0, 200) and that moves at 50 kmph along the x-axis.
100 seconds simulation


When I run the script with the same frequency on all eNode B, the ouput is:
t = 25.00 s (25 %) *** Handover from 1 to 2
t = 46.25 s (46 %) *** Handover from 2 to 3
t = 61.50 s (61 %) *** Handover from 3 to 4
t = 84.25 s (84 %) *** Handover from 4 to 5
t = 100.00 s (100 %)
Simulation finished in 16.585 secs

When I run the script with 2 sets of frequency (EARFCN 0 on eNodeB 1,3,5 , EARFCN 50 on eNodeB 2,4,6), the output is:
t = 34.75 s (34 %) *** Handover from 1 to 3
t = 71.50 s (71 %) *** Handover from 3 to 5
t = 100.00 s (100 %)

To activate/desactivate multiple frequencies, just uncomment/comment the following lines (l. 156 to 159)
lteHelper->SetEnbDeviceAttribute("DlEarfcn",     UintegerValue ( (u%2)*50 ));
lteHelper->SetEnbDeviceAttribute("UlEarfcn",     UintegerValue ( (u%2)*50 + 18000 ));
lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (25));
lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (25));


Any answers are welcome. Thank you.

Here is the code of the scenario (file is attached) :
#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/log.h"
#include <sys/timeb.h>
#include <iostream>
#include <ns3/internet-trace-helper.h>

using namespace ns3;
using namespace std;

double simulationTime = 100; // seconds

// Return system time in milliseconds
int getMilliCount(){
    timeb tb;
    ftime(&tb);
    int nCount = tb.millitm + (tb.time & 0xfffff) * 1000;
    return nCount;
}

// Compute difference between current system time and the input value
int getMilliSpan(int nTimeStart){
    int nSpan = getMilliCount() - nTimeStart;
    if(nSpan < 0)
        nSpan += 0x100000 * 1000;
    return nSpan;
}

// Print the simulation time with a progress status
void DisplayCurrentTime(void) {
    int nsec = Simulator::Now().GetMilliSeconds();
    printf("%c[2K\r", 27); //clear line
    printf("t = %.02f s (%g %%)", nsec/1000.0, floor((double)nsec/(10*(double)simulationTime)));
    cout.flush();
    Simulator::Schedule(MilliSeconds(2.5*simulationTime), &DisplayCurrentTime);
}

void NotifyHandoverStartUe (std::string context,
                       uint64_t imsi,
                       uint16_t cellid,
                       uint16_t rnti,
                       uint16_t targetCellId)
{
  std::cout << " *** Handover from " << cellid << " to " << targetCellId << std::endl;
}

int main (int argc, char *argv[]) {
    CommandLine cmd;
   
    int numberENodeB = 6;
    int numberUser = 1;
   
    double cellDiameter = 1000;
    double eNodeBAltitude = 5;
    double UESpeed = 50; // in km/h
   
    cmd.AddValue("duration", "Duration of the simulation in seconds", simulationTime);
    cmd.AddValue("neNodeB", "Number of eNodeB", numberENodeB);
    cmd.AddValue("cellDiameter", "Diameter of a cell. Defines the space between two consecutive eNodeB", cellDiameter);
   
    cmd.Parse (argc, argv);
    ConfigStore inputConfig;
    inputConfig.ConfigureDefaults ();
    cmd.Parse (argc, argv); //parse again to override default values
   
    double txStartTime = 0;
    double txEndTime = simulationTime;
   
    DataRate dlDataRate = DataRate("1Mbps");
    int dlDataSize = 1000;
   
    Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
    Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
   
    // Path Losses
    lteHelper->SetPathlossModelType("ns3::FriisSpectrumPropagationLossModel");
   
    lteHelper->SetEpcHelper (epcHelper);
    NodeContainer ueNodes;
    NodeContainer enbNodes;
   
    enbNodes.Create(numberENodeB);
    ueNodes.Create(numberUser);

    // Mobility model for the eNodeB
    MobilityHelper mobility;
    Ptr<ListPositionAllocator> enbPosAllocator = CreateObject <ListPositionAllocator>();
    for(int i=0 ; i < numberENodeB ; i++) {
        enbPosAllocator->Add(
            Vector(i*cellDiameter, 0, eNodeBAltitude)
        );
    }
    mobility.SetPositionAllocator(enbPosAllocator);
    mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
    mobility.Install(enbNodes);
                             
    // Mobility model for the UE
    Ptr<ListPositionAllocator> uePosAllocator = CreateObject <ListPositionAllocator>();
    for(int i=0 ; i < numberUser ; i++) {
        uePosAllocator->Add(Vector(0,200,0));
    }
    mobility.SetPositionAllocator(uePosAllocator);
    mobility.SetMobilityModel("ns3::ConstantVelocityMobilityModel");
    mobility.Install(ueNodes);
    Vector vSpeed = Vector( UESpeed/3.6, 0, 0 ); // moves along the x axis
    for(uint32_t u=0 ; u < ueNodes.GetN() ; u++) {
        Ptr<ConstantVelocityMobilityModel> p = ueNodes.Get(u)->GetObject<ConstantVelocityMobilityModel> ();
        p->SetVelocity (vSpeed);
    }
   
    Ptr<Node> pgw = epcHelper->GetPgwNode ();
   
    // Create RemoteHosts
    NodeContainer remoteHostsContainer;
    remoteHostsContainer.Create (numberUser); //each UE is connected to a different remoteHost
    InternetStackHelper internet;
    internet.Install (remoteHostsContainer);
   
    // Link RemoteHosts to the PGW
    for (int u=0; u < numberUser ; ++u)  {
        PointToPointHelper p2ph;
        p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
        p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
        p2ph.SetChannelAttribute ("Delay", TimeValue (MilliSeconds(10)));

        NetDeviceContainer internetDevices = p2ph.Install (remoteHostsContainer.Get(u), pgw);
       
        Ipv4AddressHelper ipv4h;
        char buf[512];
        sprintf(buf,"50.50.%d.0", u+1);
        ipv4h.SetBase(buf, "255.255.255.0");
        ipv4h.Assign (internetDevices);
    }

    // Add route from the remotes to the UEs
    Ipv4StaticRoutingHelper ipv4RoutingHelper;
    for (uint32_t u=0; u < remoteHostsContainer.GetN() ; ++u)  {
        Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHostsContainer.Get(u)->GetObject<Ipv4> ());
        remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
    }
   
    // Install LTE Devices to the nodes
    NetDeviceContainer enbLteDevs;
    for(uint32_t u=0 ; u < enbNodes.GetN() ; ++u) {
        lteHelper->SetEnbAntennaModelType ("ns3::IsotropicAntennaModel");
       
        /*lteHelper->SetEnbDeviceAttribute("DlEarfcn",     UintegerValue ( (u%2)*50 ));
        lteHelper->SetEnbDeviceAttribute("UlEarfcn",     UintegerValue ( (u%2)*50 + 18000 ));
        lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (25));
        lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (25));*/
       
        enbLteDevs.Add( lteHelper->InstallEnbDevice (enbNodes.Get(u)) );
    }
    lteHelper->SetUeAntennaModelType ("ns3::IsotropicAntennaModel");
   
    NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);
   
    // Install X2 interface
    lteHelper->AddX2Interface (enbNodes);

    // Install the IP stack on the UEs
    internet.Install (ueNodes);
    Ipv4InterfaceContainer ueIpIface;
    ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
    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->ActivateDedicatedEpsBearer (ueLteDevs.Get(u), EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), EpcTft::Default ());
    }
    // Attach all UEs to the closest eNodeB
    lteHelper->AttachToClosestEnb (ueLteDevs, enbLteDevs);

    // Install and start applications on UEs and remote host
    uint16_t dlPort = 6666;
    ApplicationContainer appContainer;
    for (uint32_t u=0; u < ueNodes.GetN() ; ++u) {
        // App
        OnOffHelper dlApp("ns3::UdpSocketFactory", InetSocketAddress(ueIpIface.GetAddress(u), dlPort+u));
        dlApp.SetAttribute("OnTime", StringValue("ns3::ConstantRandomVariable[Constant=1]"));
        dlApp.SetAttribute("OffTime", StringValue("ns3::ConstantRandomVariable[Constant=0]"));
        dlApp.SetAttribute("DataRate", DataRateValue(dlDataRate));
        dlApp.SetAttribute("PacketSize", UintegerValue(dlDataSize));
        appContainer.Add(dlApp.Install(remoteHostsContainer.Get(u)));
   
        // Sink
        ApplicationContainer tmpAppContainer;
        PacketSinkHelper dlSink ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort+u));
        tmpAppContainer = dlSink.Install(ueNodes.Get(u));
        tmpAppContainer.Start(Seconds(0));
        tmpAppContainer.Stop(Seconds(simulationTime));
       
    }
    appContainer.Start(Seconds(txStartTime));
    appContainer.Stop(Seconds(txEndTime));
   
    // Set outputs
    Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverStart", MakeCallback (&NotifyHandoverStartUe));

    // Set stop time
    Simulator::Stop( Seconds(simulationTime) );

    // Start simulation
    int startTime = getMilliCount();
    DisplayCurrentTime();
    Simulator::Run ();
    DisplayCurrentTime();
    int duration = getMilliSpan(startTime);
    cout << endl << "Simulation finished in " << duration/1000.0 << " secs" << endl;
       
    Simulator::Destroy ();
    return 0;
}



handover-bug.cc

Mehdi

unread,
Nov 7, 2013, 5:52:18 AM11/7/13
to ns-3-...@googlegroups.com
Small mistake: It is of course
double cellDiameter = 250;


Mehdi

unread,
Nov 8, 2013, 11:18:16 AM11/8/13
to ns-3-...@googlegroups.com
I have investigated to find the source of the problem.
First I noticed that the channel quality report included the data regarding eNode B 1,3,5 but not 2,4,6.
Then I found that a report is sent only when the received power is above a certain threshold and the signal received from base stations 2,4 and 6 has a power of 0W....
Finally, I found the source of the problem in the MultiModelSpectrumChannel (StartTx function) in which a "conversion" is done before the transmission of the signal.
This conversion consist into only keeping the part of the spectrum that falls into the receiver's bandwidth (which is perfectly logical).
Since the receiver's bandwidth is initialized by the first eNode B attached, it is impossible for the UE to received signals on other frequencies.

To conclude, it is impossible (from what I understand) to use a multiple frequency network with the current implementation of the simulator (actually it is, but seen as multiple networks, transparent to each other).

Is there a way to have two (or more) neighbor cells that does not interfere with each other ?!


Thank you.

Mehdi

unread,
Nov 15, 2013, 4:17:36 AM11/15/13
to ns-3-...@googlegroups.com
Anyone ?

Mehdi

unread,
Nov 29, 2013, 8:23:20 AM11/29/13
to ns-3-...@googlegroups.com
Still nobody ?

Madan Pande

unread,
Nov 30, 2013, 7:08:49 AM11/30/13
to ns-3-...@googlegroups.com
Mehdi,

           I am no expert on LTE ...Marco and Nicola are the Gurus...

2. However, to answer your query... the LTE implementation in NS-3 as on date is only compliant to LTE Rel .8,
 as such it does not cover multiple carrier components in UE/ENodeB..[which are LTE Rel.10 features for
Carrier Aggregation implementation]. I understand from earlier posts that Lena group is actively working on adding Rel 10 features...

 3.  Hence, there is nothing wrong with the results you have reported...that is how they will be...
without Carrier Aggregation compliant UE and ENodeB...

I hope this helps...

With Regards,
madan


Date: Fri, 29 Nov 2013 05:23:20 -0800
From: ameh...@gmail.com
To: ns-3-...@googlegroups.com
Subject: Re: NS-3 LTE / UE Handover when using different frequency for each eNodeB sector

Still nobody ?

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.
Message has been deleted

Mehdi

unread,
Dec 2, 2013, 7:07:29 AM12/2/13
to ns-3-...@googlegroups.com
Thank you for your answer.
I've sent an e-mail to said Marco and Nicola, but even though they are very reactive to answer trivial questions, they don't seem to be interested by this topic.
Anyway, since this feature it is not implemented I will do it myself.
If anyone have some guidelines to make this task easier, I will gladly accept them.
I will share the modifications if/when it is done.
Thank you.
Message has been deleted

Danial Zakaria

unread,
Mar 17, 2014, 2:45:00 AM3/17/14
to ns-3-...@googlegroups.com


Hi there, Im currently working on LTE project where an UE is served by two eNodeBs at the same time where the UE should have two network interfaces with different IP addresses. My question is how to set up the UE to have dual network interfaces. I would appreciate if you can show me how to configure that. TQ

Filipe Ferreira

unread,
Jun 26, 2014, 8:00:31 AM6/26/14
to ns-3-...@googlegroups.com
Did you solve this problem?

Kevin Lau

unread,
Jul 21, 2014, 2:13:40 PM7/21/14
to ns-3-...@googlegroups.com
Interested if you've solved this.  
Reply all
Reply to author
Forward
Message has been deleted
0 new messages