coverage area of cell

2,248 views
Skip to first unread message

libtel

unread,
Sep 11, 2013, 6:17:49 AM9/11/13
to ns-3-...@googlegroups.com
Hi!!
I need to know the coverage area of the cell considering the script lena-simple-epc.cc.Per first thing I put a single user and a enb. Wanted to try to get the cell radius away from time to time the user dall'enb. By this reasoning, however, I get the values ​​of the order of 10 ^ 18 as the distance and it seems wrong. I also tried to change the power antenna and the antenna model, but to no avail. Even changing the power of the antenna, and considering the same distance dall'enb get the same value of bytes sent.
Can anyone help me solve the problem?

 */
#include <fstream>
#include <iostream>
#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/position-allocator.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/netanim-module.h"
#include "ns3/flow-monitor.h"
#include "ns3/flow-monitor-helper.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 numberOfUsers = 1;
  uint16_t numberOfEnb = 1;
  double simTime = 15;
  double distance = 60.0;
  double distanceUE = 3.0;
  //double interPacketInterval = 100;
std::string traceFileCLienthelperName = "verbose.txt";

  // Command line arguments
  CommandLine cmd;
  cmd.AddValue("numberOfUsers", "Number of Users", numberOfUsers);
  cmd.AddValue("numberOfEnb", "Number of ENB", numberOfEnb);
  cmd.AddValue("simTime", "Total duration of the simulation [s])", simTime);
  cmd.AddValue("distance", "Distance between eNBs [m]", distance);
 cmd.AddValue("distanceUE", "Distance between UEs [m]", distanceUE);
 //cmd.AddValue("interPacketInterval", "Inter packet interval [ms])", interPacketInterval);
  cmd.Parse(argc, argv);
 SeedManager::SetSeed(5);
 
  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
  Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
  lteHelper->SetEpcHelper (epcHelper);
  //Config::SetDefault("ns3::LteEnbNetDevice::DlBandwidth",UintegerValue(50));
  //Config::SetDefault("ns3::LteEnbNetDevice::UlBandwidth",UintegerValue(50));
//Config::SetDefault("ns3::LteEnbPhy::TxPower",DoubleValue(20));
//Config::SetDefault("ns3::LteEnbPhy::NoiseFigure",DoubleValue(0));

 //lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
Config::SetDefault("ns3::LteEnbPhy::TxPower",DoubleValue(10));


 lteHelper->SetEnbAntennaModelType ("ns3::CosineAntennaModel");
lteHelper->SetEnbAntennaModelAttribute ("Orientation", DoubleValue (0));
  lteHelper->SetEnbAntennaModelAttribute ("Beamwidth", DoubleValue (100));
 lteHelper->SetEnbAntennaModelAttribute ("MaxGain", DoubleValue (0.0));
//lteHelper->SetAttribute ("PathlossModel",StringValue("ns3::NakagamiPropagationLossModel"));


  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(numberOfEnb);
  ueNodes.Create(numberOfUsers);

  // Install Mobility Model for ENB amd Users
  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
  positionAlloc->Add (Vector(0, 0, 0)); //Enb Position
  positionAlloc->Add (Vector(20,0, 0)); //User Position
  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);

  // 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);
    }

  // Attach one UE per eNodeB
  for (uint16_t i = 0; i < numberOfUsers; i++)
      {
        lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(0));
        // side effect: the default EPS bearer will be activated
      }


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

      UdpTraceClientHelper dlClient (ueIpIface.GetAddress (u), dlPort,traceFileCLienthelperName);
    

     UdpTraceClientHelper ulClient (remoteHostAddr, ulPort,traceFileCLienthelperName);
    

      UdpTraceClientHelper client (ueIpIface.GetAddress (u), otherPort,traceFileCLienthelperName);
     


      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 ();
  lteHelper->EnableMacTraces ();
//Ptr<Socket> ns3UdpSocket = Socket::CreateSocket (nodes.Get (0), UdpSocketFactory::GetTypeId ());

//  AsciiTraceHelper ascii;
 //p2ph.EnableAsciiAll(ascii.CreateFileStream("prova1.tr"));

 AnimationInterface anim ("pro.xml");

       
         FlowMonitorHelper flowmon;
         Ptr<FlowMonitor> monitor;
         //monitor = flowmon.InstallAll();
         monitor = flowmon.Install(ueNodes);
         monitor = flowmon.Install(enbNodes);
         monitor = flowmon.Install(remoteHostContainer);
         monitor->SetAttribute("DelayBinWidth", DoubleValue(0.001));
         monitor->SetAttribute("JitterBinWidth", DoubleValue(0.001));
         monitor->SetAttribute("PacketSizeBinWidth", DoubleValue(20));

 
 std::cout<<"Setting up flow monitor... done !"<<std::endl;


  // Uncomment to enable PCAP tracing
  //p2ph.EnablePcapAll("lena-epc-first");

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

  /*GtkConfigStore config;
  config.ConfigureAttributes();*/
 monitor->SerializeToXmlFile ("verb300.tr" , false, false);
 

  Simulator::Destroy();
  return 0;

}

