merge
authorNicola Baldo <nbaldo@cttc.es>
Thu, 30 Apr 2015 16:32:35 +0200
changeset 11355 94f9c884d2a2
parent 11354 62dfc08ba279 (current diff)
parent 11350 e5320b9a3c87 (diff)
child 11356 9550261ce72b
merge
src/lte/test/lte-test-unlicensed-interference.cc
src/lte/test/lte-test-unlicensed-interference.h
--- a/src/laa-wifi-coexistence/doc/Makefile	Thu Apr 30 15:56:09 2015 +0200
+++ b/src/laa-wifi-coexistence/doc/Makefile	Thu Apr 30 16:32:35 2015 +0200
@@ -11,7 +11,7 @@
 # specify dia figures from which .png and .pdf figures need to be built
 
 IMAGES_DIA = \
-#	$(FIGURES)/figure-name.dia \
+	$(FIGURES)/lte-unlicensed-interference-test-scenario.dia
 
 
 # specify eps figures from which .png and .pdf figures need to be built
@@ -21,7 +21,7 @@
 
 
 # rescale pdf figures as necessary
-#$(FIGURES)/figure-name.pdf_width = 8cm
+$(FIGURES)/lte-unlicensed-interference-test-scenario.pdf_width = 8cm
 
 
 
Binary file src/laa-wifi-coexistence/doc/source/figures/lte-unlicensed-interference-test-scenario.dia has changed
--- a/src/laa-wifi-coexistence/doc/source/laa-wifi-coexistence.rst	Thu Apr 30 15:56:09 2015 +0200
+++ b/src/laa-wifi-coexistence/doc/source/laa-wifi-coexistence.rst	Thu Apr 30 16:32:35 2015 +0200
@@ -11,14 +11,16 @@
    ############# Paragraph (no number)
 
 
-The LAA Wi-Fi Coexistence module provides support to simulate with |ns3| the scenarios for
-the coextistence between  LTE License Assisted Access (LAA) and Wi-Fi
-systems, following the description in [TR36889]_. 
 
 
 Model Description
 *****************
 
+
+The LAA Wi-Fi Coexistence module provides support to simulate with |ns3| the scenarios for
+the coextistence between  LTE License Assisted Access (LAA) and Wi-Fi
+systems, following the description in [TR36889]_. 
+
 The support for simulating the LTE and Wi-Fi technology is provided by the
 separate |ns3| LTE and Wi-Fi module; the LAA Wi-Fi Coexistence module focuses on the
 additional features that are needed to create a simulation scenario
@@ -95,9 +97,54 @@
 
 Add any tips for avoiding pitfalls, etc.
 
+
+
+
 Validation
 **********
 
