author | Manuel Requena <manuel.requena@cttc.es> |
Fri, 14 Dec 2012 16:54:29 +0100 | |
changeset 9556 | 29b3091d8fb8 |
parent 9489 | 6bcfc2ee2332 |
parent 9554 | ab3b569597fe |
child 10442 | a420385d5438 |
permissions | -rw-r--r-- |
8378 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
9488
3e4545c949d1
Add parameters and default values of the X2 links
Manuel Requena <manuel.requena@cttc.es>
parents:
9345
diff
changeset
|
3 |
* Copyright (c) 2011-2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
8378 | 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.es> |
|
8380 | 19 |
* Nicola Baldo <nbaldo@cttc.es> |
9488
3e4545c949d1
Add parameters and default values of the X2 links
Manuel Requena <manuel.requena@cttc.es>
parents:
9345
diff
changeset
|
20 |
* Manuel Requena <manuel.requena@cttc.es> |
8378 | 21 |
*/ |
22 |
||
23 |
#ifndef EPC_HELPER_H |
|
24 |
#define EPC_HELPER_H |
|
25 |
||
26 |
#include <ns3/object.h> |
|
8380 | 27 |
#include <ns3/ipv4-address-helper.h> |
28 |
#include <ns3/data-rate.h> |
|
8463 | 29 |
#include <ns3/epc-tft.h> |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
30 |
#include <ns3/eps-bearer.h> |
8378 | 31 |
|
32 |
namespace ns3 { |
|
33 |
||
34 |
class Node; |
|
35 |
class NetDevice; |
|
8568
fc43230a29f5
fixed valgrind errors of epc-s1u tests
Nicola Baldo <nbaldo@cttc.es>
parents:
8463
diff
changeset
|
36 |
class VirtualNetDevice; |
8380 | 37 |
class EpcSgwPgwApplication; |
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
38 |
class EpcX2; |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
39 |
class EpcMme; |
8378 | 40 |
|
41 |
/** |
|
42 |
* \brief Helper class to handle the creation of the EPC entities and protocols. |
|
43 |
* |
|
44 |
* This Helper will create an EPC network topology comprising of a |
|
45 |
* single node that implements both the SGW and PGW functionality, and |
|
46 |
* is connected to all the eNBs in the simulation by means of the S1-U |
|
47 |
* interface. |
|
48 |
*/ |
|
49 |
class EpcHelper : public Object |
|
50 |
{ |
|
51 |
public: |
|
52 |
||
53 |
/** |
|
54 |
* Constructor |
|
55 |
*/ |
|
56 |
EpcHelper (); |
|
57 |
||
58 |
/** |
|
59 |
* Destructor |
|
60 |
*/ |
|
61 |
virtual ~EpcHelper (); |
|
62 |
||
63 |
// inherited from Object |
|
8380 | 64 |
static TypeId GetTypeId (void); |
8568
fc43230a29f5
fixed valgrind errors of epc-s1u tests
Nicola Baldo <nbaldo@cttc.es>
parents:
8463
diff
changeset
|
65 |
virtual void DoDispose (); |
8378 | 66 |
|
67 |
||
68 |
/** |
|
69 |
* Add an eNB to the EPC |
|
70 |
* |
|
71 |
* \param enbNode the previosuly created eNB node which is to be |
|
72 |
* added to the EPC |
|
73 |
* \param lteEnbNetDevice the LteEnbNetDevice of the eNB node |
|
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
74 |
* \param cellId ID of the eNB |
8378 | 75 |
*/ |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
76 |
void AddEnb (Ptr<Node> enbNode, Ptr<NetDevice> lteEnbNetDevice, uint16_t cellId); |
8378 | 77 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
78 |
/** |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
79 |
* Notify the EPC of the existance of a new UE which might attach at a later time |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
80 |
* |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
81 |
* \param ueLteDevice the UE device to be attached |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
82 |
* \param imsi the unique identifier of the UE |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
83 |
*/ |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
84 |
void AddUe (Ptr<NetDevice> ueLteDevice, uint64_t imsi); |
8378 | 85 |
|
86 |
/** |
|
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
87 |
* Add an X2 interface between two eNB |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
88 |
* |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
89 |
* \param enbNode1 one eNB peer of the X2 interface |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
90 |
* \param enbNode2 the other eNB peer of the X2 interface |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
91 |
*/ |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
92 |
void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2); |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
93 |
|
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
94 |
/** |
8378 | 95 |
* Activate an EPS bearer, setting up the corresponding S1-U tunnel. |
96 |
* |
|
8380 | 97 |
* |
98 |
* |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
99 |
* \param ueLteDevice the Ipv4-enabled device of the UE, normally |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
100 |
* connected via the LTE radio interface |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
101 |
* \param imsi the unique identifier of the UE |
8380 | 102 |
* \param tft the Traffic Flow Template of the new bearer |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
103 |
* \param bearer struct describing the characteristics of the EPS bearer to be activated |
8378 | 104 |
*/ |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
105 |
void ActivateEpsBearer (Ptr<NetDevice> ueLteDevice, uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer); |
8378 | 106 |
|
107 |
||
108 |
/** |
|
109 |
* |
|
110 |
* \return a pointer to the node implementing PGW |
|
111 |
* functionality. Note that in this particular implementation this |
|
112 |
* node will also hold the SGW functionality. The primary use |
|
113 |
* intended for this method is to allow the user to configure the Gi |
|
114 |
* interface of the PGW, i.e., to connect the PGW to the internet. |
|
115 |
*/ |
|
116 |
Ptr<Node> GetPgwNode (); |
|
117 |
||
8380 | 118 |
/** |
119 |
* Assign IPv4 addresses to UE devices |
|
120 |
* |
|
121 |
* \param ueDevices the set of UE devices |
|
122 |
* |
|
123 |
* \return the interface container, \see Ipv4AddressHelper::Assign() which has similar semantics |
|
124 |
*/ |
|
125 |
Ipv4InterfaceContainer AssignUeIpv4Address (NetDeviceContainer ueDevices); |
|
126 |
||
127 |
||
8386
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
128 |
/** |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
129 |
* |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
130 |
* \return the address of the Default Gateway to be used by UEs to reach the internet |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
131 |
*/ |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
132 |
Ipv4Address GetUeDefaultGatewayAddress (); |
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
133 |
|
419cbd9e357f
S1-U now working also in uplink
Nicola Baldo <nbaldo@cttc.es>
parents:
8385
diff
changeset
|
134 |
|
8380 | 135 |
|
8378 | 136 |
private: |
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
137 |
|
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
138 |
/** |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
139 |
* SGW-PGW network element |
8380 | 140 |
*/ |
8378 | 141 |
|
8380 | 142 |
/** |
143 |
* helper to assign addresses to UE devices as well as to the TUN device of the SGW/PGW |
|
144 |
*/ |
|
145 |
Ipv4AddressHelper m_ueAddressHelper; |
|
8378 | 146 |
|
8380 | 147 |
Ptr<Node> m_sgwPgw; |
148 |
Ptr<EpcSgwPgwApplication> m_sgwPgwApp; |
|
8568
fc43230a29f5
fixed valgrind errors of epc-s1u tests
Nicola Baldo <nbaldo@cttc.es>
parents:
8463
diff
changeset
|
149 |
Ptr<VirtualNetDevice> m_tunDevice; |
9430
e8b87593ee5b
added MME with simulated S1AP and S11 interfaces
Nicola Baldo <nbaldo@cttc.es>
parents:
9345
diff
changeset
|
150 |
Ptr<EpcMme> m_mme; |
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
151 |
|
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
152 |
/** |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
153 |
* S1-U interfaces |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
154 |
*/ |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
155 |
|
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
156 |
/** |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
157 |
* helper to assign addresses to S1-U NetDevices |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
158 |
*/ |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
159 |
Ipv4AddressHelper m_s1uIpv4AddressHelper; |
8378 | 160 |
|
161 |
DataRate m_s1uLinkDataRate; |
|
162 |
Time m_s1uLinkDelay; |
|
8385
1c778218d880
S1-U downlink working with multiple eNBs and UEs
Nicola Baldo <nbaldo@cttc.es>
parents:
8380
diff
changeset
|
163 |
uint16_t m_s1uLinkMtu; |
8378 | 164 |
|
165 |
/** |
|
166 |
* UDP port where the GTP-U Socket is bound, fixed by the standard as 2152 |
|
167 |
*/ |
|
168 |
uint16_t m_gtpuUdpPort; |
|
169 |
||
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
170 |
/** |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
171 |
* Map storing for each IMSI the corresponding eNB NetDevice |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
172 |
* |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
173 |
*/ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8568
diff
changeset
|
174 |
std::map<uint64_t, Ptr<NetDevice> > m_imsiEnbDeviceMap; |
9338 | 175 |
|
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
176 |
/** |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
177 |
* helper to assign addresses to X2 NetDevices |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
178 |
*/ |
9338 | 179 |
Ipv4AddressHelper m_x2Ipv4AddressHelper; |
9326
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
180 |
|
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
181 |
DataRate m_x2LinkDataRate; |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
182 |
Time m_x2LinkDelay; |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
183 |
uint16_t m_x2LinkMtu; |
1cc7eb255f08
Add support for X2 handover in LTE Helper
Manuel Requena <manuel.requena@cttc.es>
parents:
8568
diff
changeset
|
184 |
|
8378 | 185 |
}; |
186 |
||
187 |
||
188 |
||
189 |
||
190 |
} // namespace ns3 |
|
191 |
||
192 |
#endif // EPC_HELPER_H |