src/lte/model/epc-enb-application.h
author Nicola Baldo <nbaldo@cttc.es>
Tue, 30 Oct 2012 16:02:07 +0100
changeset 9406 7f0f9d8f8e20
parent 9345 8290ae6cab62
child 9414 7b0db3dbf19b
permissions -rw-r--r--
new LTE RRC model
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>
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    36
#include <map>
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    37
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    38
namespace ns3 {
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    39
class EpcEnbS1SapUser;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    40
class EpcEnbS1SapProvider;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    41
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    42
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    43
/**
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    44
 * \ingroup lte
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    45
 *
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    46
 * 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
    47
 */
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    48
class EpcEnbApplication : public Application
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    49
{
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    50
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
    51
  friend class MemberEpcEnbS1SapProvider<EpcEnbApplication>;
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
    52
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    53
public:
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    54
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    55
  // inherited from Object
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    56
  static TypeId GetTypeId (void);
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    57
  
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    58
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    59
  /** 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    60
   * Constructor
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    61
   * 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    62
   * \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
    63
   * \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
    64
   * to/from the S1-U interface connected with the SGW 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    65
   * \param sgwAddress the IPv4 address at which this eNB will be able to reach its SGW
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    66
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    67
   */
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    68
  EpcEnbApplication (Ptr<Socket> lteSocket, Ptr<Socket> s1uSocket, Ipv4Address sgwAddress);
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    69
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    70
  /**
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    71
   * Destructor
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    72
   * 
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
    73
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    74
  virtual ~EpcEnbApplication (void);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    75
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
    76
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    77
  /** 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    78
   * Set the S1 SAP User
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    79
   * 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    80
   * \param s the S1 SAP User
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    81
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    82
  void SetS1SapUser (EpcEnbS1SapUser * s);
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    83
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    84
  /** 
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
   * \return the S1 SAP Provider
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
  EpcEnbS1SapProvider* GetS1SapProvider ();
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    89
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    90
  /** 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    91
   * This method is triggered after the eNB received
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    92
   * a S1-AP message of type E-RAB Setup Request by the MME and will
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    93
   * trigger the corresponding RadioBearer creation 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    94
   * 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    95
   * \param teid the Tunnel Endpoint IDentifier of the S1-bearer to be setup.
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    96
   * \param imsi the unique ID of the UE
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    97
   * \param bearer the specification of the corresponding EPS bearer
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
    98
   */
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
    99
  void ErabSetupRequest (uint32_t teid, uint64_t imsi, EpsBearer bearer);
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   100
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   101
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   102
   * 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
   103
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   104
   * \param socket pointer to the LTE socket
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   105
   */
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   106
  void RecvFromLteSocket (Ptr<Socket> socket);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   107
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   108
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   109
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   110
   * 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
   111
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   112
   * \param socket pointer to the S1-U socket
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   113
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   114
  void RecvFromS1uSocket (Ptr<Socket> socket);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   115
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   116
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   117
  struct EpsFlowId_t
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   118
  {
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   119
    uint16_t  m_rnti;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   120
    uint8_t   m_bid;
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   121
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   122
  public:
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   123
    EpsFlowId_t ();
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   124
    EpsFlowId_t (const uint16_t a, const uint8_t b);
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   125
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   126
    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
   127
    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
   128
  };
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   129
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   130
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   131
private:
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   132
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   133
  // S1 SAP provider methods
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   134
  void DoS1BearerSetupRequest (EpcEnbS1SapProvider::S1BearerSetupRequestParameters params);
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   135
  void DoInitialUeMessage (uint64_t imsi, uint16_t rnti);
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   136
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   137
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   138
   * 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
   139
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   140
   * \param packet t
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   141
   * \param bid the EPS Bearer IDentifier
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   142
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   143
  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
   144
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   145
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   146
  /** 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   147
   * 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
   148
   * 
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   149
   * \param packet packet to be sent
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   150
   * \param teid the Tunnel Enpoint IDentifier
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   151
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   152
  void SendToS1uSocket (Ptr<Packet> packet, uint32_t teid);
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   153
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   154
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   155
  
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   156
  /** 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   157
   * 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
   158
   * 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   159
   * \param teid 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   160
   * \param rnti 
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   161
   * \param bid 
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   162
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   163
  void SetupS1Bearer (uint32_t teid, uint16_t rnti, uint8_t bid);
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   164
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   165
  /**
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   166
   * 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
   167
   */
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   168
  Ptr<Socket> m_lteSocket;
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   169
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   170
  /**
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   171
   * 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
   172
   */
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   173
  Ptr<Socket> m_s1uSocket;
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   174
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   175
  /**
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   176
   * address of the SGW which terminates all S1-U tunnels
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   177
   */
8378
0d8107d1548b save changes before merge
Nicola Baldo <nbaldo@cttc.es>
parents: 8366
diff changeset
   178
  Ipv4Address m_sgwAddress;
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   179
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   180
  /**
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   181
   * map telling for each EpsBearer (RNTI,BID) the corresponding  S1-U TEID
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   182
   * 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   183
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   184
  std::map<EpsFlowId_t, uint32_t> m_rbidTeidMap;  
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   185
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   186
  /**
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   187
   * map telling for each S1-U TEID the corresponding EpsBearer (RNTI,BID) 
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   188
   * 
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   189
   */
9406
7f0f9d8f8e20 new LTE RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 9345
diff changeset
   190
  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
   191
 
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   192
  /**
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   193
   * UDP port to be used for GTP
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   194
   */
419cbd9e357f S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents: 8380
diff changeset
   195
  uint16_t m_gtpuUdpPort;
8380
f615b30c26e1 S1-U working in downlink
Nicola Baldo <nbaldo@cttc.es>
parents: 8378
diff changeset
   196
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   197
  /**
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   198
   * Provider for the S1 SAP 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   199
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   200
  EpcEnbS1SapProvider* m_s1SapProvider;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   201
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   202
  /**
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   203
   * User for the S1 SAP 
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   204
   */
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   205
  EpcEnbS1SapUser* m_s1SapUser;
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   206
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8590
diff changeset
   207
9345
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   208
  /**
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   209
   * UE context info
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   210
   * 
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   211
   */
8290ae6cab62 add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents: 9337
diff changeset
   212
  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
   213
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   214
};
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   215
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   216
} //namespace ns3
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   217
8366
a3af0a5ed1e9 draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents: 8357
diff changeset
   218
#endif /* EPC_ENB_APPLICATION_H */
8357
7bb52f00c205 Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff changeset
   219