merge lena-epc and lena-dev
This commit is contained in:
@@ -36,6 +36,7 @@ SOURCES = \
|
||||
$(SRC)/lte/doc/source/lte-user.rst \
|
||||
$(SRC)/lte/doc/source/lte-design.rst \
|
||||
$(SRC)/lte/doc/source/lte-testing.rst \
|
||||
$(SRC)/lte/doc/source/lte-profiling.rst \
|
||||
$(SRC)/lte/doc/source/lte-references.rst \
|
||||
$(SRC)/propagation/doc/propagation.rst \
|
||||
$(SRC)/network/doc/network-overview.rst \
|
||||
|
||||
@@ -28,15 +28,15 @@ namespace ns3 {
|
||||
|
||||
|
||||
Building::Building (double _xMin, double _xMax,
|
||||
double _yMin, double _yMax,
|
||||
double _zMin, double _zMax/*,
|
||||
uint8_t _nFloors, uint8_t _nRoomX, uint8_t _nRoomY*/) :
|
||||
m_floor (1),
|
||||
m_roomX (1),
|
||||
m_roomY (1),
|
||||
m_buildingType (Residential),
|
||||
m_externalWalls (ConcreteWithWindows)
|
||||
|
||||
double _yMin, double _yMax,
|
||||
double _zMin, double _zMax/*,
|
||||
uint8_t _nFloors, uint8_t _nRoomX, uint8_t _nRoomY*/)
|
||||
: m_floor (1),
|
||||
m_roomX (1),
|
||||
m_roomY (1),
|
||||
m_buildingType (Residential),
|
||||
m_externalWalls (ConcreteWithWindows)
|
||||
|
||||
{
|
||||
m_buldingBounds = Box (_xMin, _xMax, _yMin, _yMax, _zMin, _zMax);
|
||||
}
|
||||
|
||||
@@ -37,15 +37,14 @@ namespace ns3 {
|
||||
class Building : public SimpleRefCount<Building>
|
||||
{
|
||||
public:
|
||||
|
||||
enum BuildingType_t
|
||||
{
|
||||
Residential, Office, Commercial
|
||||
};
|
||||
{
|
||||
Residential, Office, Commercial
|
||||
};
|
||||
enum ExtWallsType_t
|
||||
{
|
||||
Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks
|
||||
};
|
||||
{
|
||||
Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks
|
||||
};
|
||||
/**
|
||||
* \param _xMin x coordinates of left boundary.
|
||||
* \param _xMax x coordinates of right boundary.
|
||||
@@ -63,21 +62,21 @@ public:
|
||||
double _yMin, double _yMax,
|
||||
double _zMin, double _zMax/*,
|
||||
uint8_t _nFloors, uint8_t _nRoomX, uint8_t _nRoomY*/);
|
||||
|
||||
|
||||
/**
|
||||
* Create a zero-sized building located at coordinates (0.0,0.0,0.0)
|
||||
* and with no floors and 1 room.
|
||||
*/
|
||||
Building ();
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \param t the type of building (i.e., Residential, Office, Commercial)
|
||||
*
|
||||
* This method allows to set building type (default is Residential)
|
||||
*/
|
||||
void SetBuildingType (Building::BuildingType_t t);
|
||||
|
||||
|
||||
/**
|
||||
* \param t the type of external walls (i.e., Wood, ConcreteWithWindows,
|
||||
* ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss
|
||||
@@ -86,7 +85,7 @@ public:
|
||||
* This method allows to set external walls type (default is Residential)
|
||||
*/
|
||||
void SetExtWallsType (Building::ExtWallsType_t t);
|
||||
|
||||
|
||||
/**
|
||||
* \param nfloors the number of floors in the building
|
||||
*
|
||||
@@ -94,7 +93,7 @@ public:
|
||||
* (default is 1)
|
||||
*/
|
||||
void SetFloorsNumber (uint8_t nfloors);
|
||||
|
||||
|
||||
/**
|
||||
* \param nroomx the number of rooms in the x axis
|
||||
*
|
||||
@@ -102,7 +101,7 @@ public:
|
||||
* The rooms are disposed as a grid of nº of rooms in X per nº of rooms in Y
|
||||
*/
|
||||
void SetNumberRoomX (uint8_t nroomx);
|
||||
|
||||
|
||||
/**
|
||||
* \param nroomy the number of floors in the building
|
||||
*
|
||||
@@ -110,40 +109,40 @@ public:
|
||||
* (default is 1)
|
||||
*/
|
||||
void SetNumberRoomY (uint8_t nroomy);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \return the type of building
|
||||
* Return the type of building (i.e., Residential, Office, Commercial)
|
||||
*/
|
||||
BuildingType_t GetBuildingType ();
|
||||
|
||||
|
||||
/**
|
||||
* \return the type of external walls
|
||||
* Return the type of external walls (i.e., Wood, ConcreteWithWindows,
|
||||
* ConcreteWithoutWindows)
|
||||
*/
|
||||
ExtWallsType_t GetExtWallsType ();
|
||||
|
||||
|
||||
/**
|
||||
* \return the number of floors
|
||||
* Return the number of floors
|
||||
*/
|
||||
uint8_t GetNumberFloors ();
|
||||
|
||||
|
||||
/**
|
||||
* \return the number of room in x-axis
|
||||
* Return the number of room in x-axis
|
||||
*/
|
||||
uint8_t GetNumberRoomX ();
|
||||
|
||||
|
||||
/**
|
||||
* \return the number of room in y-axis
|
||||
* Return the number of room in y-axis
|
||||
*/
|
||||
uint8_t GetNumberRoomY ();
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Box m_buldingBounds;
|
||||
/**
|
||||
@@ -153,11 +152,11 @@ private:
|
||||
uint8_t m_floor;
|
||||
uint8_t m_roomX;
|
||||
uint8_t m_roomY;
|
||||
|
||||
|
||||
uint8_t m_buildingId;
|
||||
BuildingType_t m_buildingType;
|
||||
ExtWallsType_t m_externalWalls;
|
||||
|
||||
|
||||
};
|
||||
|
||||
//std::ostream &operator << (std::ostream &os, const Box &box);
|
||||
|
||||
@@ -26,25 +26,25 @@
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (BuildingsMobilityModel);
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (BuildingsMobilityModel);
|
||||
|
||||
TypeId
|
||||
BuildingsMobilityModel::GetTypeId (void)
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::BuildingsMobilityModel")
|
||||
.SetParent<MobilityModel> ()
|
||||
.SetGroupName ("Mobility")
|
||||
.AddConstructor<BuildingsMobilityModel> ()
|
||||
.AddAttribute ("Bounds",
|
||||
"Bounds of the area to cruise.",
|
||||
BoxValue (Box (-100.0, 100.0, -100.0, 100.0, 0.0, 100.0)),
|
||||
MakeBoxAccessor (&BuildingsMobilityModel::m_bounds),
|
||||
MakeBoxChecker ());
|
||||
|
||||
return tid;
|
||||
.SetParent<MobilityModel> ()
|
||||
.SetGroupName ("Mobility")
|
||||
.AddConstructor<BuildingsMobilityModel> ()
|
||||
.AddAttribute ("Bounds",
|
||||
"Bounds of the area to cruise.",
|
||||
BoxValue (Box (-100.0, 100.0, -100.0, 100.0, 0.0, 100.0)),
|
||||
MakeBoxAccessor (&BuildingsMobilityModel::m_bounds),
|
||||
MakeBoxChecker ());
|
||||
|
||||
return tid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BuildingsMobilityModel::BuildingsMobilityModel ()
|
||||
{
|
||||
|
||||
@@ -48,47 +48,47 @@ namespace ns3 {
|
||||
|
||||
class BuildingsMobilityModel : public MobilityModel
|
||||
{
|
||||
public:
|
||||
static TypeId GetTypeId (void);
|
||||
BuildingsMobilityModel ();
|
||||
|
||||
bool IsIndoor (void);
|
||||
bool IsOutdoor (void);
|
||||
|
||||
void SetIndoor (Ptr<Building> building);
|
||||
void SetOutdoor (void);
|
||||
|
||||
void SetSurroudingBuilding (Ptr<Building> building);
|
||||
|
||||
void SetFloorNumber (uint8_t nfloor);
|
||||
void SetRoomNumberX (uint8_t nroomx);
|
||||
void SetRoomNumberY (uint8_t nroomy);
|
||||
|
||||
uint8_t GetFloorNumber (void);
|
||||
uint8_t GetRoomNumberX (void);
|
||||
uint8_t GetRoomNumberY (void);
|
||||
|
||||
Ptr<Building> GetBuilding ();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void DoDispose (void);
|
||||
virtual Vector DoGetPosition (void) const;
|
||||
virtual void DoSetPosition (const Vector &position);
|
||||
virtual Vector DoGetVelocity (void) const;
|
||||
ConstantVelocityHelper m_helper;
|
||||
Box m_bounds; // bounds of the simulation field (if needed)
|
||||
std::list < Ptr<Building> > m_surroudingBuildings; // buildings blocks
|
||||
Ptr<Building> m_myBuilding;
|
||||
bool m_indoor;
|
||||
/**
|
||||
* floors numbering starts from 0 (basement)
|
||||
*/
|
||||
uint8_t m_nFloor;
|
||||
uint8_t m_roomX;
|
||||
uint8_t m_roomY;
|
||||
|
||||
public:
|
||||
static TypeId GetTypeId (void);
|
||||
BuildingsMobilityModel ();
|
||||
|
||||
bool IsIndoor (void);
|
||||
bool IsOutdoor (void);
|
||||
|
||||
void SetIndoor (Ptr<Building> building);
|
||||
void SetOutdoor (void);
|
||||
|
||||
void SetSurroudingBuilding (Ptr<Building> building);
|
||||
|
||||
void SetFloorNumber (uint8_t nfloor);
|
||||
void SetRoomNumberX (uint8_t nroomx);
|
||||
void SetRoomNumberY (uint8_t nroomy);
|
||||
|
||||
uint8_t GetFloorNumber (void);
|
||||
uint8_t GetRoomNumberX (void);
|
||||
uint8_t GetRoomNumberY (void);
|
||||
|
||||
Ptr<Building> GetBuilding ();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void DoDispose (void);
|
||||
virtual Vector DoGetPosition (void) const;
|
||||
virtual void DoSetPosition (const Vector &position);
|
||||
virtual Vector DoGetVelocity (void) const;
|
||||
ConstantVelocityHelper m_helper;
|
||||
Box m_bounds; // bounds of the simulation field (if needed)
|
||||
std::list < Ptr<Building> > m_surroudingBuildings; // buildings blocks
|
||||
Ptr<Building> m_myBuilding;
|
||||
bool m_indoor;
|
||||
/**
|
||||
* floors numbering starts from 0 (basement)
|
||||
*/
|
||||
uint8_t m_nFloor;
|
||||
uint8_t m_roomX;
|
||||
uint8_t m_roomY;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -36,28 +36,28 @@
|
||||
NS_LOG_COMPONENT_DEFINE ("BuildingsPropagationLossModel");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
NS_OBJECT_ENSURE_REGISTERED (BuildingsPropagationLossModel);
|
||||
|
||||
|
||||
|
||||
class BuildingsPropagationLossModel::ShadowingLoss
|
||||
{
|
||||
public:
|
||||
public:
|
||||
ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver);
|
||||
~ShadowingLoss ();
|
||||
double GetLoss ();
|
||||
Ptr<MobilityModel> GetReceiver (void);
|
||||
private:
|
||||
private:
|
||||
Ptr<MobilityModel> m_receiver;
|
||||
NormalVariable m_randVariable;
|
||||
double m_shadowingValue;
|
||||
};
|
||||
|
||||
|
||||
BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver) :
|
||||
m_receiver (receiver),
|
||||
m_randVariable (mean, sigma*sigma) // NormalVariable class wants mean and variance (sigma is a standard deviation)
|
||||
BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver)
|
||||
: m_receiver (receiver),
|
||||
m_randVariable (mean, sigma * sigma) // NormalVariable class wants mean and variance (sigma is a standard deviation)
|
||||
{
|
||||
m_shadowingValue = m_randVariable.GetValue ();
|
||||
NS_LOG_INFO (this << " New Shadowing: sigma " << sigma << " value " << m_shadowingValue);
|
||||
@@ -65,9 +65,9 @@ BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss (double mean, double
|
||||
|
||||
BuildingsPropagationLossModel::ShadowingLoss::~ShadowingLoss ()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
BuildingsPropagationLossModel::ShadowingLoss::GetLoss ()
|
||||
{
|
||||
@@ -100,94 +100,94 @@ BuildingsPropagationLossModel::GetTypeId (void)
|
||||
DoubleValue (2160e6),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::SetFrequency),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("ShadowSigmaOutdoor",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
|
||||
DoubleValue (7.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaOutdoor),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("ShadowSigmaIndoor",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
|
||||
DoubleValue (8.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaIndoor),
|
||||
MakeDoubleChecker<double> ())
|
||||
.AddAttribute ("ShadowSigmaExtWalls",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
|
||||
DoubleValue (5.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaExtWalls),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
|
||||
.AddAttribute ("ShadowSigmaOutdoor",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
|
||||
DoubleValue (7.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaOutdoor),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("ShadowSigmaIndoor",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
|
||||
DoubleValue (8.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaIndoor),
|
||||
MakeDoubleChecker<double> ())
|
||||
.AddAttribute ("ShadowSigmaExtWalls",
|
||||
"Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
|
||||
DoubleValue (5.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaExtWalls),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("RooftopLevel",
|
||||
" The height of the rooftop [m].",
|
||||
DoubleValue (20.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_rooftopHeight),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
" The height of the rooftop [m].",
|
||||
DoubleValue (20.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_rooftopHeight),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("Los2NlosThr",
|
||||
" Threshold from LoS to NLoS in ITU 1411 [m].",
|
||||
DoubleValue (200.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_itu1411NlosThreshold),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
" Threshold from LoS to NLoS in ITU 1411 [m].",
|
||||
DoubleValue (200.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_itu1411NlosThreshold),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("ITU1411DistanceThr",
|
||||
" Threshold for ITU 1411 [m].",
|
||||
DoubleValue (2000.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_itu1411DistanceThreshold),
|
||||
MakeDoubleChecker<double> ())
|
||||
" Threshold for ITU 1411 [m].",
|
||||
DoubleValue (2000.0),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::m_itu1411DistanceThreshold),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("MinDistance",
|
||||
"The distance under which the propagation model refuses to give results (m) ",
|
||||
DoubleValue (0.5),
|
||||
MakeDoubleAccessor (&BuildingsPropagationLossModel::SetMinDistance, &BuildingsPropagationLossModel::GetMinDistance),
|
||||
MakeDoubleChecker<double> ())
|
||||
|
||||
.AddAttribute ("Environment",
|
||||
"Environment Scenario",
|
||||
EnumValue (BuildingsPropagationLossModel::Urban),
|
||||
MakeEnumAccessor (&BuildingsPropagationLossModel::SetEnvironment,
|
||||
&BuildingsPropagationLossModel::GetEnvironment),
|
||||
MakeEnumChecker (BuildingsPropagationLossModel::Urban, "Urban",
|
||||
BuildingsPropagationLossModel::SubUrban, "SubUrban",
|
||||
BuildingsPropagationLossModel::OpenAreas, "OpenAreas"))
|
||||
|
||||
.AddAttribute ("CitySize",
|
||||
"Dimension of the city",
|
||||
EnumValue (BuildingsPropagationLossModel::Large),
|
||||
MakeEnumAccessor (&BuildingsPropagationLossModel::SetCitySize),
|
||||
MakeEnumChecker (BuildingsPropagationLossModel::Small, "Small",
|
||||
BuildingsPropagationLossModel::Medium, "Medium",
|
||||
BuildingsPropagationLossModel::Large, "Large"));
|
||||
.AddAttribute ("Environment",
|
||||
"Environment Scenario",
|
||||
EnumValue (BuildingsPropagationLossModel::Urban),
|
||||
MakeEnumAccessor (&BuildingsPropagationLossModel::SetEnvironment,
|
||||
&BuildingsPropagationLossModel::GetEnvironment),
|
||||
MakeEnumChecker (BuildingsPropagationLossModel::Urban, "Urban",
|
||||
BuildingsPropagationLossModel::SubUrban, "SubUrban",
|
||||
BuildingsPropagationLossModel::OpenAreas, "OpenAreas"))
|
||||
|
||||
.AddAttribute ("CitySize",
|
||||
"Dimension of the city",
|
||||
EnumValue (BuildingsPropagationLossModel::Large),
|
||||
MakeEnumAccessor (&BuildingsPropagationLossModel::SetCitySize),
|
||||
MakeEnumChecker (BuildingsPropagationLossModel::Small, "Small",
|
||||
BuildingsPropagationLossModel::Medium, "Medium",
|
||||
BuildingsPropagationLossModel::Large, "Large"));
|
||||
|
||||
|
||||
|
||||
return tid;
|
||||
}
|
||||
|
||||
BuildingsPropagationLossModel::BuildingsPropagationLossModel () :
|
||||
C (0),
|
||||
m_environment (Urban),
|
||||
m_citySize (Large),
|
||||
m_streetsOrientation (45.0),
|
||||
m_streetsWidth (20.0),
|
||||
m_buildingsExtend (80.0),
|
||||
m_buildingSeparation (50.0)
|
||||
BuildingsPropagationLossModel::BuildingsPropagationLossModel ()
|
||||
: C (0),
|
||||
m_environment (Urban),
|
||||
m_citySize (Large),
|
||||
m_streetsOrientation (45.0),
|
||||
m_streetsWidth (20.0),
|
||||
m_buildingsExtend (80.0),
|
||||
m_buildingSeparation (50.0)
|
||||
{
|
||||
}
|
||||
|
||||
BuildingsPropagationLossModel::~BuildingsPropagationLossModel ()
|
||||
{
|
||||
for (PairsList::reverse_iterator i = m_shadowingPairs.rbegin (); i != m_shadowingPairs.rend (); i++)
|
||||
{
|
||||
PairsSet *ps = *i;
|
||||
for (DestinationList::iterator r = ps->receivers.begin (); r != ps->receivers.end (); r++)
|
||||
{
|
||||
ShadowingLoss *pc = *r;
|
||||
delete pc;
|
||||
PairsSet *ps = *i;
|
||||
for (DestinationList::iterator r = ps->receivers.begin (); r != ps->receivers.end (); r++)
|
||||
{
|
||||
ShadowingLoss *pc = *r;
|
||||
delete pc;
|
||||
}
|
||||
ps->sender = 0;
|
||||
ps->receivers.clear ();
|
||||
delete ps;
|
||||
}
|
||||
ps->sender = 0;
|
||||
ps->receivers.clear ();
|
||||
delete ps;
|
||||
}
|
||||
m_shadowingPairs.clear ();
|
||||
}
|
||||
|
||||
@@ -278,20 +278,20 @@ BuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<B
|
||||
{
|
||||
// Hp: a is the rooftop antenna (from GetLoss logic)
|
||||
double loss = 0.0;
|
||||
double fmhz = m_frequency/1e6;
|
||||
double fmhz = m_frequency / 1e6;
|
||||
double dist = a->GetDistanceFrom (b) / 1000.0;
|
||||
if (m_frequency<=1.500e9)
|
||||
if (m_frequency <= 1.500e9)
|
||||
{
|
||||
// standard Okumura Hata (from wikipedia)
|
||||
double log_f = log10 (fmhz);
|
||||
double hb = (a->GetPosition ().z>b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z< b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hb = (a->GetPosition ().z > b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z < b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
NS_ASSERT_MSG (hb > 0 && hm > 0, "nodes' height must be greater then 0");
|
||||
double log_aHeight = 13.82 * log10 (hb);
|
||||
double log_bHeight = 0.0;
|
||||
if (m_citySize == Large)
|
||||
{
|
||||
if (m_frequency<200)
|
||||
if (m_frequency < 200)
|
||||
{
|
||||
log_bHeight = 8.29 * pow (log10 (1.54 * hm), 2) - 1.1;
|
||||
}
|
||||
@@ -302,43 +302,43 @@ BuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<B
|
||||
}
|
||||
else
|
||||
{
|
||||
log_bHeight = 0.8 + (1.1*log_f - 0.7)*hm - 1.56*log_f;
|
||||
log_bHeight = 0.8 + (1.1 * log_f - 0.7) * hm - 1.56 * log_f;
|
||||
}
|
||||
|
||||
|
||||
// NS_LOG_INFO (this << " logf " << 26.16 * log_f << " loga " << log_aHeight << " X " << (((44.9 - (6.55 * log10(hb)) ))*log10 (a->GetDistanceFrom (b))) << " logb " << log_bHeight);
|
||||
loss = 69.55 + (26.16 * log_f) - log_aHeight + (((44.9 - (6.55 * log10(hb)) ))*log10 (dist)) - log_bHeight;
|
||||
loss = 69.55 + (26.16 * log_f) - log_aHeight + (((44.9 - (6.55 * log10 (hb)) )) * log10 (dist)) - log_bHeight;
|
||||
if (m_environment == SubUrban)
|
||||
{
|
||||
loss += - 2 * (pow(log10 (fmhz / 28), 2)) - 5.4;
|
||||
loss += -2 * (pow (log10 (fmhz / 28), 2)) - 5.4;
|
||||
}
|
||||
else if (m_environment == OpenAreas)
|
||||
{
|
||||
loss += -4.70*pow(log10(fmhz),2) + 18.33*log10(fmhz) - 40.94;
|
||||
loss += -4.70 * pow (log10 (fmhz),2) + 18.33 * log10 (fmhz) - 40.94;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (m_frequency <= 2.170e9) // max 3GPP freq EUTRA band #1
|
||||
{
|
||||
// COST 231 Okumura model
|
||||
double log_f = log10 (fmhz);
|
||||
double hb = (a->GetPosition ().z>b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z< b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hb = (a->GetPosition ().z > b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z < b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
NS_ASSERT_MSG (hb > 0 && hm > 0, "nodes' height must be greater then 0");
|
||||
double log_aHeight = 13.82 * log10 (hb);
|
||||
double log_bHeight = 0.0;
|
||||
double C = 0.0;
|
||||
|
||||
|
||||
if (m_citySize == Large)
|
||||
{
|
||||
log_bHeight = 3.2 * pow ((log10(11.75 * hm)),2);
|
||||
log_bHeight = 3.2 * pow ((log10 (11.75 * hm)),2);
|
||||
C = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_bHeight = 1.1*log_f - 0.7*hm - (1.56*log_f - 0.8);
|
||||
log_bHeight = 1.1 * log_f - 0.7 * hm - (1.56 * log_f - 0.8);
|
||||
}
|
||||
|
||||
loss = 46.3 + (33.9 * log_f) - log_aHeight + (((44.9 - (6.55 * log10(hb)) ))*log10 (dist)) - log_bHeight + C;
|
||||
|
||||
loss = 46.3 + (33.9 * log_f) - log_aHeight + (((44.9 - (6.55 * log10 (hb)) )) * log10 (dist)) - log_bHeight + C;
|
||||
}
|
||||
else if (m_frequency <= 2.690e9) // max 3GPP freq EUTRA band #1
|
||||
{
|
||||
@@ -346,9 +346,9 @@ BuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<B
|
||||
// "Path Loss Models for Suburban Scenario at 2.3GHz, 2.6GHz and 3.5GHz"
|
||||
// Sun Kun, Wang Ping, Li Yingze
|
||||
// Antennas, Propagation and EM Theory, 2008. ISAPE 2008. 8th International Symposium on
|
||||
loss = 36 + 26*log10(dist*1000);
|
||||
loss = 36 + 26 * log10 (dist * 1000);
|
||||
}
|
||||
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -377,22 +377,22 @@ BuildingsPropagationLossModel::ItuR1411Los (Ptr<BuildingsMobilityModel> a, Ptr<B
|
||||
double lossUp = 0.0;
|
||||
double pi = 3.141592653589793;
|
||||
NS_ASSERT_MSG (a->GetPosition ().z > 0 && b->GetPosition ().z > 0, "nodes' height must be greater then 0");
|
||||
double Lbp = fabs (20*log10 ((m_lambda*m_lambda)/(8*pi*a->GetPosition ().z*b->GetPosition ().z)));
|
||||
double Lbp = fabs (20 * log10 ((m_lambda * m_lambda) / (8 * pi * a->GetPosition ().z * b->GetPosition ().z)));
|
||||
double Rbp = (4 * a->GetPosition ().z * b->GetPosition ().z) / m_lambda;
|
||||
// NS_LOG_INFO (this << " Lbp " << Lbp << " Rbp " << Rbp << " lambda " << m_lambda);
|
||||
if (dist <= Rbp)
|
||||
{
|
||||
lossLow = Lbp + 20*log10(dist/Rbp);
|
||||
lossUp = Lbp + 20 + 25*log10(dist/Rbp);
|
||||
}
|
||||
{
|
||||
lossLow = Lbp + 20 * log10 (dist / Rbp);
|
||||
lossUp = Lbp + 20 + 25 * log10 (dist / Rbp);
|
||||
}
|
||||
else
|
||||
{
|
||||
lossLow = Lbp + 40*log10(dist/Rbp);
|
||||
lossUp = Lbp + 20 + 40*log10(dist/Rbp);
|
||||
}
|
||||
|
||||
{
|
||||
lossLow = Lbp + 40 * log10 (dist / Rbp);
|
||||
lossUp = Lbp + 20 + 40 * log10 (dist / Rbp);
|
||||
}
|
||||
|
||||
double loss = (lossUp + lossLow) / 2;
|
||||
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -402,26 +402,26 @@ BuildingsPropagationLossModel::ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityMod
|
||||
{
|
||||
NS_LOG_INFO (this);
|
||||
double Lori = 0.0;
|
||||
double fmhz = m_frequency/1e6;
|
||||
if ((m_streetsOrientation>=0)&&(m_streetsOrientation<35))
|
||||
double fmhz = m_frequency / 1e6;
|
||||
if ((m_streetsOrientation >= 0)&&(m_streetsOrientation < 35))
|
||||
{
|
||||
Lori = -10.0 + 0.354*m_streetsOrientation;
|
||||
Lori = -10.0 + 0.354 * m_streetsOrientation;
|
||||
}
|
||||
else if ((m_streetsOrientation>=35)&&(m_streetsOrientation<55))
|
||||
else if ((m_streetsOrientation >= 35)&&(m_streetsOrientation < 55))
|
||||
{
|
||||
Lori = 2.5 + 0.075*(m_streetsOrientation - 35);
|
||||
Lori = 2.5 + 0.075 * (m_streetsOrientation - 35);
|
||||
}
|
||||
else if ((m_streetsOrientation>=55)&&(m_streetsOrientation<90))
|
||||
else if ((m_streetsOrientation >= 55)&&(m_streetsOrientation < 90))
|
||||
{
|
||||
Lori = 2.5 + 0.075*(m_streetsOrientation - 55);
|
||||
Lori = 2.5 + 0.075 * (m_streetsOrientation - 55);
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_ERROR (this << " Street Orientation must be in [0,90]");
|
||||
}
|
||||
double distance = a->GetDistanceFrom (b);
|
||||
double hb = (a->GetPosition ().z>b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z< b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hb = (a->GetPosition ().z > b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
double hm = (a->GetPosition ().z < b->GetPosition ().z ? a->GetPosition ().z : b->GetPosition ().z);
|
||||
NS_ASSERT_MSG (hm > 0 && hb > 0, "nodes' height must be greater then 0");
|
||||
double Dhb = hb - m_rooftopHeight;
|
||||
double ds = (m_lambda * distance * distance) / (Dhb * Dhb);
|
||||
@@ -436,60 +436,60 @@ BuildingsPropagationLossModel::ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityMod
|
||||
double kf = 0.0;
|
||||
if (hb > m_rooftopHeight)
|
||||
{
|
||||
Lbsh = -18*log10(1+Dhb);
|
||||
Lbsh = -18 * log10 (1 + Dhb);
|
||||
ka = (fmhz > 2000 ? 71.4 : 54.0);
|
||||
kd = 18.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lbsh = 0;
|
||||
kd = 18.0 - 15*Dhb/a->GetPosition ().z;
|
||||
if (distance <500)
|
||||
kd = 18.0 - 15 * Dhb / a->GetPosition ().z;
|
||||
if (distance < 500)
|
||||
{
|
||||
ka = 54.0 - 1.6*Dhb*distance/1000;
|
||||
ka = 54.0 - 1.6 * Dhb * distance / 1000;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ka = 54.0 - 0.8*Dhb;
|
||||
ka = 54.0 - 0.8 * Dhb;
|
||||
}
|
||||
}
|
||||
if (fmhz>2000)
|
||||
if (fmhz > 2000)
|
||||
{
|
||||
kf = -8;
|
||||
}
|
||||
else if ((m_environment==Urban)&&(m_citySize==Large))
|
||||
else if ((m_environment == Urban)&&(m_citySize == Large))
|
||||
{
|
||||
kf = -4 + 0.7*(fmhz/925.0 -1);
|
||||
kf = -4 + 0.7 * (fmhz / 925.0 - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
kf = -4 + 1.5*(fmhz/925.0 -1);
|
||||
kf = -4 + 1.5 * (fmhz / 925.0 - 1);
|
||||
}
|
||||
|
||||
Lmsd = Lbsh + ka + kd*log10(distance/1000.0) + kf*log10(fmhz) -9.0*log10(m_buildingSeparation);
|
||||
|
||||
Lmsd = Lbsh + ka + kd*log10 (distance / 1000.0) + kf*log10 (fmhz) - 9.0 * log10 (m_buildingSeparation);
|
||||
}
|
||||
else
|
||||
{
|
||||
double theta = atan (Dhb/m_buildingSeparation);
|
||||
double rho = sqrt(Dhb*Dhb+m_buildingSeparation*m_buildingSeparation);
|
||||
double theta = atan (Dhb / m_buildingSeparation);
|
||||
double rho = sqrt (Dhb * Dhb + m_buildingSeparation * m_buildingSeparation);
|
||||
double Qm = 0.0;
|
||||
if ((hb > m_rooftopHeight -1.0) && (hb < m_rooftopHeight + 1.0))
|
||||
if ((hb > m_rooftopHeight - 1.0) && (hb < m_rooftopHeight + 1.0))
|
||||
{
|
||||
Qm = m_buildingSeparation / distance;
|
||||
}
|
||||
else if (hb > m_rooftopHeight)
|
||||
{
|
||||
Qm = 2.35*pow(Dhb/distance*sqrt(m_buildingSeparation/m_lambda), 0.9);
|
||||
Qm = 2.35 * pow (Dhb / distance * sqrt (m_buildingSeparation / m_lambda), 0.9);
|
||||
}
|
||||
else
|
||||
{
|
||||
Qm = m_buildingSeparation/(2*pi*distance)*sqrt(m_lambda/rho)*(1/theta-(1/(2*pi+theta)));
|
||||
Qm = m_buildingSeparation / (2 * pi * distance) * sqrt (m_lambda / rho) * (1 / theta - (1 / (2 * pi + theta)));
|
||||
}
|
||||
Lmsd = -10*log10(Qm*Qm);
|
||||
Lmsd = -10 * log10 (Qm * Qm);
|
||||
}
|
||||
double Lbf = 32.4 + 20*log10(distance/1000) + 20*log10(fmhz);
|
||||
double Lbf = 32.4 + 20 * log10 (distance / 1000) + 20 * log10 (fmhz);
|
||||
double Dhm = m_rooftopHeight - hm;
|
||||
double Lrts = -8.2 -10*log10 (m_streetsWidth) + 10*log10 (fmhz) + 20*log10 (Dhm) + Lori;
|
||||
double Lrts = -8.2 - 10 * log10 (m_streetsWidth) + 10 * log10 (fmhz) + 20 * log10 (Dhm) + Lori;
|
||||
// NS_LOG_INFO (this << " Lbf " << Lbf << " Lrts " << Lrts << " Dhm" << Dhm << " Lmsd " << Lmsd);
|
||||
double loss = 0.0;
|
||||
if (Lrts + Lmsd > 0)
|
||||
@@ -525,11 +525,11 @@ BuildingsPropagationLossModel::ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityMod
|
||||
// }
|
||||
// double pi = 3.141592653589793;
|
||||
// double Lr = -20*log10 (x1+x2) + (x1*x2*f_alpha/(m_streetsWidth*m_streetsWidth)) - 20*log10 (4*pi/m_lambda);
|
||||
//
|
||||
//
|
||||
// // diffraction pathloss
|
||||
// double Da = -1*(40/(2*pi))*(atan (x2/m_streetsWidth) + atan (x1/m_streetsWidth) - (pi/2));
|
||||
// double Ld = -10*log10 (x2*x1*(x1+x2)) + 2*Da + 0.1*(90 - m_cornerAngle*(180/pi)) - 20*log10 (4*pi/m_lambda);
|
||||
//
|
||||
//
|
||||
// double loss = -10*log10 (pow (10, Lr/10) + pow (10, Ld/10));
|
||||
// return (loss);
|
||||
// }
|
||||
@@ -544,39 +544,39 @@ BuildingsPropagationLossModel::ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<Buil
|
||||
double Lf = 0.0;
|
||||
Ptr<Building> aBuilding = a->GetBuilding ();
|
||||
if (aBuilding->GetBuildingType () == Building::Residential)
|
||||
{
|
||||
N = 28;
|
||||
if (n>=1)
|
||||
{
|
||||
Lf = 4 * n;
|
||||
}
|
||||
{
|
||||
N = 28;
|
||||
if (n >= 1)
|
||||
{
|
||||
Lf = 4 * n;
|
||||
}
|
||||
// NS_LOG_INFO (this << " Residential ");
|
||||
}
|
||||
}
|
||||
else if (aBuilding->GetBuildingType () == Building::Office)
|
||||
{
|
||||
N = 30;
|
||||
if (n>=1)
|
||||
{
|
||||
Lf = 15 + (4 * (n-1));
|
||||
}
|
||||
{
|
||||
N = 30;
|
||||
if (n >= 1)
|
||||
{
|
||||
Lf = 15 + (4 * (n - 1));
|
||||
}
|
||||
// NS_LOG_INFO (this << " Office ");
|
||||
}
|
||||
}
|
||||
else if (aBuilding->GetBuildingType () == Building::Commercial)
|
||||
{
|
||||
N = 22;
|
||||
if (n>=1)
|
||||
{
|
||||
Lf = 6 + (3 * (n-1));
|
||||
}
|
||||
{
|
||||
N = 22;
|
||||
if (n >= 1)
|
||||
{
|
||||
Lf = 6 + (3 * (n - 1));
|
||||
}
|
||||
// NS_LOG_INFO (this << " Commercial ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_ERROR (this << " Unkwnon Wall Type");
|
||||
}
|
||||
{
|
||||
NS_LOG_ERROR (this << " Unkwnon Wall Type");
|
||||
}
|
||||
NS_LOG_INFO (this << " Node " << a->GetPosition () << " <-> " << b->GetPosition ());
|
||||
double loss = 20*log10(m_frequency/1e6/*MHz*/) + N*log10(a->GetDistanceFrom (b)) + Lf - 28.0;
|
||||
|
||||
double loss = 20 * log10 (m_frequency / 1e6 /*MHz*/) + N*log10 (a->GetDistanceFrom (b)) + Lf - 28.0;
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -602,8 +602,8 @@ BuildingsPropagationLossModel::BEWPL (Ptr<BuildingsMobilityModel> a) const
|
||||
{
|
||||
loss = 12;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -612,9 +612,9 @@ double
|
||||
BuildingsPropagationLossModel::HeightGain (Ptr<BuildingsMobilityModel> node) const
|
||||
{
|
||||
double loss = 0.0;
|
||||
|
||||
|
||||
int nfloors = node->GetFloorNumber ();
|
||||
loss = -2*(nfloors);
|
||||
loss = -2 * (nfloors);
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -624,37 +624,37 @@ BuildingsPropagationLossModel::HeightGain (Ptr<BuildingsMobilityModel> node) con
|
||||
double
|
||||
BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
{
|
||||
|
||||
|
||||
double distance = a->GetDistanceFrom (b);
|
||||
if (distance <= m_minDistance)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
// get the BuildingsMobilityModel pointers
|
||||
Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
|
||||
Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
|
||||
|
||||
|
||||
double loss = 0.0;
|
||||
|
||||
|
||||
if (a1->IsOutdoor ())
|
||||
{
|
||||
if (b1->IsOutdoor ())
|
||||
{
|
||||
if (distance > 1000)
|
||||
{
|
||||
NS_LOG_INFO (this << a1->GetPosition ().z<<b1->GetPosition ().z<< m_rooftopHeight);
|
||||
NS_LOG_INFO (this << a1->GetPosition ().z << b1->GetPosition ().z << m_rooftopHeight);
|
||||
if ((a1->GetPosition ().z < m_rooftopHeight)
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
{
|
||||
// ITU limit in distance (i.e., < 2000 for small cells)
|
||||
if (distance < m_itu1411DistanceThreshold)
|
||||
{
|
||||
{
|
||||
// short range communication
|
||||
loss = ItuR1411 (a1, b1);
|
||||
NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// out of bound
|
||||
loss = std::numeric_limits<double>::infinity ();
|
||||
@@ -681,14 +681,14 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
if (distance > 1000)
|
||||
{
|
||||
if ((a1->GetPosition ().z < m_rooftopHeight)
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
{
|
||||
|
||||
|
||||
// ITU limit in distance (i.e., < 2000 for small cells)
|
||||
if (distance < m_itu1411DistanceThreshold)
|
||||
{
|
||||
{
|
||||
// short range communication
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(b1) + HeightGain (a1);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL (b1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " 0-I (>1000): down rooftop -> ITUR1411 : " << loss);
|
||||
}
|
||||
else
|
||||
@@ -701,13 +701,13 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
else
|
||||
{
|
||||
// Over the rooftop tranmission -> Okumura Hata
|
||||
loss = OkumuraHata (a1, b1) + BEWPL(b1);
|
||||
loss = OkumuraHata (a1, b1) + BEWPL (b1);
|
||||
NS_LOG_INFO (this << " O-I (>1000): Over the rooftop -> OH : " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(b1) + HeightGain (b1);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL (b1) + HeightGain (b1);
|
||||
NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss);
|
||||
}
|
||||
} // end b1->isIndoor ()
|
||||
@@ -719,15 +719,15 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
{
|
||||
if (a1->GetBuilding () == b1->GetBuilding ())
|
||||
{
|
||||
// nodes are in same building -> indoor communication ITU-R P.1238
|
||||
loss = ItuR1238 (a1, b1);
|
||||
NS_LOG_INFO (this << " I-I (same building) ITUR1238 : " << loss);
|
||||
|
||||
// nodes are in same building -> indoor communication ITU-R P.1238
|
||||
loss = ItuR1238 (a1, b1);
|
||||
NS_LOG_INFO (this << " I-I (same building) ITUR1238 : " << loss);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// nodes are in different buildings
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(a1) + BEWPL(b1);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL (a1) + BEWPL (b1);
|
||||
NS_LOG_INFO (this << " I-I (different) ITUR1238 + 2*BEL : " << loss);
|
||||
}
|
||||
}
|
||||
@@ -737,14 +737,14 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
if (distance > 1000)
|
||||
{
|
||||
if ((a1->GetPosition ().z < m_rooftopHeight)
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
{
|
||||
|
||||
|
||||
// ITU limit in distance (i.e., < 2000 for small cells)
|
||||
if (distance < m_itu1411DistanceThreshold)
|
||||
{
|
||||
{
|
||||
// short range communication
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL (a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " I-O (>1000): down rooftop -> ITUR1411 : " << loss);
|
||||
}
|
||||
else
|
||||
@@ -757,13 +757,13 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
else
|
||||
{
|
||||
// above rooftop -> OH
|
||||
loss = OkumuraHata (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
loss = OkumuraHata (a1, b1) + BEWPL (a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL (a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " I-O (<1000) ITUR1411 + BEL + HG: " << loss);
|
||||
}
|
||||
} // end b1->IsIndoor ()
|
||||
@@ -785,8 +785,8 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
return loss + pc->GetLoss ();
|
||||
}
|
||||
}
|
||||
double sigma = EvaluateSigma (a1, b1);
|
||||
ShadowingLoss *pc = new ShadowingLoss (0.0, sigma,b);
|
||||
double sigma = EvaluateSigma (a1, b1);
|
||||
ShadowingLoss *pc = new ShadowingLoss (0.0, sigma,b);
|
||||
ps->receivers.push_back (pc);
|
||||
return loss + pc->GetLoss ();
|
||||
}
|
||||
@@ -806,25 +806,25 @@ BuildingsPropagationLossModel::EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr
|
||||
const
|
||||
{
|
||||
if (a->IsOutdoor ())
|
||||
{
|
||||
if (b->IsOutdoor ())
|
||||
{
|
||||
return (m_shadowingSigmaOutdoor);
|
||||
if (b->IsOutdoor ())
|
||||
{
|
||||
return (m_shadowingSigmaOutdoor);
|
||||
}
|
||||
else
|
||||
{
|
||||
double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
|
||||
return (sigma);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
double sigma = sqrt((m_shadowingSigmaOutdoor*m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls*m_shadowingSigmaExtWalls));
|
||||
return (sigma);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (b->IsIndoor ())
|
||||
if (b->IsIndoor ())
|
||||
{
|
||||
return (m_shadowingSigmaIndoor);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
double sigma = sqrt((m_shadowingSigmaOutdoor*m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls*m_shadowingSigmaExtWalls));
|
||||
double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
|
||||
return (sigma);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ns3 {
|
||||
|
||||
class ShadowingLossModel;
|
||||
class JakesFadingLossModel;
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup propagation
|
||||
*
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
{
|
||||
Urban, SubUrban, OpenAreas
|
||||
};
|
||||
|
||||
|
||||
enum CitySize
|
||||
{
|
||||
Small, Medium, Large
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
double GetLambda (void) const;
|
||||
double GetFrequency (void) const;
|
||||
// void SetLambda (double frequency, double speed);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
@@ -103,9 +103,9 @@ private:
|
||||
// double ItuR1411NlosStreetCanyons (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double BEWPL (Ptr<BuildingsMobilityModel> a) const;
|
||||
|
||||
|
||||
double HeightGain (Ptr<BuildingsMobilityModel> n) const;
|
||||
|
||||
|
||||
double C; // OH loss coefficient for the environment
|
||||
double N; // ITU-R P.1238: power loss coefficient
|
||||
double m_lambda;
|
||||
@@ -120,20 +120,21 @@ private:
|
||||
double m_streetsWidth; // in meters
|
||||
double m_buildingsExtend; // in meters
|
||||
double m_buildingSeparation; // in meters
|
||||
|
||||
|
||||
// the shadowing tx/rx pairs management has been inspired by the
|
||||
// JakesFadingLossModel developed by Federico Maguolo (see jakes-propagation-model.h/cc)
|
||||
class ShadowingLoss;
|
||||
friend class ShadowingLoss;
|
||||
typedef std::vector<ShadowingLoss *> DestinationList;
|
||||
struct PairsSet {
|
||||
struct PairsSet
|
||||
{
|
||||
Ptr<MobilityModel> sender;
|
||||
DestinationList receivers;
|
||||
};
|
||||
typedef std::vector<PairsSet *> PairsList;
|
||||
double EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
|
||||
|
||||
|
||||
|
||||
double m_shadowingSigmaExtWalls;
|
||||
double m_shadowingSigmaOutdoor;
|
||||
double m_shadowingSigmaIndoor;
|
||||
|
||||
@@ -49,76 +49,76 @@ BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
|
||||
{
|
||||
|
||||
LogComponentEnable ("BuildingsPathlossTest", LOG_LEVEL_ALL);
|
||||
|
||||
double freq = 869e6; // E_UTRA BAND #5 see table 5.5-1 of 36.101
|
||||
|
||||
|
||||
double freq = 869e6; // E_UTRA BAND #5 see table 5.5-1 of 36.101
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 137.93, "OH Urban Large city"));
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Small, 137.88, "OH Urban small city"));
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::SubUrban, BuildingsPropagationLossModel::Large, 128.03, "loss OH SubUrban"));
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::OpenAreas, BuildingsPropagationLossModel::Large, 110.21, "loss OH OpenAreas"));
|
||||
|
||||
|
||||
// Test #2 COST231 Model (1500 < freq < 2000~2170 MHz) (Macro<->UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 148.55, "COST231 Urban Large city"));
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Small, 150.64, "COST231 Urban small city and suburban"));
|
||||
|
||||
|
||||
// Test #3 2.6 GHz model (Macro<->UE)
|
||||
|
||||
|
||||
freq = 2.620e9; // E_UTRA BAND #7 see table 5.5-1 of 36.101
|
||||
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Small, 121.83, "2.6GHz model"));
|
||||
|
||||
|
||||
// Test #4 ITU1411 LOS model (Macro<->UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 3, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 81.00, "ITU1411 LOS"));
|
||||
|
||||
|
||||
// Test #5 ITU1411 NLOS model (Macro<->UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 4, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 143.69, "ITU1411 NLOS"));
|
||||
|
||||
|
||||
// Test #6 ITUP1238 (HeNB <-> UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 5, 6, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 88.3855, "ITUP1238"));
|
||||
|
||||
|
||||
// Test #7 Outdoor -> Indoor OkumuraHata (Macro<->UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
// The loss is as in test #2 (large city) plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB -> 148.55 + 7 = 155.55
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 7, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 155.55, "Okumura Hata Outdoor -> Indoor"));
|
||||
|
||||
|
||||
// Test #8 Outdoor -> Indoor ITU1411 (Macro<->UE)
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
// The loss is as in test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB -> 81.000 + 7 = 88.000
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 1, 8, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 88.000, "ITU1411 LOS Outdoor -> Indoor"));
|
||||
|
||||
|
||||
// Test #9 Indoor -> Outdoor LOS (HeNB <-> UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
// The loss is similar of test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB and the height gain
|
||||
// (2 floors x 2 dB/floor = 4) -> 81.838 + 7 - 4 = 84.838
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 9, 10, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 84.838, "ITU1411 LOS Indoor -> Outdoor"));
|
||||
|
||||
|
||||
// Test #10 Indoor -> Outdoor NLOS (HeNB <-> UE)
|
||||
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
// The loss is similar as in test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB and the height gain
|
||||
// (2 floors x 2 dB/floor = 4) -> 180.90 + 7 - 4 = 183.90
|
||||
AddTestCase (new BuildingsPathlossTestCase (freq, 9, 11, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 183.90, "ITU1411 NLOS Indoor -> Outdoor"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -184,25 +184,25 @@ BuildingsPathlossTestCase::DoRun (void)
|
||||
Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
|
||||
Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
|
||||
propagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
|
||||
propagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 / m_freq));
|
||||
propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
|
||||
propagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
|
||||
// cancel shadowing effect
|
||||
propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
|
||||
propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
|
||||
propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
|
||||
|
||||
|
||||
double loss = propagationLossModel->GetLoss (mma, mmb);
|
||||
|
||||
NS_LOG_INFO ("Calculated loss: " << loss);
|
||||
NS_LOG_INFO ("Theoretical loss: " << m_lossRef);
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ_TOL(loss, m_lossRef, 0.1, "Wrong loss !");
|
||||
NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss !");
|
||||
}
|
||||
|
||||
Ptr<MobilityModel>
|
||||
@@ -223,10 +223,10 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
double distance = 2000;
|
||||
double hm = 1;
|
||||
double hb = 30;
|
||||
|
||||
|
||||
Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm1->SetPosition (Vector (0.0, 0.0, hb));
|
||||
|
||||
|
||||
Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm2->SetPosition (Vector (distance, 0.0, hm));
|
||||
|
||||
@@ -237,14 +237,14 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
distance = 900;
|
||||
Ptr<BuildingsMobilityModel> mm4 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm4->SetPosition (Vector (distance, 0.0, hm));
|
||||
|
||||
|
||||
distance = 30;
|
||||
double henbHeight = 10.0;
|
||||
Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
|
||||
|
||||
// this needs to be static otherwise it will look like a different building every time
|
||||
static Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0/*, 1, 1, 1*/);
|
||||
static Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/);
|
||||
building1->SetBuildingType (Building::Residential);
|
||||
building1->SetExtWallsType (Building::ConcreteWithWindows);
|
||||
mm5->SetIndoor (building1);
|
||||
@@ -257,7 +257,7 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
Ptr<BuildingsMobilityModel> mm7 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm7->SetPosition (Vector (distance, 0.0, hm));
|
||||
mm7->SetIndoor (building1);
|
||||
|
||||
|
||||
distance = 100;
|
||||
Ptr<BuildingsMobilityModel> mm8 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm8->SetPosition (Vector (distance, 0.0, hm));
|
||||
@@ -270,7 +270,7 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
mm9->SetFloorNumber (2);
|
||||
Ptr<BuildingsMobilityModel> mm10 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm10->SetPosition (Vector (distance, 0.0, hm));
|
||||
|
||||
|
||||
distance = 500;
|
||||
Ptr<BuildingsMobilityModel> mm11 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm11->SetPosition (Vector (distance, 0.0, hm));
|
||||
@@ -292,8 +292,8 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
break;
|
||||
|
||||
case 4:
|
||||
return mm4;
|
||||
break;
|
||||
return mm4;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
return mm5;
|
||||
@@ -322,7 +322,7 @@ BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
|
||||
case 11:
|
||||
return mm11;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
BuildingsPropagationLossModel::Environment m_env;
|
||||
BuildingsPropagationLossModel::CitySize m_city;
|
||||
double m_lossRef;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -43,19 +43,19 @@ using namespace ns3;
|
||||
|
||||
|
||||
BuildingsShadowingTestSuite::BuildingsShadowingTestSuite ()
|
||||
: TestSuite ("buildings-shadowing-test", SYSTEM)
|
||||
: TestSuite ("buildings-shadowing-test", SYSTEM)
|
||||
{
|
||||
|
||||
|
||||
LogComponentEnable ("BuildingsShadowingTest", LOG_LEVEL_ALL);
|
||||
|
||||
// Test #1 Outdoor Model
|
||||
|
||||
// Test #1 Outdoor Model
|
||||
AddTestCase (new BuildingsShadowingTestCase (1, 2, 148.86, 7.0, "Outdoor Shadowing"));
|
||||
|
||||
|
||||
// Test #2 Indoor model
|
||||
AddTestCase (new BuildingsShadowingTestCase (5, 6, 88.5724, 8.0, "Indoor Shadowing"));
|
||||
|
||||
|
||||
// Test #3 Indoor -> Outdoor
|
||||
AddTestCase (new BuildingsShadowingTestCase (9, 10, 85.0012, 8.6, "Indoor -> Outdoor Shadowing"));
|
||||
AddTestCase (new BuildingsShadowingTestCase (9, 10, 85.0012, 8.6, "Indoor -> Outdoor Shadowing"));
|
||||
|
||||
}
|
||||
|
||||
@@ -67,11 +67,11 @@ static BuildingsShadowingTestSuite buildingsShadowingTestSuite;
|
||||
*/
|
||||
|
||||
BuildingsShadowingTestCase::BuildingsShadowingTestCase ( uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name)
|
||||
: TestCase ("SHADOWING calculation: " + name),
|
||||
: TestCase ("SHADOWING calculation: " + name),
|
||||
m_mobilityModelIndex1 (m1),
|
||||
m_mobilityModelIndex2 (m2),
|
||||
m_lossRef (refValue),
|
||||
m_sigmaRef (sigmaRef)
|
||||
m_lossRef (refValue),
|
||||
m_sigmaRef (sigmaRef)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ void
|
||||
BuildingsShadowingTestCase::DoRun (void)
|
||||
{
|
||||
// LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
|
||||
|
||||
|
||||
// LogComponentEnable ("LteEnbRrc", logLevel);
|
||||
// LogComponentEnable ("LteUeRrc", logLevel);
|
||||
// LogComponentEnable ("LteEnbMac", logLevel);
|
||||
@@ -102,39 +102,39 @@ BuildingsShadowingTestCase::DoRun (void)
|
||||
// LogComponentEnable ("LtePropagationLossModel", logLevel);
|
||||
// LogComponentEnable ("LossModel", logLevel);
|
||||
// LogComponentEnable ("ShadowingLossModel", logLevel);
|
||||
// LogComponentEnable ("PenetrationLossModel", logLevel);
|
||||
// LogComponentEnable ("MultipathLossModel", logLevel);
|
||||
// LogComponentEnable ("PathLossModel", logLevel);
|
||||
//
|
||||
// LogComponentEnable ("LteNetDevice", logLevel);
|
||||
// LogComponentEnable ("LteUeNetDevice", logLevel);
|
||||
// LogComponentEnable ("LteEnbNetDevice", logLevel);
|
||||
|
||||
// LogComponentEnable ("PenetrationLossModel", logLevel);
|
||||
// LogComponentEnable ("MultipathLossModel", logLevel);
|
||||
// LogComponentEnable ("PathLossModel", logLevel);
|
||||
//
|
||||
// LogComponentEnable ("LteNetDevice", logLevel);
|
||||
// LogComponentEnable ("LteUeNetDevice", logLevel);
|
||||
// LogComponentEnable ("LteEnbNetDevice", logLevel);
|
||||
|
||||
// LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
|
||||
|
||||
|
||||
Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
|
||||
Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
|
||||
|
||||
|
||||
std::vector<double> loss;
|
||||
double sum = 0.0;
|
||||
double sumSquared = 0.0;
|
||||
int samples = 10000;
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
loss.push_back (propagationLossModel->GetLoss (mma, mmb) - m_lossRef);
|
||||
sum += loss.at (loss.size()-1);
|
||||
sumSquared += (loss.at (loss.size()-1)*loss.at (loss.size()-1));
|
||||
}
|
||||
double mean = sum/samples;
|
||||
double sigma = sqrt(sumSquared/samples - (mean*mean));
|
||||
{
|
||||
Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
loss.push_back (propagationLossModel->GetLoss (mma, mmb) - m_lossRef);
|
||||
sum += loss.at (loss.size () - 1);
|
||||
sumSquared += (loss.at (loss.size () - 1) * loss.at (loss.size () - 1));
|
||||
}
|
||||
double mean = sum / samples;
|
||||
double sigma = sqrt (sumSquared / samples - (mean * mean));
|
||||
// test whether the distribution falls in the 99% confidence interval, as expected with a nornal distribution
|
||||
double ci = (2.575829303549 * sigma) / sqrt (samples);
|
||||
|
||||
|
||||
NS_LOG_INFO ("Mean from simulation " << mean << ", sigma " << sigma << ", reference value " << m_sigmaRef << ", CI(99%) " << ci);
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ_TOL(fabs(mean), 0.0, ci, "Wrong shadowing distribution !");
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ_TOL (fabs (mean), 0.0, ci, "Wrong shadowing distribution !");
|
||||
}
|
||||
|
||||
|
||||
@@ -157,16 +157,16 @@ BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
|
||||
double hb = 30;
|
||||
Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm1->SetPosition (Vector (0.0, 0.0, hb));
|
||||
|
||||
|
||||
Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm2->SetPosition (Vector (distance, 0.0, hm));
|
||||
|
||||
|
||||
|
||||
distance = 30;
|
||||
double henbHeight = 10.0;
|
||||
Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
|
||||
static Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0/*, 1, 1, 1*/);
|
||||
static Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/);
|
||||
building1->SetBuildingType (Building::Residential);
|
||||
building1->SetExtWallsType (Building::ConcreteWithWindows);
|
||||
mm5->SetIndoor (building1);
|
||||
@@ -175,7 +175,7 @@ BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
|
||||
mm6->SetIndoor (building1);
|
||||
mm6->SetFloorNumber (2);
|
||||
|
||||
|
||||
|
||||
distance = 100;
|
||||
Ptr<BuildingsMobilityModel> mm9 = CreateObject<BuildingsMobilityModel> ();
|
||||
mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
|
||||
@@ -209,7 +209,7 @@ BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
|
||||
case 10:
|
||||
return mm10;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -35,26 +35,26 @@ using namespace ns3;
|
||||
*/
|
||||
class BuildingsShadowingTestSuite : public TestSuite
|
||||
{
|
||||
public:
|
||||
BuildingsShadowingTestSuite ();
|
||||
public:
|
||||
BuildingsShadowingTestSuite ();
|
||||
};
|
||||
|
||||
|
||||
class BuildingsShadowingTestCase : public TestCase
|
||||
{
|
||||
public:
|
||||
BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name);
|
||||
virtual ~BuildingsShadowingTestCase ();
|
||||
|
||||
private:
|
||||
virtual void DoRun (void);
|
||||
public:
|
||||
BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name);
|
||||
virtual ~BuildingsShadowingTestCase ();
|
||||
|
||||
private:
|
||||
virtual void DoRun (void);
|
||||
Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
|
||||
|
||||
uint16_t m_mobilityModelIndex1;
|
||||
uint16_t m_mobilityModelIndex2;
|
||||
double m_lossRef; // pathloss value (without shadowing)
|
||||
double m_sigmaRef;
|
||||
|
||||
double m_lossRef; // pathloss value (without shadowing)
|
||||
double m_sigmaRef;
|
||||
|
||||
};
|
||||
|
||||
#endif /*BUILDINGS_SHADOWING_TEST_H*/
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 173 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 153 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 145 KiB |
@@ -11,4 +11,6 @@ This is the stand-alone version of the ns-3 LTE module documentation.
|
||||
lte-design
|
||||
lte-user
|
||||
lte-testing
|
||||
lte-profiling
|
||||
lte-references
|
||||
|
||||
|
||||
@@ -77,13 +77,10 @@ figures :ref:`fig-lte-enb-architecture` and :ref:`fig-lte-ue-architecture`, whic
|
||||
deal respectively with the eNB and the UE. A detailed description of the most
|
||||
important components are provided in the following sections.
|
||||
|
||||
|
||||
.. figure:: figures/lte-ue-architecture.*
|
||||
:align: right
|
||||
|
||||
.. _fig-lte-enb-architecture:
|
||||
|
||||
.. figure:: figures/lte-enb-architecture.*
|
||||
:align: center
|
||||
|
||||
Architecture of the LTE eNB
|
||||
|
||||
@@ -92,6 +89,7 @@ important components are provided in the following sections.
|
||||
.. _fig-lte-ue-architecture:
|
||||
|
||||
.. figure:: figures/lte-ue-architecture.*
|
||||
:align: center
|
||||
|
||||
Architecture of the LTE UE
|
||||
|
||||
@@ -139,6 +137,7 @@ between the blocks and the SAPs defined in our implementation of the MAC
|
||||
Scheduler Interface.
|
||||
|
||||
.. figure:: figures/ff-mac-saps.*
|
||||
:align: center
|
||||
|
||||
In addition to the above principles, the following design choices have been
|
||||
taken:
|
||||
@@ -165,6 +164,7 @@ The figure below shows how the MAC Scheduler Interface is
|
||||
used within the eNB.
|
||||
|
||||
.. figure:: figures/ff-example.*
|
||||
:align: center
|
||||
|
||||
The User side of both the CSCHED SAP and the SCHED SAP are
|
||||
implemented within the eNB MAC, i.e., in the file ``lte-enb-mac.cc``.
|
||||
@@ -354,8 +354,7 @@ discussed in [Ofcom2.6GHz]_.
|
||||
|
||||
|
||||
|
||||
.. [4] 3GPP R1-081483 (available on
|
||||
http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip )
|
||||
.. [4] 3GPP R1-081483 (available `here <http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip>`_ )
|
||||
|
||||
|
||||
Physical layer
|
||||
|
||||
60
src/lte/doc/source/lte-profiling.rst
Normal file
60
src/lte/doc/source/lte-profiling.rst
Normal file
@@ -0,0 +1,60 @@
|
||||
.. include:: replace.txt
|
||||
|
||||
|
||||
+++++++++++++++++++++++++++++++++
|
||||
Profiling Documentation
|
||||
+++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
|
||||
Execution time and memory consumption
|
||||
-------------------------------------
|
||||
|
||||
In order to provide an evaluation of the execution time and
|
||||
memory consumption, a
|
||||
reference simulation program (``examples/profiling-reference``) has been
|
||||
developed. This program simulates a scenario
|
||||
composed by a set of eNodeBs, and a set of UEs attached to each eNB. All eNodeBs
|
||||
have the same number of attached UEs. Communications are performed both in the
|
||||
dowlink and in the uplink using a saturation model (i.e., each RLC instance
|
||||
always has a PDU to transmit). The UEs are all in the same position than its
|
||||
eNodeB and the eNodeBs are distributed in a line, each one 140m away from the
|
||||
previous one. The total simulation time is set to 60s.
|
||||
|
||||
Using this simulation program, we ran a simulation campaign varying the number
|
||||
of eNBs as well as the number of UEs per eNB. For each simulation, we measured
|
||||
the execution time using the ``time`` shell command in linux, and the memory
|
||||
consumption by looking at the information in ``/proc/\{pid\}/statm``. The
|
||||
reference hardware platform is an Intel Core2 Duo E8400 3.00GHz with 512 MB of
|
||||
RAM memory running a Fedora Core 10 distribution with kernel
|
||||
2.6.27.5. The simulator build used in this
|
||||
experiment was configured with the options ``-d optimized
|
||||
--enable-static``.
|
||||
|
||||
The results are reported in `fig-simulationTime`_ and `fig-memoryUsage`_.
|
||||
We note that the memory usage, as expected,
|
||||
primarily depends on the number of eNBs, however is in general quite low. The
|
||||
execution time depends significantly on both the number of eNBs and the number
|
||||
of UEs per eNB. For the case of 10 UEs per eNB, we also show that the
|
||||
experimental data can be fitted quite accurately by a quadratic function. We
|
||||
suggest that this behavior is due to the fact that the
|
||||
interference calculations have a computational complexity which is quadratic with
|
||||
respect to the number of eNBs, and which is the dominant contribution in the overall
|
||||
computational load.
|
||||
|
||||
|
||||
.. _fig-simulationTime:
|
||||
|
||||
.. figure:: figures/simulationTime.*
|
||||
:align: center
|
||||
|
||||
Execution time of the reference program for a simulation duration of 60s.
|
||||
|
||||
|
||||
.. _fig-memoryUsage:
|
||||
|
||||
.. figure:: figures/memoryUsage.*
|
||||
:align: center
|
||||
|
||||
Memory usage of the reference program.
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
.. include:: replace.txt
|
||||
|
||||
|
||||
+++++++++++++++++++++++++++++++++
|
||||
References
|
||||
+++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
.. [Sesia2009] S. Sesia, I. Toufik and M. Baker, "LTE - The UMTS Long Term Evolution - from theory to practice",
|
||||
Wiley, 2009
|
||||
@@ -36,13 +41,13 @@
|
||||
.. [TS36.104] 3GPP TS 36.104 "E-UTRA Base Station (BS) radio transmission and reception"
|
||||
|
||||
|
||||
.. [R1-081483] 3GPP R1-081483 "Conveying MCS and TB size via PDCCH" http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip
|
||||
.. [R1-081483] 3GPP R1-081483 `Conveying MCS and TB size via PDCCH <http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip>`_
|
||||
|
||||
.. [FFAPI] FemtoForum LTE MAC Scheduler Interface Specification v1.11 http://www.femtoforum.org/femto/technical.php
|
||||
.. [FFAPI] `FemtoForum LTE MAC Scheduler Interface Specification v1.11 <http://www.femtoforum.org/femto/technical.php>`_
|
||||
|
||||
.. [ns3tutorial] The ns-3 Tutorial http://www.nsnam.org/docs/tutorial/singlehtml/index.html
|
||||
.. [ns3tutorial] `The ns-3 Tutorial <http://www.nsnam.org/docs/tutorial/singlehtml/index.html>`_
|
||||
|
||||
.. [ns3manual] The ns-3 Manual http://www.nsnam.org/docs/manual/singlehtml/index.html
|
||||
.. [ns3manual] `The ns-3 Manual <http://www.nsnam.org/docs/manual/singlehtml/index.html>`_
|
||||
|
||||
.. [pl26ghz] Sun Kun; Wang Ping; Li Yingze, "Path loss models for suburban scenario at 2.3GHz, 2.6GHz and 3.5GHz",
|
||||
in Proc. of ISAPE 2008, Kunming, China, Nov 2008.
|
||||
@@ -56,5 +61,5 @@
|
||||
|
||||
.. [cost231] "Digital Mobile Radio: COST 231 View on the Evolution Towards 3rd Generation Systems", Commission of the European Communities, L-2920, Luxembourg, 1989
|
||||
|
||||
.. [mathworks] Matlab R2011b Documentation Communications System Toolbox, "Methodology for Simulating Multipath Fading Channels" http://www.mathworks.es/help/toolbox/comm/ug/a1069449399.html#bq5zk36
|
||||
.. [mathworks] Matlab R2011b Documentation Communications System Toolbox, `Methodology for Simulating Multipath Fading Channels <http://www.mathworks.es/help/toolbox/comm/ug/a1069449399.html#bq5zk36>`_
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
Background
|
||||
**********
|
||||
----------
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ we strongly recommend the reader to consult [ns3tutorial]_.
|
||||
|
||||
|
||||
Usage Overview
|
||||
**************
|
||||
--------------
|
||||
|
||||
The ns-3 LTE model is a software library that allows the simulation of
|
||||
LTE networks. The process of performing such simulations typically involves the following
|
||||
@@ -161,7 +161,7 @@ Now create a text file named (for example) ``input-defaults.txt``
|
||||
specifying the new default values that you want to use for some attributes::
|
||||
|
||||
default ns3::LenaHelper::Scheduler "ns3::PfFfMacScheduler"
|
||||
default ns3::LenaHelper::PropagationModel "ns3::FriisSpectrumPropagationLossModel"
|
||||
default ns3::LenaHelper::PathlossModel "ns3::FriisSpectrumPropagationLossModel"
|
||||
default ns3::LteEnbNetDevice::UlBandwidth "25"
|
||||
default ns3::LteEnbNetDevice::DlBandwidth "25"
|
||||
default ns3::LteEnbNetDevice::DlEarfcn "100"
|
||||
@@ -259,75 +259,16 @@ the ns-3 attributes ``ns3::MacStatsCalculator::DlOutputFilename`` and
|
||||
``ns3::MacStatsCalculator::UlOutputFilename``.
|
||||
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
Fading Trace Usage
|
||||
------------------
|
||||
|
||||
The directory ``src/lte/examples/`` contains some example simulation programs that
|
||||
show how to simulate different LTE scenarios.
|
||||
|
||||
|
||||
Performance evaluation
|
||||
**********************
|
||||
|
||||
Execution time and memory consumption
|
||||
-------------------------------------
|
||||
|
||||
In order to provide an evaluation of the execution time and
|
||||
memory consumption, a
|
||||
reference simulation program (``examples/profiling-reference``) has been
|
||||
developed. This program simulates a scenario
|
||||
composed by a set of eNodeBs, and a set of UEs attached to each eNB. All eNodeBs
|
||||
have the same number of attached UEs. Communications are performed both in the
|
||||
dowlink and in the uplink using a saturation model (i.e., each RLC instance
|
||||
always has a PDU to transmit). The UEs are all in the same position than its
|
||||
eNodeB and the eNodeBs are distributed in a line, each one 140m away from the
|
||||
previous one. The total simulation time is set to 60s.
|
||||
|
||||
Using this simulation program, we ran a simulation campaign varying the number
|
||||
of eNBs as well as the number of UEs per eNB. For each simulation, we measured
|
||||
the execution time using the ``time`` shell command in linux, and the memory
|
||||
consumption by looking at the information in ``/proc/\{pid\}/statm``. The
|
||||
reference hardware platform is an Intel Core2 Duo E8400 3.00GHz with 512 MB of
|
||||
RAM memory running a Fedora Core 10 distribution with kernel
|
||||
2.6.27.5. The simulator build used in this
|
||||
experiment was configured with the options ``-d optimized
|
||||
--enable-static``.
|
||||
|
||||
The results are reported in `fig-simulationTime`_ and `fig-memoryUsage`_.
|
||||
We note that the memory usage, as expected,
|
||||
primarily depends on the number of eNBs, however is in general quite low. The
|
||||
execution time depends significantly on both the number of eNBs and the number
|
||||
of UEs per eNB. For the case of 10 UEs per eNB, we also show that the
|
||||
experimental data can be fitted quite accurately by a quadratic function. We
|
||||
suggest that this behavior is due to the fact that the
|
||||
interference calculations have a computational complexity which is quadratic with
|
||||
respect to the number of eNBs, and which is the dominant contribution in the overall
|
||||
computational load.
|
||||
|
||||
|
||||
.. _fig-simulationTime:
|
||||
|
||||
.. figure:: figures/simulationTime.*
|
||||
:align: center
|
||||
|
||||
Execution time of the reference program for a simulation duration of 60s.
|
||||
|
||||
|
||||
.. _fig-memoryUsage:
|
||||
|
||||
.. figure:: figures/memoryUsage.*
|
||||
:align: center
|
||||
|
||||
Memory usage of the reference program.
|
||||
|
||||
|
||||
Fading Trace Management
|
||||
***********************
|
||||
In this section we will describe how to use fading traces within LTE simulations.
|
||||
|
||||
Fading Traces Generation
|
||||
------------------------
|
||||
************************
|
||||
|
||||
Thanks to the matlab script provided with the code (``/lte/model/fading-traces/fading-trace-generator.m``) it is possible to generate traces according to specific simulation scenarios. The script already includes the typical taps configurations for three 3GPP scenarios (i.e., pedestrian, vehicular and urban as defined in Annex B.2 of [TS36.104]_); however users can introduce their specific configurations. The list of the configurable parameters is provided in the following:
|
||||
|
||||
It is possible to generate fading traces by using a dedicated matlab script provided with the code (``/lte/model/fading-traces/fading-trace-generator.m``). This script already includes the typical taps configurations for three 3GPP scenarios (i.e., pedestrian, vehicular and urban as defined in Annex B.2 of [TS36.104]_); however users can also introduce their specific configurations. The list of the configurable parameters is provided in the following:
|
||||
|
||||
* ``fc`` : the frequency in use (it affects the computation of the dopples speed).
|
||||
* ``v_km_h`` : the speed of the users
|
||||
@@ -335,29 +276,31 @@ Thanks to the matlab script provided with the code (``/lte/model/fading-traces/f
|
||||
* ``numRBs`` : the number of the resource block to be evaluated.
|
||||
* ``tag`` : the tag to be applied to the file generated.
|
||||
|
||||
The file generated is formatted in a matrix fashion by putting each RBs temporal fading trace samples in different rows.
|
||||
It has to be noted that, the model is able to manage external fading trace (e.g., generated with dedicated simulators or obtained in experimental way) which respect the format used by the model (i.e., ASCII file with temporal fading trace of each RB distributed in rows).
|
||||
The file generated contains ASCII-formatted real values organized in a matrix fashion: every row corresponds to a different RB, and every column correspond to a different temporal fading trace sample.
|
||||
|
||||
It has to be noted that the ns-3 LTE module is able to work with any fading trace file that complies with the above described ASCII format. Hence, other external tools can be used to generate custom fading traces, such as for example other simulators or experimental devices.
|
||||
|
||||
Fading Traces Usage
|
||||
-------------------
|
||||
*******************
|
||||
|
||||
The proper set of the trace parameters in the simulation is of paramount importance for the correct interpretation of the trace itself within the simulator.
|
||||
The list of the parameters to be configured are:
|
||||
When using a fading trace, it is of paramount importance to specify correctly the trace parameters in the simulation, so that the fading model can load and use it correcly.
|
||||
The parameters to be configured are:
|
||||
|
||||
* ``TraceFilename`` : the name of the trace to be loaded (absolute path o relative one according to the execution point of the script).
|
||||
* ``TraceLength`` : the trace duration in seconds.
|
||||
* ``SamplesNum`` : the number of samples.
|
||||
* ``WindowSize`` : the size of the fading sampling window in seconds.
|
||||
* ``TraceFilename`` : the name of the trace to be loaded (absolute path, or relative path w.r.t. the path from where the simulation program is executed);
|
||||
* ``TraceLength`` : the trace duration in seconds;
|
||||
* ``SamplesNum`` : the number of samples;
|
||||
* ``WindowSize`` : the size of the fading sampling window in seconds;
|
||||
|
||||
It is important to highlight that the sampling interval of the fading trace has to me at most of 1 ms or greater and in the latter case it has to be an integer multiple of 1 ms in order to be correctly processed by the fading module.
|
||||
The default configuration of the matlab script provides a trace 10 seconds long, made of 10,000 samples (i.e., 1 sample per TTI ~ 1ms) and used with a windows size of 0.5 seconds amplitude. These are also the default values of the parameters above used in the simulator; therefore their settage can be avoided in case the fading trace respects them.
|
||||
|
||||
In order to activate the fading module (by default not active) it has to be explicitly specified in the simulation script::
|
||||
The default configuration of the matlab script provides a trace 10 seconds long, made of 10,000 samples (i.e., 1 sample per TTI=1ms) and used with a windows size of 0.5 seconds amplitude. These are also the default values of the parameters above used in the simulator; therefore their settage can be avoided in case the fading trace respects them.
|
||||
|
||||
In order to activate the fading module (which is not active by default) the following code should be included in the simulation program::
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
lena->SetFadingModel("ns3::TraceFadingLossModel");
|
||||
|
||||
While, for setting the parameters::
|
||||
And for setting the parameters::
|
||||
|
||||
lena->SetFadingModelAttribute ("TraceFilename", StringValue ("src/lte/model/fading-traces/fading_trace_EPA_3kmph.fad"));
|
||||
lena->SetFadingModelAttribute ("TraceLength", TimeValue (Seconds (10.0)));
|
||||
@@ -365,49 +308,55 @@ While, for setting the parameters::
|
||||
lena->SetFadingModelAttribute ("WindowSize", TimeValue (Seconds (0.5)));
|
||||
lena->SetFadingModelAttribute ("RbNum", UintegerValue (100));
|
||||
|
||||
It has to be noted that, ``TraceFilename`` does not have a default value, therefore is has to be always set for using the fading module in the simulator. The simulator provide natively three fading traces generated according to the configurations defined in in Annex B.2 of [TS36.104]_ (available in the folder ``src/lte/model/fading-traces/``); examples of such traces are reported in `fig-fadingPedestrianTrace_`, `fig-fadingVehicularTrace_` and `fig-fadingUrbanTrace_`.
|
||||
It has to be noted that, ``TraceFilename`` does not have a default value, therefore is has to be always set explicitly.
|
||||
|
||||
The simulator provide natively three fading traces generated according to the configurations defined in in Annex B.2 of [TS36.104]_. These traces are available in the folder ``src/lte/model/fading-traces/``). An excerpt from these traces is represented in the following figures.
|
||||
|
||||
|
||||
.. _fig-fadingPedestrianTrace:
|
||||
|
||||
.. figure:: figures/fading_pedestrian.*
|
||||
:align: center
|
||||
:alt: Fading trace 3 kmph
|
||||
|
||||
Example of the fading trace included in the simulator for a pedestrian scenario (speed of 3 kmph).
|
||||
Excerpt of the fading trace included in the simulator for a pedestrian scenario (speed of 3 kmph).
|
||||
|
||||
.. _fig-fadingVehicularTrace:
|
||||
|
||||
.. figure:: figures/fading_vehicular.*
|
||||
:align: center
|
||||
:alt: Fading trace 60 kmph
|
||||
|
||||
Example of the fading trace included in the simulator for a vehicular scenario (speed of 60 kmph).
|
||||
Excerpt of the fading trace included in the simulator for a vehicular scenario (speed of 60 kmph).
|
||||
|
||||
.. _fig-fadingUrbanTrace:
|
||||
|
||||
.. figure:: figures/fading_urban_3kmph.*
|
||||
:align: center
|
||||
:alt: Fading trace 3 kmph
|
||||
|
||||
Example of the fading trace included in the simulator for an urban scenario (speed of 3 kmph).
|
||||
Excerpt of the fading trace included in the simulator for an urban scenario (speed of 3 kmph).
|
||||
|
||||
|
||||
Building Mobility Model
|
||||
-----------------------
|
||||
Buildings Mobility Model
|
||||
------------------------
|
||||
|
||||
We now explain by examples how to use the buildings model (in particular, the ``BuildingMobilityModel`` and the ``BuildingPropagationModel`` classes) in an ns-3 simulation program to setup an LTE simulation scenario that includes buildings and indoor nodes.
|
||||
|
||||
In what following, a few guidelines for the usage of the ``BuildingMobilityModel`` and the ``BuildingPropagationModel`` classes.
|
||||
|
||||
.. highlight:: none
|
||||
|
||||
#. Inheritance::
|
||||
#. Header files to be included::
|
||||
|
||||
#include <ns3/buildings-mobility-model.h>
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/building.h>
|
||||
|
||||
#. Propagation model selection::
|
||||
#. Pathloss model selection::
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
|
||||
#. EUTRA Band Selection
|
||||
|
||||
@@ -416,7 +365,7 @@ The selection of the working frequency of the propagation model has to be done w
|
||||
lena->SetEnbDeviceAttribute ("DlEarfcn", UintegerValue (100));
|
||||
lena->SetEnbDeviceAttribute ("UlEarfcn", UintegerValue (18100));
|
||||
|
||||
It is to be noted that any other configuration (i.e., with BuildingsPropagationLossModel attributes) might generates conflicts in the frequencies definition in the modules during the simulation.
|
||||
It is to be noted that using other means to configure the frequency used by the propagation model (i.e., configuring the corresponding BuildingsPropagationLossModel attributes directly) might generates conflicts in the frequencies definition in the modules during the simulation, and is therefore not advised.
|
||||
|
||||
#. Mobility model selection::
|
||||
|
||||
@@ -450,7 +399,7 @@ It is to be noted that any other configuration (i.e., with BuildingsPropagationL
|
||||
building->SetNumberRoomX (3);
|
||||
building->SetNumberRoomY (2);
|
||||
|
||||
This will instantiate a residential building with base of 10 x 20 meters and height of 10 meters with concrete with windows as external walls, three floors and a grid of rooms of 3 x 2.
|
||||
This will instantiate a residential building with base of 10 x 20 meters and height of 10 meters whose external walls are of concrete with windows; the building has three floors and has an internal 3 x 2 grid of rooms of equal size.
|
||||
|
||||
#. Building and nodes interactions::
|
||||
|
||||
@@ -459,12 +408,18 @@ It is to be noted that any other configuration (i.e., with BuildingsPropagationL
|
||||
mm->SetRoomNumberX (1);
|
||||
mm->SetRoomNumberY (1);
|
||||
|
||||
This informs node's mobility model the fact that the node is inside the building at the second floor in the corner room of the 3 x 2 grid.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position and the building site, which is user's responsibility.
|
||||
|
||||
|
||||
|
||||
|
||||
This informs the node's mobility model that the node is located inside the building on the second floor in the corner room of the 3 x 2 grid.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position (x,y,z coordinates) and the building position and size. The responsibility of this consistency is completely left to the user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
|
||||
The directory ``src/lte/examples/`` contains some example simulation programs that
|
||||
show how to simulate different LTE scenarios.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
lte-design
|
||||
lte-user
|
||||
lte-testing
|
||||
lte-profiling
|
||||
lte-references
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -78,7 +78,7 @@ int main (int argc, char *argv[])
|
||||
cmd.Parse (argc, argv);
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
//lena->EnableLogComponents ();
|
||||
|
||||
// LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
|
||||
|
||||
@@ -177,7 +177,7 @@ int main (int argc, char *argv[])
|
||||
// but it WON'T work if you ONLY use SpectrumPropagationLossModels such as:
|
||||
// ns3::FriisSpectrumPropagationLossModel
|
||||
// ns3::ConstantSpectrumPropagationLossModel
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::Cost231PropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::Cost231PropagationLossModel"));
|
||||
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/lte-module.h"
|
||||
#include "ns3/config-store.h"
|
||||
#include "ns3/gtk-config-store.h"
|
||||
//#include "ns3/gtk-config-store.h"
|
||||
|
||||
|
||||
using namespace ns3;
|
||||
@@ -43,7 +43,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
// Enable LTE log components
|
||||
//lena->EnableLogComponents ();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/lte-module.h"
|
||||
#include "ns3/config-store.h"
|
||||
#include "ns3/gtk-config-store.h"
|
||||
//#include "ns3/gtk-config-store.h"
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
|
||||
#include <iomanip>
|
||||
@@ -69,16 +69,16 @@ main (int argc, char *argv[])
|
||||
|
||||
Ptr < LenaHelper > lena = CreateObject<LenaHelper> ();
|
||||
//lena->EnableLogComponents ();
|
||||
LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
|
||||
//LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
|
||||
if (nFloors == 0)
|
||||
{
|
||||
lena->SetAttribute("PropagationModel",
|
||||
lena->SetAttribute("PathlossModel",
|
||||
StringValue("ns3::FriisPropagationLossModel"));
|
||||
nEnb = nEnbPerFloor;
|
||||
}
|
||||
else
|
||||
{
|
||||
lena->SetAttribute("PropagationModel",
|
||||
lena->SetAttribute("PathlossModel",
|
||||
StringValue("ns3::BuildingsPropagationLossModel"));
|
||||
nEnb = nFloors * nEnbPerFloor;
|
||||
}
|
||||
@@ -147,12 +147,13 @@ main (int argc, char *argv[])
|
||||
building->SetNumberRoomY(nRooms);
|
||||
mobility.SetMobilityModel("ns3::BuildingsMobilityModel");
|
||||
mobility.Install (enbNodes);
|
||||
uint32_t plantedEnb = 0;
|
||||
for (uint32_t floor = 0; floor < nFloors; floor++)
|
||||
{
|
||||
uint32_t plantedEnb = 0;
|
||||
uint32_t plantedEnbPerFloor = 0;
|
||||
for (uint32_t row = 0; row < nRooms; row++)
|
||||
{
|
||||
for (uint32_t column = 0; column < nRooms && plantedEnb < nEnbPerFloor; column++, plantedEnb++)
|
||||
for (uint32_t column = 0; column < nRooms && plantedEnbPerFloor < nEnbPerFloor; column++, plantedEnb++, plantedEnbPerFloor++)
|
||||
{
|
||||
Vector v (roomLength * (column + 0.5),
|
||||
roomLength * (row + 0.5),
|
||||
@@ -209,7 +210,7 @@ main (int argc, char *argv[])
|
||||
|
||||
Simulator::Run();
|
||||
|
||||
/* GtkConfigStore config;
|
||||
/*GtkConfigStore config;
|
||||
config.ConfigureAttributes ();*/
|
||||
|
||||
Simulator::Destroy();
|
||||
|
||||
@@ -21,38 +21,30 @@
|
||||
|
||||
|
||||
#include "lena-helper.h"
|
||||
|
||||
#include <ns3/string.h>
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/abort.h>
|
||||
#include <ns3/pointer.h>
|
||||
|
||||
#include <ns3/lte-enb-rrc.h>
|
||||
#include <ns3/lte-ue-rrc.h>
|
||||
#include <ns3/lte-ue-mac.h>
|
||||
#include <ns3/lte-enb-mac.h>
|
||||
#include <ns3/lte-enb-net-device.h>
|
||||
|
||||
#include <ns3/lte-enb-phy.h>
|
||||
#include <ns3/lte-ue-phy.h>
|
||||
#include <ns3/lte-spectrum-phy.h>
|
||||
#include <ns3/lte-sinr-chunk-processor.h>
|
||||
#include <ns3/single-model-spectrum-channel.h>
|
||||
#include <ns3/friis-spectrum-propagation-loss.h>
|
||||
|
||||
#include <ns3/lte-enb-net-device.h>
|
||||
#include <ns3/lte-ue-net-device.h>
|
||||
|
||||
#include <ns3/ff-mac-scheduler.h>
|
||||
#include <ns3/lte-rlc.h>
|
||||
#include <ns3/lte-rlc-um.h>
|
||||
|
||||
#include <ns3/epc-helper.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
|
||||
#include <ns3/lte-spectrum-value-helper.h>
|
||||
|
||||
|
||||
@@ -139,8 +131,8 @@ TypeId LenaHelper::GetTypeId (void)
|
||||
StringValue ("ns3::PfFfMacScheduler"),
|
||||
MakeStringAccessor (&LenaHelper::SetSchedulerType),
|
||||
MakeStringChecker ())
|
||||
.AddAttribute ("PropagationModel",
|
||||
"The type of propagation model to be used",
|
||||
.AddAttribute ("PathlossModel",
|
||||
"The type of pathloss model to be used",
|
||||
StringValue ("ns3::BuildingsPropagationLossModel"),
|
||||
MakeStringAccessor (&LenaHelper::SetPropagationModelType),
|
||||
MakeStringChecker ())
|
||||
@@ -210,7 +202,7 @@ LenaHelper::SetPropagationModelType (std::string type)
|
||||
}
|
||||
|
||||
void
|
||||
LenaHelper::SetPropagationModelAttribute (std::string n, const AttributeValue &v)
|
||||
LenaHelper::SetPathlossModelAttribute (std::string n, const AttributeValue &v)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << n);
|
||||
m_dlPropagationModelFactory.Set (n, v);
|
||||
@@ -359,6 +351,7 @@ LenaHelper::InstallSingleEnbDevice (Ptr<Node> n)
|
||||
Ptr<NetDevice>
|
||||
LenaHelper::InstallSingleUeDevice (Ptr<Node> n)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
Ptr<LteSpectrumPhy> dlPhy = CreateObject<LteSpectrumPhy> ();
|
||||
Ptr<LteSpectrumPhy> ulPhy = CreateObject<LteSpectrumPhy> ();
|
||||
|
||||
@@ -522,6 +515,7 @@ LenaHelper::GetRlcType (EpsBearer bearer)
|
||||
void
|
||||
LenaHelper::EnableLogComponents (void)
|
||||
{
|
||||
LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
|
||||
LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
|
||||
@@ -578,12 +572,12 @@ FindImsiFromEnbRlcPath (std::string path)
|
||||
|
||||
// We retrieve the UeInfo associated to the C-RNTI and perform the IMSI lookup
|
||||
std::string ueMapPath = path.substr (0, path.find ("/RadioBearerMap"));
|
||||
NS_LOG_LOGIC ("ueMapPath = " << ueMapPath);
|
||||
Config::MatchContainer match = Config::LookupMatches (ueMapPath);
|
||||
|
||||
if (match.GetN () != 0)
|
||||
{
|
||||
Ptr<Object> ueInfo = match.Get (0);
|
||||
NS_LOG_LOGIC ("FindImsiFromEnbRlcPath: " << path << ", " << ueInfo->GetObject<UeInfo> ()->GetImsi ());
|
||||
return ueInfo->GetObject<UeInfo> ()->GetImsi ();
|
||||
}
|
||||
else
|
||||
@@ -606,6 +600,7 @@ FindCellIdFromEnbRlcPath (std::string path)
|
||||
if (match.GetN () != 0)
|
||||
{
|
||||
Ptr<Object> enbNetDevice = match.Get (0);
|
||||
NS_LOG_LOGIC ("FindCellIdFromEnbRlcPath: " << path << ", " << enbNetDevice->GetObject<LteEnbNetDevice> ()->GetCellId ());
|
||||
return enbNetDevice->GetObject<LteEnbNetDevice> ()->GetCellId ();
|
||||
}
|
||||
else
|
||||
@@ -628,6 +623,7 @@ FindImsiFromUeRlcPath (std::string path)
|
||||
if (match.GetN () != 0)
|
||||
{
|
||||
Ptr<Object> ueNetDevice = match.Get (0);
|
||||
NS_LOG_LOGIC ("FindImsiFromUeRlcPath: " << path << ", " << ueNetDevice->GetObject<LteUeNetDevice> ()->GetImsi ());
|
||||
return ueNetDevice->GetObject<LteUeNetDevice> ()->GetImsi ();
|
||||
}
|
||||
else
|
||||
@@ -644,11 +640,11 @@ FindImsiFromEnbMac (std::string path, uint16_t rnti)
|
||||
// /NodeList/#NodeId/DeviceList/#DeviceId/LteEnbMac/DlScheduling
|
||||
std::ostringstream oss;
|
||||
std::string p = path.substr (0, path.find ("/LteEnbMac"));
|
||||
NS_LOG_LOGIC ("p = " << p);
|
||||
oss << rnti;
|
||||
p += "/LteEnbRrc/UeMap/" + oss.str ();
|
||||
NS_LOG_LOGIC ("p = " << p);
|
||||
return FindImsiFromEnbRlcPath (p);
|
||||
uint64_t imsi = FindImsiFromEnbRlcPath (p);
|
||||
NS_LOG_LOGIC ("FindImsiFromEnbMac: " << path << ", " << rnti << ", " << imsi);
|
||||
return imsi;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
@@ -660,7 +656,9 @@ FindCellIdFromEnbMac (std::string path, uint16_t rnti)
|
||||
std::string p = path.substr (0, path.find ("/LteEnbMac"));
|
||||
oss << rnti;
|
||||
p += "/LteEnbRrc/UeMap/" + oss.str ();
|
||||
return FindCellIdFromEnbRlcPath (p);
|
||||
uint16_t cellId = FindCellIdFromEnbRlcPath (p);
|
||||
NS_LOG_LOGIC ("FindCellIdFromEnbMac: " << path << ", "<< rnti << ", " << cellId);
|
||||
return cellId;
|
||||
}
|
||||
|
||||
|
||||
@@ -774,25 +772,27 @@ DlSchedulingCallback (Ptr<MacStatsCalculator> macStats,
|
||||
{
|
||||
NS_LOG_FUNCTION (macStats << path);
|
||||
uint64_t imsi = 0;
|
||||
if (macStats->ExistsImsiPath(path) == true)
|
||||
std::ostringstream pathAndRnti;
|
||||
pathAndRnti << path << "/" << rnti;
|
||||
if (macStats->ExistsImsiPath(pathAndRnti.str ()) == true)
|
||||
{
|
||||
imsi = macStats->GetImsiPath (path);
|
||||
imsi = macStats->GetImsiPath (pathAndRnti.str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
imsi = FindImsiFromEnbMac (path, rnti);
|
||||
macStats->SetImsiPath (path, imsi);
|
||||
macStats->SetImsiPath (pathAndRnti.str (), imsi);
|
||||
}
|
||||
|
||||
uint16_t cellId = 0;
|
||||
if (macStats->ExistsCellIdPath(path) == true)
|
||||
if (macStats->ExistsCellIdPath(pathAndRnti.str ()) == true)
|
||||
{
|
||||
cellId = macStats->GetCellIdPath (path);
|
||||
cellId = macStats->GetCellIdPath (pathAndRnti.str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
cellId = FindCellIdFromEnbMac (path, rnti);
|
||||
macStats->SetCellIdPath (path, cellId);
|
||||
macStats->SetCellIdPath (pathAndRnti.str (), cellId);
|
||||
}
|
||||
|
||||
macStats->DlScheduling (cellId, imsi, frameNo, subframeNo, rnti, mcsTb1, sizeTb1, mcsTb2, sizeTb2);
|
||||
@@ -830,24 +830,26 @@ UlSchedulingCallback (Ptr<MacStatsCalculator> macStats, std::string path,
|
||||
NS_LOG_FUNCTION (macStats << path);
|
||||
|
||||
uint64_t imsi = 0;
|
||||
if (macStats->ExistsImsiPath(path) == true)
|
||||
std::ostringstream pathAndRnti;
|
||||
pathAndRnti << path << "/" << rnti;
|
||||
if (macStats->ExistsImsiPath(pathAndRnti.str ()) == true)
|
||||
{
|
||||
imsi = macStats->GetImsiPath (path);
|
||||
imsi = macStats->GetImsiPath (pathAndRnti.str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
imsi = FindImsiFromEnbMac (path, rnti);
|
||||
macStats->SetImsiPath (path, imsi);
|
||||
macStats->SetImsiPath (pathAndRnti.str (), imsi);
|
||||
}
|
||||
uint16_t cellId = 0;
|
||||
if (macStats->ExistsCellIdPath(path) == true)
|
||||
if (macStats->ExistsCellIdPath(pathAndRnti.str ()) == true)
|
||||
{
|
||||
cellId = macStats->GetCellIdPath (path);
|
||||
cellId = macStats->GetCellIdPath (pathAndRnti.str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
cellId = FindCellIdFromEnbMac (path, rnti);
|
||||
macStats->SetCellIdPath (path, cellId);
|
||||
macStats->SetCellIdPath (pathAndRnti.str (), cellId);
|
||||
}
|
||||
|
||||
macStats->UlScheduling (cellId, imsi, frameNo, subframeNo, rnti, mcs, size);
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
* \param n the name of the attribute
|
||||
* \param v the value of the attribute
|
||||
*/
|
||||
void SetPropagationModelAttribute (std::string n, const AttributeValue &v);
|
||||
void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
*/
|
||||
|
||||
#include "lte-stats-calculator.h"
|
||||
#include <ns3/log.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("LteStatsCalculator");
|
||||
|
||||
LteStatsCalculator::LteStatsCalculator ()
|
||||
: m_dlOutputFilename (""),
|
||||
@@ -86,6 +88,7 @@ LteStatsCalculator::ExistsImsiPath (std::string path)
|
||||
void
|
||||
LteStatsCalculator::SetImsiPath (std::string path, uint64_t imsi)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << path << imsi);
|
||||
m_pathImsiMap[path] = imsi;
|
||||
}
|
||||
|
||||
@@ -111,6 +114,7 @@ LteStatsCalculator::ExistsCellIdPath (std::string path)
|
||||
void
|
||||
LteStatsCalculator::SetCellIdPath (std::string path, uint16_t cellId)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << path << cellId);
|
||||
m_pathCellIdMap[path] = cellId;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void
|
||||
MacStatsCalculator::DlScheduling (uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo,
|
||||
uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << mcsTb1 << sizeTb1 << mcsTb2 << sizeTb2);
|
||||
NS_LOG_INFO ("Write DL Mac Stats in " << GetDlOutputFilename ().c_str ());
|
||||
|
||||
std::ofstream outFile;
|
||||
@@ -99,7 +99,7 @@ void
|
||||
MacStatsCalculator::UlScheduling (uint16_t cellId, uint64_t imsi, uint32_t frameNo,
|
||||
uint32_t subframeNo, uint16_t rnti,uint8_t mcs, uint16_t size)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
NS_LOG_FUNCTION (this << cellId << imsi << frameNo << subframeNo << rnti << mcs << size);
|
||||
NS_LOG_INFO ("Write UL Mac Stats in " << GetUlOutputFilename ().c_str ());
|
||||
|
||||
std::ofstream outFile;
|
||||
|
||||
@@ -383,7 +383,7 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
// --- DOWNLINK ---
|
||||
// Send Dl-CQI info to the scheduler
|
||||
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters dlcqiInfoReq;
|
||||
dlcqiInfoReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
|
||||
int cqiNum = m_dlCqiReceived.size ();
|
||||
if (cqiNum > MAX_CQI_LIST)
|
||||
@@ -397,14 +397,14 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
|
||||
// Get downlink transmission opportunities
|
||||
FfMacSchedSapProvider::SchedDlTriggerReqParameters params; // to be filled
|
||||
params.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
params.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
m_schedSapProvider->SchedDlTriggerReq (params);
|
||||
|
||||
|
||||
// --- UPLINK ---
|
||||
// Send UL-CQI info to the scheduler
|
||||
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqiInfoReq;
|
||||
ulcqiInfoReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
ulcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
cqiNum = m_ulCqiReceived.size ();
|
||||
if (cqiNum >= 1)
|
||||
{
|
||||
@@ -422,7 +422,7 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
|
||||
// Send BSR reports to the scheduler
|
||||
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ulMacReq;
|
||||
ulMacReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
ulMacReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
ulMacReq.m_macCeList.insert (ulMacReq.m_macCeList.begin (), m_ulCeReceived.begin (), m_ulCeReceived.end ());
|
||||
m_ulCeReceived.erase (m_ulCeReceived.begin (), m_ulCeReceived.end ());
|
||||
m_schedSapProvider->SchedUlMacCtrlInfoReq (ulMacReq);
|
||||
@@ -430,7 +430,7 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
|
||||
// Get uplink transmission opportunities
|
||||
FfMacSchedSapProvider::SchedUlTriggerReqParameters ulparams;
|
||||
ulparams.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
ulparams.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
|
||||
std::map <uint16_t,UlInfoListElement_s>::iterator it;
|
||||
for (it = m_ulInfoListElements.begin (); it != m_ulInfoListElements.end (); it++)
|
||||
|
||||
@@ -62,12 +62,22 @@ TypeId LteUeNetDevice::GetTypeId (void)
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&LteUeNetDevice::m_rrc),
|
||||
MakePointerChecker <LteUeRrc> ())
|
||||
.AddAttribute ("Imsi",
|
||||
.AddAttribute ("LteUeMac",
|
||||
"The MAC associated to this UeNetDevice",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&LteUeNetDevice::m_mac),
|
||||
MakePointerChecker <LteUeMac> ())
|
||||
.AddAttribute ("LteUePhy",
|
||||
"The PHY associated to this UeNetDevice",
|
||||
PointerValue (),
|
||||
MakePointerAccessor (&LteUeNetDevice::m_phy),
|
||||
MakePointerChecker <LteUePhy> ())
|
||||
/* .AddAttribute ("Imsi",
|
||||
"International Mobile Subscriber Identity assigned to this UE",
|
||||
TypeId::ATTR_GET,
|
||||
UintegerValue (0), // not used because the attribute is read-only
|
||||
MakeUintegerAccessor (&LteUeNetDevice::m_imsi),
|
||||
MakeUintegerChecker<uint64_t> ())
|
||||
MakeUintegerChecker<uint64_t> ())*/
|
||||
;
|
||||
|
||||
return tid;
|
||||
|
||||
@@ -971,25 +971,29 @@ void
|
||||
PfFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
//NS_LOG_DEBUG (this << " RX UL CQI at " << params.m_sfnSf);
|
||||
// NS_LOG_DEBUG (this << " RX SFNID " << params.m_sfnSf << " delay " << (uint32_t)m_schedTtiDelay);
|
||||
// correlate info on UL-CQIs with previous scheduling -> calculate m_sfnSf of transmission
|
||||
uint32_t frameNo = (0xFF & params.m_sfnSf) >> 4;
|
||||
uint32_t frameNo = (0x3FF & (params.m_sfnSf >> 4));
|
||||
uint32_t subframeNo = (0xF & params.m_sfnSf);
|
||||
//NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
|
||||
if (subframeNo - m_schedTtiDelay < 0)
|
||||
// NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
|
||||
if (subframeNo <= m_schedTtiDelay)
|
||||
{
|
||||
frameNo--;
|
||||
subframeNo = (10 + subframeNo - m_schedTtiDelay) % 11;
|
||||
}
|
||||
subframeNo = (subframeNo - m_schedTtiDelay) % 10;
|
||||
//NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo);
|
||||
uint16_t sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
else
|
||||
{
|
||||
subframeNo = (subframeNo - m_schedTtiDelay) % 11;
|
||||
}
|
||||
uint16_t sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
// NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo << " sfnSf " << sfnSf);
|
||||
// retrieve the allocation for this subframe
|
||||
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
|
||||
std::map <uint16_t, std::vector <double> >::iterator itCqi;
|
||||
itMap = m_allocationMaps.find (sfnSf);
|
||||
if (itMap == m_allocationMaps.end ())
|
||||
{
|
||||
NS_LOG_DEBUG (this << " Does not find info on allocation");
|
||||
NS_LOG_DEBUG (this << " Does not find info on allocation, size : " << m_allocationMaps.size ());
|
||||
return;
|
||||
}
|
||||
for (uint32_t i = 0; i < (*itMap).second.size (); i++)
|
||||
@@ -1033,7 +1037,7 @@ PfFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::Sched
|
||||
|
||||
}
|
||||
// remove obsolete info on allocation
|
||||
m_allocationMaps.erase (m_allocationMaps.begin (), ++itMap);
|
||||
m_allocationMaps.erase (itMap);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ RrFfMacScheduler::DoSchedDlRlcBufferReq (const struct FfMacSchedSapProvider::Sch
|
||||
{
|
||||
NS_LOG_FUNCTION (this << params.m_rnti << (uint32_t) params.m_logicalChannelIdentity);
|
||||
// API generated by RLC for updating RLC parameters on a LC (tx and retx queues)
|
||||
std::vector<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
|
||||
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
|
||||
bool newLc = true;
|
||||
for (it = m_rlcBufferReq.begin (); it != m_rlcBufferReq.end (); it++)
|
||||
{
|
||||
@@ -375,6 +375,12 @@ RrFfMacScheduler::GetRbgSize (int dlbandwidth)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bool
|
||||
RrFfMacScheduler::SortRlcBufferReq (FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i,FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j)
|
||||
{
|
||||
return (i.m_rnti<j.m_rnti);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::SchedDlTriggerReqParameters& params)
|
||||
@@ -385,7 +391,8 @@ RrFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sched
|
||||
RefreshDlCqiMaps ();
|
||||
|
||||
// Get the actual active flows (queue!=0)
|
||||
std::vector<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
|
||||
std::list<FfMacSchedSapProvider::SchedDlRlcBufferReqParameters>::iterator it;
|
||||
m_rlcBufferReq.sort (SortRlcBufferReq);
|
||||
int nflows = 0;
|
||||
std::map <uint16_t,uint8_t> lcActivesPerRnti;
|
||||
std::map <uint16_t,uint8_t>::iterator itLcRnti;
|
||||
@@ -807,18 +814,22 @@ void
|
||||
RrFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
//NS_LOG_DEBUG (this << " RX UL CQI at " << params.m_sfnSf);
|
||||
// NS_LOG_DEBUG (this << " RX SFNID " << params.m_sfnSf);
|
||||
// correlate info on UL-CQIs with previous scheduling -> calculate m_sfnSf of transmission
|
||||
uint32_t frameNo = (0xFF & params.m_sfnSf) >> 4;
|
||||
uint32_t frameNo = (0x3FF & (params.m_sfnSf >> 4));
|
||||
uint32_t subframeNo = (0xF & params.m_sfnSf);
|
||||
//NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
|
||||
if (subframeNo - m_schedTtiDelay < 0)
|
||||
if (subframeNo <= m_schedTtiDelay)
|
||||
{
|
||||
frameNo--;
|
||||
subframeNo = (10 + subframeNo - m_schedTtiDelay) % 11;
|
||||
}
|
||||
subframeNo = (subframeNo - m_schedTtiDelay) % 10;
|
||||
//NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo);
|
||||
uint16_t sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
else
|
||||
{
|
||||
subframeNo = (subframeNo - m_schedTtiDelay) % 11;
|
||||
}
|
||||
uint16_t sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo);
|
||||
// NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo << " sfnSf " << sfnSf);
|
||||
// retrieve the allocation for this subframe
|
||||
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
|
||||
std::map <uint16_t, std::vector <double> >::iterator itCqi;
|
||||
@@ -867,7 +878,7 @@ RrFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::Sched
|
||||
|
||||
}
|
||||
// remove obsolete info on allocation
|
||||
m_allocationMaps.erase (m_allocationMaps.begin (), ++itMap);
|
||||
m_allocationMaps.erase (itMap);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,13 +119,15 @@ private:
|
||||
|
||||
int GetRbgSize (int dlbandwidth);
|
||||
|
||||
static bool SortRlcBufferReq (FfMacSchedSapProvider::SchedDlRlcBufferReqParameters i,FfMacSchedSapProvider::SchedDlRlcBufferReqParameters j);
|
||||
|
||||
void RefreshDlCqiMaps(void);
|
||||
void RefreshUlCqiMaps(void);
|
||||
|
||||
/*
|
||||
* Vectors of UE's RLC info
|
||||
*/
|
||||
std::vector <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
|
||||
std::list <FfMacSchedSapProvider::SchedDlRlcBufferReqParameters> m_rlcBufferReq;
|
||||
|
||||
/*
|
||||
* Map of UE's DL CQI P01 received
|
||||
|
||||
@@ -85,7 +85,7 @@ LteFadingTestSuite::LteFadingTestSuite ()
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB, home eNB, UE and home UE (UE attached to HeNB)
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -116,7 +116,7 @@ LteInterferenceTestCase::DoRun (void)
|
||||
// lena->EnableLogComponents ();
|
||||
lena->EnableMacTraces ();
|
||||
lena->EnableRlcTraces ();
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -162,9 +162,9 @@ LteLinkAdaptationTestCase::DoRun (void)
|
||||
// lena->EnableLogComponents ();
|
||||
lena->EnableMacTraces ();
|
||||
lena->EnableRlcTraces ();
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::ConstantSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::ConstantSpectrumPropagationLossModel"));
|
||||
NS_LOG_INFO ("SNR = " << m_snrDb << " LOSS = " << m_loss);
|
||||
lena->SetPropagationModelAttribute ("Loss", DoubleValue (m_loss));
|
||||
lena->SetPathlossModelAttribute ("Loss", DoubleValue (m_loss));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -207,16 +207,16 @@ LtePathlossModelSystemTestCase::DoRun (void)
|
||||
// lena->EnableLogComponents ();
|
||||
lena->EnableMacTraces ();
|
||||
lena->EnableRlcTraces ();
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel"));
|
||||
|
||||
// set frequency. This is important because it changes the behavior of the pathloss model
|
||||
lena->SetEnbDeviceAttribute ("DlEarfcn", UintegerValue (200));
|
||||
|
||||
|
||||
// remove shadowing component
|
||||
lena->SetPropagationModelAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
|
||||
lena->SetPropagationModelAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
|
||||
lena->SetPropagationModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
|
||||
lena->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
|
||||
lena->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
|
||||
lena->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -241,7 +241,7 @@ LenaPfFfMacSchedulerTestCase1::DoRun (void)
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
@@ -422,7 +422,7 @@ LenaPfFfMacSchedulerTestCase2::DoRun (void)
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -229,7 +229,7 @@ LenaRrFfMacSchedulerTestCase::DoRun (void)
|
||||
|
||||
Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
|
||||
|
||||
lena->SetAttribute ("PropagationModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
|
||||
|
||||
// Create Nodes: eNodeB and UE
|
||||
NodeContainer enbNodes;
|
||||
|
||||
@@ -12,8 +12,7 @@ print FILE "#sTime\tnFloors\tnEnb\tnUe\trTime\trTDev\n";
|
||||
my @nUe = ( 1, 5, 10, 15, 20, 25, 30 );
|
||||
my @nEnb = ( 1, 2, 4, 6, 8, 12, 14, 18, 22 );
|
||||
my @nFloors = ( 0, 1 );
|
||||
#$my @simTime = ( 1, 5, 10, 20 );
|
||||
my @simTime = ( 1 );
|
||||
my @simTime = ( 1, 5, 10, 20, 30, 40 );
|
||||
|
||||
my $traceDirectory = ".";
|
||||
my $traceDirectory = getcwd() . "/";
|
||||
|
||||
@@ -105,7 +105,7 @@ LteEpcE2eDataTestCase::DoRun ()
|
||||
Ptr<EpcHelper> epcHelper = CreateObject<EpcHelper> ();
|
||||
lteHelper->SetEpcHelper (epcHelper);
|
||||
|
||||
lteHelper->SetAttribute("PropagationModel",
|
||||
lteHelper->SetAttribute("PathlossModel",
|
||||
StringValue("ns3::FriisPropagationLossModel"));
|
||||
|
||||
Ptr<Node> pgw = epcHelper->GetPgwNode ();
|
||||
|
||||
Reference in New Issue
Block a user