Commit Graph

320 Commits

Author SHA1 Message Date
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
Sukchan Lee 906e7c5046 [UPF] Consider RS message for IP spoofing (#1354) 2022-02-14 20:07:08 +09:00
Sukchan Lee 8bc584ce80 [CX] Update test code 2022-02-01 14:51:54 +09:00
Sukchan Lee 3b275edec7 [SBI] Remove one octet length in FQDN (#1333) 2022-01-23 13:49:03 +09:00
Sukchan Lee 866ae78f5e [NRF] fix the crash for invalid FQDN (#1333) 2022-01-22 09:34:38 +09:00
Pau Espin 68407efa16
[CORE] tlv_test: Fix trailing whitespace (#1337) 2022-01-22 06:44:08 +09:00
Sukchan Lee 79239d8eff [IMPORTANT] changed network_access_mode: 0 (#1323)
The network access mode of HSS has been changed to 0 (Packet and Circuit).

Versions of MME prior to v2.4.2 did not use this value. Open5GS set
the attach result of Attach Complete message as it is by looking
at the attach type of the Attach Request message.

Now, if the network access mode of HSS is set to 2 (Only Packet),
this value is affected by MME from v2.4.3. Regardless of the attach type
of the Attach Request, the MME will set EPS Only to the attach result
of Attach Complete.
2022-01-16 12:35:55 +09:00
Julian Lemmerich f75e51ca46
changed default ipv6 prefix to 2001:db8:cafe:: (#1321)
to be compliant with RFC3849
2022-01-14 11:50:27 +09:00
Sukchan Lee 2ed35f245d Fix the ciphered test program 2022-01-08 12:26:23 +09:00
Sukchan Lee 715e4c0b50 Shall cipher in the NAS message container IE
3GPP TS 24.501 version 16.6.0 Release 16
4.4 NAS security
4.4.6 Protection of initial NAS signalling messages

1) the UE needs to send non-cleartext IEs in a REGISTRATION REQUEST
or SERVICE REQUEST message, the UE includes the entire REGISTRATION
REQUEST or SERVICE REQUEST message (i.e. containing both cleartext IEs
and non-cleartext IEs) in the NAS message container IE and shall cipher
the value part of the NAS message container IE. The UE shall then send
a REGISTRATION REQUEST or SERVICE REQUEST message containing
the cleartext IEs and the NAS message container IE;
2022-01-05 22:39:06 +09:00
Sukchan Lee b6de06ee01 fix the test program bug 2022-01-04 17:27:28 +09:00
Sukchan Lee b988e7edce Use talloc for all memory pool (#1263) 2022-01-04 08:29:18 +09:00
Sukchan Lee 4f7bb847a9 fix the test program in VoNR 2021-12-11 22:11:36 +09:00
Sukchan Lee 5a85be09d6 [Test] fix the VoNR test program 2021-12-11 07:11:29 -05:00
Sukchan Lee 07a61018b2 [AMF] fix the crash (#1280)
During PDU Session Establishment,
if gNB sends PDUSessionResourceReleaseResponse,
AMF was crashed.

In this case, AMF/SMF remove Session Context and sends ErrorIndication.
2021-12-11 20:35:16 +09:00
Sukchan Lee 74bbc6ecbf [MME] Add S1AP debug (#1263) 2021-12-11 17:28:05 +09:00
Sukchan Lee acd67c7aa6 [5GC] Service Request Race Condition(#1226)
When UE-triggered and Network-triggered Service Request was occurred at
the same time, we need UPF deactivation and UEContextRelease
2021-11-28 20:54:51 +09:00
Sukchan Lee bfa34be222 fix the buffer overflow (CVE-2021-41794) 2021-11-15 15:49:58 +09:00
Sukchan Lee 0fb8279e36 VoNR added but not tested! 2021-11-14 21:07:56 +09:00
Sukchan Lee 0e5f438cdc fix the meson 0.60 build error (#1213) 2021-10-27 15:23:09 +09:00
Sukchan Lee 5d234cb108 [GTPv2-C] Fix the Create Bearer Request (#1201)
Use instance 2 instead of instance 1
2021-10-26 15:26:10 +09:00
Sukchan Lee 9ba4b317d2 Improve GTP message (#1201)
Extended Indication
Add Delay Value
2021-10-16 17:26:30 +09:00
Sukchan Lee 13f1b390ae CVE-2021-41794 from NCC Group by Mark Tedman
When connecting to the UPF port for the PFCP protocol (8805) and sending
an association setup request followed by a session establishment request
with a PDI Network Instance set to ‘internet’, it causes a stack corruption
to occur.

So, ogs_fqdn_parse() fixed.
2021-10-01 22:41:03 +09:00
Sukchan Lee e730530f7b [SMF] Exception handling in session release(#1155)
- UE changes the airplain-mode. However, it does not send PDU
    session complete message
    - Added exception handling for PDU session release
2021-09-04 16:14:18 +09:00
Sukchan Lee 831b29973f [PCF] fix the 'NULL' AfEvent in VoNR (#1120) 2021-08-08 09:10:37 +09:00
Sukchan Lee 039b9d0aaa SBI updated
- openapi-generator version 5.2.0
- add priority/capacity/load in NFProfile/NFService
- add AllowedNfTypes in NFProfile/NFService
2021-07-16 17:02:33 +09:00
Sukchan Lee 1326fc85dc [MME] fix the bug when GTPv2 conflict (#1095) 2021-07-15 21:20:56 +09:00
Sukchan Lee 4537142929 [EPC] Support ePDG Interface (#1039) 2021-06-21 22:36:38 +09:00
Sukchan Lee 118d62d42d Add more memory log 2021-06-06 22:35:46 +09:00
Sukchan Lee ef07ccfb88 fix the default SBI port (#997, #1008) 2021-05-30 10:35:01 +09:00
Sukchan Lee 899c121478 remove warning in MacOSX 2021-05-29 16:03:40 +09:00
Sukchan Lee fe89f7cd11 [5GC] Added BSF(Binding Support Function) 2021-05-29 15:56:12 +09:00
Sukchan Lee 3d11b87127 [AMF] Buffix for NON-initial NAS message (#1106)
Confirmation for non-cleartext IE should only be applied
to the initial NAS message. Registration requests and Service requests
with UplinkNASTransport do not have to.
2021-05-19 13:27:31 +09:00
Sukchan Lee f861919507 [AMF] asn1c decode error for APC_EXTENSIBLE (#994) 2021-05-14 16:46:08 +09:00
Sukchan Lee 5ea9b22209 [AMF] security protection (UERANSIM-issues316)
1. Allocate ngKSI other than the value already used.
2. Add the protection of Service request
3. fix SBI convert error ng_ap_cause
2021-05-08 13:24:17 +09:00
Sukchan Lee 1dc692753a [AMF] Distinguish Cleartext/Non-cleartext (#958)
1. If UE does not use a NAS container for Non-cleartext IEs,
   Open5GS AMF will send Registration reject message.
2. If UE sends Non-cleartext IEs without Integrity-protected,
   Open5GS AMF will send Registration reject message.
3. If UE does not send NAS container in Security mode complete message,
   Open5GS AMF will send Registration reject message.
2021-05-07 15:07:51 +09:00
Sukchan Lee 5901582281 [GTPv2] fix incorrect formatting PLMN-ID (#969) 2021-05-05 22:51:50 +09:00
Sukchan Lee e5a0dfb444 [SBI] fix the compile warning in MacOSX 2021-05-05 22:04:17 +09:00
Sukchan Lee dcfc9ef803 [AMF/MME] Add retransmission for accept message
Registration accept with GUTI
Attach accept
Tracking area update request with GUTI
2021-04-23 15:16:18 +09:00
Sukchan Lee ea89d8dc8e [AMF] Added RANConfigurationUpdate (#943) 2021-04-16 16:26:13 +09:00
Sukchan Lee cc03c91bdd [AMF] 5G-GUTI generation changed (#910)
The AMF shall assign a new 5G-GUTI for a particular UE:
a) during  a successful initial registration procedure;
b) during a successful registration procedure
   for mobility registration update; and
c) after a successful service request procedure invoked as a response
   to a paging request from the network and before the release
   of the N1 NAS signalling connection as specified in subclause 5.4.4.1.

The AMF should assign a new 5G-GUTI for a particular UE
during a successful registration procedure
for periodic registration update. The AMF may assign a new 5G-GUTI
at any time for a particular UE by performing
the generic UE configuration update procedure.
2021-04-13 17:34:25 +09:00
Sukchan Lee 83720fff9a fix: mobilty -> mobility (#930) 2021-04-13 10:02:52 +09:00
Sukchan Lee 27cee12a7b [Cx] User-Name can be skipped in SAR (#921) 2021-04-08 22:49:08 +09:00
Sukchan Lee 90f60cad0e misc: Add MSISDN duplicate check in WebUI 2021-04-07 22:45:37 +09:00
Sukchan Lee 26066bb0ca [Cx] LIR/LIA is added (#921) 2021-04-07 21:46:05 +09:00
Sukchan Lee d40348c00c [SBI] Unknown timezone offset (#914)
add a debug message for unknown timezone offset
2021-04-05 21:16:52 +09:00
Sukchan Lee 41c6bb4681 new: HSS Cx interface is added 2021-04-05 17:09:39 +09:00
Sukchan Lee bb38c01229 fix : Allow NSSAI in Registration accept (#910)
Always Present Allow NSSAI in Registration accept
2021-04-03 14:07:44 +09:00
Sukchan Lee 5f9785af52 sctp: Add sack_delay in sctp configuration (#895) 2021-04-01 15:40:46 +09:00
Sukchan Lee cc30aa2a9a fix: No S-TMSI in InitialUEMessage (#890) 2021-03-31 15:35:59 +09:00
Sukchan Lee 1e2a16fc5b fix: No Modify Bearer Request (#885)
Now MME send Modify Bearer Request regardless of the order of
Attach Complete and InitialContextSetupResponse
2021-03-29 22:35:34 +09:00
Sukchan Lee 829123dad0 fix: managing multiple calls (#869)
If PCRF sends RAR, it generates different Charging-Rule-Name.
2021-03-29 10:28:08 +09:00
Sukchan Lee 457230a2f6 doc: Re-install with updated source code 2021-03-28 20:44:31 +09:00
Sukchan Lee b22023afb8 fix: creating allowed NSSAI (#859)
AMF checks whether it can serve all the S-NSSAI(s) from
the Requested NSSAI present in the Subscribed S-NSSAIs
(potentially using configuration for mapping S-NSSAI values
between HPLMN and Serving PLMN), or all the S-NSSAI(s) marked
as default in the Subscribed S-NSSAIs in the case that
no Requested NSSAI was provided or none of the S-NSSAIs
in the Requested NSSAI are permitted,
i.e. do not match any of the Subscribed S-NSSAIs or not available
at the current UE's Tracking Area (see clause 5.15.3).
2021-03-25 23:06:59 +09:00
Sukchan Lee d0eec31f5c upf/sgwu: fix the PDR creation bug (#860)
When PDR is created without deleting session, there is a bug to create
new PDR.
2021-03-19 10:08:37 +09:00
Sukchan Lee 22b09443ce feat: E-RABModificationIndication/Confirm (#834) 2021-03-17 14:26:57 +09:00
Sukchan Lee 37e0a714f9 Fixes UE IPv6 BUG (#808) 2021-03-15 10:01:55 +09:00
Sukchan Lee 0270c0e340 ASN.1 encoding failure if no Request-NSSAI #844 2021-03-12 23:25:58 +09:00
Sukchan Lee a6e42a4932 fix: No S-NSSAI error during NAS signalling #845 2021-03-12 22:45:21 +09:00
Sukchan Lee fc5c9b2af0 Try to fix the UE infinite attach (#568)
If both Delete-Session-Request/Response and
UEContextReleaseCommand/UEContextReleaseComplete are failed at the same time,
UE cannot attach to the EPC infinitely.

So, I've add the protection code
if timer expires when MME does not receive Delete-Session-Response.
2021-03-09 14:28:07 +09:00
Sukchan Lee 9af4268bab arch: DB schema Changes (#796)
- New function : NSSF
- New feature : SMF selection
2021-03-08 21:25:09 +09:00
Sukchan Lee 852756f902 test: Porting FreeBSD 2021-02-08 14:25:40 -05:00
Sukchan Lee 7901a1164f mac: Support Apple M1 chips
See https://open5gs.org/open5gs/docs/platform/05-macosx-apple-silicon/
2021-02-06 00:13:48 -05:00
Sukchan Lee 5e839e25fe fix: amf crash bug (#793) 2021-02-03 23:49:16 -05:00
Sukchan Lee e7cb25ac9b asn1c: MME crash is resolved (#783) 2021-02-02 14:27:03 -05:00
Sukchan Lee f47f65a51c fix: asn1c decode problem for NGReset (#773) 2021-02-02 13:33:09 -05:00
Sukchan Lee d9417be9a6 feat: Handling Duplicated PDU Session ID
TS29.502 5.2.2.3.11 AMF requested PDU Session Release due to duplciated
PDU Session Id
2021-02-01 10:14:27 -05:00
Sukchan Lee ff5236f3e0 feat: Indirect Data Forwarding in N2-Handover 2021-01-31 23:01:15 -05:00
Sukchan Lee 388e64213f etc: miscellaneous work (#779)
o Check IMEISV length == 16 digits
o Add Relative Capabity comment in the configuration file
2021-01-29 00:10:17 -05:00
Sukchan Lee 49a9e58efe feat: Add N2-Handover 2021-01-28 14:23:54 -05:00
Sukchan Lee ada01fca8f spec: S1AP/NGAP update to v16.4.0(2021-01-04) 2021-01-24 23:43:42 -05:00
Sukchan Lee 61778f9142 fix: UE Context Request IE handling (#771) 2021-01-23 13:42:59 -05:00
Sukchan Lee 776d323a16 fix: Change UE Context Request IE handling (#771)
Previously, AMF would sends PDUSessionResourceSetupRequest
when the following conditions were met:
- gNB didn't send UE Context Request IE of InitialUEMessage
- AMF should send SMF generated TRANSFER message(PDU_RES_SETUP_REQ)
to the gNB

However, in issues #771, the gNB did not accept
PDUSessionResourceSetupRequest. Perhaps the gNB engineer thought
that if gNB needs to send data traffic to the UE, AMF should send
an InitialContextSetupRequest regardless of UE Context Request IE.
This is because gNB requires the kgNB security context
for data connection.

So, in this case, Open5GS-AMF decided to send
an InitialContexSetupRequest regardless of
whether it received UE Context Request IE of InitialUEMessage.
2021-01-23 11:56:04 -05:00
Sukchan Lee 9eac90252e fix: AMF/SMF/UDM crash issues resolved (#770/#771) 2021-01-22 22:17:01 -05:00
Sukchan Lee c9363b1320 5gc: Paging was added 2021-01-18 11:48:35 -05:00
Sukchan Lee 5fb0611cb2 fix: Derive ESM cause from GTP-Cause (#755) 2021-01-10 23:36:12 -05:00
Sukchan Lee d17ea0f135 fix: update test code 2021-01-08 22:30:31 -05:00
Sukchan Lee b4358fe703 fix: Add dedicated bearer activation reject (#755) 2021-01-08 15:09:02 -05:00
Sukchan Lee e531ccab5a fix: The SBI time string converting error in 32bit 2021-01-08 10:42:51 -05:00
Sukchan Lee 31cc259ee4 fix: release error 2021-01-08 00:24:00 -05:00
Sukchan Lee 7b29cdf898 Handling UEContextRequest of InitialUEMessage 2021-01-07 22:26:06 -05:00
Sukchan Lee a96d3ca0fa feat: Add multiple session 2021-01-03 23:29:01 -05:00
Sukchan Lee 70a7bac6b2 feat: Add 5G Core Xn Handover (#726) 2021-01-03 00:50:59 -05:00
Sukchan Lee 79b0552bb0 test: for checking issues #736 2020-12-31 21:55:11 -05:00
Sukchan Lee 235a041b8d feat: Add dedicated QoS flow 2020-12-31 21:07:08 -05:00
Sukchan Lee efd1780745 fix: update NRF issues (#727,#728,#729,#730) 2020-12-24 15:41:31 -05:00
Sukchan Lee 371e22c96b fix: AMF sets default DNN if UE does not send it. 2020-12-21 14:49:05 -05:00
Sukchan Lee 198abc6e8b Add PCF(Policy Control Function) 2020-12-11 14:03:20 -05:00
Sukchan Lee 33edd12335 fix: UPF is not working with Landslide (#685)
* Flow-Description use 'to assigned' in Gx Interface
* Support SDF Filter ID
* Support F-TEID's Choose
* BAR(Buffering) is added in PFCP session
* Default Apply Action uses NOCP|BUFF
2020-12-03 01:16:57 -05:00
Sukchan Lee 2c2b6dfcaf Use HTTP/2 instead of HTTP/1.1 in 5G Core SBI 2020-11-26 21:44:37 -05:00
Sukchan Lee f0b9a35962 [#672] Fix DL data is not working in 5G Core 2020-11-19 07:47:26 -05:00
Sukchan Lee 23e8e6577c Update ogs_pollset library
- Fix the ogs_pollset_remove() bug in select(WIN32), kqueue(MacOSX)
- Modify to enable ogs_pollset_remove() in pollset callback handler
2020-11-09 22:57:14 -05:00
Sukchan Lee f1a207fd9b Support VoLTE service in ECM-IDLE 2020-11-07 17:27:12 -05:00
Sukchan Lee ad85c12513 checking for APN/DNN in case insensitive #617 2020-11-02 11:45:14 -05:00
Sukchan Lee 21595426b2 Fix the bug of the TAU update result value #568 2020-11-01 22:50:41 -05:00
Sukchan Lee 3fef5848b8 Oops! Fix the PDN connectivity reject handler #568 2020-11-01 00:54:32 -04:00
Sukchan Lee aa81bb2c89 Fix the bug #619
When missing Activate default EPS bearer context accept
between UE and eNB, MME's exception handler has a bug.

So I've fixed it!
2020-10-23 13:48:39 -04:00
Sukchan Lee 15e42bc4a9 Fix MME crash when VoLTE is enabled [#619] 2020-10-22 17:53:13 -04:00
Sukchan Lee 1bed0d5872 [#568] Add GTP-U Error Indication Handling
So far, no operation was performed when Error Indication was received
from eNodeB. For that reason, I solved #568 issues by controlling
the MME to prevent this from happening.

Now, when GTP-U Error Indication is received, MME and SGW are implemented
to do what they have to do. I hope that the network can be restored
by responding appropriately even if Error Indication occurs.
2020-10-20 20:00:02 -04:00
Sukchan Lee c244dcc5e9 Fix the DIAMETER_MISSING_AVP on Rx #610 2020-10-16 14:05:49 -04:00