src/lte/model/lte-ue-net-device.h
author Manuel Requena <manuel.requena@cttc.es>
Tue, 26 Mar 2013 10:41:49 +0100
changeset 10019 6efd95740e39
parent 9439 5107601b7a75
child 9703 681f35b212ff
permissions -rw-r--r--
Add automatic triger of the HO based on the RSRQ measures
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Mileti? <rivanvx@gmail.com>
parents: 7238
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
 *         Nicola Baldo <nbaldo@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
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    22
#ifndef LTE_UE_NET_DEVICE_H
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    23
#define LTE_UE_NET_DEVICE_H
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    24
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    25
#include "ns3/lte-net-device.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    26
#include "ns3/event-id.h"
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    27
#include "ns3/mac48-address.h"
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    28
#include "ns3/traced-callback.h"
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    29
#include "ns3/nstime.h"
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    30
#include "ns3/lte-phy.h"
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    31
#include "ns3/eps-bearer.h"
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    32
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    33
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    34
namespace ns3 {
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    35
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    36
class Packet;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    37
class PacketBurst;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    38
class Node;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    39
class LtePhy;
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    40
class LteUePhy;
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    41
class LteEnbNetDevice;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    42
class LteUeMac;
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    43
class LteUeRrc;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    44
class EpcUeNas;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    45
class EpcTft;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    46
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    47
/**
7238
85a7e87bb4cc Make some more modules show up on doxygen modules page
Mitch Watrous <watrous@u.washington.edu>
parents: 6852
diff changeset
    48
 * \ingroup lte
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    49
 * The LteUeNetDevice class implements the UE net device
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    50
 */
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    51
class LteUeNetDevice : public LteNetDevice
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    52
{
8389
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
    53
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    54
public:
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    55
  static TypeId GetTypeId (void);
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    56
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    57
  LteUeNetDevice (void);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    58
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    59
   * \brief Create an UE net device
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    60
   * \param node the node to which the device belongs
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    61
   * \param phy the PHY entity
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    62
   * \param mac the MAC entity
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    63
   * \param rrc the RRC entity
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    64
   * \param nas the NAS entity
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9430
diff changeset
    65
   * \param imsi the unique UE identifier
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    66
   * 
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    67
   */
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9430
diff changeset
    68
  LteUeNetDevice (Ptr<Node> node, Ptr<LteUePhy> phy, Ptr<LteUeMac> mac, Ptr<LteUeRrc> rrc, Ptr<EpcUeNas> nas, uint64_t imsi);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    69
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    70
  virtual ~LteUeNetDevice (void);
6710
3cd651349cb6 lte examples now passing valgrind tests
Nicola Baldo <nbaldo@cttc.es>
parents: 6705
diff changeset
    71
  virtual void DoDispose ();
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    72
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    73
8389
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
    74
  // inherited from NetDevice
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
    75
  virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
    76
  
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
    77
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    78
  Ptr<LteUeMac> GetMac (void) const;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    79
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    80
  Ptr<LteUeRrc> GetRrc () const ;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    81
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    82
  Ptr<LteUePhy> GetPhy (void) const;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    83
  
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    84
  Ptr<EpcUeNas> GetNas (void) const;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    85
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    86
  uint64_t GetImsi () const;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    87
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    88
 
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    89
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    90
   * \brief Set the targer eNB where the UE is registered
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    91
   * \param enb
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    92
   */
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    93
  void SetTargetEnb (Ptr<LteEnbNetDevice> enb);
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
    94
  
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    95
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    96
   * \brief Get the targer eNB where the UE is registered
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    97
   * \return the pointer to the enb
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    98
   */
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
    99
  Ptr<LteEnbNetDevice> GetTargetEnb (void);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   100
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   101
7976
541eee38ac12 fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents: 7945
diff changeset
   102
protected:
541eee38ac12 fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents: 7945
diff changeset
   103
  // inherited from Object
541eee38ac12 fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents: 7945
diff changeset
   104
  virtual void DoStart (void);
541eee38ac12 fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents: 7945
diff changeset
   105
541eee38ac12 fixed LENA-78 m_dlBandwidth not initialized
Nicola Baldo <nbaldo@cttc.es>
parents: 7945
diff changeset
   106
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   107
private:
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   108
8389
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   109
  /**
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   110
   * Some attributes are exported as
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   111
   * attributes of the LteUeNetDevice from a user perspective,  but
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   112
   * are actually used also in other modules as well (the RRC, the
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   113
   * PHY...). This methods takes care of updating the
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   114
   * configuration of all modules so that their copy of the attribute
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   115
   * values is in sync with the one in the LteUeNetDevice.
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   116
   */
7945
dbab335f9eea connection of SAPs moved from UeNetDevice to LenaHelper
Nicola Baldo <nbaldo@cttc.es>
parents: 7906
diff changeset
   117
  void UpdateConfig (void);
dbab335f9eea connection of SAPs moved from UeNetDevice to LenaHelper
Nicola Baldo <nbaldo@cttc.es>
parents: 7906
diff changeset
   118
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   119
  Ptr<LteEnbNetDevice> m_targetEnb;
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   120
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   121
  Ptr<LteUeMac> m_mac;
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   122
  Ptr<LteUePhy> m_phy;
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
   123
  Ptr<LteUeRrc> m_rrc;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8390
diff changeset
   124
  Ptr<EpcUeNas> m_nas;
7893
8dba98ae26ee PHY synchronization
Nicola Baldo <nbaldo@cttc.es>
parents: 7887
diff changeset
   125
7989
96f3da01306a Added IMSI field to LteUeNetDevice as unique UE identifier.
jnin
parents: 7976
diff changeset
   126
  uint64_t m_imsi;
8389
cb215987eb77 LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents: 8148
diff changeset
   127
  
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   128
};
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   129
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   130
} // namespace ns3
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   131
7887
78911c978517 renamed several LTE files and classes
CTTC
parents: 7886
diff changeset
   132
#endif /* LTE_UE_NET_DEVICE_H */