A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
epc-sgw-pgw-application.h
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Jaume Nin <jnin@cttc.cat>
19
* Nicola Baldo <nbaldo@cttc.cat>
20
*/
21
22
#ifndef EPC_SGW_PGW_APPLICATION_H
23
#define EPC_SGW_PGW_APPLICATION_H
24
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>
33
#include <ns3/epc-tft.h>
34
#include <ns3/epc-tft-classifier.h>
35
#include <ns3/lte-common.h>
36
#include <ns3/application.h>
37
#include <ns3/epc-s1ap-sap.h>
38
#include <ns3/epc-s11-sap.h>
39
#include <map>
40
41
namespace
ns3 {
42
48
class
EpcSgwPgwApplication
:
public
Application
49
{
50
friend
class
MemberEpcS11SapSgw
<
EpcSgwPgwApplication
>;
51
52
public
:
53
54
// inherited from Object
55
static
TypeId
GetTypeId
(
void
);
56
virtual
void
DoDispose
();
57
66
EpcSgwPgwApplication
(
const
Ptr<VirtualNetDevice>
tunDevice,
const
Ptr<Socket>
s1uSocket);
67
71
virtual
~EpcSgwPgwApplication
(
void
);
72
85
bool
RecvFromTunDevice
(
Ptr<Packet>
packet,
const
Address
& source,
const
Address
& dest, uint16_t protocolNumber);
86
87
95
void
RecvFromS1uSocket
(
Ptr<Socket>
socket);
96
102
void
SendToTunDevice
(
Ptr<Packet>
packet, uint32_t teid);
103
104
112
void
SendToS1uSocket
(
Ptr<Packet>
packet,
Ipv4Address
enbS1uAddress, uint32_t teid);
113
114
120
void
SetS11SapMme
(
EpcS11SapMme
* s);
121
126
EpcS11SapSgw
*
GetS11SapSgw
();
127
128
135
void
AddEnb
(uint16_t cellId,
Ipv4Address
enbAddr,
Ipv4Address
sgwAddr);
136
142
void
AddUe
(uint64_t imsi);
143
150
void
SetUeAddress
(uint64_t imsi,
Ipv4Address
ueAddr);
151
152
private
:
153
154
// S11 SAP SGW methods
155
void
DoCreateSessionRequest
(
EpcS11SapSgw::CreateSessionRequestMessage
msg);
156
void
DoModifyBearerRequest
(
EpcS11SapSgw::ModifyBearerRequestMessage
msg);
157
161
class
UeInfo
:
public
SimpleRefCount
<UeInfo>
162
{
163
public
:
164
UeInfo
();
165
172
void
AddBearer
(
Ptr<EpcTft>
tft, uint8_t epsBearerId, uint32_t teid);
173
183
uint32_t
Classify
(
Ptr<Packet>
p);
184
188
Ipv4Address
GetEnbAddr
();
189
195
void
SetEnbAddr
(
Ipv4Address
addr);
196
200
Ipv4Address
GetUeAddr
();
201
207
void
SetUeAddr
(
Ipv4Address
addr);
208
209
210
private
:
211
EpcTftClassifier
m_tftClassifier
;
212
Ipv4Address
m_enbAddr
;
213
Ipv4Address
m_ueAddr
;
214
std::map<uint8_t, uint32_t>
m_teidByBearerIdMap
;
215
};
216
217
221
Ptr<Socket>
m_s1uSocket
;
222
227
Ptr<VirtualNetDevice>
m_tunDevice
;
228
232
std::map<Ipv4Address, Ptr<UeInfo> >
m_ueInfoByAddrMap
;
233
237
std::map<uint64_t, Ptr<UeInfo> >
m_ueInfoByImsiMap
;
238
242
uint16_t
m_gtpuUdpPort
;
243
244
uint32_t
m_teidCount
;
245
250
EpcS11SapMme
*
m_s11SapMme
;
251
256
EpcS11SapSgw
*
m_s11SapSgw
;
257
258
struct
EnbInfo
259
{
260
Ipv4Address
enbAddr
;
261
Ipv4Address
sgwAddr
;
262
};
263
264
std::map<uint16_t, EnbInfo>
m_enbInfoByCellId
;
265
};
266
267
}
//namespace ns3
268
269
#endif
/* EPC_SGW_PGW_APPLICATION_H */
270
src
lte
model
epc-sgw-pgw-application.h
Generated on Tue May 14 2013 11:08:24 for ns-3 by
1.8.1.2