Commit Graph

17 Commits

Author SHA1 Message Date
Sukchan Lee e0a487f479 [SMF] Optimiza Session Modification Message
For video in VoNR, multiple QosFlow is required in one session.

In the past, since only one Session Modification Message was supported,
QoS-Flow was put into several Session Messages one by one and processed.

Now that multiple QoS-Flows can be supported,
it is optimized to process one session modification message.
2022-05-15 23:35:41 +09:00
Pau Espin fe7f9d85bb
[SMF] Store IMEI from GTPv1C/2C and append AVP in Gy CCR (#1535) 2022-05-14 21:32:32 +09:00
Pau Espin 99f59be5d7
[SMF] Store Charging Characteristics IE from GTPv1C/2C and append AVP in Gy CCR (#1532) 2022-05-13 06:32:20 +09:00
Sukchan Lee 4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Pau Espin 11d4be1779
[SMF] Store Selection Mode IE from GTPv1C/2C and append as 3GPP-Selection-Mode AVP in Gy CCR (#1530)
* [GTPv1C] Make Selection Mode IE uint8

* [SMF] Store Selection Mode in GTPv1C and GTPv2C

* [SMF] Gy CCR: append 3GPP-Selection-Mode AVP
2022-05-12 22:43:12 +09:00
Pau Espin 5d478e2488
Pespin/pr (#1529)
* [SMF] rename function s/gtp/gtp2/

* [SMF] Store GTPC version in session

So far we always depended on an xact being present in the code path in
order to know which kind of session it is (GTPv1C vs GTPv2C). Let's
instead store that information in smf_sess_t so that we have it always
available in an easy way.

* [SMF] Move smf_sess_t GTPv1C specifics into gtp substruct

* [SMF] Gy CCR: append 3GPP-NSAPI AVP
2022-05-12 21:42:45 +09:00
Supreeth Herle 6ffdce598a
Fix attach reject when ULA subscription data does not contain MSISDN (#1524)
Issue:
When the ULA - Subscription Data does not contain MSISDN, the Create Session Request
from MME to SGW does not contain MSISDN IE resulting in SMF throwing following log

smf        | 05/09 15:20:53.683: [smf] ERROR: No MSISDN (../src/smf/s5c-handler.c:82)
sgwc       | 05/09 15:20:53.683: [sgwc] ERROR: No Context in TEID (../src/sgwc/s5c-handler.c:104)
mme        | 05/09 15:20:53.683: [mme] ERROR: No Context in TEID (../src/mme/mme-s11-handler.c:122)

As per 3GPP TS 29.274 version 16.5.0, table 7.2.1-1: MSISDN IE shall only be included
in Create Session Request if its provided in subscription data from the HSS. This commit
fixes this by removing the mandatory MSISDN IE check in SMF.
2022-05-10 21:23:03 +09:00
Pau Espin 76fecdb54e
[SMF] Store MSISDN from GTPC and pass it in Gy CCR (#1519) 2022-05-04 05:37:44 +09:00
Pau Espin aa6f3ef8d6
[SMF] gn-handler: Fix typo in error message (#1517) 2022-05-03 21:14:19 +09:00
Pau Espin 2de12e32f4
[SMF] Integrate session tear down cycle into sess->sm (#1500)
* [SMF] smf_sm.c Fix indentation

* [SMF] gsm-sm: log fsm events

* [SMF] Integrate session tear down cycle into sess->sm
2022-04-20 21:42:18 +09:00
Pau Espin e61b469489
[SMF] Inegrate session setup cycle into sess->sm (#1489)
It allows for much better control on the lifecycle of the session, and
already shows some missing tear down paths in case of errors.
It also clarifies the existence of "sess" pointer in several paths.

The code also becomes clearer overall, since all the transitions and
logic to send next messages are put together.

Tear down of the session will be integrated into gsm-sm in a follow-up
patch.

The 5gc session setup is only partially moved to gsm-sm, and left as an
exercise for users wishin to improve 5gc support.
2022-04-14 10:30:58 +09:00
Pau Espin e3da7c9934
Rename GTPv2C specifics to gtp2 prefix (#1485)
In the past only GTPv2C was supported, and had the "gtp" generic prefix.
Later on, GTPv1C support was added, and "gtp1" prefix was used.
Let's move GTPv2C specific bits to have "gtp2" prefix too, and leave
"gtp" prefix for generic stuff among different GTP versions.
2022-04-13 07:07:39 +09:00
Pau Espin 51a75cde26
Pespin/pr (#1395)
* [SMF] Gn: Avoid assert crash if no PDP resources available

* [SMF] Gn: Rearrange IE handling order in CreatePDPContextRequest

Let's handle the GTPC remote addr + TEID first, since those should be
used in the CreatePDPContextResponse ideally if available.

Let's then handle parsing of all IEs not related to bearers/UserPlane,
then those missing, and finally do all the IP resource allocation.
2022-02-25 22:39:44 +09:00
Pau Espin 3833a73a14
[SMF] incorrect GTPv1C cause with changed APN (#1387) 2022-02-23 20:48:36 +09:00
Pau Espin 5ad1b188e4
[SMF] UpdatePDPContext: forward update of remote TEID+IPaddr to UPF (#1383)
* [SMF] typo fixes in commented code

* [SMF] Fix early err return handling UpdatePDPContextRequest

* [SMF] UpdatePDPContext: forward update of remote TEID+IPaddr to UPF

Updating the remote GTP-U IP address and/or TEID on the GGSN is a common
practice, used for instance by an SGSN in a UTRAN network to connect an
HNB(GW) to exchange GTP-U directly with the GGSN. It is also used in
general when doing handovers.
When receiving a UpdatePDPContext with the new address, we need to
forward the update to the UPF so that it takes it into account when
forwarding packets.

This patch only implements updating the information towards the UPF when
GTPv1C is used. Similar approach for GTPv2C (upon receival of Modify
Bearer Request) is still unimplemented.

Related: https://github.com/open5gs/open5gs/issues/1367
2022-02-23 20:21:33 +09:00
Pau Espin b7698810ac
[SMF] s/'Context not found'/'Non-existent'/ in {Update,Delete}PdpContextResponse (#1379)
TS 29.060 sections 7.3.4 and 7.3.6 specify the possible cause values for
UpdatePdpContextResponse and DeletePdpContextResponse.
Together with section 8.2, it becomes clear that 'Non-existent' cause
should be sent instead of 'Context not found' one in those cases.
2022-02-21 22:18:39 +09:00
Pau Espin 8cc70694db
Introduce Gn interface (GTPv1C) Support to PGW (#1351)
* [CORE] tlv: Store mode in ogs_tlv_t

This allows specifying the format of the IE for each individual IE,
hence allowing messages containing IEs formatted in different ways.

This is needed in order to support parsing GTPv1-C, since messages
contain IEs with different structure (TLV vs TV). Hence, this is a
preparation patch to add support for parsing TVs in ogs-tlv.c/.h.

* [CORE] tlv: Support parsing msg with both TLV and TV in it

IEs of type TV are sometimes used in GTPv1-C. Current tlv parser/builder
doesn't provide with ways to parse messages which contain TV formatted
IEs. This patch adds the relevant types and ways to encode/decode them.

Furthermore, the current parser/builder allows parsing/building messages
containing the exact same format in all its IEs. A new parser function
is added which allows parsing messages of different types (TV, TLV)
mixed in the same message. In order to be able to do so, it uses the
general msg_mode passed to it in order to know the general TLV format
(in essence, the length of the Tag field, and also the length of the
Length field if applicable each IE).

Looking up the instance in the TLV description is left undone and
hadcoded to 0, since the only user so far requiring this API is GTPv1-C,
which has no instances.

* [CORE] tlv: Support repeated tag+instance parsing TLV message

In GTPv2C, repeated IEs (same tag) are easily differentiated by the
Instance byte, which provides info to match different decoded
structures. In GTPv1C though, there's no Instance byte, and we still
encounter repeated IEs (like GSN Address in Create PDP Context Request).
Hence, the TLV decoder needs to be updated to track count of IEs found
(identified by tag+instance, where instance is always 0 in GTPv1C) and
get the proper description index + offset into the decoded structure.

* [GTP]: Move GTPv2-C specifics to its own libgtp subdir

This will allow adding GTPv1-C code by the side. Most GTPv2 code is left
in this patch as "gtp" instead of renaming it to "gtp2" in order to
avoid massive changes. It can be done at a later stage if wanted.

* [GTP] Support generating GTPv1-C messages

* [SMF] Add Gn interface support

This patch introduces GTPv1C support to open5gs-smfd. With it,
open5gs-becomes a GGSN too, where SGSN can connect to, hence supporting
GERAN and UTRAN networks.
2022-02-18 22:23:45 +09:00