src/lte/model/lte-enb-phy.cc
author Vedran Miletić <rivanvx@gmail.com>
Fri, 19 Apr 2013 22:39:55 +0200
changeset 9703 681f35b212ff
parent 9653 382d27da8905
child 9802 5dea58a3b261
child 10063 6b30859ebd37
permissions -rw-r--r--
Rename Start and DoStart methods to Initialize and DoInitialize The goal of this patch is to allows us to differentiate the Start/Stop functionality present in some classes from Initialize/Dispose functionality.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 6852
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     2
/*
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     3
 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     4
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     8
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    12
 * GNU General Public License for more details.
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    13
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    17
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    18
 * Author: Giuseppe Piro  <g.piro@poliba.it>
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    19
 *         Marco Miozzo <mmiozzo@cttc.es>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    20
 */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    21
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    22
#include <ns3/object-factory.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    23
#include <ns3/log.h>
9063
32755d0516f4 Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents: 9053
diff changeset
    24
#include <cmath>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    25
#include <ns3/simulator.h>
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    26
#include <ns3/attribute-accessor-helper.h>
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    27
#include <ns3/double.h>
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    28
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
    29
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    30
#include "lte-enb-phy.h"
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
    31
#include "lte-ue-phy.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    32
#include "lte-net-device.h"
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    33
#include "lte-spectrum-value-helper.h"
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
    34
#include "lte-control-messages.h"
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    35
#include "lte-enb-net-device.h"
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
    36
#include "lte-ue-rrc.h"
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    37
#include "lte-enb-mac.h"
7947
4ed7cfac199d PUSCH UL-CQ Integrated in PFS
mmiozzo
parents: 7944
diff changeset
    38
#include <ns3/lte-common.h>
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
    39
#include <ns3/lte-vendor-specific-parameters.h>
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    40
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
    41
// WILD HACK for the inizialization of direct eNB-UE ctrl messaging
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
    42
#include <ns3/node-list.h>
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
    43
#include <ns3/node.h>
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
    44
#include <ns3/lte-ue-net-device.h>
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
    45
