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,6 @@
ies = []
ies.append({ "ie_type" : "EBI", "ie_value" : "List of RABs", "presence" : "C", "instance" : "0", "comment" : "Shall be present on S4 interface when this message is used to release a subset of all active RABs according to the RAB release procedure.Several IEs with this type and instance values shall be included as necessary to represent a list of RABs to be released."})
ies.append({ "ie_type" : "Node Type", "ie_value" : "Originating Node", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be sent on S11 interface, if ISR is active in the MME.This IE shall be sent on S4 interface, if ISR is active in the SGSNSee NOTE 1."})
ies.append({ "ie_type" : "Indication", "ie_value" : "Indication Flags", "presence" : "CO", "instance" : "0", "comment" : "This IE shall be included if any one of the applicable flags is set to 1.Applicable flags are:Abnormal Release of Radio Link: This flag shall be set to 1 on the S11 interface - if the S1 release is due to an abnormal release of the radio link, e.g. when the MME receives UE CONTEXT RELEASE REQUEST with the cause value set to Radio Connection With UE Lost, or- if the MME performs DL data buffering and the operator specified policy/configuration conditions for triggering the PGW pause of charging are met (e.g. number/fraction of packets/bytes dropped at MME in downlink) as specified in clause 5.3.6A of 3GPP TS23.401 [3]."})
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, the MME shall include this IE on the S11 interface if it has received Secondary RAT usage data from eNodeB in a Connection Suspend, or S1 release procedure. 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