Buildings and SINR in ns3-LENA

579 views
Skip to first unread message

Marco Giordani

unread,
Jun 10, 2015, 3:58:43 AM6/10/15
to ns-3-...@googlegroups.com
Hi everybody, 
I am new in the ns3's world so maybe this question can be very easily solvable. 
I'm trying to study the effect on SINR caused by a building placed in a very simple scenario. There is one omnidirectional BS transmitting, and I expect to see that, when the signal pass through the building's walls, it results to be attenuated, in terms of SINR. However, the REM map (that I attach here) shows that it's like the building doesn't affect the whole scenario. This is my code:

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/lte-module.h"
#include "ns3/antenna-model.h"
#include "ns3/isotropic-antenna-model.h"
#include "ns3/config-store.h"
#include "ns3/building.h"
#include "ns3/buildings-helper.h"
#include "ns3/mobility-building-info.h"
#include <ns3/buildings-module.h>
#include "ns3/hybrid-buildings-propagation-loss-model.h"
#include "ns3/oh-buildings-propagation-loss-model.h"

using namespace ns3;

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

 
double speed =  50.0;
 
double initialPosition = 0.0;
 
double enbTxPowerDbm = 30.0;
 
double ueNoiseFigure = 5.0;


 
CommandLine cmd;
 cmd
.AddValue ("enbTxPowerDbm", "TX power [dBm] (default = 30.0dBm)", enbTxPowerDbm);
 cmd
.AddValue ("ueNoiseFigure", "User noise figure [dB] (default = 5.0dB)", ueNoiseFigure);
 cmd
.Parse (argc, argv);


 
ConfigStore inputConfig;
 inputConfig
.ConfigureDefaults ();

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

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

 
//BUILDING CREATION
 
double x_min = 4.0;
 
double x_max = 20.0;
 
double y_min = -10.0;
 
double y_max = 20.0;
 
double z_min = -10.0;
 
double z_max = 10.0;
 
Ptr<Building> b = CreateObject <Building> ();
 b
->SetBoundaries (Box (x_min, x_max, y_min, y_max, z_min, z_max));
 b
->SetBuildingType (Building::Residential);
 b
->SetExtWallsType (Building::ConcreteWithWindows);
 b
->SetNFloors (3);
 b
->SetNRoomsX (3);
 b
->SetNRoomsY (2);

 
// Create Nodes: eNodeB and UE
 
NodeContainer enbNodes;
 
NodeContainer ueNodes;
 enbNodes
.Create (1);
 ueNodes
.Create (1);

 
// MOBILITY OF ENB
 
Ptr<ListPositionAllocator> enbPositionAlloc = CreateObject<ListPositionAllocator> ();
 enbPositionAlloc
->Add(Vector(0.0,0.0,0.1));
 
MobilityHelper enbMobility;
 enbMobility
.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
 enbMobility
.SetPositionAllocator(enbPositionAlloc);
 enbMobility
.Install (enbNodes);
 
BuildingsHelper::Install (enbNodes);


 
// MOBILITY OF UE
 
Ptr<ListPositionAllocator> uePositionAlloc = CreateObject<ListPositionAllocator> ();
 uePositionAlloc
->Add(Vector(initialPosition,0.0,0.1));
 
MobilityHelper ueMobility;
 ueMobility
.SetMobilityModel ("ns3::ConstantVelocityMobilityModel");
 ueMobility
.SetPositionAllocator(uePositionAlloc);
 ueMobility
.Install (ueNodes);
 ueNodes
.Get(0)->GetObject<ConstantVelocityMobilityModel>()->SetVelocity(Vector (speed,0.0,0.0));
 
BuildingsHelper::Install (ueNodes);

 
// SET PARAMETERS OF TX
 
Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (enbTxPowerDbm));
 
Config::SetDefault ("ns3::LteUePhy::NoiseFigure", DoubleValue (ueNoiseFigure));

 
// Create Devices and install them in the Nodes (eNB and UE)
 
NetDeviceContainer enbDevs;
 
NetDeviceContainer ueDevs;

 enbDevs
= lteHelper->InstallEnbDevice (enbNodes);
 ueDevs
= lteHelper->InstallUeDevice (ueNodes);


 
// Attach a UE to a eNB
 lteHelper
->Attach (ueDevs, enbDevs.Get (0));

 
// Activate a data radio bearer
 
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
 
EpsBearer bearer (q);
 lteHelper
->ActivateDataRadioBearer (ueDevs, bearer);
 lteHelper
->EnableDlPhyTraces();


 
BuildingsHelper::MakeMobilityModelConsistent ();

 
Simulator::Stop (Seconds (5));
 
Simulator::Run ();
 
Simulator::Destroy ();
 
return 0;
}


What am I skipping, in the code? How can I study the effect of the building? 

Thanks for you time!
Schermata 2015-06-09 alle 21.33.58.png

David Palacios Campos

unread,
Jun 5, 2016, 6:42:36 AM6/5/16
to ns-3-users
Hi Marco,

did you finally find any reason for the simulator to obviate the losses due to the buildings?

Thanks,
David

Marco Miozzo

unread,
Jun 6, 2016, 4:05:40 AM6/6/16
to ns-3-users
Hi David,

I did not get the question, may I ask you to provide me more info.

Best,
marco.


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
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 https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

arash mohammadi

unread,
Jun 4, 2018, 10:28:19 AM6/4/18
to ns-3-users
 
Hi Marco

you Skip a code that sets propagation loss model to simulation, such as:

     // lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel")); \\
try it.
Reply all
Reply to author
Forward
0 new messages