Nicola Baldo

unread,
Sep 17, 2013, 8:21:55 AM9/17/13
to ns-3-...@googlegroups.com
I think Marco already replied you on this issue:
https://groups.google.com/d/msg/ns-3-users/llm3iy2AuZc/suQlSb-MI7wJ

I recommend to check the propagation loss model, if you use Friis of course you'll get a very large cell.
To get an idea of what is the cell area in a simulation, you could plot a REM:
http://lena.cttc.es/manual/lte-user.html#radio-environment-maps

khc...@siswa.um.edu.my

unread,
Oct 23, 2013, 8:19:31 AM10/23/13
to ns-3-...@googlegroups.com
Hi

In a scenario with just one UE and one eNodeB, if I set my UE to move until it is out of the coverage area, by right, the connection is supposed to drop rite.

If i want to add a trace file to detect this when it happens, can you suggest in which source code file and function that I should put the trace?

Thanks

Marco Miozzo

unread,
Oct 23, 2013, 9:24:26 AM10/23/13
to ns-3-...@googlegroups.com
There are tow possible solutions:

1) looking at the RLC traces you may know when the UE reaches the CQI 0, which means disconnected (you will see also the received bytes dropping to zero), more info on simulation output:
http://www.nsnam.org/docs/release/3.16/models/html/lte-user.html#simulation-output

2) otherwise you can check in Rrc protocols files the attachment procedure.

Best regards,
marco.




--
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.

khc...@siswa.um.edu.my

unread,
Oct 23, 2013, 11:43:56 AM10/23/13
to ns-3-...@googlegroups.com
Thanks for your reply. It helps a lot.

Normally when we want to attach a UE to a eNodeB, we use the function such as:
     void ns3::LteHelper::Attach (NetDeviceContainer ueDevices , Ptr< NetDevice > enbDevice )

When the UE moves out of the coverage of the first eNodeB and if let say I have a second eNodeB now. The UE then moves into this second eNodeB coverage after dropping its connection with the first eNodeB (due to out of coverage), would it knows to automatically connect to this second eNodeB?

Thanks

Best regards
KH Chua

Marco Miozzo

unread,
Oct 24, 2013, 6:39:03 AM10/24/13
to ns-3-...@googlegroups.com
The answer is yes, but check your version of the code cause the automatic HO has been recently released (ns3.18 or ns-3-dev repository).
The last summer a GSoC project has been devoted to improve the HO, more info at the following link:
https://www.nsnam.org/wiki/index.php/GSOC2013UeMeasurementActiveIdle

Best regards,
marco.

KH Chua

unread,
Oct 31, 2013, 12:15:11 PM10/31/13
to ns-3-...@googlegroups.com
Hi Marco,

I have been going through the lte-enb-rrc.cc and lte-rrc-protocol-ideal.cc scripts to understand how the detachment of UE from eNB occur when UE move out of eNB coverage area. But I still can't figure it out yet. Can you let me know which class and functions it is implemented in?

And I am also currently trying to understand how the X2 Handover mechanism is implemented in ns3 codes. I have been going through the lte-enb-rrc.cc and lte-rrc-protocol-ideal.cc scripts for quite some time. But there are a few parts that I don't quite get it and need some explanation. Should start a new thread for this question or can I just ask you here?

Thanks

KH Chua

unread,
Nov 7, 2013, 11:41:01 AM11/7/13
to ns-3-...@googlegroups.com
Hi Marco,

Following your advice, I had tried to see the RLC trace using the lena-x2-handover-measures.cc example script and extend the simulation time so that the UE continues to move in the same direction. But the ouput rlc trace files are empty? Shouldn't there be some values?

Please help.

Thanks


 

On Wednesday, October 23, 2013 9:24:26 PM UTC+8, Marco wrote:

KH Chua

unread,
Nov 7, 2013, 11:58:31 AM11/7/13
to ns-3-...@googlegroups.com
Hi Marco,

