Name refactoring of example simulation scripts
authorJaume Nin
Wed, 30 Nov 2011 11:20:49 +0100
changeset 8429 fb109ecf2718
parent 8428 18b75acf693b
child 8430 e8b3ccdf6673
Name refactoring of example simulation scripts
src/lte/examples/epc-gtpu-tunnel-example.cc
src/lte/examples/inter-cell-interference.cc
src/lte/examples/lena-cqi-threshold.cc
src/lte/examples/lena-epc-first.cc
src/lte/examples/lena-extract-pathloss.cc
src/lte/examples/lena-fading.cc
src/lte/examples/lena-first-sim.cc
src/lte/examples/lena-gtpu-tunnel.cc
src/lte/examples/lena-intercell-interference.cc
src/lte/examples/lena-pathloss-traces.cc
src/lte/examples/lena-profiling.cc
src/lte/examples/lena-rlc-calculator.cc
src/lte/examples/lena-rlc-traces.cc
src/lte/examples/lena-runtime-profiler.cc
src/lte/examples/lena-simple-epc.cc
src/lte/examples/lena-simple.cc
src/lte/examples/profiling-reference.cc
src/lte/examples/wscript
src/lte/test/examples-to-run.py
src/lte/test/lte-test-run-time.pl
--- a/src/lte/examples/epc-gtpu-tunnel-example.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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: Jaume Nin <jaume.nin@cttc.cat>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-#include "ns3/internet-module.h"
-#include "ns3/csma-module.h"
-#include "ns3/csma-helper.h"
-#include "ns3/applications-module.h"
-#include "ns3/ipv4-global-routing-helper.h"
-#include "ns3/gtpu-tunnel-helper.h"
-//#include "ns3/gtk-config-store.h"
-
-using namespace ns3;
-
-NS_LOG_COMPONENT_DEFINE ("EpcGtpUTunnelExample");
-int
-main (int argc, char *argv[])
-{
-  Packet::EnablePrinting ();
-
-  // Command line arguments
-  CommandLine cmd;
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  NS_LOG_INFO ("Create nodes.");
-  NodeContainer c;
-  c.Create (2);
-
-  InternetStackHelper internet;
-  internet.Install (c);
-
-  // Create the channels first
-  NS_LOG_INFO ("Create channels.");
-
-  CsmaHelper csma;
-  csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
-  csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
-  NetDeviceContainer nc = csma.Install (c);
-
-  NS_LOG_INFO ("Assign IP Addresses.");
-  Ipv4AddressHelper ipv4;
-  ipv4.SetBase ("10.0.1.0", "255.255.255.0");
-  Ipv4InterfaceContainer ic = ipv4.Assign (nc);
-  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
-  AsciiTraceHelper ascii;
-  csma.EnableAsciiAll (ascii.CreateFileStream ("epc-gtp.tr"));
-  csma.EnablePcapAll ("epc-gtp");
-
-  GtpuTunnerHelper epcHelper;
-
-  epcHelper.InstallGtpu (c.Get (0));
-  epcHelper.InstallGtpu (c.Get (1));
-
-  epcHelper.CreateGtpuTunnel (c.Get (0), ic.GetAddress (0),  c.Get (1), ic.GetAddress (1));
-
-  NS_LOG_INFO ("Create Applications.");
-  // Set up some default values for the simulation.
-  Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (200));
-  Config::SetDefault ("ns3::OnOffApplication::OnTime", RandomVariableValue (ConstantVariable (1)));
-  Config::SetDefault ("ns3::OnOffApplication::OffTime", RandomVariableValue (ConstantVariable (0)));
-  Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("2kbps"));
-  OnOffHelper onoffAB = OnOffHelper ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.2")));
-  OnOffHelper onoffBA = OnOffHelper ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.1")));
-  PacketSinkHelper sinkA ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.1")));
-  PacketSinkHelper sinkB ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.2")));
-
-  ApplicationContainer apps = onoffAB.Install (c.Get (0));
-  apps.Add (onoffBA.Install (c.Get (1)));
-  apps.Add (sinkA.Install (c.Get (0)));
-  apps.Add (sinkB.Install (c.Get (1)));
-
-  apps.Start (Seconds (1.0));
-  apps.Stop (Seconds (10.0));
-
-  NS_LOG_INFO ("Run Simulation.");
-  Simulator::Run ();
-
-  /*GtkConfigStore config;
-  config.ConfigureAttributes ();*/
-
-  Simulator::Destroy ();
-  NS_LOG_INFO ("Done.");
-
-  return 0;
-}
--- a/src/lte/examples/inter-cell-interference.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +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>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-#include "ns3/rlc-stats-calculator.h"
-
-#include <iomanip>
-#include <string>
-
-using namespace ns3;
-
-int main (int argc, char *argv[])
-{
-  double enbDist = 100.0;
-  double radius = 50.0;
-  uint32_t numUes = 1;
-
-
-  CommandLine cmd;
-  cmd.AddValue ("enbDist", "distance between the two eNBs", enbDist);
-  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
-  cmd.AddValue ("numUes", "how many UEs are attached to each eNB", numUes);
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  // determine the string tag that identifies this simulation run
-  // this tag is then appended to all filenames
-
-  IntegerValue runValue;
-  GlobalValue::GetValueByName ("RngRun", runValue);
-
-  std::ostringstream tag;
-  tag  << "_enbDist" << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
-       << "_radius"  << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
-       << "_numUes"  << std::setw (3) << std::setfill ('0')  << numUes
-       << "_rngRun"  << std::setw (3) << std::setfill ('0')  << runValue.Get () ;
-
-  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-  
-  lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer ueNodes1, ueNodes2;
-  enbNodes.Create (2);
-  ueNodes1.Create (numUes);
-  ueNodes2.Create (numUes);
-
-  // Position of eNBs
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
-  positionAlloc->Add (Vector (enbDist, 0.0, 0.0));
-  MobilityHelper enbMobility;
-  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  enbMobility.SetPositionAllocator (positionAlloc);
-  enbMobility.Install (enbNodes);
-
-  // Position of UEs attached to eNB 1
-  MobilityHelper ue1mobility;
-  ue1mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
-                                    "X", DoubleValue (0.0),
-                                    "Y", DoubleValue (0.0),
-                                    "rho", DoubleValue (radius));
-  ue1mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  ue1mobility.Install (ueNodes1);
-
-  // Position of UEs attached to eNB 2
-  MobilityHelper ue2mobility;
-  ue2mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
-                                    "X", DoubleValue (enbDist),
-                                    "Y", DoubleValue (0.0),
-                                    "rho", DoubleValue (radius));
-  ue2mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  ue2mobility.Install (ueNodes2);
-
-
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  NetDeviceContainer ueDevs1;
-  NetDeviceContainer ueDevs2;
-  enbDevs = lena->InstallEnbDevice (enbNodes);
-  ueDevs1 = lena->InstallUeDevice (ueNodes1);
-  ueDevs2 = lena->InstallUeDevice (ueNodes2);
-
-  // Attach UEs to a eNB
-  lena->Attach (ueDevs1, enbDevs.Get (0));
-  lena->Attach (ueDevs2, enbDevs.Get (1));
-
-  // Activate an EPS bearer on all UEs
-  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-  EpsBearer bearer (q);
-  lena->ActivateEpsBearer (ueDevs1, bearer, LteTft::Default ());
-  lena->ActivateEpsBearer (ueDevs2, bearer, LteTft::Default ());
-
-  Simulator::Stop (Seconds (10));
-
-  // Insert RLC Performance Calculator
-  std::string dlOutFname = "DlRlcStats";
-  dlOutFname.append (tag.str ());
-  std::string ulOutFname = "UlRlcStats";
-  ulOutFname.append (tag.str ());
-
-  lena->EnableMacTraces ();
-  lena->EnableRlcTraces ();
-
-  Simulator::Run ();
-  Simulator::Destroy ();
-  return 0;
-}
--- a/src/lte/examples/lena-cqi-threshold.cc	Tue Nov 29 18:14:02 2011 +0100
+++ b/src/lte/examples/lena-cqi-threshold.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -25,10 +25,10 @@
 #include "ns3/lte-module.h"
 #include "ns3/config-store.h"
 //#include "ns3/gtk-config-store.h"
+
 using namespace ns3;
 
 // position functions insipred by /examples/wireless/wifi-ap.cc
