src/lte/model/epc-enb-application.h
author Manuel Requena <manuel.requena@cttc.es>
Tue, 26 Mar 2013 10:41:49 +0100
changeset 10019 6efd95740e39
parent 9442 ea15d4676dff
child 11168 d09129217e78
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:
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     2
/*
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     4
 *
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     7
 * published by the Free Software Foundation;
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     8
 *
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    12
 * GNU General Public License for more details.
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    13
 *
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    17
 *
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    18
 * Author: Jaume Nin <jnin@cttc.cat>
8366
a3af0a5ed1e9 draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents: 8357
diff changeset
    19
 *         Nicola Baldo <nbaldo@cttc.cat>
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    20
 */
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    21
8366
a3af0a5ed1e9 draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents: 8357
diff changeset
    22
#ifndef EPC_ENB_APPLICATION_H
a3af0a5ed1e9 draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents: 8357
diff changeset
    23
#define EPC_ENB_APPLICATION_H
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    24
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    25
#include <ns3/address.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    26
#include <ns3/socket.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    27
#include <ns3/virtual-net-device.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    28
#include <ns3/traced-callback.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    29
#include <ns3/callback.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    30
#include <ns3/ptr.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    31
#include <ns3/object.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    32
#include <ns3/lte-common.h>
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    33
#include <ns3/application.h>
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    34
#include <ns3/eps-bearer.h>
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    35
#include <ns3/epc-enb-s1-sap.h>
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
    36
