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.
This commit is contained in:
Pau Espin Pedrol 2022-02-18 14:23:45 +01:00 committed by GitHub
parent 3eab4be135
commit 8cc70694db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
146 changed files with 9199 additions and 538 deletions

View file

@ -0,0 +1,9 @@
ies = []
ies.append({ "ie_type" : "Indication", "ie_value" : "Indication Flags", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included if any one of the applicable flags is set to 1.Applicable flags are:ISRAI: This flag shall be set to 1 if ISR is established between the MME and the S4 SGSN for an S1-based Handover without SGW relocation and for an X2-based Handover without SGW relocation. Change F-TEID support Indication: This flag shall be set to 1 for an IDLE state UE initiated TAU procedure to allow the SGW changing the GTP-U F-TEID.S11-U Tunnel Flag: this flag shall be set to 1 on the S11 interface if user data is transported in NAS signalling."})
ies.append({ "ie_type" : "F-TEID", "ie_value" : "Sender F-TEID for Control Plane", "presence" : "C", "instance" : "0", "comment" : "The new MME shall include this IE on the S11 interface for a TAU/Handover with MME change and without any SGW change. If the SGW receives this IE and if it finds that its value is the same as the earlier received value of this IE for this UE, it should interpret this to mean that the MME has not changed."})
ies.append({ "ie_type" : "Delay Value", "ie_value" : "Delay Downlink Packet Notification Request", "presence" : "C", "instance" : "0", "comment" : "This IE shall be sent for a UE triggered Service Request and UE initiated Connection Resume procedures. It shall contain the delay the SGW shall apply between receiving downlink data and sending Downlink Data Notification for all UEs served by that MME (see clause 5.3.4.2 of 3GPP TS 23.401 [3])."})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be modified", "presence" : "C", "instance" : "0", "comment" : "Several IEs with the same type and instance value may be included as necessary to represent a list of Bearers to be modified.See NOTE 1."})
ies.append({ "ie_type" : "Bearer Context", "ie_value" : "Bearer Contexts to be removed", "presence" : "C", "instance" : "1", "comment" : "This IE shall be included for the TAU/Handover, UE initiated Connection Resume and Service Request procedures where any of the bearers existing before the TAU/Handover procedure, UE initiated Connection Resume and Service Request procedures will be deactivated as consequence of the TAU/Handover procedure, UE initiated Connection Resume and Service Request procedures. For the Service Request and UE initiated Connection Resume procedures, all unaccepted bearers for this UE shall be included.For each of those bearers, an IE with the same type and instance value, shall be included.See NOTE 1."})
ies.append({ "ie_type" : "Recovery", "ie_value" : "Recovery", "presence" : "C", "instance" : "0", "comment" : "This IE shall be included if contacting the peer for the first time. "})
ies.append({ "ie_type" : "Secondary RAT Usage Data Report", "ie_value" : "Secondary RAT Usage Data Report", "presence" : "CO", "instance" : "0", "comment" : "If the PLMN has configured secondary RAT usage reporting, and if the Secondary RAT usage data is not intended for the PGW(s) for any of active PDN Connections, the MME shall include this IE on the S11 interface if it has received Secondary RAT usage data from eNodeB in an X2-based handover without Serving GW relocation, S1-based handover without MME or SGW relocation, or E-UTRAN initiated E-RAB modification procedure.The MME shall also include this IE on the S11 interface if it has received a Secondary RAT Usage Data Report from the source MME in an S1-based handover with MME relocation but without SGW relocation.The MME shall set the IRPGW flag to 0, to indicate that the IE shall not be forwarded to the PGW.Several IEs with the same type and instance value may be included, to represent multiple usage data reports."})
msg_list[key]["ies"] = ies