-
 static void
 SetPosition (Ptr<Node> node, Vector position)
 {
@@ -79,16 +79,9 @@
 
   Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
   lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
+  // Uncomment to enable logging
   //lena->EnableLogComponents ();
 
-  //   LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
-  LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
-  //   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
-  LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
-  LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
-  LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
-  LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
- 
   // Create Nodes: eNodeB and UE
   NodeContainer enbNodes;
   NodeContainer ueNodes;
--- a/src/lte/examples/lena-epc-first.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +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: Jaume Nin <jaume.nin@cttc.cat>
- */
-
-#include "ns3/lena-helper.h"
-#include "ns3/epc-helper.h"
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/ipv4-global-routing-helper.h"
-#include "ns3/internet-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/applications-module.h"
-#include "ns3/point-to-point-helper.h"
-#include "ns3/config-store.h"
-//#include "ns3/gtk-config-store.h"
-
-/**
- * Sample simulation script for LTE+EPC. It instantiates several eNodeB,
- * attaches one UE per eNodeB starts a flow for each UE to  and from a remote host.
- * It also  starts yet another flow between each UE pair.
- */
-
-using namespace ns3;
-NS_LOG_COMPONENT_DEFINE ("EpcFirstExample");
-int
-main (int argc, char *argv[])
-{
-
-  uint16_t numberOfNodes = 2;
-  uint32_t simTime = 4;
-  double distance = 10.0;
-
-  // Command line arguments
-  CommandLine cmd;
-  cmd.AddValue("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes);
-  cmd.AddValue("simTime", "Total duration of the simulation (in seconds)",simTime);
-  cmd.Parse(argc, argv);
-
-  Ptr<LenaHelper> lteHelper = CreateObject<LenaHelper> ();
-  Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
-  lteHelper->SetEpcHelper (epcHelper);
-  lteHelper->SetSchedulerType("ns3::RrFfMacScheduler");
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse(argc, argv);
-
-  Ptr<Node> pgw = epcHelper->GetPgwNode ();
-
-   // Create a single RemoteHost
-  NodeContainer remoteHostContainer;
-  remoteHostContainer.Create (1);
-  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
-  InternetStackHelper internet;
-  internet.Install (remoteHostContainer);
-
-  // Create the Internet
-  PointToPointHelper p2ph;
-  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
-  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
-  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
-  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
-  Ipv4AddressHelper ipv4h;
-  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
-  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
-  // interface 0 is localhost, 1 is the p2p device
-  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
-
-  Ipv4StaticRoutingHelper ipv4RoutingHelper;
-  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
-  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
-
-  NodeContainer ueNodes;
-  NodeContainer enbNodes;
-  enbNodes.Create(numberOfNodes);
-  ueNodes.Create(numberOfNodes);
-
-  // Install Mobility Model
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  for (uint16_t i = 0; i < numberOfNodes; i++)
-    {
-      positionAlloc->Add (Vector(distance * i, 0, 0));
-    }
-  MobilityHelper mobility;
-  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
-  mobility.SetPositionAllocator(positionAlloc);
-  mobility.Install(enbNodes);
-  mobility.Install(ueNodes);
-
-  // Install LTE Devices to the nodes
-  NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice (enbNodes);
-  NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);
-
-  // Attach one UE per eNodeB
-  for (uint16_t i = 0; i < numberOfNodes; i++)
-      {
-        lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(i));
-      }
-
-  // Install the IP stack on the UEs
-  internet.Install (ueNodes);
-  Ipv4InterfaceContainer ueIpIface;
-  ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
-  // Assign IP address to UEs, and install applications
-  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
-    {
-      Ptr<Node> ueNode = ueNodes.Get (u);
-      // Set the default gateway for the UE
-      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
-      ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
-    }
-  lteHelper->ActivateEpsBearer (ueLteDevs, EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), LteTft::Default ());
-
-
-  // Install and start applications on UEs and remote host
-  uint16_t dlPort = 1234;
-  uint16_t ulPort = 1235;
-  uint16_t otherPort = 1236;
-  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
-  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
-  PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
-  ApplicationContainer clientApps;
-  ApplicationContainer serverApps;
-  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
-    {
-      serverApps = dlPacketSinkHelper.Install (ueNodes.Get(u));
-      serverApps = ulPacketSinkHelper.Install (remoteHost);
-      serverApps = packetSinkHelper.Install (ueNodes.Get(u));
-      UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort);
-      UdpClientHelper ulClient (remoteHostAddr, ulPort);
-      UdpClientHelper client (ueIpIface.GetAddress (u), otherPort);
-      clientApps = dlClient.Install (remoteHost);
-      clientApps = ulClient.Install (ueNodes.Get(u));
-      if (u+1 < ueNodes.GetN ())
-        {
-          clientApps = client.Install (ueNodes.Get(u+1));
-        }
-      else
-        {
-          clientApps = client.Install (ueNodes.Get(0));
-        }
-
-    }
-  serverApps.Start (Seconds (0.01));
-  clientApps.Start (Seconds (0.01));
-
-  // Enable PCAP tracing
-  p2ph.EnablePcapAll("lena-epc-first");
-
-  Simulator::Stop(Seconds(simTime));
-  Simulator::Run();
-
-  /*GtkConfigStore config;
-  config.ConfigureAttributes();*/
-
-  Simulator::Destroy();
-  return 0;
-
-}
-
--- a/src/lte/examples/lena-extract-pathloss.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +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>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-#include "ns3/rlc-stats-calculator.h"
-
-#include <iomanip>
-#include <string>
-
-#include <ns3/log.h>
-
-using namespace ns3;
-
-
-NS_LOG_COMPONENT_DEFINE ("InterCellInterference");
-
-
-/**
- * Store the last pathloss value for each TX-RX pair. This is an
- * example of how the PathlossTrace (provided by some SpectrumChannel
- * implementations) work. 
- * 
- */
-class GlobalPathlossDatabase
-{
-public:
-
-  /** 
-   * update the pathloss value
-   * 
-   * \param context 
-   * \param txPhy the transmitting PHY
-   * \param rxPhy the receiving PHY
-   * \param lossDb the loss in dB
-   */
-  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb) = 0;
-
-  /** 
-   * print the stored pathloss values to standard output
-   * 
-   */
-  void Print ();
-
-protected:
-
-  //        CELL ID            IMSI     PATHLOSS
-  std::map<uint16_t, std::map<uint64_t, double> > m_pathlossMap;
-};
-
-void 
-GlobalPathlossDatabase::Print ()
-{
-  NS_LOG_FUNCTION (this);
-  for (std::map<uint16_t, std::map<uint64_t, double> >::const_iterator cellIdIt = m_pathlossMap.begin ();
-       cellIdIt != m_pathlossMap.end ();
-       ++cellIdIt)
-    {
-      for (std::map<uint64_t, double>::const_iterator imsiIt = cellIdIt->second.begin ();
-           imsiIt != cellIdIt->second.end ();
-           ++imsiIt)
-        {
-          std::cout << "CellId: " << cellIdIt->first << " IMSI: " << imsiIt->first << " pathloss: " << imsiIt->second << " dB" << std::endl;
-        }
-    }
-}
-
-class DownlinkGlobalPathlossDatabase : public GlobalPathlossDatabase
-{
-public:
-  // inherited from GlobalPathlossDatabase
-  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb);
-};
-
-void
-DownlinkGlobalPathlossDatabase::UpdatePathloss (std::string context, 
-                                        Ptr<SpectrumPhy> txPhy, 
-                                        Ptr<SpectrumPhy> rxPhy, 
-                                        double lossDb)
-{
-  NS_LOG_FUNCTION (this << lossDb);
-  uint16_t cellId = txPhy->GetDevice ()->GetObject<LteEnbNetDevice> ()->GetCellId ();
-  uint16_t imsi = rxPhy->GetDevice ()->GetObject<LteUeNetDevice> ()->GetImsi ();
-  m_pathlossMap[cellId][imsi] = lossDb;
-}
-
-
-class UplinkGlobalPathlossDatabase : public GlobalPathlossDatabase
-{
-public:
-  // inherited from GlobalPathlossDatabase
-  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb);
-};
-
-void
-UplinkGlobalPathlossDatabase::UpdatePathloss (std::string context, 
-                                        Ptr<SpectrumPhy> txPhy, 
-                                        Ptr<SpectrumPhy> rxPhy, 
-                                        double lossDb)
-{
-  NS_LOG_FUNCTION (this << lossDb);
-  uint16_t imsi = txPhy->GetDevice ()->GetObject<LteUeNetDevice> ()->GetImsi ();
-  uint16_t cellId = rxPhy->GetDevice ()->GetObject<LteEnbNetDevice> ()->GetCellId ();
-  m_pathlossMap[cellId][imsi] = lossDb;
-}
-
-
-
-
-
-int main (int argc, char *argv[])
-{
-  double enbDist = 20.0;
-  double radius = 10.0;
-  uint32_t numUes = 1;
-
-
-  CommandLine cmd;
-  cmd.AddValue ("enbDist", "distance between the two eNBs", enbDist);
-  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
-  cmd.AddValue ("numUes", "how many UEs are attached to each eNB", numUes);
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  // determine the string tag that identifies this simulation run
-  // this tag is then appended to all filenames
-
-  IntegerValue runValue;
-  GlobalValue::GetValueByName ("RngRun", runValue);
-
-  std::ostringstream tag;
-  tag  << "_enbDist" << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
-       << "_radius"  << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
-       << "_numUes"  << std::setw (3) << std::setfill ('0')  << numUes
-       << "_rngRun"  << std::setw (3) << std::setfill ('0')  << runValue.Get () ;
-
-  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-
-
-  // NOTE: the PropagationLoss trace source of the SpectrumChannel
-  // works only for single-frequency path loss model.  
-  // e.g., it will work with the following models:
-  // ns3::FriisPropagationLossModel, 
-  // ns3::TwoRayGroundPropagationLossModel, 
-  // ns3::LogDistancePropagationLossModel,
-  // ns3::ThreeLogDistancePropagationLossModel, 
-  // ns3::NakagamiPropagationLossModel
-  // ns3::BuildingsPropagationLossModel
-  // etc.
-  // but it WON'T work if you ONLY use SpectrumPropagationLossModels such as:
-  // ns3::FriisSpectrumPropagationLossModel
-  // ns3::ConstantSpectrumPropagationLossModel
-  lena->SetAttribute ("PathlossModel", StringValue ("ns3::Cost231PropagationLossModel"));
-  
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer ueNodes1, ueNodes2;
-  enbNodes.Create (2);
-  ueNodes1.Create (numUes);
-  ueNodes2.Create (numUes);
-
-  // Position of eNBs
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
-  positionAlloc->Add (Vector (enbDist, 0.0, 0.0));
-  MobilityHelper enbMobility;
-  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  enbMobility.SetPositionAllocator (positionAlloc);
-  enbMobility.Install (enbNodes);
-
-  // Position of UEs attached to eNB 1
-  MobilityHelper ue1mobility;
-  ue1mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
-                                    "X", DoubleValue (0.0),
-                                    "Y", DoubleValue (0.0),
-                                    "rho", DoubleValue (radius));
-  ue1mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  ue1mobility.Install (ueNodes1);
-
-  // Position of UEs attached to eNB 2
-  MobilityHelper ue2mobility;
-  ue2mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
-                                    "X", DoubleValue (enbDist),
-                                    "Y", DoubleValue (0.0),
-                                    "rho", DoubleValue (radius));
-  ue2mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  ue2mobility.Install (ueNodes2);
-
-
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  NetDeviceContainer ueDevs1;
-  NetDeviceContainer ueDevs2;
-  enbDevs = lena->InstallEnbDevice (enbNodes);
-  ueDevs1 = lena->InstallUeDevice (ueNodes1);
-  ueDevs2 = lena->InstallUeDevice (ueNodes2);
-
-  // Attach UEs to a eNB
-  lena->Attach (ueDevs1, enbDevs.Get (0));
-  lena->Attach (ueDevs2, enbDevs.Get (1));
-
-  // Activate an EPS bearer on all UEs
-  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-  EpsBearer bearer (q);
-  lena->ActivateEpsBearer (ueDevs1, bearer, LteTft::Default ());
-  lena->ActivateEpsBearer (ueDevs2, bearer, LteTft::Default ());
-
-  Simulator::Stop (Seconds (0.5));
-
-  // Insert RLC Performance Calculator
-  std::string dlOutFname = "DlRlcStats";
-  dlOutFname.append (tag.str ());
-  std::string ulOutFname = "UlRlcStats";
-  ulOutFname.append (tag.str ());
-
-  lena->EnableMacTraces ();
-  lena->EnableRlcTraces ();
-
-
-
-  // keep track of all path loss values in a global object
-  DownlinkGlobalPathlossDatabase dlPathlossDb;
-  UplinkGlobalPathlossDatabase ulPathlossDb;
-  // we rely on the fact that LenaHelper creates the DL channel object first, then the UL channel object,
-  // hence the former will have index 0 and the latter 1
-  Config::Connect ("/ChannelList/0/PropagationLoss",
-                   MakeCallback (&DownlinkGlobalPathlossDatabase::UpdatePathloss, &dlPathlossDb));
-  Config::Connect ("/ChannelList/1/PropagationLoss",
-                    MakeCallback (&UplinkGlobalPathlossDatabase::UpdatePathloss, &ulPathlossDb)); 
-
-  Simulator::Run ();
-
-
-  // print the pathloss values at the end of the simulation
-  std::cout << std::endl << "Downlink pathloss:" << std::endl;
-  dlPathlossDb.Print ();
-  std::cout << std::endl << "Uplink pathloss:" << std::endl;
-  ulPathlossDb.Print ();
-
-
-  Simulator::Destroy ();
-  return 0;
-}
--- a/src/lte/examples/lena-fading.cc	Tue Nov 29 18:14:02 2011 +0100
+++ b/src/lte/examples/lena-fading.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -48,13 +48,10 @@
   //cmd.Parse (argc, argv);
 
   Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-
