author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Thu, 13 Aug 2015 12:10:01 -0700 | |
changeset 11577 | 0210ca11dad1 |
parent 11168 | d09129217e78 |
permissions | -rw-r--r-- |
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_SGW_PGW_APPLICATION_H |
a3af0a5ed1e9
draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents:
8357
diff
changeset
|
23 |
#define EPC_SGW_PGW_APPLICATION_H |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
24 |
|
8380 | 25 |
#include <ns3/address.h> |
26 |
#include <ns3/socket.h> |
|
27 |
#include <ns3/virtual-net-device.h> |
|
28 |
#include <ns3/traced-callback.h> |
|
29 |
#include <ns3/callback.h> |
|
30 |
#include <ns3/ptr.h> |
|
31 |
#include <ns3/object.h> |
|
32 |
#include <ns3/eps-bearer.h> |
|
8463 | 33 |
#include <ns3/epc-tft.h> |
8464
60dd9cd95447
renamed EpsTftClassifier --> EpcTftClassifier
Nicola Baldo <nbaldo@cttc.es>
parents:
8463
diff
changeset
|
34 |
#include <ns3/epc-tft-classifier.h> |
8380 | 35 |
#include <ns3/lte-common.h> |
36 |
#include <ns3/application.h> |
|
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
37 |
#include <ns3/epc-s1ap-sap.h> |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
38 |
#include <ns3/epc-s11-sap.h> |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
39 |
#include <map> |
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
40 |
|
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
41 |
namespace ns3 { |
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 | 46 |
* This application implements the SGW/PGW functionality. |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
47 |
*/ |
8380 | 48 |
class EpcSgwPgwApplication : public Application |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
49 |
{ |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
50 |
friend class MemberEpcS11SapSgw<EpcSgwPgwApplication>; |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
51 |
|
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
52 |
public: |
8380 | 53 |
|
54 |
// inherited from Object |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
55 |
static TypeId GetTypeId (void); |
8568
fc43230a29f5
fixed valgrind errors of epc-s1u tests
Nicola Baldo <nbaldo@cttc.es>
parents:
8464
diff
changeset
|
56 |
virtual void DoDispose (); |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
57 |
|
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
58 |
/** |
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
59 |
* Constructor that binds the tap device to the callback methods. |
8380 | 60 |
* |
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
61 |
* \param tunDevice TUN VirtualNetDevice used to tunnel IP packets from |
8380 | 62 |
* the Gi interface of the PGW/SGW over the |
63 |
* internet over GTP-U/UDP/IP on the S1-U interface |
|
64 |
* \param s1uSocket socket used to send GTP-U packets to the eNBs |
|
65 |
*/ |
|
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
66 |
EpcSgwPgwApplication (const Ptr<VirtualNetDevice> tunDevice, const Ptr<Socket> s1uSocket); |
8380 | 67 |
|
68 |
/** |
|
69 |
* Destructor |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
70 |
*/ |
8380 | 71 |
virtual ~EpcSgwPgwApplication (void); |
72 |
||
73 |
/** |
|
74 |
* Method to be assigned to the callback of the Gi TUN VirtualNetDevice. It |
|
75 |
* is called when the SGW/PGW receives a data packet from the |
|
76 |
* internet (including IP headers) that is to be sent to the UE via |
|
77 |
* its associated eNB, tunneling IP over GTP-U/UDP/IP. |
|
78 |
* |
|
79 |
* \param packet |
|
80 |
* \param source |
|
81 |
* \param dest |
|
82 |
* \param protocolNumber |
|
83 |
* \return true always |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
84 |
*/ |
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
85 |
bool RecvFromTunDevice (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber); |
8380 | 86 |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
87 |
|
8380 | 88 |
/** |
89 |
* Method to be assigned to the recv callback of the S1-U socket. It |
|
90 |
* is called when the SGW/PGW receives a data packet from the eNB |
|
91 |
* that is to be forwarded to the internet. |
|
92 |
* |
|
93 |
* \param socket pointer to the S1-U socket |
|
94 |
*/ |
|
95 |
void RecvFromS1uSocket (Ptr<Socket> socket); |
|
96 |
||
97 |
/** |
|
98 |
* Send a packet to the internet via the Gi interface of the SGW/PGW |
|
99 |
* |
|
100 |
* \param packet |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
101 |
*/ |
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
102 |
void SendToTunDevice (Ptr<Packet> packet, uint32_t teid); |
8380 | 103 |
|
104 |
||
105 |
/** |
|
106 |
* Send a packet to the SGW via the S1-U interface |
|
107 |
* |
|
108 |
* \param packet packet to be sent |
|
109 |
* \param enbS1uAddress the address of the eNB |
|
110 |
* \param teid the Tunnel Enpoint IDentifier |
|
111 |
*/ |
|
112 |
void SendToS1uSocket (Ptr<Packet> packet, Ipv4Address enbS1uAddress, uint32_t teid); |
|
113 |
||
114 |
||
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
115 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
116 |
* Set the MME side of the S11 SAP |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
117 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
118 |
* \param s the MME side of the S11 SAP |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
119 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
120 |
void SetS11SapMme (EpcS11SapMme * s); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
121 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
122 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
123 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
124 |
* \return the SGW side of the S11 SAP |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
125 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
126 |
EpcS11SapSgw* GetS11SapSgw (); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
127 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
128 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
129 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
130 |
* Let the SGW be aware of a new eNB |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
131 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
132 |
* \param cellId the cell identifier |
10425
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9743
diff
changeset
|
133 |
* \param enbAddr the address of the eNB |
1867d8c25aa7
doxygen warnings for lte module
Budiarto Herman <budiarto.herman@magister.fi>
parents:
9743
diff
changeset
|
134 |
* \param sgwAddr the address of the SGW |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
135 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
136 |
void AddEnb (uint16_t cellId, Ipv4Address enbAddr, Ipv4Address sgwAddr); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
137 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
138 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
139 |
* Let the SGW be aware of a new UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
140 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
141 |
* \param imsi the unique identifier of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
142 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
143 |
void AddUe (uint64_t imsi); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
144 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
145 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
146 |
* set the address of a previously added UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
147 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
148 |
* \param imsi the unique identifier of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
149 |
* \param ueAddr the IPv4 address of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
150 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
151 |
void SetUeAddress (uint64_t imsi, Ipv4Address ueAddr); |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
152 |
|
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
153 |
private: |
8380 | 154 |
|
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
155 |
// S11 SAP SGW methods |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9430
diff
changeset
|
156 |
void DoCreateSessionRequest (EpcS11SapSgw::CreateSessionRequestMessage msg); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9430
diff
changeset
|
157 |
void DoModifyBearerRequest (EpcS11SapSgw::ModifyBearerRequestMessage msg); |
8380 | 158 |
|
11168
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
159 |
void DoDeleteBearerCommand (EpcS11SapSgw::DeleteBearerCommandMessage req); |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
160 |
void DoDeleteBearerResponse (EpcS11SapSgw::DeleteBearerResponseMessage req); |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
161 |
|
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
162 |
|
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
163 |
/** |
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
164 |
* store info for each UE connected to this SGW |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
165 |
*/ |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
166 |
class UeInfo : public SimpleRefCount<UeInfo> |
8380 | 167 |
{ |
11168
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
168 |
public: |
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
169 |
UeInfo (); |
8380 | 170 |
|
171 |
/** |
|
172 |
* |
|
173 |
* \param tft the Traffic Flow Template of the new bearer to be added |
|
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9430
diff
changeset
|
174 |
* \param epsBearerId the ID of the EPS Bearer to be activated |
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
175 |
* \param teid the TEID of the new bearer |
8380 | 176 |
*/ |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9430
diff
changeset
|
177 |
void AddBearer (Ptr<EpcTft> tft, uint8_t epsBearerId, uint32_t teid); |
8380 | 178 |
|
179 |
/** |
|
11168
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
180 |
* \brief Function, deletes contexts of bearer on SGW and PGW side |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
181 |
* \param bearerId, the Bearer Id whose contexts to be removed |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
182 |
*/ |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
183 |
void RemoveBearer (uint8_t bearerId); |
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
184 |
|
d09129217e78
added release bearer functionality
Gaurav Sathe <gaurav.sathe@tcs.com>
parents:
10425
diff
changeset
|
185 |
/** |
8380 | 186 |
* |
187 |
* |
|
188 |
* \param p the IP packet from the internet to be classified |
|
189 |
* |
|
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
190 |
* \return the corresponding bearer ID > 0 identifying the bearer |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
191 |
* among all the bearers of this UE; returns 0 if no bearers |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
192 |
* matches with the previously declared TFTs |
8380 | 193 |
*/ |
194 |
uint32_t Classify (Ptr<Packet> p); |
|
195 |
||
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
196 |
/** |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
197 |
* \return the address of the eNB to which the UE is connected |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
198 |
*/ |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
199 |
Ipv4Address GetEnbAddr (); |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
200 |
|
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
201 |
/** |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
202 |
* set the address of the eNB to which the UE is connected |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
203 |
* |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
204 |
* \param addr the address of the eNB |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
205 |
*/ |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
206 |
void SetEnbAddr (Ipv4Address addr); |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
207 |
|
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
208 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
209 |
* \return the address of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
210 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
211 |
Ipv4Address GetUeAddr (); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
212 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
213 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
214 |
* set the address of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
215 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
216 |
* \param addr the address of the UE |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
217 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
218 |
void SetUeAddr (Ipv4Address addr); |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
219 |
|
8380 | 220 |
|
221 |
private: |
|
8464
60dd9cd95447
renamed EpsTftClassifier --> EpcTftClassifier
Nicola Baldo <nbaldo@cttc.es>
parents:
8463
diff
changeset
|
222 |
EpcTftClassifier m_tftClassifier; |
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
223 |
Ipv4Address m_enbAddr; |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
224 |
Ipv4Address m_ueAddr; |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9430
diff
changeset
|
225 |
std::map<uint8_t, uint32_t> m_teidByBearerIdMap; |
8380 | 226 |
}; |
227 |
||
228 |
||
229 |
/** |
|
230 |
* UDP socket to send and receive GTP-U packets to and from the S1-U interface |
|
231 |
*/ |
|
232 |
Ptr<Socket> m_s1uSocket; |
|
233 |
||
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
234 |
/** |
8380 | 235 |
* TUN VirtualNetDevice used for tunneling/detunneling IP packets |
236 |
* from/to the internet over GTP-U/UDP/IP on the S1 interface |
|
237 |
*/ |
|
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
238 |
Ptr<VirtualNetDevice> m_tunDevice; |
8380 | 239 |
|
240 |
/** |
|
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
241 |
* Map telling for each UE address the corresponding UE info |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
242 |
*/ |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
243 |
std::map<Ipv4Address, Ptr<UeInfo> > m_ueInfoByAddrMap; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
244 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
245 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
246 |
* Map telling for each IMSI the corresponding UE info |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
247 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
248 |
std::map<uint64_t, Ptr<UeInfo> > m_ueInfoByImsiMap; |
8380 | 249 |
|
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
250 |
/** |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
251 |
* UDP port to be used for GTP |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
252 |
*/ |
8380 | 253 |
uint16_t m_gtpuUdpPort; |
254 |
||
8387
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
255 |
uint32_t m_teidCount; |
2c745ee2d92c
revised TEID generation and TFT classification at SGW
Nicola Baldo <nbaldo@cttc.es>
parents:
8386
diff
changeset
|
256 |
|
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
257 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
258 |
* MME side of the S11 SAP |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
259 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
260 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
261 |
EpcS11SapMme* m_s11SapMme; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
262 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
263 |
/** |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
264 |
* SGW side of the S11 SAP |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
265 |
* |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
266 |
*/ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
267 |
EpcS11SapSgw* m_s11SapSgw; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
268 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
269 |
struct EnbInfo |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
270 |
{ |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
271 |
Ipv4Address enbAddr; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
272 |
Ipv4Address sgwAddr; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
273 |
}; |
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
274 |
|
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
8590
diff
changeset
|
275 |
std::map<uint16_t, EnbInfo> m_enbInfoByCellId; |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
276 |
}; |
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
277 |
|
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
278 |
} //namespace ns3 |
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
279 |
|
8366
a3af0a5ed1e9
draft eNB and SGW/PGW applications
Nicola Baldo <nbaldo@cttc.es>
parents:
8357
diff
changeset
|
280 |
#endif /* EPC_SGW_PGW_APPLICATION_H */ |
8357
7bb52f00c205
Refurbished GTP tunneling implementation + documentation
Jaume Nin
parents:
diff
changeset
|
281 |