I had tried to see the RLC traces with one of the example scripts lena-x2-handover-measures and set the UE to continuous move in one direction. However, I don't get any output in the DlRlcStats.txt and UlRlcStats.txt files? Both files are empty.


Please help.

Thanks

On Wednesday, October 23, 2013 9:24:26 PM UTC+8, Marco wrote:
DlRlcStats.txt

Marco Miozzo

unread,
Nov 8, 2013, 4:56:00 AM11/8/13
to ns-3-...@googlegroups.com
Hi,

usually when traces are empty it means that no one packet has been transmitted (so no one event triggers the writing on the files), please check also the traces of the lower layers (PDPC and MAC) and check the log traces for evaluating whether data has been transmitted or not.

Best regards,
marco.



KH Chua

unread,
Nov 10, 2013, 11:58:05 AM11/10/13
to ns-3-...@googlegroups.com
Hi

In the log traces, it does not show any data transmitted. And the PDCP file is empty as well. There is no mac trace file generated.

I had attached the script I used for the simulation here, it is based on the lena-x2-handover-measures.cc file. The only modifications I did were to extend the sim time to 400 s, increase speed of UE to 100, and enabled the netanim animation trace.

I had attached the log file here as well.

Is there any modification needed in the simulation script?

WhenI read the LTE documentation at
http://www.nsnam.org/docs/models/html/lte-design.html#rrc
It states that:

It is to be noted that most of the states are transient, i.e., once the UE goes into one of the CONNECTED states it will never switch back to any of the IDLE states. This choice is done for the following reasons:

  • as discussed in the section Design Criteria, the focus of the LTE-EPC simulation model is on CONNECTED mode
  • radio link failure is not currently modeled, as discussed in the section Radio Link Failure, so an UE cannot go IDLE because of radio link failure
  • RRC connection release is currently never triggered neither by the EPC nor by the NAS


Does this means that even if the UE goes out of coverage area, the UE is still attached to the eNB but just that the the scheduler will stop allocating resources to it for communications (as in the case for a Radio link Failure)?

Hope you can answer my questions.

Thanks
KH Chua
lena-x2-handover-measures2.cc
log.out

Marco Miozzo

unread,
Nov 12, 2013, 7:42:58 AM11/12/13
to ns-3-...@googlegroups.com
Hi,

when UEs go outside coverage area, they remain connected but the throughput falls to 0 as scheduler cannot allocate resources (CQI = 0).
You may check whether this is the situation happening in your simulation script by enabling MAC log and traces.

Best regards,
marco.

KH Chua

unread,
Nov 13, 2013, 7:53:10 AM11/13/13
to ns-3-...@googlegroups.com
Thanks for the reply.

I saw that the LTE documentation model had changed with some new features added related to handover. May I know where can I download this new LTE version?

KH Chua

unread,
Nov 19, 2013, 12:17:45 PM11/19/13
to ns-3-...@googlegroups.com
Hi

I had downloaded the new lte module using the command: hg clone http://lena.cttc.es/hg/lena/ 

that we can set the coverage area by changing the Tx power value and antenna model.

But is there a specific function in ns3 lte that uses these values to calculate and determine the resulting coverage area?

Thanks

Marco Miozzo

unread,
Nov 20, 2013, 3:37:36 AM11/20/13
to ns-3-...@googlegroups.com
Hi,

ns3 does not provide such functionality, but you may find octave script for calculating the path loss and have an idea of the coverage range in your specific scenario.
The scripts are in src/propagation/test/reference folder, and you may refer to data and control error model for estimating the coverage range:
http://www.nsnam.org/docs/release/3.16/models/html/lte-design.html#data-phy-error-model
http://www.nsnam.org/docs/release/3.16/models/html/lte-design.html#control-channels-phy-error-model

Best regards,
marco.

ashesh mishra

unread,
Dec 10, 2013, 12:12:07 PM12/10/13
to ns-3-...@googlegroups.com
Hi,
I'm a newbie and have faced exactly same problem in  running file lena-x2-handover-measures.cc.
Problem as I assume was:- it is using dedicated EPS bearer and numBearersPerUe is set to 0.
Setting numBearersPerUe to 1 solved the issue.
Please Correct me if I'm wrong.
ashesh.

Dowon Hyun

unread,
Apr 17, 2014, 6:39:02 AM4/17/14
to ns-3-...@googlegroups.com
Hi, Chua

How did you get above "log.out" file?
Please let me know...

Thanks in advance,
Dowon

2013년 12월 11일 수요일 오전 2시 12분 7초 UTC+9, ashesh 님의 말:
Reply all
Reply to author
Forward
0 new messages