+  // Uncomment to enable logging
   //lena->EnableLogComponents ();
   
 
-  LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
-  LogComponentEnable ("TraceFadingLossModel", LOG_LEVEL_ALL);
-  
   lena->SetAttribute ("FadingModel", StringValue ("ns3::TraceFadingLossModel"));
   
   std::ifstream ifTraceFile;
@@ -97,8 +94,6 @@
   // Create Devices and install them in the Nodes (eNB and UE)
   NetDeviceContainer enbDevs;
   NetDeviceContainer ueDevs;
-  //lena->SetSchedulerType ("ns3::RrFfMacScheduler");
-  lena->SetSchedulerType ("ns3::PfFfMacScheduler");
   enbDevs = lena->InstallEnbDevice (enbNodes);
   ueDevs = lena->InstallUeDevice (ueNodes);
 
--- a/src/lte/examples/lena-first-sim.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-//#include "ns3/gtk-config-store.h"
-using namespace ns3;
-
-int main (int argc, char *argv[])
-{	
-  CommandLine cmd;
-  cmd.Parse (argc, argv);
-	
-  // to save a template default attribute file run it like this:
-  // ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Save --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim
-  //
-  // to load a previously created default attribute file
-  // ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Load --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-
-  //lena->EnableLogComponents ();
-
-  //   LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
-  LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
-  //   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
-//   LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
-  LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
-  LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
-  LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
- 
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer ueNodes;
-  enbNodes.Create (1);
-  ueNodes.Create (1);
-
-  // Install Mobility Model
-  MobilityHelper mobility;
-  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
-  mobility.Install (enbNodes);
-  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
-  mobility.Install (ueNodes);
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  NetDeviceContainer ueDevs;
-  //lena->SetSchedulerType ("ns3::RrFfMacScheduler");
-  lena->SetSchedulerType ("ns3::PfFfMacScheduler");
-  enbDevs = lena->InstallEnbDevice (enbNodes);
-  ueDevs = lena->InstallUeDevice (ueNodes);
-
-  // Attach a UE to a eNB
-  lena->Attach (ueDevs, enbDevs.Get (0));
-
-  // Activate an EPS bearer
-  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-  EpsBearer bearer (q);
-  lena->ActivateEpsBearer (ueDevs, bearer, LteTft::Default ());
-
-
-  Simulator::Stop (Seconds (0.005));
-
-  Simulator::Run ();
-
-  //GtkConfigStore config;
-  //config.ConfigureAttributes ();
-
-  Simulator::Destroy ();
-  return 0;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-gtpu-tunnel.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,112 @@
+/* -*-  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: Jaume Nin <jaume.nin@cttc.cat>
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include "ns3/internet-module.h"
+#include "ns3/csma-module.h"
+#include "ns3/csma-helper.h"
+#include "ns3/applications-module.h"
+#include "ns3/ipv4-global-routing-helper.h"
+#include "ns3/gtpu-tunnel-helper.h"
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+
+NS_LOG_COMPONENT_DEFINE ("EpcGtpUTunnelExample");
+int
+main (int argc, char *argv[])
+{
+  Packet::EnablePrinting ();
+
+  // Command line arguments
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  NS_LOG_INFO ("Create nodes.");
+  NodeContainer c;
+  c.Create (2);
+
+  InternetStackHelper internet;
+  internet.Install (c);
+
+  // Create the channels first
+  NS_LOG_INFO ("Create channels.");
+
+  CsmaHelper csma;
+  csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps"));
+  csma.SetChannelAttribute ("Delay", TimeValue (NanoSeconds (6560)));
+  NetDeviceContainer nc = csma.Install (c);
+
+  NS_LOG_INFO ("Assign IP Addresses.");
+  Ipv4AddressHelper ipv4;
+  ipv4.SetBase ("10.0.1.0", "255.255.255.0");
+  Ipv4InterfaceContainer ic = ipv4.Assign (nc);
+  Ipv4GlobalRoutingHelper::PopulateRoutingTables ();
+  AsciiTraceHelper ascii;
+  csma.EnableAsciiAll (ascii.CreateFileStream ("epc-gtp.tr"));
+  csma.EnablePcapAll ("epc-gtp");
+
+  GtpuTunnerHelper epcHelper;
+
+  epcHelper.InstallGtpu (c.Get (0));
+  epcHelper.InstallGtpu (c.Get (1));
+
+  epcHelper.CreateGtpuTunnel (c.Get (0), ic.GetAddress (0),  c.Get (1), ic.GetAddress (1));
+
+  NS_LOG_INFO ("Create Applications.");
+  // Set up some default values for the simulation.
+  Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (200));
+  Config::SetDefault ("ns3::OnOffApplication::OnTime", RandomVariableValue (ConstantVariable (1)));
+  Config::SetDefault ("ns3::OnOffApplication::OffTime", RandomVariableValue (ConstantVariable (0)));
+  Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("2kbps"));
+  OnOffHelper onoffAB = OnOffHelper ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.2")));
+  OnOffHelper onoffBA = OnOffHelper ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.1")));
+  PacketSinkHelper sinkA ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.1")));
+  PacketSinkHelper sinkB ("ns3::Ipv4RawSocketFactory", InetSocketAddress (Ipv4Address ("100.0.0.2")));
+
+  ApplicationContainer apps = onoffAB.Install (c.Get (0));
+  apps.Add (onoffBA.Install (c.Get (1)));
+  apps.Add (sinkA.Install (c.Get (0)));
+  apps.Add (sinkB.Install (c.Get (1)));
+
+  apps.Start (Seconds (1.0));
+  apps.Stop (Seconds (10.0));
+
+  NS_LOG_INFO ("Run Simulation.");
+  Simulator::Run ();
+
+  /*GtkConfigStore config;
+  config.ConfigureAttributes ();*/
+
+  Simulator::Destroy ();
+  NS_LOG_INFO ("Done.");
+
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-intercell-interference.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,143 @@
+/* -*-  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>
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include "ns3/rlc-stats-calculator.h"
+
+#include <iomanip>
+#include <string>
+
+using namespace ns3;
+
+/**
+ * This simulation script creates two eNodeBs and drops randomly several UEs in
+ * a disc around them (same number on both). The number of UEs , the radius of
+ * that disc and the distance between the eNodeBs can be configured.
+ */
+int main (int argc, char *argv[])
+{
+  double enbDist = 100.0;
+  double radius = 50.0;
+  uint32_t numUes = 1;
+
+
+  CommandLine cmd;
+  cmd.AddValue ("enbDist", "distance between the two eNBs", enbDist);
+  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
+  cmd.AddValue ("numUes", "how many UEs are attached to each eNB", numUes);
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  // determine the string tag that identifies this simulation run
+  // this tag is then appended to all filenames
+
+  IntegerValue runValue;
+  GlobalValue::GetValueByName ("RngRun", runValue);
+
+  std::ostringstream tag;
+  tag  << "_enbDist" << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
+       << "_radius"  << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
+       << "_numUes"  << std::setw (3) << std::setfill ('0')  << numUes
+       << "_rngRun"  << std::setw (3) << std::setfill ('0')  << runValue.Get () ;
+
+  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
+  
+  lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer ueNodes1, ueNodes2;
+  enbNodes.Create (2);
+  ueNodes1.Create (numUes);
+  ueNodes2.Create (numUes);
+
+  // Position of eNBs
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (enbDist, 0.0, 0.0));
+  MobilityHelper enbMobility;
+  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  enbMobility.SetPositionAllocator (positionAlloc);
+  enbMobility.Install (enbNodes);
+
+  // Position of UEs attached to eNB 1
+  MobilityHelper ue1mobility;
+  ue1mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
+                                    "X", DoubleValue (0.0),
+                                    "Y", DoubleValue (0.0),
+                                    "rho", DoubleValue (radius));
+  ue1mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  ue1mobility.Install (ueNodes1);
+
+  // Position of UEs attached to eNB 2
+  MobilityHelper ue2mobility;
+  ue2mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
+                                    "X", DoubleValue (enbDist),
+                                    "Y", DoubleValue (0.0),
+                                    "rho", DoubleValue (radius));
+  ue2mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  ue2mobility.Install (ueNodes2);
+
+
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  NetDeviceContainer ueDevs1;
+  NetDeviceContainer ueDevs2;
+  enbDevs = lena->InstallEnbDevice (enbNodes);
+  ueDevs1 = lena->InstallUeDevice (ueNodes1);
+  ueDevs2 = lena->InstallUeDevice (ueNodes2);
+
+  // Attach UEs to a eNB
+  lena->Attach (ueDevs1, enbDevs.Get (0));
+  lena->Attach (ueDevs2, enbDevs.Get (1));
+
+  // Activate an EPS bearer on all UEs
+  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+  EpsBearer bearer (q);
+  lena->ActivateEpsBearer (ueDevs1, bearer, LteTft::Default ());
+  lena->ActivateEpsBearer (ueDevs2, bearer, LteTft::Default ());
+
+  Simulator::Stop (Seconds (10));
+
+  // Insert RLC Performance Calculator
+  std::string dlOutFname = "DlRlcStats";
+  dlOutFname.append (tag.str ());
+  std::string ulOutFname = "UlRlcStats";
+  ulOutFname.append (tag.str ());
+
+  lena->EnableMacTraces ();
+  lena->EnableRlcTraces ();
+
+  Simulator::Run ();
+  Simulator::Destroy ();
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-pathloss-traces.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,267 @@
+/* -*-  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>
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include "ns3/rlc-stats-calculator.h"
+
+#include <iomanip>
+#include <string>
+
+#include <ns3/log.h>
+
+using namespace ns3;
+
+
+NS_LOG_COMPONENT_DEFINE ("InterCellInterference");
+
+
+/**
+ * Store the last pathloss value for each TX-RX pair. This is an
+ * example of how the PathlossTrace (provided by some SpectrumChannel
+ * implementations) work. 
+ * 
+ */
+class GlobalPathlossDatabase
+{
+public:
+
+  /** 
+   * update the pathloss value
+   * 
+   * \param context 
+   * \param txPhy the transmitting PHY
+   * \param rxPhy the receiving PHY
+   * \param lossDb the loss in dB
+   */
+  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb) = 0;
+
+  /** 
+   * print the stored pathloss values to standard output
+   * 
+   */
+  void Print ();
+
+protected:
+
+  //        CELL ID            IMSI     PATHLOSS
+  std::map<uint16_t, std::map<uint64_t, double> > m_pathlossMap;
+};
+
+void 
+GlobalPathlossDatabase::Print ()
+{
+  NS_LOG_FUNCTION (this);
+  for (std::map<uint16_t, std::map<uint64_t, double> >::const_iterator cellIdIt = m_pathlossMap.begin ();
+       cellIdIt != m_pathlossMap.end ();
+       ++cellIdIt)
+    {
+      for (std::map<uint64_t, double>::const_iterator imsiIt = cellIdIt->second.begin ();
+           imsiIt != cellIdIt->second.end ();
+           ++imsiIt)
+        {
+          std::cout << "CellId: " << cellIdIt->first << " IMSI: " << imsiIt->first << " pathloss: " << imsiIt->second << " dB" << std::endl;
+        }
+    }
+}
+
+class DownlinkGlobalPathlossDatabase : public GlobalPathlossDatabase
+{
+public:
+  // inherited from GlobalPathlossDatabase
+  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb);
+};
+
+void
+DownlinkGlobalPathlossDatabase::UpdatePathloss (std::string context, 
+                                        Ptr<SpectrumPhy> txPhy, 
+                                        Ptr<SpectrumPhy> rxPhy, 
+                                        double lossDb)
+{
+  NS_LOG_FUNCTION (this << lossDb);
+  uint16_t cellId = txPhy->GetDevice ()->GetObject<LteEnbNetDevice> ()->GetCellId ();
+  uint16_t imsi = rxPhy->GetDevice ()->GetObject<LteUeNetDevice> ()->GetImsi ();
+  m_pathlossMap[cellId][imsi] = lossDb;
+}
+
+
+class UplinkGlobalPathlossDatabase : public GlobalPathlossDatabase
+{
+public:
+  // inherited from GlobalPathlossDatabase
+  virtual void UpdatePathloss (std::string context, Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy, double lossDb);
+};
+
+void
+UplinkGlobalPathlossDatabase::UpdatePathloss (std::string context, 
+                                        Ptr<SpectrumPhy> txPhy, 
+                                        Ptr<SpectrumPhy> rxPhy, 
+                                        double lossDb)
+{
+  NS_LOG_FUNCTION (this << lossDb);
+  uint16_t imsi = txPhy->GetDevice ()->GetObject<LteUeNetDevice> ()->GetImsi ();
+  uint16_t cellId = rxPhy->GetDevice ()->GetObject<LteEnbNetDevice> ()->GetCellId ();
+  m_pathlossMap[cellId][imsi] = lossDb;
+}
+
+
+int main (int argc, char *argv[])
+{
+  double enbDist = 20.0;
+  double radius = 10.0;
+  uint32_t numUes = 1;
+
+
+  CommandLine cmd;
+  cmd.AddValue ("enbDist", "distance between the two eNBs", enbDist);
+  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
+  cmd.AddValue ("numUes", "how many UEs are attached to each eNB", numUes);
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  // determine the string tag that identifies this simulation run
+  // this tag is then appended to all filenames
+
+  IntegerValue runValue;
+  GlobalValue::GetValueByName ("RngRun", runValue);
+
+  std::ostringstream tag;
+  tag  << "_enbDist" << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
+       << "_radius"  << std::setw (3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
+       << "_numUes"  << std::setw (3) << std::setfill ('0')  << numUes
+       << "_rngRun"  << std::setw (3) << std::setfill ('0')  << runValue.Get () ;
+
+  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
+
+
+  // NOTE: the PropagationLoss trace source of the SpectrumChannel
+  // works only for single-frequency path loss model.  
+  // e.g., it will work with the following models:
+  // ns3::FriisPropagationLossModel, 
+  // ns3::TwoRayGroundPropagationLossModel, 
+  // ns3::LogDistancePropagationLossModel,
+  // ns3::ThreeLogDistancePropagationLossModel, 
+  // ns3::NakagamiPropagationLossModel
+  // ns3::BuildingsPropagationLossModel
+  // etc.
+  // but it WON'T work if you ONLY use SpectrumPropagationLossModels such as:
+  // ns3::FriisSpectrumPropagationLossModel
+  // ns3::ConstantSpectrumPropagationLossModel
+  lena->SetAttribute ("PathlossModel", StringValue ("ns3::Cost231PropagationLossModel"));
+  
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer ueNodes1, ueNodes2;
+  enbNodes.Create (2);
+  ueNodes1.Create (numUes);
+  ueNodes2.Create (numUes);
+
+  // Position of eNBs
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  positionAlloc->Add (Vector (0.0, 0.0, 0.0));
+  positionAlloc->Add (Vector (enbDist, 0.0, 0.0));
+  MobilityHelper enbMobility;
+  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  enbMobility.SetPositionAllocator (positionAlloc);
+  enbMobility.Install (enbNodes);
+
+  // Position of UEs attached to eNB 1
+  MobilityHelper ue1mobility;
+  ue1mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
+                                    "X", DoubleValue (0.0),
+                                    "Y", DoubleValue (0.0),
+                                    "rho", DoubleValue (radius));
+  ue1mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  ue1mobility.Install (ueNodes1);
+
+  // Position of UEs attached to eNB 2
+  MobilityHelper ue2mobility;
+  ue2mobility.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
+                                    "X", DoubleValue (enbDist),
+                                    "Y", DoubleValue (0.0),
+                                    "rho", DoubleValue (radius));
+  ue2mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  ue2mobility.Install (ueNodes2);
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  NetDeviceContainer ueDevs1;
+  NetDeviceContainer ueDevs2;
+  enbDevs = lena->InstallEnbDevice (enbNodes);
+  ueDevs1 = lena->InstallUeDevice (ueNodes1);
+  ueDevs2 = lena->InstallUeDevice (ueNodes2);
+
+  // Attach UEs to a eNB
+  lena->Attach (ueDevs1, enbDevs.Get (0));
+  lena->Attach (ueDevs2, enbDevs.Get (1));
+
+  // Activate an EPS bearer on all UEs
+  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+  EpsBearer bearer (q);
+  lena->ActivateEpsBearer (ueDevs1, bearer, LteTft::Default ());
+  lena->ActivateEpsBearer (ueDevs2, bearer, LteTft::Default ());
+
+  Simulator::Stop (Seconds (0.5));
+
+  // Insert RLC Performance Calculator
+  std::string dlOutFname = "DlRlcStats";
+  dlOutFname.append (tag.str ());
+  std::string ulOutFname = "UlRlcStats";
+  ulOutFname.append (tag.str ());
+
+  lena->EnableMacTraces ();
+  lena->EnableRlcTraces ();
+
+
+
+  // keep track of all path loss values in a global object
+  DownlinkGlobalPathlossDatabase dlPathlossDb;
+  UplinkGlobalPathlossDatabase ulPathlossDb;
+  // we rely on the fact that LenaHelper creates the DL channel object first, then the UL channel object,
+  // hence the former will have index 0 and the latter 1
+  Config::Connect ("/ChannelList/0/PropagationLoss",
+                   MakeCallback (&DownlinkGlobalPathlossDatabase::UpdatePathloss, &dlPathlossDb));
+  Config::Connect ("/ChannelList/1/PropagationLoss",
+                    MakeCallback (&UplinkGlobalPathlossDatabase::UpdatePathloss, &ulPathlossDb)); 
+
+  Simulator::Run ();
+
+
+  // print the pathloss values at the end of the simulation
+  std::cout << std::endl << "Downlink pathloss:" << std::endl;
+  dlPathlossDb.Print ();
+  std::cout << std::endl << "Uplink pathloss:" << std::endl;
+  ulPathlossDb.Print ();
+
+
+  Simulator::Destroy ();
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-profiling.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,217 @@
+/* -*-  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: Jaume Nin <jnin@cttc.es>
+ */
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include <ns3/buildings-propagation-loss-model.h>
+#include <iomanip>
+#include <string>
+#include <vector>
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+using std::vector;
+
+int
+main (int argc, char *argv[])
+{
+  uint32_t nEnbPerFloor = 1;
+  uint32_t nUe = 1;
+  uint32_t nFloors = 0;
+  double simTime = 1.0;
+  std::string traceDirectory = "";
+  CommandLine cmd;
+
+  cmd.AddValue("nEnb", "Number of eNodeBs per floor", nEnbPerFloor);
+  cmd.AddValue("nUe", "Number of UEs", nUe);
+  cmd.AddValue("nFloors", "Number of floors, 0 for Friis propagation model",
+      nFloors);
+  cmd.AddValue("simTime", "Total duration of the simulation (in seconds)",
+      simTime);
+  cmd.AddValue("traceDirectory",
+      "Destination folder where the traces will be stored", traceDirectory);
+  cmd.Parse(argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults();
+  
+  // parse again so you can override default values from the command line
+  cmd.Parse(argc, argv);
+
+  // Geometry of the scenario (in meters)
+  // Assume squared building
+  double nodeHeight = 1.5;
+  double roomHeight = 3;
+  double roomLength = 8;
+  uint32_t nRooms = ceil (sqrt (nEnbPerFloor));
+  uint32_t nEnb;
+
+  Ptr < LenaHelper > lena = CreateObject<LenaHelper> ();
+  //lena->EnableLogComponents ();
+  //LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
+  if (nFloors == 0)
+    {
+      lena->SetAttribute("PathlossModel",
+          StringValue("ns3::FriisPropagationLossModel"));
+      nEnb = nEnbPerFloor;
+    }
+  else
+    {
+      lena->SetAttribute("PathlossModel",
+          StringValue("ns3::BuildingsPropagationLossModel"));
+      nEnb = nFloors * nEnbPerFloor;
+    }
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  vector < NodeContainer > ueNodes;
+
+  enbNodes.Create(nEnb);
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NodeContainer ueNode;
+      ueNode.Create(nUe);
+      ueNodes.push_back(ueNode);
+    }
+
+  MobilityHelper mobility;
+  vector<Vector> enbPosition;
+  Ptr < ListPositionAllocator > positionAlloc = CreateObject<ListPositionAllocator> ();
+  Ptr < Building > building;
+
+  if (nFloors == 0)
+    {
+      mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
+      // Position of eNBs
+      uint32_t plantedEnb = 0;
+      for (uint32_t row = 0; row < nRooms; row++)
+        {
+          for (uint32_t column = 0; column < nRooms && plantedEnb < nEnbPerFloor; column++, plantedEnb++)
+            {
+              Vector v(roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
+              positionAlloc->Add(v);
+              enbPosition.push_back(v);
+              mobility.Install(ueNodes[plantedEnb]);
+            }
+        }
+      mobility.SetPositionAllocator(positionAlloc);
+      mobility.Install (enbNodes);
+
+      // Position of UEs attached to eNB
+     for (uint32_t i = 0; i < nEnb; i++)
+       {
+         UniformVariable posX(enbPosition[i].x - roomLength * 0.5,
+            enbPosition[i].x + roomLength * 0.5);
+         UniformVariable posY(enbPosition[i].y - roomLength * 0.5,
+            enbPosition[i].y + roomLength * 0.5);
+        positionAlloc = CreateObject<ListPositionAllocator> ();
+        for (uint32_t j = 0; j < nUe; j++)
+          {
+            positionAlloc->Add(Vector(posX.GetValue(), posY.GetValue(), nodeHeight));
+            mobility.SetPositionAllocator(positionAlloc);
+          }
+         mobility.Install(ueNodes[i]);
+     }
+
+    }
+  else
+    {
+      building = Create<Building> (0.0, nRooms * roomLength,
+                                                    0.0, nRooms * roomLength,
+                                                    0.0, nFloors* roomHeight);
+      building->SetBuildingType(Building::Residential);
+      building->SetExtWallsType(Building::ConcreteWithWindows);
+      building->SetFloorsNumber(nFloors);
+      building->SetNumberRoomX(nRooms);
+      building->SetNumberRoomY(nRooms);
+      mobility.SetMobilityModel("ns3::BuildingsMobilityModel");
+      mobility.Install (enbNodes);
+      uint32_t plantedEnb = 0;
+      for (uint32_t floor = 0; floor < nFloors; floor++)
+        {
+          uint32_t plantedEnbPerFloor = 0;
+          for (uint32_t row = 0; row < nRooms; row++)
+            {
+              for (uint32_t column = 0; column < nRooms && plantedEnbPerFloor < nEnbPerFloor; column++, plantedEnb++, plantedEnbPerFloor++)
+                {
+                  Vector v (roomLength * (column + 0.5),
+                            roomLength * (row + 0.5),
+                            nodeHeight + roomHeight * floor);
+                  positionAlloc->Add(v);
+                  enbPosition.push_back(v);
+                  Ptr<BuildingsMobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<BuildingsMobilityModel> ();
+                  mmEnb->SetPosition (v);
+                  mmEnb->SetIndoor (building);
+                  mmEnb->SetFloorNumber (floor);
+                  mmEnb->SetRoomNumberX (row);
+                  mmEnb->SetRoomNumberY (column);
+                  
+                  // Positioning UEs attached to eNB
+                  mobility.Install(ueNodes[plantedEnb]);
+                  for (uint32_t ue = 0; ue < nUe; ue++)
+                    {
+                      Ptr<BuildingsMobilityModel> mmUe = ueNodes[plantedEnb].Get (ue)->GetObject<BuildingsMobilityModel> ();
+                      Vector vUe (v.x, v.y, v.z);
+                      mmUe->SetPosition (vUe);
+                      mmUe->SetIndoor (building);
+                      mmUe->SetFloorNumber (floor);
+                      mmUe->SetRoomNumberX (row);
+                      mmUe->SetRoomNumberY (column);
+                    }
+                }
+            }
+        }
+      
+
+    }
+
+
+
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  vector < NetDeviceContainer > ueDevs;
+  enbDevs = lena->InstallEnbDevice(enbNodes);
+  for (uint32_t i = 0; i < nEnb; i++)
+    {
+      NetDeviceContainer ueDev = lena->InstallUeDevice(ueNodes[i]);
+      ueDevs.push_back(ueDev);
+      lena->Attach(ueDev, enbDevs.Get(i));
+      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+      EpsBearer bearer(q);
+      lena->ActivateEpsBearer(ueDev, bearer, LteTft::Default ());
+    }
+
+  Simulator::Stop(Seconds(simTime));
+  lena->SetTraceDirectory(traceDirectory);
+  lena->EnableRlcTraces();
+  lena->EnableMacTraces();
+
+  Simulator::Run();
+
+  /*GtkConfigStore config;
+  config.ConfigureAttributes ();*/
+
+  Simulator::Destroy();
+  return 0;
+}
--- a/src/lte/examples/lena-rlc-calculator.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-//#include "ns3/gtk-config-store.h"
-
-
-using namespace ns3;
-
-int main (int argc, char *argv[])
-{
-  // Command line arguments
-  CommandLine cmd;
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-
-  lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
-  // Enable LTE log components
-  //lena->EnableLogComponents ();
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  NodeContainer ueNodes;
-  enbNodes.Create (1);
-  ueNodes.Create (3);
-
-  // Install Mobility Model
-  MobilityHelper mobility;
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  mobility.Install (enbNodes);
-  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  mobility.Install (ueNodes);
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  NetDeviceContainer ueDevs;
-  enbDevs = lena->InstallEnbDevice (enbNodes);
-  ueDevs = lena->InstallUeDevice (ueNodes);
-
-  // Attach a UE to a eNB
-  lena->Attach (ueDevs, enbDevs.Get (0));
-
-  // Activate an EPS bearer
-  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-  EpsBearer bearer (q);
-  lena->ActivateEpsBearer (ueDevs, bearer, LteTft::Default ());
-
-  Simulator::Stop (Seconds (0.2));
-
-  lena->EnableMacTraces ();
-  lena->EnableRlcTraces ();
-
-
-  double distance_temp [] = { 10000,10000,10000}; //{10000, 10000, 10000};
-  std::vector<double> userDistance;
-  userDistance.assign (distance_temp, distance_temp + 3);
-  for (int i = 0; i < 3; i++)
-    {
-      Ptr<ConstantPositionMobilityModel> mm = ueNodes.Get (i)->GetObject<ConstantPositionMobilityModel> ();
-      mm->SetPosition (Vector (userDistance[i], 0.0, 0.0));
-    } 
-
-  Simulator::Run ();
-
-  // Uncomment to show available paths
-  /*GtkConfigStore config;
-  config.ConfigureAttributes ();*/
-
-  Simulator::Destroy ();
-
-  // Generate RLC output
-
-  return 0;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-rlc-traces.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,102 @@
+/* -*-  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>
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+//#include "ns3/gtk-config-store.h"
+
+
+using namespace ns3;
+
+int main (int argc, char *argv[])
+{
+  // Command line arguments
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
+
+  lena->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
+  // Enable LTE log components
+  //lena->EnableLogComponents ();
+  lena->EnableRlcTraces();
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer ueNodes;
+  enbNodes.Create (1);
+  ueNodes.Create (3);
+
+  // Install Mobility Model
+  MobilityHelper mobility;
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (enbNodes);
+  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
+  mobility.Install (ueNodes);
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  NetDeviceContainer ueDevs;
+  enbDevs = lena->InstallEnbDevice (enbNodes);
+  ueDevs = lena->InstallUeDevice (ueNodes);
+
+  // Attach a UE to a eNB
+  lena->Attach (ueDevs, enbDevs.Get (0));
+
+  // Activate an EPS bearer
+  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+  EpsBearer bearer (q);
+  lena->ActivateEpsBearer (ueDevs, bearer, LteTft::Default ());
+
+  Simulator::Stop (Seconds (2));
+
+  lena->EnableMacTraces ();
+  lena->EnableRlcTraces ();
+
+
+  double distance_temp [] = { 10000,10000,10000};
+  std::vector<double> userDistance;
+  userDistance.assign (distance_temp, distance_temp + 3);
+  for (int i = 0; i < 3; i++)
+    {
+      Ptr<ConstantPositionMobilityModel> mm = ueNodes.Get (i)->GetObject<ConstantPositionMobilityModel> ();
+      mm->SetPosition (Vector (userDistance[i], 0.0, 0.0));
+    } 
+
+  Simulator::Run ();
+
+  // Uncomment to show available paths
+  /*GtkConfigStore config;
+  config.ConfigureAttributes ();*/
+
+  Simulator::Destroy ();
+
+  return 0;
+}
--- a/src/lte/examples/lena-runtime-profiler.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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: Jaume Nin <jnin@cttc.es>
- */
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-//#include "ns3/gtk-config-store.h"
-#include <ns3/buildings-propagation-loss-model.h>
-
-#include <iomanip>
-#include <string>
-#include <vector>
-
-using namespace ns3;
-using std::vector;
-
-int
-main (int argc, char *argv[])
-{
-  uint32_t nEnbPerFloor = 1;
-  uint32_t nUe = 1;
-  uint32_t nFloors = 0;
-  double simTime = 1.0;
-  std::string traceDirectory = "";
-  CommandLine cmd;
-
-  cmd.AddValue("nEnb", "Number of eNodeBs per floor", nEnbPerFloor);
-  cmd.AddValue("nUe", "Number of UEs", nUe);
-  cmd.AddValue("nFloors", "Number of floors, 0 for Friis propagation model",
-      nFloors);
-  cmd.AddValue("simTime", "Total duration of the simulation (in seconds)",
-      simTime);
-  cmd.AddValue("traceDirectory",
-      "Destination folder where the traces will be stored", traceDirectory);
-  cmd.Parse(argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults();
-  
-  // parse again so you can override default values from the command line
-  cmd.Parse(argc, argv);
-
-  // Geometry of the scenario (in meters)
-  // Assume squared building
-  double nodeHeight = 1.5;
-  double roomHeight = 3;
-  double roomLength = 8;
-  uint32_t nRooms = ceil (sqrt (nEnbPerFloor));
-  uint32_t nEnb;
-
-  Ptr < LenaHelper > lena = CreateObject<LenaHelper> ();
-  //lena->EnableLogComponents ();
-  //LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
-  if (nFloors == 0)
-    {
-      lena->SetAttribute("PathlossModel",
-          StringValue("ns3::FriisPropagationLossModel"));
-      nEnb = nEnbPerFloor;
-    }
-  else
-    {
-      lena->SetAttribute("PathlossModel",
-          StringValue("ns3::BuildingsPropagationLossModel"));
-      nEnb = nFloors * nEnbPerFloor;
-    }
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  vector < NodeContainer > ueNodes;
-
-  enbNodes.Create(nEnb);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NodeContainer ueNode;
-      ueNode.Create(nUe);
-      ueNodes.push_back(ueNode);
-    }
-
-  MobilityHelper mobility;
-  vector<Vector> enbPosition;
-  Ptr < ListPositionAllocator > positionAlloc = CreateObject<ListPositionAllocator> ();
-  Ptr < Building > building;
-
-  if (nFloors == 0)
-    {
-      mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
-      // Position of eNBs
-      uint32_t plantedEnb = 0;
-      for (uint32_t row = 0; row < nRooms; row++)
-        {
-          for (uint32_t column = 0; column < nRooms && plantedEnb < nEnbPerFloor; column++, plantedEnb++)
-            {
-              Vector v(roomLength * (column + 0.5), roomLength * (row + 0.5), nodeHeight);
-              positionAlloc->Add(v);
-              enbPosition.push_back(v);
-              mobility.Install(ueNodes[plantedEnb]);
-            }
-        }
-      mobility.SetPositionAllocator(positionAlloc);
-      mobility.Install (enbNodes);
-
-      // Position of UEs attached to eNB
-     for (uint32_t i = 0; i < nEnb; i++)
-       {
-         UniformVariable posX(enbPosition[i].x - roomLength * 0.5,
-            enbPosition[i].x + roomLength * 0.5);
-         UniformVariable posY(enbPosition[i].y - roomLength * 0.5,
-            enbPosition[i].y + roomLength * 0.5);
-        positionAlloc = CreateObject<ListPositionAllocator> ();
-        for (uint32_t j = 0; j < nUe; j++)
-          {
-            positionAlloc->Add(Vector(posX.GetValue(), posY.GetValue(), nodeHeight));
-            mobility.SetPositionAllocator(positionAlloc);
-          }
-         mobility.Install(ueNodes[i]);
-     }
-
-    }
-  else
-    {
-      building = Create<Building> (0.0, nRooms * roomLength,
-                                                    0.0, nRooms * roomLength,
-                                                    0.0, nFloors* roomHeight);
-      building->SetBuildingType(Building::Residential);
-      building->SetExtWallsType(Building::ConcreteWithWindows);
-      building->SetFloorsNumber(nFloors);
-      building->SetNumberRoomX(nRooms);
-      building->SetNumberRoomY(nRooms);
-      mobility.SetMobilityModel("ns3::BuildingsMobilityModel");
-      mobility.Install (enbNodes);
-      uint32_t plantedEnb = 0;
-      for (uint32_t floor = 0; floor < nFloors; floor++)
-        {
-          uint32_t plantedEnbPerFloor = 0;
-          for (uint32_t row = 0; row < nRooms; row++)
-            {
-              for (uint32_t column = 0; column < nRooms && plantedEnbPerFloor < nEnbPerFloor; column++, plantedEnb++, plantedEnbPerFloor++)
-                {
-                  Vector v (roomLength * (column + 0.5),
-                            roomLength * (row + 0.5),
-                            nodeHeight + roomHeight * floor);
-                  positionAlloc->Add(v);
-                  enbPosition.push_back(v);
-                  Ptr<BuildingsMobilityModel> mmEnb = enbNodes.Get (plantedEnb)->GetObject<BuildingsMobilityModel> ();
-                  mmEnb->SetPosition (v);
-                  mmEnb->SetIndoor (building);
-                  mmEnb->SetFloorNumber (floor);
-                  mmEnb->SetRoomNumberX (row);
-                  mmEnb->SetRoomNumberY (column);
-                  
-                  // Positioning UEs attached to eNB
-                  mobility.Install(ueNodes[plantedEnb]);
-                  for (uint32_t ue = 0; ue < nUe; ue++)
-                    {
-                      Ptr<BuildingsMobilityModel> mmUe = ueNodes[plantedEnb].Get (ue)->GetObject<BuildingsMobilityModel> ();
-                      Vector vUe (v.x, v.y, v.z);
-                      mmUe->SetPosition (vUe);
-                      mmUe->SetIndoor (building);
-                      mmUe->SetFloorNumber (floor);
-                      mmUe->SetRoomNumberX (row);
-                      mmUe->SetRoomNumberY (column);
-                    }
-                }
-            }
-        }
-      
-
-    }
-
-
-
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  vector < NetDeviceContainer > ueDevs;
-  enbDevs = lena->InstallEnbDevice(enbNodes);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NetDeviceContainer ueDev = lena->InstallUeDevice(ueNodes[i]);
-      ueDevs.push_back(ueDev);
-      lena->Attach(ueDev, enbDevs.Get(i));
-      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-      EpsBearer bearer(q);
-      lena->ActivateEpsBearer(ueDev, bearer, LteTft::Default ());
-    }
-
-  Simulator::Stop(Seconds(simTime));
-  lena->SetTraceDirectory(traceDirectory);
-  lena->EnableRlcTraces();
-  lena->EnableMacTraces();
-
-  Simulator::Run();
-
-  /*GtkConfigStore config;
-  config.ConfigureAttributes ();*/
-
-  Simulator::Destroy();
-  return 0;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-simple-epc.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,187 @@
+/* -*-  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: Jaume Nin <jaume.nin@cttc.cat>
+ */
+
+#include "ns3/lena-helper.h"
+#include "ns3/epc-helper.h"
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/ipv4-global-routing-helper.h"
+#include "ns3/internet-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/applications-module.h"
+#include "ns3/point-to-point-helper.h"
+#include "ns3/config-store.h"
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+
+/**
+ * Sample simulation script for LTE+EPC. It instantiates several eNodeB,
+ * attaches one UE per eNodeB starts a flow for each UE to  and from a remote host.
+ * It also  starts yet another flow between each UE pair.
+ */
+NS_LOG_COMPONENT_DEFINE ("EpcFirstExample");
+int
+main (int argc, char *argv[])
+{
+
+  uint16_t numberOfNodes = 2;
+  uint32_t simTime = 5;
+  double distance = 60.0;
+  // Inter packet interval in ms
+  double interPacketInterval = 1;
+
+  // Command line arguments
+  CommandLine cmd;
+  cmd.AddValue("numberOfNodes", "Number of eNodeBs + UE pairs", numberOfNodes);
+  cmd.AddValue("simTime", "Total duration of the simulation (in seconds)",simTime);
+  cmd.Parse(argc, argv);
+
+  Ptr<LenaHelper> lteHelper = CreateObject<LenaHelper> ();
+  Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
+  lteHelper->SetEpcHelper (epcHelper);
+  lteHelper->SetSchedulerType("ns3::RrFfMacScheduler");
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults();
+
+  // parse again so you can override default values from the command line
+  cmd.Parse(argc, argv);
+
+  Ptr<Node> pgw = epcHelper->GetPgwNode ();
+
+   // Create a single RemoteHost
+  NodeContainer remoteHostContainer;
+  remoteHostContainer.Create (1);
+  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
+  InternetStackHelper internet;
+  internet.Install (remoteHostContainer);
+
+  // Create the Internet
+  PointToPointHelper p2ph;
+  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
+  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
+  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
+  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
+  Ipv4AddressHelper ipv4h;
+  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
+  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
+  // interface 0 is localhost, 1 is the p2p device
+  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
+
+  Ipv4StaticRoutingHelper ipv4RoutingHelper;
+  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
+  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
+
+  NodeContainer ueNodes;
+  NodeContainer enbNodes;
+  enbNodes.Create(numberOfNodes);
+  ueNodes.Create(numberOfNodes);
+
+  // Install Mobility Model
+  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
+  for (uint16_t i = 0; i < numberOfNodes; i++)
+    {
+      positionAlloc->Add (Vector(distance * i, 0, 0));
+    }
+  MobilityHelper mobility;
+  mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
+  mobility.SetPositionAllocator(positionAlloc);
+  mobility.Install(enbNodes);
+  mobility.Install(ueNodes);
+
+  // Install LTE Devices to the nodes
+  NetDeviceContainer enbLteDevs = lteHelper->InstallEnbDevice (enbNodes);
+  NetDeviceContainer ueLteDevs = lteHelper->InstallUeDevice (ueNodes);
+
+  // Attach one UE per eNodeB
+  for (uint16_t i = 0; i < numberOfNodes; i++)
+      {
+        lteHelper->Attach (ueLteDevs.Get(i), enbLteDevs.Get(i));
+      }
+
+  // Install the IP stack on the UEs
+  internet.Install (ueNodes);
+  Ipv4InterfaceContainer ueIpIface;
+  ueIpIface = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
+  // Assign IP address to UEs, and install applications
+  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
+    {
+      Ptr<Node> ueNode = ueNodes.Get (u);
+      // Set the default gateway for the UE
+      Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
+      ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
+    }
+  lteHelper->ActivateEpsBearer (ueLteDevs, EpsBearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT), LteTft::Default ());
+
+
+  // Install and start applications on UEs and remote host
+  uint16_t dlPort = 1234;
+  uint16_t ulPort = 1235;
+  uint16_t otherPort = 1236;
+  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
+  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
+  PacketSinkHelper packetSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), otherPort));
+  ApplicationContainer clientApps;
+  ApplicationContainer serverApps;
+  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
+    {
+      serverApps = dlPacketSinkHelper.Install (ueNodes.Get(u));
+      serverApps = ulPacketSinkHelper.Install (remoteHost);
+      serverApps = packetSinkHelper.Install (ueNodes.Get(u));
+      UdpClientHelper dlClient (ueIpIface.GetAddress (u), dlPort);
+      dlClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
+      dlClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
+      UdpClientHelper ulClient (remoteHostAddr, ulPort);
+      ulClient.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
+      ulClient.SetAttribute ("MaxPackets", UintegerValue(1000000));
+      UdpClientHelper client (ueIpIface.GetAddress (u), otherPort);
+      client.SetAttribute ("Interval", TimeValue (MilliSeconds(interPacketInterval)));
+      client.SetAttribute ("MaxPackets", UintegerValue(1000000));
+      clientApps = dlClient.Install (remoteHost);
+      clientApps = ulClient.Install (ueNodes.Get(u));
+      if (u+1 < ueNodes.GetN ())
+        {
+          clientApps = client.Install (ueNodes.Get(u+1));
+        }
+      else
+        {
+          clientApps = client.Install (ueNodes.Get(0));
+        }
+
+    }
+  serverApps.Start (Seconds (0.01));
+  clientApps.Start (Seconds (0.01));
+  lteHelper->EnableTraces ();
+  // Uncomment to enable PCAP tracing
+  //p2ph.EnablePcapAll("lena-epc-first");
+
+  Simulator::Stop(Seconds(simTime));
+  Simulator::Run();
+
+  /*GtkConfigStore config;
+  config.ConfigureAttributes();*/
+
+  Simulator::Destroy();
+  return 0;
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/examples/lena-simple.cc	Wed Nov 30 11:20:49 2011 +0100
@@ -0,0 +1,93 @@
+/* -*-  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>
+ */
+
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+//#include "ns3/gtk-config-store.h"
+
+using namespace ns3;
+
+int main (int argc, char *argv[])
+{	
+  CommandLine cmd;
+  cmd.Parse (argc, argv);
+	
+  // to save a template default attribute file run it like this:
+  // ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Save --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim
+  //
+  // to load a previously created default attribute file
+  // ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Load --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim
+
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+
+  // Parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+
+  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
+
+  // Uncomment to enable logging
+  //lena->EnableLogComponents ();
+
+  // Create Nodes: eNodeB and UE
+  NodeContainer enbNodes;
+  NodeContainer ueNodes;
+  enbNodes.Create (1);
+  ueNodes.Create (1);
+
+  // Install Mobility Model
+  MobilityHelper mobility;
+  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
+  mobility.Install (enbNodes);
+  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
+  mobility.Install (ueNodes);
+
+  // Create Devices and install them in the Nodes (eNB and UE)
+  NetDeviceContainer enbDevs;
+  NetDeviceContainer ueDevs;
+  // Default scheduler is PF, uncomment to use RR
+  //lena->SetSchedulerType ("ns3::RrFfMacScheduler");
+
+  enbDevs = lena->InstallEnbDevice (enbNodes);
+  ueDevs = lena->InstallUeDevice (ueNodes);
+
+  // Attach a UE to a eNB
+  lena->Attach (ueDevs, enbDevs.Get (0));
+
+  // Activate an EPS bearer
+  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
+  EpsBearer bearer (q);
+  lena->ActivateEpsBearer (ueDevs, bearer, LteTft::Default ());
+
+
+  Simulator::Stop (Seconds (0.005));
+
+  Simulator::Run ();
+
+  //GtkConfigStore config;
+  //config.ConfigureAttributes ();
+
+  Simulator::Destroy ();
+  return 0;
+}
--- a/src/lte/examples/profiling-reference.cc	Tue Nov 29 18:14:02 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +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: Jaume Nin <jnin@cttc.es>
- */
-
-
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/mobility-module.h"
-#include "ns3/lte-module.h"
-#include "ns3/config-store.h"
-//#include "ns3/gtk-config-store.h"
-
-#include <iomanip>
-#include <string>
-#include <vector>
-
-using namespace ns3;
-using std::vector;
-
-int main (int argc, char *argv[])
-{
-  double radius = 0.0;
-  uint32_t nEnb = 1;
-  uint32_t nUe  = 1;
-  double enbDist = 100;
-  CommandLine cmd;
-
-  cmd.AddValue ("nEnb", "Number of eNodeBs", nEnb);
-  cmd.AddValue ("nUe", "Number of UEs", nUe);
-  cmd.AddValue ("radius", "the radius of the disc where UEs are placed around an eNB", radius);
-  cmd.Parse (argc, argv);
-
-  ConfigStore inputConfig;
-  inputConfig.ConfigureDefaults ();
-
-  // parse again so you can override default values from the command line
-  cmd.Parse (argc, argv);
-
-  // determine the string tag that identifies this simulation run
-  // this tag is then appended to all filenames
-
-  IntegerValue runValue;
-  GlobalValue::GetValueByName ("RngRun", runValue);
-
-//  std::ostringstream tag;
-/*  tag  << "_enbDist" << std::setw(3) << std::setfill ('0') << std::fixed << std::setprecision (0) << enbDist
-       << "_radius"  << std::setw(3) << std::setfill ('0') << std::fixed << std::setprecision (0) << radius
-       << "_nUe"  << std::setw(3) << std::setfill('0')  << nUe
-       << "_rngRun"  << std::setw(3) << std::setfill('0')  << runValue.Get () ;
-*/
-  Ptr<LenaHelper> lena = CreateObject<LenaHelper> ();
-  lena->EnableLogComponents ();
-
-  // Create Nodes: eNodeB and UE
-  NodeContainer enbNodes;
-  vector<NodeContainer> ueNodes;
-
-  enbNodes.Create (nEnb);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NodeContainer ueNode;
-      ueNode.Create (nUe);
-      ueNodes.push_back (ueNode);
-    }
-
-  // Position of eNBs
-  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      positionAlloc->Add (Vector (enbDist * i, enbDist * i, 0.0));
-    }
-
-  MobilityHelper enbMobility;
-  enbMobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-  enbMobility.SetPositionAllocator (positionAlloc);
-  enbMobility.Install (enbNodes);
-
-  // Position of UEs attached to eNB
-  vector<MobilityHelper> ueMobility;
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      MobilityHelper ueMob;
-      ueMob.SetPositionAllocator ("ns3::UniformDiscPositionAllocator",
-                                  "X", DoubleValue (enbDist * i),
-                                  "Y", DoubleValue (enbDist * i),
-                                  "rho", DoubleValue (radius));
-      ueMob.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
-      ueMobility.push_back (ueMob);
-      ueMobility[i].Install (ueNodes[i]);
-    }
-
-  // Create Devices and install them in the Nodes (eNB and UE)
-  NetDeviceContainer enbDevs;
-  vector<NetDeviceContainer> ueDevs;
-  //NetDeviceContainer ueDevs2;
-  enbDevs = lena->InstallEnbDevice (enbNodes);
-  for (uint32_t i = 0; i < nEnb; i++)
-    {
-      NetDeviceContainer ueDev = lena->InstallUeDevice (ueNodes[i]);
-      ueDevs.push_back (ueDev);
-      lena->Attach (ueDev, enbDevs.Get (i));
-      enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
-      EpsBearer bearer (q);
-      lena->ActivateEpsBearer (ueDev, bearer, LteTft::Default ());
-
-
-    }
-
-  Simulator::Stop (Seconds (60));
-  //lena->EnableRlcTraces ();
-
-  Simulator::Run ();
-
-  /*GtkConfigStore config;
-  config.ConfigureAttributes ();*/
-
-  Simulator::Destroy ();
-  return 0;
-}
--- a/src/lte/examples/wscript	Tue Nov 29 18:14:02 2011 +0100
+++ b/src/lte/examples/wscript	Wed Nov 30 11:20:49 2011 +0100
@@ -1,27 +1,31 @@
 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 
 def build(bld):
