A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
epc-enb-s1-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.es>
7 */
8
9#ifndef EPC_ENB_S1_SAP_H
10#define EPC_ENB_S1_SAP_H
11
12#include "eps-bearer.h"
13
14#include <ns3/ipv4-address.h>
15
16#include <list>
17
18namespace ns3
19{
20
21/**
22 * This class implements the Service Access Point (SAP) between the
23 * LteEnbRrc and the EpcEnbApplication. In particular, this class implements the
24 * Provider part of the SAP, i.e., the methods exported by the
25 * EpcEnbApplication and called by the LteEnbRrc.
26 */
28{
29 public:
30 virtual ~EpcEnbS1SapProvider();
31
32 /**
33 * Initial UE message.
34 *
35 * \param imsi IMSI
36 * \param rnti RNTI
37 */
38 virtual void InitialUeMessage(uint64_t imsi, uint16_t rnti) = 0;
39
40 /**
41 * \brief Triggers epc-enb-application to send ERAB Release Indication message towards MME
42 * \param imsi the UE IMSI
43 * \param rnti the UE RNTI
44 * \param bearerId Bearer Identity which is to be de-activated
45 */
46 virtual void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId) = 0;
47
48 /// BearerToBeSwitched structure
50 {
51 uint8_t epsBearerId; ///< Bearer ID
52 uint32_t teid; ///< TEID
53 };
54
55 /// PathSwitchRequestParameters structure
57 {
58 uint16_t rnti; ///< RNTI
59 uint16_t cellId; ///< cell ID
60 uint32_t mmeUeS1Id; ///< mmeUeS1Id in practice, we use the IMSI
61 std::list<BearerToBeSwitched> bearersToBeSwitched; ///< list of bearers to be switched
62 };
63
64 /**
65 * Path Switch Request
66 *
67 * \param params
68 */
70
71 /**
72 * Release UE context at the S1 Application of the source eNB after
73 * reception of the UE CONTEXT RELEASE X2 message from the target eNB
74 * during X2-based handover
75 *
76 * \param rnti RNTI
77 */
78 virtual void UeContextRelease(uint16_t rnti) = 0;
79};
80
81/**
82 * This class implements the Service Access Point (SAP) between the
83 * LteEnbRrc and the EpcEnbApplication. In particular, this class implements the
84 * User part of the SAP, i.e., the methods exported by the LteEnbRrc
85 * and called by the EpcEnbApplication.
86 */
88{
89 public:
90 virtual ~EpcEnbS1SapUser();
91
92 /**
93 * Parameters passed to InitialContextSetupRequest ()
94 */
96 {
97 uint16_t rnti; /**< the RNTI identifying the UE */
98 };
99
100 /**
101 * Initial context setup request
102 *
103 * \param params Parameters
104 */
106
107 /**
108 * Parameters passed to DataRadioBearerSetupRequest ()
109 */
111 {
112 uint16_t rnti; /**< the RNTI identifying the UE for which the
113 DataRadioBearer is to be created */
114 EpsBearer bearer; /**< the characteristics of the bearer to be setup */
115 uint8_t bearerId; /**< the EPS Bearer Identifier */
116 uint32_t gtpTeid; /**< S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1 */
117 Ipv4Address transportLayerAddress; /**< IP Address of the SGW, see 36.423 9.2.1 */
118 };
119
120 /**
121 * Request the setup of a DataRadioBearer
122 *
123 * \param params Parameters
124 */
126
127 /// PathSwitchRequestAcknowledgeParameters structure
129 {
130 uint16_t rnti; ///< RNTI
131 };
132
133 /**
134 * Request a path switch acknowledge
135 *
136 * \param params Parameters
137 */
139};
140
141/**
142 * Template for the implementation of the EpcEnbS1SapProvider as a member
143 * of an owner class of type C to which all methods are forwarded
144 */
145template <class C>
147{
148 public:
149 /**
150 * Constructor
151 *
152 * \param owner the owner class
153 */
155
156 // Delete default constructor to avoid misuse
158
159 // inherited from EpcEnbS1SapProvider
160 void InitialUeMessage(uint64_t imsi, uint16_t rnti) override;
161 void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId) override;
162
164 void UeContextRelease(uint16_t rnti) override;
165
166 private:
167 C* m_owner; ///< owner class
168};
169
170template <class C>
172 : m_owner(owner)
173{
174}
175
176template <class C>
177void
179{
180 m_owner->DoInitialUeMessage(imsi, rnti);
181}
182
183template <class C>
184void
186 uint16_t rnti,
187 uint8_t bearerId)
188{
189 m_owner->DoReleaseIndication(imsi, rnti, bearerId);
190}
191
192template <class C>
193void
195{
196 m_owner->DoPathSwitchRequest(params);
197}
198
199template <class C>
200void
202{
203 m_owner->DoUeContextRelease(rnti);
204}
205
206/**
207 * Template for the implementation of the EpcEnbS1SapUser as a member
208 * of an owner class of type C to which all methods are forwarded
209 */
210template <class C>
212{
213 public:
214 /**
215 * Constructor
216 *
217 * \param owner the owner class
218 */
219 MemberEpcEnbS1SapUser(C* owner);
220
221 // Delete default constructor to avoid misuse
223
224 // inherited from EpcEnbS1SapUser
228
229 private:
230 C* m_owner; ///< owner class
231};
232
233template <class C>
235 : m_owner(owner)
236{
237}
238
239template <class C>
240void
242{
243 m_owner->DoInitialContextSetupRequest(params);
244}
245
246template <class C>
247void
249{
250 m_owner->DoDataRadioBearerSetupRequest(params);
251}
252
253template <class C>
254void
257{
258 m_owner->DoPathSwitchRequestAcknowledge(params);
259}
260
261} // namespace ns3
262
263#endif // EPC_ENB_S1_SAP_H
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication.
virtual void UeContextRelease(uint16_t rnti)=0
Release UE context at the S1 Application of the source eNB after reception of the UE CONTEXT RELEASE ...
virtual void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId)=0
Triggers epc-enb-application to send ERAB Release Indication message towards MME.
virtual void PathSwitchRequest(PathSwitchRequestParameters params)=0
Path Switch Request.
virtual void InitialUeMessage(uint64_t imsi, uint16_t rnti)=0
Initial UE message.
This class implements the Service Access Point (SAP) between the LteEnbRrc and the EpcEnbApplication.
virtual void PathSwitchRequestAcknowledge(PathSwitchRequestAcknowledgeParameters params)=0
Request a path switch acknowledge.
virtual void DataRadioBearerSetupRequest(DataRadioBearerSetupRequestParameters params)=0
Request the setup of a DataRadioBearer.
virtual void InitialContextSetupRequest(InitialContextSetupRequestParameters params)=0
Initial context setup request.
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 EpcEnbS1SapProvider as a member of an owner class of type C to...
void DoSendReleaseIndication(uint64_t imsi, uint16_t rnti, uint8_t bearerId) override
Triggers epc-enb-application to send ERAB Release Indication message towards MME.
void InitialUeMessage(uint64_t imsi, uint16_t rnti) override
Initial UE message.
void PathSwitchRequest(PathSwitchRequestParameters params) override
Path Switch Request.
void UeContextRelease(uint16_t rnti) override
Release UE context at the S1 Application of the source eNB after reception of the UE CONTEXT RELEASE ...
Template for the implementation of the EpcEnbS1SapUser as a member of an owner class of type C to whi...
void DataRadioBearerSetupRequest(DataRadioBearerSetupRequestParameters params) override
Request the setup of a DataRadioBearer.
void PathSwitchRequestAcknowledge(PathSwitchRequestAcknowledgeParameters params) override
Request a path switch acknowledge.
void InitialContextSetupRequest(InitialContextSetupRequestParameters params) override
Initial context setup request.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PathSwitchRequestParameters structure.
std::list< BearerToBeSwitched > bearersToBeSwitched
list of bearers to be switched
uint32_t mmeUeS1Id
mmeUeS1Id in practice, we use the IMSI
Parameters passed to DataRadioBearerSetupRequest ()
EpsBearer bearer
the characteristics of the bearer to be setup
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
uint32_t gtpTeid
S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1.
Ipv4Address transportLayerAddress
IP Address of the SGW, see 36.423 9.2.1.
Parameters passed to InitialContextSetupRequest ()
PathSwitchRequestAcknowledgeParameters structure.