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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.cat>
7 */
8
9#ifndef EPC_S1AP_SAP_H
10#define EPC_S1AP_SAP_H
11
12#include "eps-bearer.h"
13
14#include <ns3/address.h>
15#include <ns3/ipv4-address.h>
16#include <ns3/object.h>
17#include <ns3/ptr.h>
18
19#include <list>
20
21namespace ns3
22{
23
24/**
25 * \ingroup lte
26 *
27 * Base class that defines EPC S1-AP Service Access Point (SAP) interface.
28 */
30{
31 public:
32 virtual ~EpcS1apSap();
33};
34
35/**
36 * \ingroup lte
37 *
38 * MME side of the S1-AP Service Access Point (SAP), provides the MME
39 * methods to be called when an S1-AP message is received by the MME.
40 */
42{
43 public:
44 /**
45 * Initial UE message.
46 *
47 * \param mmeUeS1Id in practice, we use the IMSI
48 * \param enbUeS1Id in practice, we use the RNTI
49 * \param stmsi in practice, the imsi
50 * \param ecgi in practice, the cell Id
51 */
52 virtual void InitialUeMessage(uint64_t mmeUeS1Id,
53 uint16_t enbUeS1Id,
54 uint64_t stmsi,
55 uint16_t ecgi) = 0;
56
57 /**
58 * E-RAB Release Indication Item IEs, 3GPP TS 36.413 version 9.8.0 section 9.1.3.7
59 */
61 {
62 uint8_t erabId; ///< E-RAB ID
63 };
64
65 /**
66 * \brief As per 3GPP TS 36.413 version 9.8.0 section 8.2.3.2.2, the eNB
67 * indicates bearer release by sending an E-RAB RELEASE INDICATION message
68 * towards MME
69 *
70 * \param mmeUeS1Id in practice, we use the IMSI
71 * \param enbUeS1Id in practice, we use the RNTI
72 * \param erabToBeReleaseIndication List of bearers to be deactivated
73 */
75 uint64_t mmeUeS1Id,
76 uint16_t enbUeS1Id,
77 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication) = 0;
78
79 /**
80 * E-RAB Setup Item IEs, see 3GPP TS 36.413 9.1.4.2
81 */
83 {
84 uint16_t erabId; ///< E-RAB ID
85 Ipv4Address enbTransportLayerAddress; ///< transport layer address
86 uint32_t enbTeid; ///< TEID
87 };
88
89 /**
90 * INITIAL CONTEXT SETUP RESPONSE message, see 3GPP TS 36.413 9.1.4.2
91 *
92 * \param mmeUeS1Id in practice, we use the IMSI
93 * \param enbUeS1Id in practice, we use the RNTI
94 * \param erabSetupList List of ERAB setup
95 *
96 */
97 virtual void InitialContextSetupResponse(uint64_t mmeUeS1Id,
98 uint16_t enbUeS1Id,
99 std::list<ErabSetupItem> erabSetupList) = 0;
100
101 /**
102 * E-RABs Switched in Downlink Item IE, see 3GPP TS 36.413 9.1.5.8
103 */
105 {
106 uint16_t erabId; ///< ERAB ID
108 uint32_t enbTeid; ///< TEID
109 };
110
111 /**
112 * PATH SWITCH REQUEST message, see 3GPP TS 36.413 9.1.5.8
113 *
114 * \param enbUeS1Id in practice, we use the RNTI
115 * \param mmeUeS1Id in practice, we use the IMSI
116 * \param gci GCI
117 * \param erabToBeSwitchedInDownlinkList List of ERAB to be switched in downlink
118 */
119 virtual void PathSwitchRequest(
120 uint64_t enbUeS1Id,
121 uint64_t mmeUeS1Id,
122 uint16_t gci,
123 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList) = 0;
124};
125
126/**
127 * \ingroup lte
128 *
129 * eNB side of the S1-AP Service Access Point (SAP), provides the eNB
130 * methods to be called when an S1-AP message is received by the eNB.
131 */
133{
134 public:
135 /// ErabToBeSetupItem structure
137 {
138 uint8_t erabId; ///< ERAB iD
139 EpsBearer erabLevelQosParameters; ///< Level QOS parameters
140 Ipv4Address transportLayerAddress; ///< transport layer address
141 uint32_t sgwTeid; ///< TEID
142 };
143
144 /**
145 * Initial context setup request
146 *
147 * \param mmeUeS1Id in practice, we use the IMSI
148 * \param enbUeS1Id in practice, we use the RNTI
149 * \param erabToBeSetupList List of ERAB to be setup
150 */
151 virtual void InitialContextSetupRequest(uint64_t mmeUeS1Id,
152 uint16_t enbUeS1Id,
153 std::list<ErabToBeSetupItem> erabToBeSetupList) = 0;
154
155 /**
156 * E-RABs Switched in Uplink Item IE, see 3GPP TS 36.413 9.1.5.9
157 */
159 {
160 uint8_t erabId; ///< E_RAB ID
161 Ipv4Address transportLayerAddress; ///< transport layer address
162 uint32_t enbTeid; ///< TEID
163 };
164
165 /**
166 * PATH SWITCH REQUEST ACKNOWLEDGE message, see 3GPP TS 36.413 9.1.5.9
167 *
168 * \param enbUeS1Id in practice, we use the RNTI
169 * \param mmeUeS1Id in practice, we use the IMSI
170 * \param cgi CGI
171 * \param erabToBeSwitchedInUplinkList List of ERAB to be switched in uplink
172 */
174 uint64_t enbUeS1Id,
175 uint64_t mmeUeS1Id,
176 uint16_t cgi,
177 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList) = 0;
178};
179
180/**
181 * Template for the implementation of the EpcS1apSapMme as a member
182 * of an owner class of type C to which all methods are forwarded
183 */
184template <class C>
186{
187 public:
188 /**
189 * Constructor
190 *
191 * \param owner the owner class
192 */
193 MemberEpcS1apSapMme(C* owner);
194
195 // Delete default constructor to avoid misuse
197
198 // inherited from EpcS1apSapMme
199 /**
200 * Initial UE Message function
201 * \param mmeUeS1Id in practice, we use the IMSI
202 * \param enbUeS1Id in practice, we use the RNTI
203 * \param imsi the IMSI
204 * \param ecgi ECGI
205 */
206 void InitialUeMessage(uint64_t mmeUeS1Id,
207 uint16_t enbUeS1Id,
208 uint64_t imsi,
209 uint16_t ecgi) override;
210 /**
211 * ERAB Release Indiation function
212 * \param mmeUeS1Id in practice, we use the IMSI
213 * \param enbUeS1Id in practice, we use the RNTI
214 * \param erabToBeReleaseIndication List of ERAB to be release indication
215 */
217 uint64_t mmeUeS1Id,
218 uint16_t enbUeS1Id,
219 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication) override;
220
221 /**
222 * Initial context setup response
223 * \param mmeUeS1Id in practice, we use the IMSI
224 * \param enbUeS1Id in practice, we use the RNTI
225 * \param erabSetupList List of ERAB setup
226 */
227 void InitialContextSetupResponse(uint64_t mmeUeS1Id,
228 uint16_t enbUeS1Id,
229 std::list<ErabSetupItem> erabSetupList) override;
230 /**
231 * Path switch request
232 * \param enbUeS1Id in practice, we use the RNTI
233 * \param mmeUeS1Id in practice, we use the IMSI
234 * \param cgi CGI
235 * \param erabToBeSwitchedInDownlinkList List of ERAB to be switched in downlink
236 */
238 uint64_t enbUeS1Id,
239 uint64_t mmeUeS1Id,
240 uint16_t cgi,
241 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList) override;
242
243 private:
244 C* m_owner; ///< owner class
245};
246
247template <class C>
249 : m_owner(owner)
250{
251}
252
253template <class C>
254void
256 uint16_t enbUeS1Id,
257 uint64_t imsi,
258 uint16_t ecgi)
259{
260 m_owner->DoInitialUeMessage(mmeUeS1Id, enbUeS1Id, imsi, ecgi);
261}
262
263template <class C>
264void
266 uint64_t mmeUeS1Id,
267 uint16_t enbUeS1Id,
268 std::list<ErabToBeReleasedIndication> erabToBeReleaseIndication)
269{
270 m_owner->DoErabReleaseIndication(mmeUeS1Id, enbUeS1Id, erabToBeReleaseIndication);
271}
272
273template <class C>
274void
276 uint16_t enbUeS1Id,
277 std::list<ErabSetupItem> erabSetupList)
278{
279 m_owner->DoInitialContextSetupResponse(mmeUeS1Id, enbUeS1Id, erabSetupList);
280}
281
282template <class C>
283void
285 uint64_t enbUeS1Id,
286 uint64_t mmeUeS1Id,
287 uint16_t cgi,
288 std::list<ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownlinkList)
289{
290 m_owner->DoPathSwitchRequest(enbUeS1Id, mmeUeS1Id, cgi, erabToBeSwitchedInDownlinkList);
291}
292
293/**
294 * Template for the implementation of the EpcS1apSapEnb as a member
295 * of an owner class of type C to which all methods are forwarded
296 */
297template <class C>
299{
300 public:
301 /**
302 * Constructor
303 *
304 * \param owner the owner class
305 */
306 MemberEpcS1apSapEnb(C* owner);
307
308 // Delete default constructor to avoid misuse
310
311 // inherited from EpcS1apSapEnb
312 /**
313 * Initial context setup request function
314 * \param mmeUeS1Id in practice, we use the IMSI
315 * \param enbUeS1Id in practice, we use the RNTI
316 * \param erabToBeSetupList List of ERAB to be setup
317 */
318 void InitialContextSetupRequest(uint64_t mmeUeS1Id,
319 uint16_t enbUeS1Id,
320 std::list<ErabToBeSetupItem> erabToBeSetupList) override;
321 /**
322 * Path switch request acknowledge function
323 * \param enbUeS1Id in practice, we use the RNTI
324 * \param mmeUeS1Id in practice, we use the IMSI
325 * \param cgi CGI
326 * \param erabToBeSwitchedInUplinkList List of ERAB to be switched in uplink
327 */
329 uint64_t enbUeS1Id,
330 uint64_t mmeUeS1Id,
331 uint16_t cgi,
332 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList) override;
333
334 private:
335 C* m_owner; ///< owner class
336};
337
338template <class C>
340 : m_owner(owner)
341{
342}
343
344template <class C>
345void
347 uint16_t enbUeS1Id,
348 std::list<ErabToBeSetupItem> erabToBeSetupList)
349{
350 m_owner->DoInitialContextSetupRequest(mmeUeS1Id, enbUeS1Id, erabToBeSetupList);
351}
352
353template <class C>
354void
356 uint64_t enbUeS1Id,
357 uint64_t mmeUeS1Id,
358 uint16_t cgi,
359 std::list<ErabSwitchedInUplinkItem> erabToBeSwitchedInUplinkList)
360{
361 m_owner->DoPathSwitchRequestAcknowledge(enbUeS1Id,
362 mmeUeS1Id,
363 cgi,
364 erabToBeSwitchedInUplinkList);
365}
366
367} // namespace ns3
368
369#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...
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.
virtual ~EpcS1apSap()
MME side of the S1-AP Service Access Point (SAP), provides the MME methods to be called when an S1-AP...
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:80
Ipv4 addresses are stored in host order in this class.
Template for the implementation of the EpcS1apSapEnb as a member of an owner class of type C to which...
void InitialContextSetupRequest(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeSetupItem > erabToBeSetupList) override
Initial context setup request function.
void PathSwitchRequestAcknowledge(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< ErabSwitchedInUplinkItem > erabToBeSwitchedInUplinkList) override
Path switch request acknowledge function.
Template for the implementation of the EpcS1apSapMme as a member of an owner class of type C to which...
void PathSwitchRequest(uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t cgi, std::list< ErabSwitchedInDownlinkItem > erabToBeSwitchedInDownlinkList) override
Path switch request.
void InitialUeMessage(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, uint64_t imsi, uint16_t ecgi) override
Initial UE Message function.
void ErabReleaseIndication(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabToBeReleasedIndication > erabToBeReleaseIndication) override
ERAB Release Indiation function.
void InitialContextSetupResponse(uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::list< ErabSetupItem > erabSetupList) override
Initial context setup response.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ErabToBeSetupItem structure.
EpsBearer erabLevelQosParameters
Level QOS parameters.
Ipv4Address transportLayerAddress
transport layer address
E-RAB Setup Item IEs, see 3GPP TS 36.413 9.1.4.2.
Ipv4Address enbTransportLayerAddress
transport layer address
E-RAB Release Indication Item IEs, 3GPP TS 36.413 version 9.8.0 section 9.1.3.7.