#include <ns3/epc-s1ap-sap.h>
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    37
#include <map>
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    38
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    39
namespace ns3 {
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    40
class EpcEnbS1SapUser;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    41
class EpcEnbS1SapProvider;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    42
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    43
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    44
/**
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    45
 * \ingroup lte
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    46
 *
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    47
 * This application is installed inside eNBs and provides the bridge functionality for user data plane packets between the radio interface and the S1-U interface.
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    48
 */
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    49
class EpcEnbApplication : public Application
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    50
{
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    51
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
    52
  friend class MemberEpcEnbS1SapProvider<EpcEnbApplication>;
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
    53
  friend class MemberEpcS1apSapEnb<EpcEnbApplication>;
9380
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    54
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    55
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    56
  // inherited from Object
9380
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    57
public:
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    58
  static TypeId GetTypeId (void);
9380
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    59
protected:
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    60
  void DoDispose (void);
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    61
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    62
public:
890e3ccc4bc5 fixed valgrind error in EpcEnbApplication
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
    63
  
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    64
  
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    65
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    66
  /** 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    67
   * Constructor
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    68
   * 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    69
   * \param lteSocket the socket to be used to send/receive packets to/from the LTE radio interface
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    70
   * \param s1uSocket the socket to be used to send/receive packets
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    71
   * to/from the S1-U interface connected with the SGW 
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
    72
   * \param enbS1uAddress the IPv4 address of the S1-U interface of this eNB
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
    73
   * \param sgwS1uAddress the IPv4 address at which this eNB will be able to reach its SGW for S1-U communications
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
    74
   * \param cellId the identifier of the enb
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    75
   */
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
    76
  EpcEnbApplication (Ptr<Socket> lteSocket, Ptr<Socket> s1uSocket, Ipv4Address enbS1uAddress, Ipv4Address sgwS1uAddress, uint16_t cellId);
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    77
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    78
  /**
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    79
   * Destructor
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    80
   * 
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    81
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    82
  virtual ~EpcEnbApplication (void);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    83
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    84
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    85
  /** 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    86
   * Set the S1 SAP User
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    87
   * 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    88
   * \param s the S1 SAP User
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    89
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    90
  void SetS1SapUser (EpcEnbS1SapUser * s);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    91
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    92
  /** 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    93
   * 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    94
   * \return the S1 SAP Provider
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    95
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    96
  EpcEnbS1SapProvider* GetS1SapProvider ();
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    97
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    98
  /** 
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
    99
   * Set the MME side of the S1-AP SAP 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   100
   * 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   101
   * \param s the MME side of the S1-AP SAP 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   102
   */
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   103
  void SetS1apSapMme (EpcS1apSapMme * s);
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   104
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   105
  /** 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   106
   * 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   107
   * \return the ENB side of the S1-AP SAP 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   108
   */
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   109
  EpcS1apSapEnb* GetS1apSapEnb ();
9431
d157ce87b1c0 removed obsolete S1BearerSetupRequest method from EpcEnbS1Sap
Nicola Baldo <nbaldo@cttc.es>
parents: 9430
diff changeset
   110
 
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   111
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   112
   * Method to be assigned to the recv callback of the LTE socket. It is called when the eNB receives a data packet from the radio interface that is to be forwarded to the SGW.
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   113
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   114
   * \param socket pointer to the LTE socket
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   115
   */
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   116
  void RecvFromLteSocket (Ptr<Socket> socket);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   117
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   118
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   119
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   120
   * Method to be assigned to the recv callback of the S1-U socket. It is called when the eNB receives a data packet from the SGW that is to be forwarded to the UE.
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   121
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   122
   * \param socket pointer to the S1-U socket
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   123
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   124
  void RecvFromS1uSocket (Ptr<Socket> socket);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   125
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   126
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   127
  struct EpsFlowId_t
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   128
  {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   129
    uint16_t  m_rnti;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   130
    uint8_t   m_bid;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   131
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   132
  public:
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   133
    EpsFlowId_t ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   134
    EpsFlowId_t (const uint16_t a, const uint8_t b);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   135
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   136
    friend bool operator == (const EpsFlowId_t &a, const EpsFlowId_t &b);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   137
    friend bool operator < (const EpsFlowId_t &a, const EpsFlowId_t &b);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   138
  };
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   139
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   140
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   141
private:
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   142
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   143
  // ENB S1 SAP provider methods
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   144
  void DoInitialUeMessage (uint64_t imsi, uint16_t rnti);
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   145
  void DoPathSwitchRequest (EpcEnbS1SapProvider::PathSwitchRequestParameters params);
9442
ea15d4676dff release UE context at EpcEnbApplication upon X2 UE CONTEXT RELEASE
Nicola Baldo <nbaldo@cttc.es>
parents: 9439
diff changeset
   146
  void DoUeContextRelease (uint16_t rnti);
ea15d4676dff release UE context at EpcEnbApplication upon X2 UE CONTEXT RELEASE
Nicola Baldo <nbaldo@cttc.es>
parents: 9439
diff changeset
   147
  
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   148
  // S1-AP SAP ENB methods
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   149
  void DoInitialContextSetupRequest (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list<EpcS1apSapEnb::ErabToBeSetupItem> erabToBeSetupList);
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   150
  void DoPathSwitchRequestAcknowledge (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list<EpcS1apSapEnb::ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList);
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   151
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   152
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   153
   * Send a packet to the UE via the LTE radio interface of the eNB
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   154
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   155
   * \param packet t
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   156
   * \param bid the EPS Bearer IDentifier
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   157
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   158
  void SendToLteSocket (Ptr<Packet> packet, uint16_t rnti, uint8_t bid);
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   159
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   160
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   161
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   162
   * Send a packet to the SGW via the S1-U interface
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   163
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   164
   * \param packet packet to be sent
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   165
   * \param teid the Tunnel Enpoint IDentifier
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   166
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   167
  void SendToS1uSocket (Ptr<Packet> packet, uint32_t teid);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   168
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   169
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   170
  
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   171
  /** 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   172
   * internal method used for the actual setup of the S1 Bearer
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   173
   * 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   174
   * \param teid 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   175
   * \param rnti 
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   176
   * \param bid 
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   177
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   178
  void SetupS1Bearer (uint32_t teid, uint16_t rnti, uint8_t bid);
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   179
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   180
  /**
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   181
   * raw packet socket to send and receive the packets to and from the LTE radio interface
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   182
   */
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   183
  Ptr<Socket> m_lteSocket;
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   184
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   185
  /**
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   186
   * UDP socket to send and receive GTP-U the packets to and from the S1-U interface
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   187
   */
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   188
  Ptr<Socket> m_s1uSocket;
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   189
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   190
  /**
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   191
   * address of the eNB for S1-U communications
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   192
   */
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   193
  Ipv4Address m_enbS1uAddress;
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   194
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   195
  /**
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   196
   * address of the SGW which terminates all S1-U tunnels
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   197
   */
9439
5107601b7a75 added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents: 9431
diff changeset
   198
  Ipv4Address m_sgwS1uAddress;
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   199
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   200
  /**
9442
ea15d4676dff release UE context at EpcEnbApplication upon X2 UE CONTEXT RELEASE
Nicola Baldo <nbaldo@cttc.es>
parents: 9439
diff changeset
   201
   * map of maps telling for each RNTI and BID the corresponding  S1-U TEID
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   202
   * 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   203
   */
9442
ea15d4676dff release UE context at EpcEnbApplication upon X2 UE CONTEXT RELEASE
Nicola Baldo <nbaldo@cttc.es>
parents: 9439
diff changeset
   204
  std::map<uint16_t, std::map<uint8_t, uint32_t> > m_rbidTeidMap;  
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   205
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   206
  /**
9442
ea15d4676dff release UE context at EpcEnbApplication upon X2 UE CONTEXT RELEASE
Nicola Baldo <nbaldo@cttc.es>
parents: 9439
diff changeset
   207
   * map telling for each S1-U TEID the corresponding RNTI,BID
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   208
   * 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   209
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   210
  std::map<uint32_t, EpsFlowId_t> m_teidRbidMap;
8386
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   211
 
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   212
  /**
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   213
   * UDP port to be used for GTP
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   214
   */
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   215
  uint16_t m_gtpuUdpPort;
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   216
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   217
  /**
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   218
   * Provider for the S1 SAP 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   219
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   220
  EpcEnbS1SapProvider* m_s1SapProvider;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   221
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   222
  /**
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   223
   * User for the S1 SAP 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   224
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   225
  EpcEnbS1SapUser* m_s1SapUser;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   226
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   227
  /**
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   228
   * MME side of the S1-AP SAP
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   229
   * 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   230
   */
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   231
  EpcS1apSapMme* m_s1apSapMme;
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   232
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   233
  /**
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   234
   * ENB side of the S1-AP SAP
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   235
   * 
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   236
   */
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   237
  EpcS1apSapEnb* m_s1apSapEnb;
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   238
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   239
  /**
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   240
   * UE context info
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   241
   * 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   242
   */
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   243
  std::map<uint64_t, uint16_t> m_imsiRntiMap;
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   244
9430
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   245
  uint16_t m_cellId;
e8b87593ee5b added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents: 9414
diff changeset
   246
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   247
};
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   248
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   249
} //namespace ns3
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   250
8366
a3af0a5ed1e9 draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents: 8357
diff changeset
   251
#endif /* EPC_ENB_APPLICATION_H */
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   252