A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
epc-s1ap-sap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.cat>
18 */
19
20#ifndef EPC_S1AP_SAP_H
21#define EPC_S1AP_SAP_H
22
23#include "eps-bearer.h"
24
25#include <ns3/address.h>
26#include <ns3/ipv4-address.h>
27#include <ns3/object.h>
28#include <ns3/ptr.h>
29
30#include <list>
31
32namespace ns3
33{
34
35/**
36 * \ingroup lte
37 *
38 * Base class that defines EPC S1-AP Service Access Point (SAP) interface.
39 */
41{
42 public:
43 virtual ~EpcS1apSap();
44};
45
46/**
47 * \ingroup lte
48 *
49 * MME side of the S1-AP Service Access Point (SAP), provides the MME
50 * methods to be called when an S1-AP message is received by the MME.
51 */
53{
54 public:
55 /**
56 * Initial UE message.
57 *
58 * \param mmeUeS1Id in practice, we use the IMSI
59 * \param enbUeS1Id in practice, we use the RNTI
60 * \param stmsi in practice, the imsi
61 * \param ecgi in practice, the cell Id
62 */
63 virtual void InitialUeMessage(uint64_t mmeUeS1Id,
64 uint16_t enbUeS1Id,
65 uint64_t stmsi,
66 uint16_t ecgi) = 0;
67
68 /**
69 * E-RAB Release Indication Item IEs, 3GPP TS 36.413 version 9.8.0 section 9.1.3.7
70 */
72 {
73 uint8_t erabId; ///< E-RAB ID
74 };
75
76 /**
77 * \brief As per 3GPP TS 36.413 version 9.8.0 section 8.2.3.2.2, the eNB
78 * indicates bearer release by sending an E-RAB RELEASE INDICATION message
79 * towards MME
80 *
81 * \param mmeUeS1Id in practice, we use the IMSI
82 * \param enbUeS1Id in practice, we use the RNTI
83 * \param erabToBeReleaseIndication List of bearers to be deactivated
84 */
86 uint64_t mmeUeS1Id,
87 uint16_t enbUeS1Id,
88 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication) = 0;
89
90 /**
91 * E-RAB Setup Item IEs, see 3GPP TS 36.413 9.1.4.2
92 */
94 {
95 uint16_t erabId; ///< E-RAB ID
96 Ipv4Address enbTransportLayerAddress; ///< transport layer address
97 uint32_t enbTeid; ///< TEID
98 };
99
100 /**
101 * INITIAL CONTEXT SETUP RESPONSE message, see 3GPP TS 36.413 9.1.4.2
102 *
103 * \param mmeUeS1Id in practice, we use the IMSI
104 * \param enbUeS1Id in practice, we use the RNTI
105 * \param erabSetupList List of ERAB setup
106 *
107 */
108 virtual void InitialContextSetupResponse(uint64_t mmeUeS1Id,
109 uint16_t enbUeS1Id,
110 std::list<ErabSetupItem> erabSetupList) = 0;
111
112 /**
113 * E-RABs Switched in Downlink Item IE, see 3GPP TS 36.413 9.1.5.8
114 */
116 {
117 uint16_t erabId; ///< ERAB ID
119 uint32_t enbTeid; ///< TEID
120 };
121
122 /**
123 * PATH SWITCH REQUEST message, see 3GPP TS 36.413 9.1.5.8
124 *
125 * \param enbUeS1Id in practice, we use the RNTI
126 * \param mmeUeS1Id in practice, we use the IMSI
127 * \param gci GCI
128 * \param erabToBeSwitchedInDownlinkList List of ERAB to be switched in downlink
129 */
130 virtual void PathSwitchRequest(
131 uint64_t enbUeS1Id,
132 uint64_t mmeUeS1Id,
133 uint16_t gci,
134 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList) = 0;
135};
136
137/**
138 * \ingroup lte
139 *
140 * eNB side of the S1-AP Service Access Point (SAP), provides the eNB
141 * methods to be called when an S1-AP message is received by the eNB.
142 */
144{
145 public:
146 /// ErabToBeSetupItem structure
148 {
149 uint8_t erabId; ///< ERAB iD
150 EpsBearer erabLevelQosParameters; ///< Level QOS parameters
151 Ipv4Address transportLayerAddress; ///< transport layer address
152 uint32_t sgwTeid; ///< TEID
153 };
154
155 /**
156 * Initial context setup request
157 *
158 * \param mmeUeS1Id in practice, we use the IMSI
159 * \param enbUeS1Id in practice, we use the RNTI
160 * \param erabToBeSetupList List of ERAB to be setup
161 */
162 virtual void InitialContextSetupRequest(uint64_t mmeUeS1Id,
163 uint16_t enbUeS1Id,
164 std::list<ErabToBeSetupItem> erabToBeSetupList) = 0;
165
166 /**
167 * E-RABs Switched in Uplink Item IE, see 3GPP TS 36.413 9.1.5.9
168 */
170 {
171 uint8_t erabId; ///< E_RAB ID
172 Ipv4Address transportLayerAddress; ///< transport layer address
173 uint32_t enbTeid; ///< TEID
174 };
175
176 /**
177 * PATH SWITCH REQUEST ACKNOWLEDGE message, see 3GPP TS 36.413 9.1.5.9
178 *
179 * \param enbUeS1Id in practice, we use the RNTI
180 * \param mmeUeS1Id in practice, we use the IMSI
181 * \param cgi CGI
182 * \param erabToBeSwitchedInUplinkList List of ERAB to be switched in uplink
183 */
185 uint64_t enbUeS1Id,
186 uint64_t mmeUeS1Id,
187 uint16_t cgi,
188 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList) = 0;
189};
190
191/**
192 * Template for the implementation of the EpcS1apSapMme as a member
193 * of an owner class of type C to which all methods are forwarded
194 */
195template <class C>
197{
198 public:
199 /**
200 * Constructor
201 *
202 * \param owner the owner class
203 */
204 MemberEpcS1apSapMme(C* owner);
205
206 // Delete default constructor to avoid misuse
208
209 // inherited from EpcS1apSapMme
210 /**
211 * Initial UE Message function
212 * \param mmeUeS1Id in practice, we use the IMSI
213 * \param enbUeS1Id in practice, we use the RNTI
214 * \param imsi the IMSI
215 * \param ecgi ECGI
216 */
217 void InitialUeMessage(uint64_t mmeUeS1Id,
218 uint16_t enbUeS1Id,
219 uint64_t imsi,
220 uint16_t ecgi) override;
221 /**
222 * ERAB Release Indiation function
223 * \param mmeUeS1Id in practice, we use the IMSI
224 * \param enbUeS1Id in practice, we use the RNTI
225 * \param erabToBeReleaseIndication List of ERAB to be release indication
226 */
228 uint64_t mmeUeS1Id,
229 uint16_t enbUeS1Id,
230 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication) override;
231
232 /**
233 * Initial context setup response
234 * \param mmeUeS1Id in practice, we use the IMSI
235 * \param enbUeS1Id in practice, we use the RNTI
236 * \param erabSetupList List of ERAB setup
237 */
238 void InitialContextSetupResponse(uint64_t mmeUeS1Id,
239 uint16_t enbUeS1Id,
240 std::list<ErabSetupItem> erabSetupList) override;
241 /**
242 * Path switch request
243 * \param enbUeS1Id in practice, we use the RNTI
244 * \param mmeUeS1Id in practice, we use the IMSI
245 * \param cgi CGI
246 * \param erabToBeSwitchedInDownlinkList List of ERAB to be switched in downlink
247 */
249 uint64_t enbUeS1Id,
250 uint64_t mmeUeS1Id,
251 uint16_t cgi,
252 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList) override;
253
254 private:
255 C* m_owner; ///< owner class
256};
257
258template <class C>
260 : m_owner(owner)
261{
262}
263
264template <class C>
265void
267 uint16_t enbUeS1Id,
268 uint64_t imsi,
269 uint16_t ecgi)
270{
271 m_owner->DoInitialUeMessage(mmeUeS1Id, enbUeS1Id, imsi, ecgi);
272}
273
274template <class C>
275void
277 uint64_t mmeUeS1Id,
278 uint16_t enbUeS1Id,
279 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication)
280{
281 m_owner->DoErabReleaseIndication(mmeUeS1Id, enbUeS1Id, erabToBeReleaseIndication);
282}
283
284template <class C>
285void
287 uint16_t enbUeS1Id,
288 std::list<ErabSetupItem> erabSetupList)
289{
290 m_owner->DoInitialContextSetupResponse(mmeUeS1Id, enbUeS1Id, erabSetupList);
291}
292
293template <class C>
294void
296 uint64_t enbUeS1Id,
297 uint64_t mmeUeS1Id,
298 uint16_t cgi,
299 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList)
300{
301 m_owner->DoPathSwitchRequest(enbUeS1Id, mmeUeS1Id, cgi, erabToBeSwitchedInDownlinkList);
302}
303
304/**
305 * Template for the implementation of the EpcS1apSapEnb as a member
306 * of an owner class of type C to which all methods are forwarded
307 */
308template <class C>
310{
311 public:
312 /**
313 * Constructor
314 *
315 * \param owner the owner class
316 */
317 MemberEpcS1apSapEnb(C* owner);
318
319 // Delete default constructor to avoid misuse
321
322 // inherited from EpcS1apSapEnb
323 /**
324 * Initial context setup request function
325 * \param mmeUeS1Id in practice, we use the IMSI
326 * \param enbUeS1Id in practice, we use the RNTI
327 * \param erabToBeSetupList List of ERAB to be setup
328 */
329 void InitialContextSetupRequest(uint64_t mmeUeS1Id,
330 uint16_t enbUeS1Id,
331 std::list<ErabToBeSetupItem> erabToBeSetupList) override;
332 /**
333 * Path switch request acknowledge function
334 * \param enbUeS1Id in practice, we use the RNTI
335 * \param mmeUeS1Id in practice, we use the IMSI
336 * \param cgi CGI
337 * \param erabToBeSwitchedInUplinkList List of ERAB to be switched in uplink
338 */
340 uint64_t enbUeS1Id,
341 uint64_t mmeUeS1Id,
342 uint16_t cgi,
343 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList) override;
344
345 private:
346 C* m_owner; ///< owner class
347};
348
349template <class C>
351 : m_owner(owner)
352{
353}
354
355template <class C>
356void
358 uint16_t enbUeS1Id,
359 std::list<ErabToBeSetupItem> erabToBeSetupList)
360{
361 m_owner->DoInitialContextSetupRequest(mmeUeS1Id, enbUeS1Id, erabToBeSetupList);
362}
363
364template <class C>
365void
367 uint64_t enbUeS1Id,
368 uint64_t mmeUeS1Id,
369 uint16_t cgi,
370 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList)
371{
372 m_owner->DoPathSwitchRequestAcknowledge(enbUeS1Id,
373 mmeUeS1Id,
374 cgi,
375 erabToBeSwitchedInUplinkList);
376}
377
378} // namespace ns3
379
380#endif /* EPC_S1AP_SAP_H */
eNB side of the S1-AP Service Access Point (SAP), provides the eNB methods to be called when an S1-AP...
Definition: epc-s1ap-sap.h:144
virtual void PathSwitchRequestAcknowledge(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList)=0
PATH SWITCH REQUEST ACKNOWLEDGE message, see 3GPP TS 36.413 9.1.5.9.
virtual void InitialContextSetupRequest(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeSetupItem > erabToBeSetupList)=0
Initial context setup request.
Base class that defines EPC S1-AP Service Access Point (SAP) interface.
Definition: epc-s1ap-sap.h:41
virtual ~EpcS1apSap()
Definition: epc-s1ap-sap.cc:25
MME side of the S1-AP Service Access Point (SAP), provides the MME methods to be called when an S1-AP...
Definition: epc-s1ap-sap.h:53
virtual void InitialContextSetupResponse(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabSetupItem > erabSetupList)=0
INITIAL CONTEXT SETUP RESPONSE message, see 3GPP TS 36.413 9.1.4.2.
virtual void InitialUeMessage(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t stmsi, uint16_t ecgi)=0
Initial UE message.
virtual void ErabReleaseIndication(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeReleasedIndication > erabToBeReleaseIndication)=0
As per 3GPP TS 36.413 version 9.8.0 section 8.2.3.2.2, the eNB indicates bearer release by sending an...
virtual void PathSwitchRequest(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t gci, std::list< ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList)=0
PATH SWITCH REQUEST message, see 3GPP TS 36.413 9.1.5.8.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
Template for the implementation of the EpcS1apSapEnb as a member of an owner class of type C to which...
Definition: epc-s1ap-sap.h:310
void InitialContextSetupRequest(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeSetupItem > erabToBeSetupList) override
Initial context setup request function.
Definition: epc-s1ap-sap.h:357
void PathSwitchRequestAcknowledge(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList) override
Path switch request acknowledge function.
Definition: epc-s1ap-sap.h:366
C * m_owner
owner class
Definition: epc-s1ap-sap.h:346
Template for the implementation of the EpcS1apSapMme as a member of an owner class of type C to which...
Definition: epc-s1ap-sap.h:197
void PathSwitchRequest(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList) override
Path switch request.
Definition: epc-s1ap-sap.h:295
void InitialUeMessage(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t imsi, uint16_t ecgi) override
Initial UE Message function.
Definition: epc-s1ap-sap.h:266
C * m_owner
owner class
Definition: epc-s1ap-sap.h:255
void ErabReleaseIndication(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeReleasedIndication > erabToBeReleaseIndication) override
ERAB Release Indiation function.
Definition: epc-s1ap-sap.h:276
void InitialContextSetupResponse(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabSetupItem > erabSetupList) override
Initial context setup response.
Definition: epc-s1ap-sap.h:286
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ErabToBeSetupItem structure.
Definition: epc-s1ap-sap.h:148
EpsBearer erabLevelQosParameters
Level QOS parameters.
Definition: epc-s1ap-sap.h:150
Ipv4Address transportLayerAddress
transport layer address
Definition: epc-s1ap-sap.h:151
E-RAB Setup Item IEs, see 3GPP TS 36.413 9.1.4.2.
Definition: epc-s1ap-sap.h:94
Ipv4Address enbTransportLayerAddress
transport layer address
Definition: epc-s1ap-sap.h:96
E-RAB Release Indication Item IEs, 3GPP TS 36.413 version 9.8.0 section 9.1.3.7.
Definition: epc-s1ap-sap.h:72