-Describe how the model has been tested/validated.  What tests run in the
-test suite?  How much API and code is covered by the tests?  Again, 
-references to outside published work may help here.
+In the following we describe the test suites that are provided along
+with the code of the laa-wifi-coexistence module and validate its
+proper functionality and correct simulation output in some key
+configurations for which the intended behavior and output can be
+determined a priori.
+
+LTE unlicensed interference test
+================================
+
+The test suite `lte-unlicensed-interference` aims at verifying the
+correct behavior and simulation output of the LTE PHY and, in
+particular, of its interference model, in presence of non-LTE
+interferes. The topology of the test is depicted in Figure
+:ref:`fig-lte-unlicensed-interference-test-scenario`, and involves an
+LTE eNB, an LTE UE attached to it, and a non-LTE interferer
+implemented using the WaveformGenerator class. The LTE downlink is
+configured in the 5GHz bandwidth where the intenterference also takes
+place. The waveform generator is configured to transmit
+continuously at constant power. The :math:`d_1` parameter represents the distance of each UE to the eNB it
+is attached to, whereas the :math:`d_2` parameter represent the
+interferer distance; different test cases are generated changing the
+values of the parameters.
+
+The following conditions are verified:
+
+ - the SINR calculated at the UE is equal to the expected one within a
+   tolerance of :math:`0.01` dB
+
+ - the MCS used for transmission by the eNB is exactly the expected
+   one
+
+The reference values are calculated using the octave script
+`lte_link_budget_unlicensed_interference.m` which can be found in
+`src/laa-wifi-coexistence/test/reference/`
+
+
+.. _fig-lte-unlicensed-interference-test-scenario:
+
+.. figure:: figures/lte-unlicensed-interference-test-scenario.*
+   :align: center
+
+   Topology of the LTE unlicensed interference test
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/laa-wifi-coexistence/test/reference/lte_link_budget_unlicensed_interference.m	Thu Apr 30 16:32:35 2015 +0200
@@ -0,0 +1,79 @@
+clear all;
+close all;
+
+%% LTE from theory to practice
+%% Table 22.7 Reference sensitivity.
+
+fdl = 5180e6;  % DL carrier freq Hz, EARFCN = 100
+ful = 1930e6;  % UL carrier freq Hz, EARFCN = 18100 
+nrbs = 100; % tx bandwidth configuration in number of RBs
+bw = nrbs * 180000; % bandwidth in Hz, note that this is smaller than
+		    % the nominal Channel Bandwdith, see TS 36.101 fig 5.6-1
+kT = -174; % noise PSD in dBm / Hz
+ndBm = kT + 10*log10(bw);  % noise power dBm
+
+dlpdBm = 30;  % tx power dBm in DL
+dlp = 10.^((dlpdBm - 30)/10); %% tx pow in W in DL
+dlnf = 9; % receiver noise figure in dB in DL
+dln = 10.^((ndBm-30+dlnf)/10); %% noise in W in DL
+
+ulpdBm = 10;  % tx power dBm in UL
+ulp = 10.^((ulpdBm - 30)/10); %% tx pow in W in UL
+ulnf = 5; % receiver noise figure in dB in UL
+uln = 10.^((ndBm-30+ulnf)/10); %% noise in W in UL
+
+ber = 0.00005;
+gamma = -log (5*ber)./1.5;
+
+
+
+%% distances
+%%         d2  
+%%  UE1-----------eNB2
+%%   |             |
+%% d1|             |d1
+%%   |     d2      |
+%%  eNB1----------UE2
+%%
+
+d1 = 20;
+%% for d2 = [10 100 1000 10000 100000 1000000]
+for d2 = [20 50 200]
+
+  %% propagation gains (linear)
+  %%             g21dl  
+  %%      UE1<----------eNB2
+  %%      ^ |              
+  %%g11dl1| |g11ul          
+  %%      | v            
+  %%      eNB1<---------UE2
+  %%             g21ul
+
+  g11dl = gain_freespace (d1, fdl);
+  g11ul = gain_freespace (d1, ful);
+  g21dl = gain_freespace (d2, fdl);
+  g21ul = gain_freespace (d2, ful);
+
+  %% SINR (linear)
+  dlsinr = dlp*g11dl / (dlp*g21dl + dln);
+  ulsinr = ulp*g11ul / (ulp*g21ul + uln);
+
+  %% SINR (dB)
+  dlsinrdB = 10.*log10(dlsinr);
+  ulsinrdB = 10.*log10(ulsinr);
+
+  %% Spectal Efficiency
+  dlse = log2(1 + dlsinr./gamma);
+  ulse = log2(1 + ulsinr./gamma);
+
+  %% to get the MCS, you need to do a manual lookup into 3GPP R1-081483
+  %% starting from the spectral efficiency value.
+  %% See the Testing section in the LTE module documentation for more info
+  %% on how this is done. You might as well look into lte_amc.m
+
+
+  printf("AddTestCase (new LteInterferenceTestCase (\"d1=%d, d2=%d\", % f, %f, % f, %f, % f, %f, , ));\n", \
+	 d1, d2, d1, d2, dlsinr, ulsinr, dlse, ulse)
+  
+
+endfor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/laa-wifi-coexistence/test/test-lte-unlicensed-interference.cc	Thu Apr 30 16:32:35 2015 +0200
@@ -0,0 +1,281 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011-2015 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *
+ * Authors: Nicola Baldo
+ *
+ * based upon lte-test-interference by 
+ *  Manuel Requena <manuel.requena@cttc.es> 
+ *  Nicola Baldo <nbaldo@cttc.es>
+ */
+
+#include "ns3/simulator.h"
+#include "ns3/log.h"
+#include <ns3/abort.h>
+#include "ns3/string.h"
+#include "ns3/double.h"
+#include <ns3/enum.h>
+#include "ns3/boolean.h"
+#include "ns3/mobility-helper.h"
+#include "ns3/lte-helper.h"
+#include "ns3/ff-mac-scheduler.h"
+
+#include "ns3/lte-enb-phy.h"
+#include "ns3/lte-enb-net-device.h"
+
+#include "ns3/lte-ue-phy.h"
+#include "ns3/lte-ue-net-device.h"
+
+#include <ns3/lte-chunk-processor.h>
+
+#include <ns3/spectrum-module.h>
+
+#include "test-lte-unlicensed-interference.h"
+
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("TestLteUnlicensedInterference");
+
+
+Ptr<SpectrumModel> SpectrumModelWifi5180MHz;
+
+class static_SpectrumModelWifi5180MHz_initializer
+{
+public:
+  static_SpectrumModelWifi5180MHz_initializer ()
+  {
+    BandInfo bandInfo;
+    bandInfo.fc = 5180e6;
+    bandInfo.fl = 5180e6 - 10e6;
+    bandInfo.fh = 5180e6 + 10e6;
+
+    Bands bands;
+    bands.push_back (bandInfo);
+    
+    SpectrumModelWifi5180MHz = Create<SpectrumModel> (bands);
+  }
+
+} static_SpectrumModelWifi5180MHz_initializer_instance;
+
+
+
+
+
+void
+LteTestDlSchedulingCallback (LteUnlicensedInterferenceTestCase *testcase, std::string path,
+                             uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                             uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
+{
+  testcase->DlScheduling (frameNo, subframeNo, rnti, mcsTb1, sizeTb1, mcsTb2, sizeTb2);
+}
+
+void
+LteTestUlSchedulingCallback (LteUnlicensedInterferenceTestCase *testcase, std::string path,
+                             uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                             uint8_t mcs, uint16_t sizeTb)
+{
+  testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb);
+}
+
+/**
+ * TestSuite
+ */
+
+LteUnlicensedInterferenceTestSuite::LteUnlicensedInterferenceTestSuite ()
+  : TestSuite ("lte-unlicensed-interference", SYSTEM)
+{
+  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=20",  20.000000, 20.000000,  0.999989, 0.999941,  0.239826, 0.239816, 2, 2), TestCase::QUICK);
+  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=50",  20.000000, 50.000000,  6.249581, 6.247687,  1.091025, 1.090793, 8, 8), TestCase::QUICK);
+  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=200",  20.000000, 200.000000,  99.892921, 99.411076,  4.252922, 4.246313, 22, 22), TestCase::QUICK);
+}
+
+static LteUnlicensedInterferenceTestSuite lteLinkAdaptationWithInterferenceTestSuite;
+
+
+/**
+ * TestCase
+ */
+
+LteUnlicensedInterferenceTestCase::LteUnlicensedInterferenceTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs)
+  : TestCase (name),
+    m_d1 (d1),
+    m_d2 (d2),
+    m_expectedDlSinrDb (10 * std::log10 (dlSinr)),
+    m_expectedUlSinrDb (10 * std::log10 (ulSinr)),
+    m_dlMcs (dlMcs),
+    m_ulMcs (ulMcs)
+{
+}
+
+LteUnlicensedInterferenceTestCase::~LteUnlicensedInterferenceTestCase ()
+{
+}
+
+void
+LteUnlicensedInterferenceTestCase::DoRun (void)
+{
+  NS_LOG_INFO (this << GetName ());
+  
+  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
+  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
+  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
+  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
+
+  // LTE-U DL transmission @5180 MHz
+  Config::SetDefault ("ns3::LteEnbNetDevice::DlEarfcn", UintegerValue (255444));
+  Config::SetDefault ("ns3::LteEnbNetDevice::DlBandwidth", UintegerValue (100));
+
+
+  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
+  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
+  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (false));
+  lteHelper->SetAttribute ("UsePdschForCqiGeneration", BooleanValue (true));
+
+  //Disable Uplink Power Control
+  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer wgNodes;
+  NodeContainer ueNodes1;
+  enbNodes.Create (1);
+  wgNodes.Create (1);
+  ueNodes1.Create (1);
+  NodeContainer allNodes = NodeContainer (enbNodes, wgNodes, ueNodes1);
+
+  // the topology is the following:
+  //         d2
+  //  UE1-----------WaveformGenerator
+  //   |             |
+  // d1|             |d1
+  //   |     d2      |
+  //  eNB1----------
+  //
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));   // eNB1
+  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // WaveformGenerator
+  positionAlloc->Add (Vector (0.0, m_d1, 0.0));  // UE1
+  positionAlloc->Add (Vector (m_d2, 0.0, 0.0));  // unused
+  MobilityHelper mobility;
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.SetPositionAllocator (positionAlloc);
+  mobility.Install (allNodes);
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  NetDeviceContainer ueDevs1;
+  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
+  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
+  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
+  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
+
+  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
+
+  // Activate an EPS bearer
+  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+  EpsBearer bearer (q);
+  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
+
+  // Use testing chunk processor in the PHY layer
+  // It will be used to test that the SNR is as intended
+  // we plug in two instances, one for DL and one for UL
+
+  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
+  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
+  LteSpectrumValueCatcher dlSinr1Catcher;
+  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
+  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
+
+  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
+  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
+  LteSpectrumValueCatcher ulSinr1Catcher;
+  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
+  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
+
+  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling",
+                   MakeBoundCallback (&LteTestDlSchedulingCallback, this));
+
+  // no UL testing since interference is in the DL only
+  //Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/UlScheduling",
+  //                MakeBoundCallback (&LteTestUlSchedulingCallback, this));
+
+  // Configure waveform generator
+
+  Ptr<SpectrumValue> wgPsd = Create<SpectrumValue> (SpectrumModelWifi5180MHz);
+  // 30 dBm over 100 RBs (18MHz total)
+  *wgPsd = 1.0 / (100*180000); 
+  NS_LOG_INFO ("wgPsd : " << *wgPsd);
+  
+  WaveformGeneratorHelper waveformGeneratorHelper;
+  Config::MatchContainer match = Config::LookupMatches ("/ChannelList/0");
+  if (match.GetN () != 1)
+    {
+      NS_FATAL_ERROR ("Lookup " << "/ChannelList/0" << " should have exactly one match");
+    }
+  Ptr<SpectrumChannel> dlChannel = match.Get (0)->GetObject<SpectrumChannel> ();
+  NS_ABORT_MSG_IF (dlChannel == 0, "object is not of type SpectrumChannel");
+  waveformGeneratorHelper.SetChannel (dlChannel);
+  waveformGeneratorHelper.SetTxPowerSpectralDensity (wgPsd);
+  
+  waveformGeneratorHelper.SetPhyAttribute ("Period", TimeValue (Seconds (0.0007)));    waveformGeneratorHelper.SetPhyAttribute ("DutyCycle", DoubleValue (1));
+  NetDeviceContainer waveformGeneratorDevices = waveformGeneratorHelper.Install (wgNodes);
+
+  Simulator::Schedule (Seconds (0.002), &WaveformGenerator::Start,
+                       waveformGeneratorDevices.Get (0)->GetObject<NonCommunicatingNetDevice> ()->GetPhy ()->GetObject<WaveformGenerator> ());
+  
+  
+
+// need to allow for RRC connection establishment + SRS
+  Simulator::Stop (Seconds (0.100));
+  Simulator::Run ();
+
+  if (m_dlMcs > 0)
+    {
+      double dlSinr1Db = 10.0 * std::log10 (dlSinr1Catcher.GetValue ()->operator[] (0));
+      NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
+    }
+
+
+  Simulator::Destroy ();
+
+}
+
+
+void
+LteUnlicensedInterferenceTestCase::DlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                                       uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
+{
+  NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcsTb1 << sizeTb1 << (uint32_t) mcsTb2 << sizeTb2);
+  // need to allow for RRC connection establishment + CQI feedback reception + persistent data transmission
+  if (Simulator::Now () > MilliSeconds (65))
+    {
+      NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcsTb1, (uint32_t)m_dlMcs, "Wrong DL MCS ");
+    }
+}
+
+void
+LteUnlicensedInterferenceTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                                       uint8_t mcs, uint16_t sizeTb)
+{
+  NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcs << sizeTb);
+  // need to allow for RRC connection establishment + SRS transmission
+  if (Simulator::Now () > MilliSeconds (50))
+    {
+      NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/laa-wifi-coexistence/test/test-lte-unlicensed-interference.h	Thu Apr 30 16:32:35 2015 +0200
@@ -0,0 +1,65 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Manuel Requena <manuel.requena@cttc.es>
+ *         Nicola Baldo <nbaldo@cttc.es>
+ */
+
+#ifndef LTE_TEST_UNLICENSED_INTERFERENCE_H
+#define LTE_TEST_UNLICENSED_INTERFERENCE_H
+
+#include "ns3/test.h"
+
+
+using namespace ns3;
+
+
+/**
+ * Test that SINR calculation and MCS selection works fine in a multi-cell interference scenario.
+ */
+class LteUnlicensedInterferenceTestSuite : public TestSuite
+{
+public:
+  LteUnlicensedInterferenceTestSuite ();
+};
+
+
+class LteUnlicensedInterferenceTestCase : public TestCase
+{
+public:
+  LteUnlicensedInterferenceTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs);
+  virtual ~LteUnlicensedInterferenceTestCase ();
+
+  void DlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                     uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2);
+
+  void UlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
+                     uint8_t mcs, uint16_t sizeTb);
+
+private:
+  virtual void DoRun (void);
+
+
+  double m_d1;
+  double m_d2;
+  double m_expectedDlSinrDb;
+  double m_expectedUlSinrDb;
+  uint16_t m_dlMcs;
+  uint16_t m_ulMcs;
+};
+
+#endif /* LTE_TEST_UNLICENSED_INTERFERENCE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/laa-wifi-coexistence/wscript	Thu Apr 30 16:32:35 2015 +0200
@@ -0,0 +1,32 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# def options(opt):
+#     pass
+
+# def configure(conf):
+#     conf.check_nonfatal(header_name='stdint.h', define_name='HAVE_STDINT_H')
+
+def build(bld):
+    module = bld.create_ns3_module('laa-wifi-coexistence', ['lte','spectrum'])
+    module.source = [
+        # 'model/laa-wifi-coexistence.cc',
+        # 'helper/laa-wifi-coexistence-helper.cc',
+        ]
+
+    module_test = bld.create_ns3_module_test_library('laa-wifi-coexistence')
+    module_test.source = [
+        'test/test-lte-unlicensed-interference.cc',
+        ]
+
+    headers = bld(features='ns3header')
+    headers.module = 'laa-wifi-coexistence'
+    headers.source = [
+#        'model/laa-wifi-coexistence.h',
+#        'helper/laa-wifi-coexistence-helper.h',
+        ]
+
+#    if bld.env.ENABLE_EXAMPLES:
+#        bld.recurse('examples')
+
+    # bld.ns3_python_bindings()
+
--- a/src/lte/test/lte-test-unlicensed-interference.cc	Thu Apr 30 15:56:09 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,281 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011-2015 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *
- * Authors: Nicola Baldo
- *
- * based upon lte-test-interference by 
- *  Manuel Requena <manuel.requena@cttc.es> 
- *  Nicola Baldo <nbaldo@cttc.es>
- */
-
-#include "ns3/simulator.h"
-#include "ns3/log.h"
-#include <ns3/abort.h>
-#include "ns3/string.h"
-#include "ns3/double.h"
-#include <ns3/enum.h>
-#include "ns3/boolean.h"
-#include "ns3/mobility-helper.h"
-#include "ns3/lte-helper.h"
-#include "ns3/ff-mac-scheduler.h"
-
-#include "ns3/lte-enb-phy.h"
-#include "ns3/lte-enb-net-device.h"
-
-#include "ns3/lte-ue-phy.h"
-#include "ns3/lte-ue-net-device.h"
-
-#include <ns3/lte-chunk-processor.h>
-
-#include <ns3/spectrum-module.h>
-
-#include "lte-test-unlicensed-interference.h"
-
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("LteUnlicensedInterferenceTest");
-
-
-Ptr<SpectrumModel> SpectrumModelWifi5180MHz;
-
-class static_SpectrumModelWifi5180MHz_initializer
-{
-public:
-  static_SpectrumModelWifi5180MHz_initializer ()
-  {
-    BandInfo bandInfo;
-    bandInfo.fc = 5180e6;
-    bandInfo.fl = 5180e6 - 10e6;
-    bandInfo.fh = 5180e6 + 10e6;
-
-    Bands bands;
-    bands.push_back (bandInfo);
-    
-    SpectrumModelWifi5180MHz = Create<SpectrumModel> (bands);
-  }
-
-} static_SpectrumModelWifi5180MHz_initializer_instance;
-
-
-
-
-
-void
-LteTestDlSchedulingCallback (LteUnlicensedInterferenceTestCase *testcase, std::string path,
-                             uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                             uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
-{
-  testcase->DlScheduling (frameNo, subframeNo, rnti, mcsTb1, sizeTb1, mcsTb2, sizeTb2);
-}
-
-void
-LteTestUlSchedulingCallback (LteUnlicensedInterferenceTestCase *testcase, std::string path,
-                             uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                             uint8_t mcs, uint16_t sizeTb)
-{
-  testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb);
-}
-
-/**
- * TestSuite
- */
-
-LteUnlicensedInterferenceTestSuite::LteUnlicensedInterferenceTestSuite ()
-  : TestSuite ("lte-unlicensed-interference", SYSTEM)
-{
-  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=20",  20.000000, 20.000000,  0.999989, 0.999941,  0.239826, 0.239816, 2, 2), TestCase::QUICK);
-  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=50",  20.000000, 50.000000,  6.249581, 6.247687,  1.091025, 1.090793, 8, 8), TestCase::QUICK);
-  AddTestCase (new LteUnlicensedInterferenceTestCase ("d1=20, d2=200",  20.000000, 200.000000,  99.892921, 99.411076,  4.252922, 4.246313, 22, 22), TestCase::QUICK);
-}
-
-static LteUnlicensedInterferenceTestSuite lteLinkAdaptationWithInterferenceTestSuite;
-
-
-/**
- * TestCase
- */
-
-LteUnlicensedInterferenceTestCase::LteUnlicensedInterferenceTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs)
-  : TestCase (name),
-    m_d1 (d1),
-    m_d2 (d2),
-    m_expectedDlSinrDb (10 * std::log10 (dlSinr)),
-    m_expectedUlSinrDb (10 * std::log10 (ulSinr)),
-    m_dlMcs (dlMcs),
-    m_ulMcs (ulMcs)
-{
-}
-
-LteUnlicensedInterferenceTestCase::~LteUnlicensedInterferenceTestCase ()
-{
-}
-
-void
-LteUnlicensedInterferenceTestCase::DoRun (void)
-{
-  NS_LOG_INFO (this << GetName ());
-  
-  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
-  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
-  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
-  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
-
-  // LTE-U DL transmission @5180 MHz
-  Config::SetDefault ("ns3::LteEnbNetDevice::DlEarfcn", UintegerValue (255444));
-  Config::SetDefault ("ns3::LteEnbNetDevice::DlBandwidth", UintegerValue (100));
-
-
-  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
-  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
-  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (false));
-  lteHelper->SetAttribute ("UsePdschForCqiGeneration", BooleanValue (true));
-
-  //Disable Uplink Power Control
-  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer wgNodes;
-  NodeContainer ueNodes1;
-  enbNodes.Create (1);
-  wgNodes.Create (1);
-  ueNodes1.Create (1);
-  NodeContainer allNodes = NodeContainer (enbNodes, wgNodes, ueNodes1);
-
-  // the topology is the following:
-  //         d2
-  //  UE1-----------WaveformGenerator
-  //   |             |
-  // d1|             |d1
-  //   |     d2      |
-  //  eNB1----------
-  //
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  positionAlloc->Add (Vector (0.0, 0.0, 0.0));   // eNB1
-  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // WaveformGenerator
-  positionAlloc->Add (Vector (0.0, m_d1, 0.0));  // UE1
-  positionAlloc->Add (Vector (m_d2, 0.0, 0.0));  // unused
-  MobilityHelper mobility;
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  mobility.SetPositionAllocator (positionAlloc);
-  mobility.Install (allNodes);
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  NetDeviceContainer ueDevs1;
-  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
-  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
-  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
-  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
-
-  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
-
-  // Activate an EPS bearer
-  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-  EpsBearer bearer (q);
-  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
-
-  // Use testing chunk processor in the PHY layer
-  // It will be used to test that the SNR is as intended
-  // we plug in two instances, one for DL and one for UL
-
-  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
-  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
-  LteSpectrumValueCatcher dlSinr1Catcher;
-  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
-  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
-
-  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
-  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
-  LteSpectrumValueCatcher ulSinr1Catcher;
-  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
-  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
-
-  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling",
-                   MakeBoundCallback (&LteTestDlSchedulingCallback, this));
-
-  // no UL testing since interference is in the DL only
-  //Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/UlScheduling",
-  //                MakeBoundCallback (&LteTestUlSchedulingCallback, this));
-
-  // Configure waveform generator
-
-  Ptr<SpectrumValue> wgPsd = Create<SpectrumValue> (SpectrumModelWifi5180MHz);
-  // 30 dBm over 100 RBs (18MHz total)
-  *wgPsd = 1.0 / (100*180000); 
-  NS_LOG_INFO ("wgPsd : " << *wgPsd);
-  
-  WaveformGeneratorHelper waveformGeneratorHelper;
-  Config::MatchContainer match = Config::LookupMatches ("/ChannelList/0");
-  if (match.GetN () != 1)
-    {
-      NS_FATAL_ERROR ("Lookup " << "/ChannelList/0" << " should have exactly one match");
-    }
-  Ptr<SpectrumChannel> dlChannel = match.Get (0)->GetObject<SpectrumChannel> ();
-  NS_ABORT_MSG_IF (dlChannel == 0, "object is not of type SpectrumChannel");
-  waveformGeneratorHelper.SetChannel (dlChannel);
-  waveformGeneratorHelper.SetTxPowerSpectralDensity (wgPsd);
-  
-  waveformGeneratorHelper.SetPhyAttribute ("Period", TimeValue (Seconds (0.0007)));    waveformGeneratorHelper.SetPhyAttribute ("DutyCycle", DoubleValue (1));
-  NetDeviceContainer waveformGeneratorDevices = waveformGeneratorHelper.Install (wgNodes);
-
-  Simulator::Schedule (Seconds (0.002), &WaveformGenerator::Start,
-                       waveformGeneratorDevices.Get (0)->GetObject<NonCommunicatingNetDevice> ()->GetPhy ()->GetObject<WaveformGenerator> ());
-  
-  
-
-// need to allow for RRC connection establishment + SRS
-  Simulator::Stop (Seconds (0.100));
-  Simulator::Run ();
-
-  if (m_dlMcs > 0)
-    {
-      double dlSinr1Db = 10.0 * std::log10 (dlSinr1Catcher.GetValue ()->operator[] (0));
-      NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
-    }
-
-
-  Simulator::Destroy ();
-
-}
-
-
-void
-LteUnlicensedInterferenceTestCase::DlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                                       uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
-{
-  NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcsTb1 << sizeTb1 << (uint32_t) mcsTb2 << sizeTb2);
-  // need to allow for RRC connection establishment + CQI feedback reception + persistent data transmission
-  if (Simulator::Now () > MilliSeconds (65))
-    {
-      NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcsTb1, (uint32_t)m_dlMcs, "Wrong DL MCS ");
-    }
-}
-
-void
-LteUnlicensedInterferenceTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                                       uint8_t mcs, uint16_t sizeTb)
-{
-  NS_LOG_FUNCTION (frameNo << subframeNo << rnti << (uint32_t) mcs << sizeTb);
-  // need to allow for RRC connection establishment + SRS transmission
-  if (Simulator::Now () > MilliSeconds (50))
-    {
-      NS_TEST_ASSERT_MSG_EQ ((uint32_t)mcs, (uint32_t)m_ulMcs, "Wrong UL MCS");
-    }
-}
--- a/src/lte/test/lte-test-unlicensed-interference.h	Thu Apr 30 15:56:09 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * Author: Manuel Requena <manuel.requena@cttc.es>
- *         Nicola Baldo <nbaldo@cttc.es>
- */
-
-#ifndef LTE_TEST_UNLICENSED_INTERFERENCE_H
-#define LTE_TEST_UNLICENSED_INTERFERENCE_H
-
-#include "ns3/test.h"
-
-
-using namespace ns3;
-
-
-/**
- * Test that SINR calculation and MCS selection works fine in a multi-cell interference scenario.
- */
-class LteUnlicensedInterferenceTestSuite : public TestSuite
-{
-public:
-  LteUnlicensedInterferenceTestSuite ();
-};
-
-
-class LteUnlicensedInterferenceTestCase : public TestCase
-{
-public:
-  LteUnlicensedInterferenceTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs);
-  virtual ~LteUnlicensedInterferenceTestCase ();
-
-  void DlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                     uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2);
-
-  void UlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
-                     uint8_t mcs, uint16_t sizeTb);
-
-private:
-  virtual void DoRun (void);
-
-
-  double m_d1;
-  double m_d2;
-  double m_expectedDlSinrDb;
-  double m_expectedUlSinrDb;
-  uint16_t m_dlMcs;
-  uint16_t m_ulMcs;
-};
-
-#endif /* LTE_TEST_UNLICENSED_INTERFERENCE_H */
--- a/src/lte/wscript	Thu Apr 30 15:56:09 2015 +0200
+++ b/src/lte/wscript	Thu Apr 30 16:32:35 2015 +0200
@@ -177,7 +177,6 @@
         'test/lte-test-interference-fr.cc',
         'test/lte-test-cqi-generation.cc',
         'test/lte-simple-spectrum-phy.cc',
-        'test/lte-test-unlicensed-interference.cc',
         ]
 
     headers = bld(features='ns3header')