#include <ns3/pointer.h>
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    46
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    47
NS_LOG_COMPONENT_DEFINE ("LteEnbPhy");
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    48
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    49
namespace ns3 {
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    50
9386
24df31b77b25 PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents: 9357
diff changeset
    51
NS_OBJECT_ENSURE_REGISTERED (LteEnbPhy);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    52
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    53
// duration of the data part of a subframe in DL
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    54
// = 0.001 / 14 * 11 (fixed to 11 symbols) -1ns as margin to avoid overlapping simulator events
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    55
static const Time DL_DATA_DURATION = NanoSeconds (785714 -1);
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    56
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    57
//  delay from subframe start to transmission of the data in DL 
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    58
// = 0.001 / 14 * 3 (ctrl fixed to 3 symbols)
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    59
static const Time DL_CTRL_DELAY_FROM_SUBFRAME_START = NanoSeconds (214286);
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
    60
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    61
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    62
// member SAP forwarders
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    63
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    64
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    65
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    66
class EnbMemberLteEnbPhySapProvider : public LteEnbPhySapProvider
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    67
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    68
public:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    69
  EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    70
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    71
  // inherited from LteEnbPhySapProvider
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    72
  virtual void SendMacPdu (Ptr<Packet> p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    73
  virtual void SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    74
  virtual void SetCellId (uint16_t cellId);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
    75
  virtual void SendLteControlMessage (Ptr<LteControlMessage> msg);
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
    76
  virtual uint8_t GetMacChTtiDelay ();
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
    77
  
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    78
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    79
private:
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    80
  LteEnbPhy* m_phy;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    81
};
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    82
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    83
EnbMemberLteEnbPhySapProvider::EnbMemberLteEnbPhySapProvider (LteEnbPhy* phy) : m_phy (phy)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    84
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    85
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    86
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    87
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    88
void
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    89
EnbMemberLteEnbPhySapProvider::SendMacPdu (Ptr<Packet> p)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    90
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    91
  m_phy->DoSendMacPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    92
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    93
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    94
void
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    95
EnbMemberLteEnbPhySapProvider::SetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    96
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    97
  m_phy->DoSetBandwidth (ulBandwidth, dlBandwidth);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    98
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    99
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   100
void
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   101
EnbMemberLteEnbPhySapProvider::SetCellId (uint16_t cellId)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   102
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   103
  m_phy->DoSetCellId (cellId);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   104
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   105
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   106
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   107
EnbMemberLteEnbPhySapProvider::SendLteControlMessage (Ptr<LteControlMessage> msg)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   108
{
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   109
  m_phy->DoSendLteControlMessage (msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   110
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   111
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   112
uint8_t
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   113
EnbMemberLteEnbPhySapProvider::GetMacChTtiDelay ()
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   114
{
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   115
  return (m_phy->DoGetMacChTtiDelay ());
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   116
}
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   117
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   118
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   119
////////////////////////////////////////
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   120
// generic LteEnbPhy methods
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   121
////////////////////////////////////////
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   122
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   123
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   124
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   125
LteEnbPhy::LteEnbPhy ()
7980
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   126
{
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   127
  NS_LOG_FUNCTION (this);
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   128
  NS_FATAL_ERROR ("This constructor should not be called");
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   129
}
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   130
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   131
LteEnbPhy::LteEnbPhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy)
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   132
  : LtePhy (dlPhy, ulPhy),
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   133
    m_enbPhySapUser (0),
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   134
    m_enbCphySapUser (0),
7980
f07d99163a56 LteSpectrumPhy instances now plugged onto LtePhy via its constructor
Nicola Baldo <nbaldo@cttc.es>
parents: 7977
diff changeset
   135
    m_nrFrames (0),
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   136
    m_nrSubFrames (0),
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   137
    m_srsPeriodicity (0),
9409
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   138
    m_srsStartTime (Seconds (0)),
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   139
    m_currentSrsOffset (0),
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   140
    m_interferenceSampleCounter (0)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   141
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   142
  m_enbPhySapProvider = new EnbMemberLteEnbPhySapProvider (this);
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   143
  m_enbCphySapProvider = new MemberLteEnbCphySapProvider<LteEnbPhy> (this);
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   144
  m_harqPhyModule = Create <LteHarqPhy> ();
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   145
  m_downlinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule);
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   146
  m_uplinkSpectrumPhy->SetHarqPhyModule (m_harqPhyModule);
7944
f7e5e0540487 connection of SAPs moved from EnbNetDevice to LenaHelper
Nicola Baldo <nicola@baldo.biz>
parents: 7943
diff changeset
   147
  Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   148
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   149
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   150
TypeId
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   151
LteEnbPhy::GetTypeId (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   152
{
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   153
  static TypeId tid = TypeId ("ns3::LteEnbPhy")
6707
2ac68a0381ca improved module after Tom's review
Giuseppe Piro <g.piro@poliba.it>
parents: 6705
diff changeset
   154
    .SetParent<LtePhy> ()
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   155
    .AddConstructor<LteEnbPhy> ()
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   156
    .AddAttribute ("TxPower",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   157
                   "Transmission power in dBm",
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   158
                   DoubleValue (30.0),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   159
                   MakeDoubleAccessor (&LteEnbPhy::SetTxPower, 
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   160
                                       &LteEnbPhy::GetTxPower),
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   161
                   MakeDoubleChecker<double> ())
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   162
    .AddAttribute ("NoiseFigure",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   163
                   "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   164
                   " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   165
                   "\"the difference in decibels (dB) between"
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   166
                   " the noise output of the actual receiver to the noise output of an "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   167
                   " ideal receiver with the same overall gain and bandwidth when the receivers "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   168
                   " are connected to sources at the standard noise temperature T0.\" "
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   169
                   "In this model, we consider T0 = 290K.",
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   170
                   DoubleValue (5.0),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   171
                   MakeDoubleAccessor (&LteEnbPhy::SetNoiseFigure, 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   172
                                       &LteEnbPhy::GetNoiseFigure),
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   173
                   MakeDoubleChecker<double> ())
8664
ab4c821fc251 revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents: 8538
diff changeset
   174
    .AddAttribute ("MacToChannelDelay",
ab4c821fc251 revision after Giuseppe's comments http://codereview.appspot.com/4626069/#msg1
Nicola Baldo <nbaldo@cttc.es>
parents: 8538
diff changeset
   175
                   "The delay in TTI units that occurs between a scheduling decision in the MAC and the actual start of the transmission by the PHY. This is intended to be used to model the latency of real PHY and MAC implementations.",
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   176
                   UintegerValue (2),
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   177
                   MakeUintegerAccessor (&LteEnbPhy::SetMacChDelay, 
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   178
                                         &LteEnbPhy::GetMacChDelay),
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   179
                   MakeUintegerChecker<uint8_t> ())
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   180
    .AddTraceSource ("ReportUeSinr",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   181
                     "Report UEs' averaged linear SINR",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   182
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportUeSinr))
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   183
    .AddAttribute ("UeSinrSamplePeriod",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   184
                   "The sampling period for reporting UEs' SINR stats (default value 1)",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   185
                   UintegerValue (1),
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   186
                   MakeUintegerAccessor (&LteEnbPhy::m_srsSamplePeriod),
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   187
                   MakeUintegerChecker<uint16_t> ())
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   188
    .AddTraceSource ("ReportInterference",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   189
                     "Report linear interference power per PHY RB",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   190
                     MakeTraceSourceAccessor (&LteEnbPhy::m_reportInterferenceTrace))
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   191
    .AddAttribute ("InterferenceSamplePeriod",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   192
                   "The sampling period for reporting interference stats (default value 1)",
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   193
                   UintegerValue (1),
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   194
                   MakeUintegerAccessor (&LteEnbPhy::m_interferenceSamplePeriod),
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   195
                   MakeUintegerChecker<uint16_t> ())
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   196
    .AddTraceSource ("DlPhyTransmission",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   197
                     "DL transmission PHY layer statistics.",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   198
                     MakeTraceSourceAccessor (&LteEnbPhy::m_dlPhyTransmission))
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   199
    .AddAttribute ("DlSpectrumPhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   200
                   "The downlink LteSpectrumPhy associated to this LtePhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   201
                   TypeId::ATTR_GET,
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   202
                   PointerValue (),
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   203
                   MakePointerAccessor (&LteEnbPhy::GetDlSpectrumPhy),
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   204
                   MakePointerChecker <LteSpectrumPhy> ())
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   205
    .AddAttribute ("UlSpectrumPhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   206
                   "The uplink LteSpectrumPhy associated to this LtePhy",
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   207
                   TypeId::ATTR_GET,
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   208
                   PointerValue (),
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   209
                   MakePointerAccessor (&LteEnbPhy::GetUlSpectrumPhy),
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   210
                   MakePointerChecker <LteSpectrumPhy> ())
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   211
  ;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   212
  return tid;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   213
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   214
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   215
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   216
LteEnbPhy::~LteEnbPhy ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   217
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   218
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   219
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   220
void
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   221
LteEnbPhy::DoDispose ()
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   222
{
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   223
  NS_LOG_FUNCTION (this);
7921
0a504caf445d added more disposal stuff
Nicola Baldo <nbaldo@cttc.es>
parents: 7914
diff changeset
   224
  m_ueAttached.clear ();
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   225
  m_srsUeOffset.clear ();
7930
ccb40542ae88 fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents: 7928
diff changeset
   226
  delete m_enbPhySapProvider;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   227
  delete m_enbCphySapProvider;
7913
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   228
  LtePhy::DoDispose ();
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   229
}
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   230
ed3a9f8a76d7 added DoDispose to lte-phy and lte-spectrum-phy
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   231
void
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 9653
diff changeset
   232
LteEnbPhy::DoInitialize ()
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   233
{
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   234
  NS_LOG_FUNCTION (this);
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   235
  Ptr<SpectrumValue> noisePsd = LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (m_ulEarfcn, m_ulBandwidth, m_noiseFigure);
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   236
  m_uplinkSpectrumPhy->SetNoisePowerSpectralDensity (noisePsd);
9703
681f35b212ff Rename Start and DoStart methods to Initialize and DoInitialize
Vedran Miletić <rivanvx@gmail.com>
parents: 9653
diff changeset
   237
  LtePhy::DoInitialize ();
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   238
}
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   239
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   240
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   241
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   242
LteEnbPhy::SetLteEnbPhySapUser (LteEnbPhySapUser* s)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   243
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   244
  m_enbPhySapUser = s;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   245
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   246
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   247
LteEnbPhySapProvider*
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   248
LteEnbPhy::GetLteEnbPhySapProvider ()
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   249
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   250
  return (m_enbPhySapProvider);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   251
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   252
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   253
void
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   254
LteEnbPhy::SetLteEnbCphySapUser (LteEnbCphySapUser* s)
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   255
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   256
  NS_LOG_FUNCTION (this);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   257
  m_enbCphySapUser = s;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   258
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   259
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   260
LteEnbCphySapProvider*
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   261
LteEnbPhy::GetLteEnbCphySapProvider ()
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   262
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   263
  NS_LOG_FUNCTION (this);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   264
  return (m_enbCphySapProvider);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   265
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   266
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   267
void
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   268
LteEnbPhy::SetTxPower (double pow)
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   269
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   270
  NS_LOG_FUNCTION (this << pow);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   271
  m_txPower = pow;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   272
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   273
7949
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   274
double
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   275
LteEnbPhy::GetTxPower () const
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   276
{
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   277
  NS_LOG_FUNCTION (this);
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   278
  return m_txPower;
3bf9450ac03f added TX power attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7944
diff changeset
   279
}
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   280
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   281
void
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   282
LteEnbPhy::SetNoiseFigure (double nf)
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   283
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   284
  NS_LOG_FUNCTION (this << nf);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   285
  m_noiseFigure = nf;
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   286
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   287
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   288
double
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   289
LteEnbPhy::GetNoiseFigure () const
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   290
{
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   291
  NS_LOG_FUNCTION (this);
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   292
  return m_noiseFigure;
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   293
}
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7980
diff changeset
   294
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   295
void
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   296
LteEnbPhy::SetMacChDelay (uint8_t delay)
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   297
{
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   298
  NS_LOG_FUNCTION (this);
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   299
  m_macChTtiDelay = delay;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   300
  for (int i = 0; i < m_macChTtiDelay; i++)
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   301
    {
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   302
      Ptr<PacketBurst> pb = CreateObject <PacketBurst> ();
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   303
      m_packetBurstQueue.push_back (pb);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   304
      std::list<Ptr<LteControlMessage> > l;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   305
      m_controlMessagesQueue.push_back (l);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   306
      std::list<UlDciLteControlMessage> l1;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   307
      m_ulDciQueue.push_back (l1);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   308
    }
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   309
  for (int i = 0; i < UL_PUSCH_TTIS_DELAY; i++)
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   310
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   311
      std::list<UlDciLteControlMessage> l1;
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   312
      m_ulDciQueue.push_back (l1);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   313
    }
8670
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   314
}
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   315
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   316
uint8_t
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   317
LteEnbPhy::GetMacChDelay (void) const
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   318
{
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   319
  return (m_macChTtiDelay);
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   320
}
8f63d16fb2e8 fixed compilation error with g++-4.4
Nicola Baldo <nbaldo@cttc.es>
parents: 8664
diff changeset
   321
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   322
Ptr<LteSpectrumPhy>
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   323
LteEnbPhy::GetDlSpectrumPhy () const
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   324
{
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   325
  return m_downlinkSpectrumPhy;
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   326
}
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   327
9636
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   328
Ptr<LteSpectrumPhy>
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   329
LteEnbPhy::GetUlSpectrumPhy () const
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   330
{
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   331
  return m_uplinkSpectrumPhy;
91e31f0e569c make Dl/UlSpectrumPhy attributes in LteUe/EnbPhy use getter instead of member variable to fix compilation issue with gcc 4.4.3
Nicola Baldo <nbaldo@cttc.es>
parents: 9569
diff changeset
   332
}
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   333
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   334
bool
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   335
LteEnbPhy::AddUePhy (uint16_t rnti)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   336
{
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   337
  NS_LOG_FUNCTION (this << rnti);
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   338
  std::set <uint16_t>::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   339
  it = m_ueAttached.find (rnti);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   340
  if (it == m_ueAttached.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   341
    {
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   342
      m_ueAttached.insert (rnti);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   343
      return (true);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   344
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   345
  else
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   346
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   347
      NS_LOG_ERROR ("UE already attached");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   348
      return (false);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   349
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   350
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   351
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   352
bool
8180
5429db8b8c37 Fix Bug JIRA:LENA-145, RNTI as uint16_t in LteEnbPhy
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8148
diff changeset
   353
LteEnbPhy::DeleteUePhy (uint16_t rnti)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   354
{
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   355
  NS_LOG_FUNCTION (this << rnti);
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   356
  std::set <uint16_t>::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   357
  it = m_ueAttached.find (rnti);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   358
  if (it == m_ueAttached.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   359
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   360
      NS_LOG_ERROR ("UE not attached");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   361
      return (false);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   362
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   363
  else
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   364
    {
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   365
      m_ueAttached.erase (it);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   366
      return (true);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   367
    }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   368
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   369
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   370
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   371
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   372
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   373
LteEnbPhy::DoSendMacPdu (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   374
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   375
  NS_LOG_FUNCTION (this);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   376
  SetMacPdu (p);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   377
}
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   378
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   379
uint8_t
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   380
LteEnbPhy::DoGetMacChTtiDelay ()
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   381
{
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   382
  return (m_macChTtiDelay);
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   383
}
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   384
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   385
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   386
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   387
LteEnbPhy::PhyPduReceived (Ptr<Packet> p)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   388
{
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   389
  NS_LOG_FUNCTION (this);
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   390
  m_enbPhySapUser->ReceivePhyPdu (p);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   391
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   392
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   393
void
9048
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   394
LteEnbPhy::SetDownlinkSubChannels (std::vector<int> mask)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   395
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   396
  NS_LOG_FUNCTION (this);
9048
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   397
  m_listOfDownlinkSubchannel = mask;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   398
  Ptr<SpectrumValue> txPsd = CreateTxPowerSpectralDensity ();
7928
b736f63e9bdf removed LtePhy::Get{Up,Down}linkSpectrumPhy methods which are evil
Nicola Baldo <nbaldo@cttc.es>
parents: 7921
diff changeset
   399
  m_downlinkSpectrumPhy->SetTxPowerSpectralDensity (txPsd);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   400
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   401
9048
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   402
std::vector<int>
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   403
LteEnbPhy::GetDownlinkSubChannels (void)
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   404
{
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   405
  NS_LOG_FUNCTION (this);
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   406
  return m_listOfDownlinkSubchannel;
4aeb9111981b removed useless LtePhy::{Get,Set}{Up,down}linkSubChannels
Nicola Baldo <nbaldo@cttc.es>
parents: 9047
diff changeset
   407
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   408
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   409
Ptr<SpectrumValue>
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   410
LteEnbPhy::CreateTxPowerSpectralDensity ()
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   411
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   412
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   413
8015
e8fd3bf1692f flexible spectrum model
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
   414
  Ptr<SpectrumValue> psd = LteSpectrumValueHelper::CreateTxPowerSpectralDensity (m_dlEarfcn, m_dlBandwidth, m_txPower, GetDownlinkSubChannels ());
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   415
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   416
  return psd;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   417
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   418
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   419
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   420
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   421
LteEnbPhy::CalcChannelQualityForUe (std::vector <double> sinr, Ptr<LteSpectrumPhy> ue)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   422
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   423
  NS_LOG_FUNCTION (this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   424
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   425
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   426
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   427
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   428
LteEnbPhy::DoSendLteControlMessage (Ptr<LteControlMessage> msg)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   429
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   430
  NS_LOG_FUNCTION (this << msg);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   431
  // queues the message (wait for MAC-PHY delay)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   432
  SetControlMessages (msg);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   433
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   434
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   435
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   436
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   437
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   438
LteEnbPhy::ReceiveLteControlMessage (Ptr<LteControlMessage> msg)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   439
{
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   440
  NS_FATAL_ERROR ("Obsolete function");
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   441
  NS_LOG_FUNCTION (this << msg);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   442
  m_enbPhySapUser->ReceiveLteControlMessage (msg);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   443
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   444
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   445
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   446
LteEnbPhy::ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> > msgList)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   447
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   448
  NS_LOG_FUNCTION (this);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   449
  std::list<Ptr<LteControlMessage> >::iterator it;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   450
  for (it = msgList.begin (); it != msgList.end(); it++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   451
    {
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   452
      switch ((*it)->GetMessageType ())
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   453
        {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   454
        case LteControlMessage::RACH_PREAMBLE:
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   455
          {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   456
            Ptr<RachPreambleLteControlMessage> rachPreamble = DynamicCast<RachPreambleLteControlMessage> (*it);
9413
20f1c6678ee2 improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents: 9409
diff changeset
   457
            m_enbPhySapUser->ReceiveRachPreamble (rachPreamble->GetRapId ());
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   458
          }
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   459
          break;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   460
          
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   461
        default:
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   462
          m_enbPhySapUser->ReceiveLteControlMessage (*it);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   463
          break;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   464
        }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   465
    }
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   466
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   467
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   468
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   469
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   470
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   471
LteEnbPhy::StartFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   472
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   473
  NS_LOG_FUNCTION (this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   474
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   475
  ++m_nrFrames;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   476
  NS_LOG_INFO ("-----frame " << m_nrFrames << "-----");
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   477
  m_nrSubFrames = 0;
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   478
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   479
  // send MIB at beginning of every frame
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   480
  m_mib.systemFrameNumber = m_nrSubFrames;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   481
  Ptr<MibLteControlMessage> mibMsg = Create<MibLteControlMessage> ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   482
  mibMsg->SetMib (m_mib);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   483
  m_controlMessagesQueue.at (0).push_back (mibMsg);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   484
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   485
  StartSubFrame ();
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   486
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   487
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   488
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   489
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   490
LteEnbPhy::StartSubFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   491
{
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   492
  NS_LOG_FUNCTION (this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   493
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   494
  ++m_nrSubFrames;
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9039
diff changeset
   495
  if (m_srsPeriodicity>0)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9039
diff changeset
   496
    { 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9039
diff changeset
   497
      // might be 0 in case the eNB has no UEs attached
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   498
        NS_ASSERT_MSG (m_nrFrames > 1, "the SRS index check code assumes that frameNo starts at 1");
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   499
      NS_ASSERT_MSG (m_nrSubFrames > 0 && m_nrSubFrames <= 10, "the SRS index check code assumes that subframeNo starts at 1");
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   500
      m_currentSrsOffset = (((m_nrFrames-1)*10 + (m_nrSubFrames-1)) % m_srsPeriodicity);
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9039
diff changeset
   501
    }
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   502
  NS_LOG_INFO ("-----sub frame " << m_nrSubFrames << "-----");
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   503
  m_harqPhyModule->SubframeIndication (m_nrFrames, m_nrSubFrames);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   504
  
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   505
  // update info on TB to be received
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   506
  std::list<UlDciLteControlMessage> uldcilist = DequeueUlDci ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   507
  std::list<UlDciLteControlMessage>::iterator dciIt = uldcilist.begin ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   508
  NS_LOG_DEBUG (this << " eNB Expected TBs " << uldcilist.size ());
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   509
  for (dciIt = uldcilist.begin (); dciIt!=uldcilist.end (); dciIt++)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   510
    {
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   511
      std::set <uint16_t>::iterator it2;
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   512
      it2 = m_ueAttached.find ((*dciIt).GetDci ().m_rnti);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   513
      
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   514
      if (it2 == m_ueAttached.end ())
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   515
        {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   516
          NS_LOG_ERROR ("UE not attached");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   517
        }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   518
      else
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   519
        {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   520
          // send info of TB to LteSpectrumPhy 
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   521
          // translate to allocation map
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   522
          std::vector <int> rbMap;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   523
          for (int i = (*dciIt).GetDci ().m_rbStart; i < (*dciIt).GetDci ().m_rbStart + (*dciIt).GetDci ().m_rbLen; i++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   524
            {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   525
              rbMap.push_back (i);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   526
            }
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   527
          m_uplinkSpectrumPhy->AddExpectedTb ((*dciIt).GetDci ().m_rnti, (*dciIt).GetDci ().m_ndi, (*dciIt).GetDci ().m_tbSize, (*dciIt).GetDci ().m_mcs, rbMap, 0 /* always SISO*/, 0 /* no HARQ proc id in UL*/, 0 /*evaluated by LteSpectrumPhy*/, false /* UL*/);
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   528
          if ((*dciIt).GetDci ().m_ndi==1)
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   529
            {
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   530
              NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " NEW TB");
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   531
            }
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   532
          else
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   533
            {
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   534
              NS_LOG_DEBUG (this << " RNTI " << (*dciIt).GetDci ().m_rnti << " HARQ RETX");
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   535
            }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   536
        }
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   537
    }
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   538
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   539
  // process the current burst of control messages
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   540
  std::list<Ptr<LteControlMessage> > ctrlMsg = GetControlMessages ();
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   541
  m_dlDataRbMap.clear ();
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   542
  if (ctrlMsg.size () > 0)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   543
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   544
      std::list<Ptr<LteControlMessage> >::iterator it;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   545
      it = ctrlMsg.begin ();
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   546
      while (it != ctrlMsg.end ())
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   547
        {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   548
          Ptr<LteControlMessage> msg = (*it);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   549
          if (msg->GetMessageType () == LteControlMessage::DL_DCI)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   550
            {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   551
              Ptr<DlDciLteControlMessage> dci = DynamicCast<DlDciLteControlMessage> (msg);
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   552
              // get the tx power spectral density according to DL-DCI(s)
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   553
              // translate the DCI to Spectrum framework
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   554
              uint32_t mask = 0x1;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   555
              for (int i = 0; i < 32; i++)
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   556
                {
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   557
                  if (((dci->GetDci ().m_rbBitmap & mask) >> i) == 1)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   558
                    {
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   559
                      for (int k = 0; k < GetRbgSize (); k++)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   560
                        {
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   561
                          m_dlDataRbMap.push_back ((i * GetRbgSize ()) + k);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   562
                          //NS_LOG_DEBUG(this << " [enb]DL-DCI allocated PRB " << (i*GetRbgSize()) + k);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   563
                        }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   564
                    }
9519
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   565
                  mask = (mask << 1);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   566
                }
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   567
              // fire trace of DL Tx PHY stats
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   568
              for (uint8_t i = 0; i < dci->GetDci ().m_mcs.size (); i++)
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   569
                {
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   570
                  PhyTransmissionStatParameters params;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   571
                  params.m_cellId = m_cellId;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   572
                  params.m_imsi = 0; // it will be set by DlPhyTransmissionCallback in LteHelper
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   573
                  params.m_timestamp = Simulator::Now ().GetMilliSeconds ();
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   574
                  params.m_rnti = dci->GetDci ().m_rnti;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   575
                  params.m_txMode = 0; // TBD
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   576
                  params.m_layer = i;
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   577
                  params.m_mcs = dci->GetDci ().m_mcs.at (i);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   578
                  params.m_size = dci->GetDci ().m_tbsSize.at (i);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   579
                  params.m_rv = dci->GetDci ().m_rv.at (i);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   580
                  params.m_ndi = dci->GetDci ().m_ndi.at (i);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   581
                  m_dlPhyTransmission (params);
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   582
                }
fc6e45584ef4 Add DL and UL PHY traces on transmission and reception statistics
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9460
diff changeset
   583
              
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   584
            }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   585
          else if (msg->GetMessageType () == LteControlMessage::UL_DCI)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   586
            {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   587
              Ptr<UlDciLteControlMessage> dci = DynamicCast<UlDciLteControlMessage> (msg);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   588
              QueueUlDci (*dci);
9460
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   589
            }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   590
          else if (msg->GetMessageType () == LteControlMessage::RAR)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   591
            {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   592
              Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   593
              for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); it != rarMsg->RarListEnd (); ++it)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   594
                {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   595
                  if (it->rarPayload.m_grant.m_ulDelay == true)
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   596
                    {
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   597
                      NS_FATAL_ERROR (" RAR delay is not yet implemented");
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   598
                    }
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   599
                  UlGrant_s ulGrant = it->rarPayload.m_grant;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   600
                  // translate the UL grant in a standard UL-DCI and queue it
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   601
                  UlDciListElement_s dci;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   602
                  dci.m_rnti = ulGrant.m_rnti;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   603
                  dci.m_rbStart = ulGrant.m_rbStart;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   604
                  dci.m_rbLen = ulGrant.m_rbLen;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   605
                  dci.m_tbSize = ulGrant.m_tbSize;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   606
                  dci.m_mcs = ulGrant.m_mcs;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   607
                  dci.m_hopping = ulGrant.m_hopping;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   608
                  dci.m_tpc = ulGrant.m_tpc;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   609
                  dci.m_cqiRequest = ulGrant.m_cqiRequest;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   610
                  dci.m_ndi = 1;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   611
                  UlDciLteControlMessage msg;
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   612
                  msg.SetDci (dci);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   613
                  QueueUlDci (msg);
0674e66ee483 Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9414
diff changeset
   614
                }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   615
            }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   616
          it++;
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   617
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   618
        }
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   619
    }
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   620
    
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   621
  SendControlChannels (ctrlMsg);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   622
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   623
  // send data frame
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   624
  Ptr<PacketBurst> pb = GetPacketBurst ();
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   625
  if (pb)
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   626
    {
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   627
      Simulator::Schedule (DL_CTRL_DELAY_FROM_SUBFRAME_START, // ctrl frame fixed to 3 symbols
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   628
                       &LteEnbPhy::SendDataChannels,
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   629
                       this,pb);
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   630
    }
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   631
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   632
  // trigger the MAC
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   633
  m_enbPhySapUser->SubframeIndication (m_nrFrames, m_nrSubFrames);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   634
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   635
  Simulator::Schedule (Seconds (GetTti ()),
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   636
                       &LteEnbPhy::EndSubFrame,
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   637
                       this);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   638
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   639
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   640
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   641
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   642
LteEnbPhy::SendControlChannels (std::list<Ptr<LteControlMessage> > ctrlMsgList)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   643
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   644
  NS_LOG_FUNCTION (this << " eNB " << m_cellId << " start tx ctrl frame");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   645
  // set the current tx power spectral density (full bandwidth)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   646
  std::vector <int> dlRb;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   647
  for (uint8_t i = 0; i < m_dlBandwidth; i++)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   648
    {
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   649
      dlRb.push_back (i);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   650
    }
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   651
  SetDownlinkSubChannels (dlRb);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   652
  NS_LOG_LOGIC (this << " eNB start TX CTRL");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   653
  m_downlinkSpectrumPhy->StartTxDlCtrlFrame (ctrlMsgList);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   654
  
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   655
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   656
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   657
void
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   658
LteEnbPhy::SendDataChannels (Ptr<PacketBurst> pb)
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   659
{
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   660
  // set the current tx power spectral density
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   661
  SetDownlinkSubChannels (m_dlDataRbMap);
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   662
  // send the current burts of packets
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   663
  NS_LOG_LOGIC (this << " eNB start TX DATA");
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   664
  std::list<Ptr<LteControlMessage> > ctrlMsgList;
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   665
  ctrlMsgList.clear ();
9053
974762654b12 subframe indication now triggered independently by LteUePhy
Nicola Baldo <nicola@baldo.biz>
parents: 9048
diff changeset
   666
  m_downlinkSpectrumPhy->StartTxDataFrame (pb, ctrlMsgList, DL_DATA_DURATION);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   667
}
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   668
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   669
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   670
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   671
LteEnbPhy::EndSubFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   672
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   673
  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   674
  if (m_nrSubFrames == 10)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   675
    {
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   676
      Simulator::ScheduleNow (&LteEnbPhy::EndFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   677
    }
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   678
  else
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   679
    {
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   680
      Simulator::ScheduleNow (&LteEnbPhy::StartSubFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   681
    }
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   682
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   683
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   684
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   685
void
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   686
LteEnbPhy::EndFrame (void)
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   687
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   688
  NS_LOG_FUNCTION (this << Simulator::Now ().GetSeconds ());
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   689
  Simulator::ScheduleNow (&LteEnbPhy::StartFrame, this);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   690
}
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   691
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   692
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   693
void 
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   694
LteEnbPhy::GenerateCtrlCqiReport (const SpectrumValue& sinr)
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   695
{
9409
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   696
  NS_LOG_FUNCTION (this << sinr << Simulator::Now () << m_srsStartTime);
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   697
  // avoid processing SRSs sent with an old SRS configuration index
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   698
  if (Simulator::Now () > m_srsStartTime)
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   699
    {
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   700
      FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi = CreateSrsCqiReport (sinr);
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   701
      m_enbPhySapUser->UlCqiReport (ulcqi);
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   702
    }
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   703
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   704
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   705
void
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   706
LteEnbPhy::GenerateDataCqiReport (const SpectrumValue& sinr)
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   707
{
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   708
  NS_LOG_FUNCTION (this << sinr);
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   709
  FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi = CreatePuschCqiReport (sinr);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   710
  m_enbPhySapUser->UlCqiReport (ulcqi);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   711
}
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   712
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   713
void
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   714
LteEnbPhy::ReportInterference (const SpectrumValue& interf)
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   715
{
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   716
  NS_LOG_FUNCTION (this << interf);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   717
  Ptr<SpectrumValue> interfCopy = Create<SpectrumValue> (interf);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   718
  m_interferenceSampleCounter++;
9388
Nicola Baldo <nbaldo@cttc.es>
parents: 9386
diff changeset
   719
  if (m_interferenceSampleCounter == m_interferenceSamplePeriod)
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   720
    {
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   721
      m_reportInterferenceTrace (m_cellId, interfCopy);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   722
      m_interferenceSampleCounter = 0;
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   723
    }
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   724
}
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   725
9389
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   726
void
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   727
LteEnbPhy::ReportRsReceivedPower (const SpectrumValue& power)
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   728
{
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   729
  // not used by eNB
4bd2725add01 Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9388
diff changeset
   730
}
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   731
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   732
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   733
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   734
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   735
LteEnbPhy::CreatePuschCqiReport (const SpectrumValue& sinr)
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   736
{
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   737
  NS_LOG_FUNCTION (this << sinr);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   738
  Values::const_iterator it;
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   739
  FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi;
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   740
  ulcqi.m_ulCqi.m_type = UlCqi_s::PUSCH;
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   741
  int i = 0;
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   742
  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   743
    {
9063
32755d0516f4 Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents: 9053
diff changeset
   744
      double sinrdb = 10 * std::log10 ((*it));
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   745
//       NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   746
      // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   747
      int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   748
      ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
8148
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   749
      i++;
09e2d03022a2 run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents: 8015
diff changeset
   750
    }
7934
0f09fc707a8c Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents: 7930
diff changeset
   751
  return (ulcqi);
7910
d7083e401e59 PUSCH based UL-CQI generation at eNB PHY side
mmiozzo
parents: 7887
diff changeset
   752
	
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   753
}
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   754
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   755
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   756
void
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   757
LteEnbPhy::DoSetBandwidth (uint8_t ulBandwidth, uint8_t dlBandwidth)
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   758
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   759
  NS_LOG_FUNCTION (this << (uint32_t) ulBandwidth << (uint32_t) dlBandwidth);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   760
  m_ulBandwidth = ulBandwidth;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   761
  m_dlBandwidth = dlBandwidth;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   762
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   763
  int Type0AllocationRbg[4] = {
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   764
    10,     // RGB size 1
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   765
    26,     // RGB size 2
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   766
    63,     // RGB size 3
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   767
    110     // RGB size 4
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   768
  };  // see table 7.1.6.1-1 of 36.213
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   769
  for (int i = 0; i < 4; i++)
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   770
    {
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   771
      if (dlBandwidth < Type0AllocationRbg[i])
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   772
        {
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   773
          m_rbgSize = i + 1;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   774
          break;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   775
        }
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   776
    }
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   777
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   778
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   779
void 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   780
LteEnbPhy::DoSetEarfcn (uint16_t ulEarfcn, uint16_t dlEarfcn)
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   781
{
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   782
  NS_LOG_FUNCTION (this << ulEarfcn << dlEarfcn);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   783
  m_ulEarfcn = ulEarfcn;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   784
  m_dlEarfcn = dlEarfcn;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   785
}
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   786
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   787
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   788
void 
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   789
LteEnbPhy::DoAddUe (uint16_t rnti)
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   790
{
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   791
  NS_LOG_FUNCTION (this << rnti);
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   792
 
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   793
  bool success = AddUePhy (rnti);
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   794
  NS_ASSERT_MSG (success, "AddUePhy() failed");
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   795
}
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9345 9053
diff changeset
   796
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   797
void 
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   798
LteEnbPhy::DoRemoveUe (uint16_t rnti)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   799
{
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   800
  NS_LOG_FUNCTION (this << rnti);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   801
 
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   802
  bool success = DeleteUePhy (rnti);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   803
  NS_ASSERT_MSG (success, "DeleteUePhy() failed");
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   804
}
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   805
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8851
diff changeset
   806
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   807
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   808
LteEnbPhy::CreateSrsCqiReport (const SpectrumValue& sinr)
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   809
{
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   810
  NS_LOG_FUNCTION (this << sinr);
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   811
  Values::const_iterator it;
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   812
  FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqi;
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   813
  ulcqi.m_ulCqi.m_type = UlCqi_s::SRS;
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   814
  int i = 0;
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   815
  double srsSum = 0.0;
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   816
  for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   817
  {
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   818
    double sinrdb = 10 * log10 ((*it));
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   819
    //       NS_LOG_DEBUG ("ULCQI RB " << i << " value " << sinrdb);
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   820
    // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   821
    int16_t sinrFp = LteFfConverter::double2fpS11dot3 (sinrdb);
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   822
    srsSum += (*it);
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   823
    ulcqi.m_ulCqi.m_sinr.push_back (sinrFp);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   824
    i++;
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   825
  }
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   826
  // Insert the user generated the srs as a vendor specific parameter
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   827
  NS_LOG_DEBUG (this << " ENB RX UL-CQI of " << m_srsUeOffset.at (m_currentSrsOffset));
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   828
  VendorSpecificListElement_s vsp;
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   829
  vsp.m_type = SRS_CQI_RNTI_VSP;
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   830
  vsp.m_length = sizeof(SrsCqiRntiVsp);
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   831
  Ptr<SrsCqiRntiVsp> rnti  = Create <SrsCqiRntiVsp> (m_srsUeOffset.at (m_currentSrsOffset));
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   832
  vsp.m_value = rnti;
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   833
  ulcqi.m_vendorSpecificList.push_back (vsp);
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   834
  // call SRS tracing method
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   835
  CreateSrsReport (m_srsUeOffset.at (m_currentSrsOffset), srsSum / i);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   836
  return (ulcqi);
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   837
  
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   838
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   839
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   840
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   841
void
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   842
LteEnbPhy::CreateSrsReport(uint16_t rnti, double srs)
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   843
{
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   844
  NS_LOG_FUNCTION (this << rnti << srs);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   845
  std::map <uint16_t,uint16_t>::iterator it = m_srsSampleCounterMap.find (rnti);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   846
  if (it==m_srsSampleCounterMap.end ())
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   847
    {
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   848
      // create new entry
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   849
      m_srsSampleCounterMap.insert (std::pair <uint16_t,uint16_t> (rnti, 0));
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   850
      it = m_srsSampleCounterMap.find (rnti);
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   851
    }
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   852
  (*it).second++;
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   853
  if ((*it).second == m_srsSamplePeriod)
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   854
    {
9386
24df31b77b25 PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents: 9357
diff changeset
   855
      m_reportUeSinr (m_cellId, rnti, srs);
9357
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   856
      (*it).second = 0;
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   857
    }
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   858
}
d52b94f66fe7 Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9353
diff changeset
   859
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   860
void
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   861
LteEnbPhy::DoSetTransmissionMode (uint16_t  rnti, uint8_t txMode)
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   862
{
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   863
  NS_LOG_FUNCTION (this << rnti << (uint16_t)txMode);
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   864
  // UL supports only SISO MODE
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   865
}
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   866
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   867
void
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   868
LteEnbPhy::QueueUlDci (UlDciLteControlMessage m)
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   869
{
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   870
  NS_LOG_FUNCTION (this);
8729
74de12409ee5 Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents: 8728
diff changeset
   871
  m_ulDciQueue.at (UL_PUSCH_TTIS_DELAY - 1).push_back (m);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   872
}
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   873
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   874
std::list<UlDciLteControlMessage>
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   875
LteEnbPhy::DequeueUlDci (void)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   876
{
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   877
  NS_LOG_FUNCTION (this);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   878
  if (m_ulDciQueue.at (0).size ()>0)
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   879
    {
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   880
      std::list<UlDciLteControlMessage> ret = m_ulDciQueue.at (0);
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   881
      m_ulDciQueue.erase (m_ulDciQueue.begin ());
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   882
      std::list<UlDciLteControlMessage> l;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   883
      m_ulDciQueue.push_back (l);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   884
      return (ret);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   885
    }
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   886
  else
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   887
    {
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   888
      m_ulDciQueue.erase (m_ulDciQueue.begin ());
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   889
      std::list<UlDciLteControlMessage> l;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   890
      m_ulDciQueue.push_back (l);
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8729
diff changeset
   891
      std::list<UlDciLteControlMessage> emptylist;
8728
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   892
      return (emptylist);
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   893
    }
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   894
}
5a99218bfd1b Bug-fix on m_macChTtiDelay management on UE-eNB PHY and consequently update RR-PF schedulers and tests
mmiozzo
parents: 8726
diff changeset
   895
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   896
void
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   897
LteEnbPhy::DoSetSrsConfigurationIndex (uint16_t  rnti, uint16_t srcCi)
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   898
{
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   899
  NS_LOG_FUNCTION (this);
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   900
  uint16_t p = GetSrsPeriodicity (srcCi);
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   901
  if (p!=m_srsPeriodicity)
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   902
    {
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   903
      // resize the array of offset -> re-initialize variables
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   904
      m_srsUeOffset.clear ();
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   905
      m_srsUeOffset.resize (p, 0);
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   906
      m_srsPeriodicity = p;
9469
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9460
diff changeset
   907
      // inhibit SRS until RRC Connection Reconfiguration propagates
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9460
diff changeset
   908
      // to UEs, otherwise we might be wrong in determining the UE who
28a7b04a0b11 removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents: 9460
diff changeset
   909
      // actually sent the SRS (if the UE was using a stale SRS config)
9569
6593186d50dd zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents: 9562
diff changeset
   910
      // if we use a static SRS configuration index, we can have a 0ms guard time
6593186d50dd zero SRS guard time since we use static SRS periodicity now
Nicola Baldo <nbaldo@cttc.es>
parents: 9562
diff changeset
   911
      m_srsStartTime = Simulator::Now () + MilliSeconds (m_macChTtiDelay) + MilliSeconds (0);
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   912
    }
9409
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   913
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   914
  NS_LOG_DEBUG (this << " ENB SRS P " << m_srsPeriodicity << " RNTI " << rnti << " offset " << GetSrsSubframeOffset (srcCi) << " CI " << srcCi);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   915
  std::map <uint16_t,uint16_t>::iterator it = m_srsCounter.find (rnti);
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   916
  if (it != m_srsCounter.end ())
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   917
    {
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   918
      (*it).second = GetSrsSubframeOffset (srcCi) + 1;
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   919
    }
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   920
  else
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   921
    {
9038
e1d67c8aa95b Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   922
      m_srsCounter.insert (std::pair<uint16_t, uint16_t> (rnti, GetSrsSubframeOffset (srcCi) + 1));
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   923
    }
9039
5bdf0c1be85f Add SRS based UL-CQI and update RR and PF schedulers for managing them
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9038
diff changeset
   924
  m_srsUeOffset.at (GetSrsSubframeOffset (srcCi)) = rnti;
9409
4513a6e69157 more LTE RRC test cases
Nicola Baldo <nbaldo@cttc.es>
parents: 9406
diff changeset
   925
    
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   926
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   927
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   928
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   929
void 
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   930
LteEnbPhy::DoSetMasterInformationBlock (LteRrcSap::MasterInformationBlock mib)
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   931
{
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   932
  NS_LOG_FUNCTION (this);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9346
diff changeset
   933
  m_mib = mib;
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   934
}
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   935
8714
398bbcbb3f42 Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8538
diff changeset
   936
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   937
void
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   938
LteEnbPhy::SetHarqPhyModule (Ptr<LteHarqPhy> harq)
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   939
{
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   940
  m_harqPhyModule = harq;
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   941
}
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   942
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   943
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   944
void
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   945
LteEnbPhy::ReceiveLteUlHarqFeedback (UlInfoListElement_s mes)
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   946
{
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   947
  NS_LOG_FUNCTION (this);
9535
999521532532 Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9525
diff changeset
   948
  // forward to scheduler
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   949
  m_enbPhySapUser->UlInfoListElementHarqFeeback (mes);
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   950
}
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   951
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   952
};