-    obj = bld.create_ns3_program('lena-first-sim',
-                                 ['lte'])
-    obj.source = 'lena-first-sim.cc'
-    obj = bld.create_ns3_program('inter-cell-interference',
+    obj = bld.create_ns3_program('lena-cqi-threshold',
                                  ['lte'])
-    obj.source = 'inter-cell-interference.cc'
-    obj = bld.create_ns3_program('lena-rlc-calculator',
-                                 ['lte'])
-    obj.source = 'lena-rlc-calculator.cc'    
+    obj.source = 'lena-cqi-threshold.cc'
     obj = bld.create_ns3_program('lena-fading',
                                  ['lte'])
     obj.source = 'lena-fading.cc'
-    obj = bld.create_ns3_program('lena-cqi-threshold',
+    obj = bld.create_ns3_program('lena-gtpu-tunnel',
+                                 ['lte'])
+    obj.source = 'lena-gtpu-tunnel.cc'
+    obj = bld.create_ns3_program('lena-intercell-interference',
                                  ['lte'])
-    obj.source = 'lena-cqi-threshold.cc'        
-    obj = bld.create_ns3_program('lena-runtime-profiler',
+    obj.source = 'lena-intercell-interference.cc'
+    obj = bld.create_ns3_program('lena-pathloss-traces',
+                                 ['lte'])
+    obj.source = 'lena-pathloss-traces.cc'
+    obj = bld.create_ns3_program('lena-profiling',
                                  ['lte'])
-    obj.source = 'lena-runtime-profiler.cc'
-    obj = bld.create_ns3_program('lena-extract-pathloss',
+    obj.source = 'lena-profiling.cc'
+    obj = bld.create_ns3_program('lena-rlc-traces',
+                                 ['lte'])
+    obj.source = 'lena-rlc-traces.cc'
+    obj = bld.create_ns3_program('lena-simple',
                                  ['lte'])
-    obj.source = 'lena-extract-pathloss.cc'
-    obj = bld.create_ns3_program('lena-epc-first',
+    obj.source = 'lena-simple.cc'
+    obj = bld.create_ns3_program('lena-simple-epc',
                                  ['lte'])
-    obj.source = 'lena-epc-first.cc'
+    obj.source = 'lena-simple-epc.cc'
+
--- a/src/lte/test/examples-to-run.py	Tue Nov 29 18:14:02 2011 +0100
+++ b/src/lte/test/examples-to-run.py	Wed Nov 30 11:20:49 2011 +0100
@@ -9,11 +9,11 @@
 #
 # See test.py for more information.
 cpp_examples = [
-    ("lena-first-sim", "True", "True"),
-    ("inter-cell-interference", "True", "True"),
-    ("lena-rlc-calculator", "True", "True"),
-    ("lena-runtime-profiler", "True", "True"),
-    ("lena-extract-pathloss", "True", "True"),
+    ("lena-simple", "True", "True"),
+    ("lena-intercell-interference", "True", "True"),
+    ("lena-rlc-traces", "True", "True"),
+    ("lena-profiling", "True", "True"),
+    ("lena-pathloss-traces", "True", "True"),
     ("lena-fading", "True", "True"),
 ]
 
--- a/src/lte/test/lte-test-run-time.pl	Tue Nov 29 18:14:02 2011 +0100
+++ b/src/lte/test/lte-test-run-time.pl	Wed Nov 30 11:20:49 2011 +0100
@@ -12,7 +12,7 @@
 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, 30, 40 );
+my @simTime = ( 1, 5);
 
 my $traceDirectory = ".";
 my $traceDirectory = getcwd() . "/"; 
@@ -28,7 +28,7 @@
             my $timeStats = Statistics::Descriptive::Full->new();
             for ( my $iteration = 0 ; $iteration < $nIterations ; $iteration++ )
             {
-               my $launch = "time ./waf --run \'lena-runtime-profiler --simTime=$time --nUe=$ue --nEnb=$enb --nFloors=$floor --traceDirectory=$traceDirectory\'";
+               my $launch = "time ./waf --run \'lena-profiling --simTime=$time --nUe=$ue --nEnb=$enb --nFloors=$floor --traceDirectory=$traceDirectory\'";
                my $out, my $err;
                print "$launch\n";
                capture { system($launch ) } \$out, \$err;