Commit Graph

2293 Commits

Author SHA1 Message Date
Sukchan Lee e42048e8a5
Reset the number of TA, SLICE, and PLMN supported by AMF/MME(#2761) (#2765)
* update it

* update it

* update it

* update it

* update it

* udpate it

* uupdate it
2023-12-03 23:52:29 +09:00
Sukchan Lee f68a1f3283
[AMF] Modification to context setup (#2729) (#2764)
Send out PduModifySessionRequest while no other PDU-related procedure is
in progress (i.e. InitialContextSetupResponse was alreay received).
2023-12-01 23:20:18 +09:00
Sukchan Lee ab64ff9514
[IPv6] Fixed to include MTU in SLAAC RA (#2754) (#2758) 2023-11-28 17:38:51 +09:00
Oliver Smith 5070ddfa3e
[MME] [AMF] Add no_time_zone_information param (#2745)
Allow network operators to omit the time zone in the 4G EMM Information
and 5G Configuration Update. This is useful for better compatibility
with some UEs.

The parameter is optional according to:
* 4G: 3GPP TS 24.301 Table 8.2.13.1
* 5G: 3GPP TS 24.501 Table 8.2.19.1.1
2023-11-27 22:26:12 +09:00
gstaa 060acee5df
[AMF] Fix Nudm_SDM_Get for re-registration (#2751)
Bug:

In case that AMF does not have subscription data for the UE,
PDU session remains unreleased after implicit de-registeration.

The exact test case:
- UE registered (integrity protection applied)
- UE deregistered (Nudm_SDM_Unsubscribe, Nudm_UECM_Registration (purgeFlag))
- UE registered, PDU session activated

    UE data are still stored in AMF. So if integrity protected applies,
    the steps 4 - 14 [ETSI TS 123 502 V16.7.0](https://www.etsi.org/deliver/etsi_ts/123500_123599/123502/16.07.00_60/ts_123502v160700p.pdf) are skipped.
    Only AM Policy Association Establishment is performed.
- UE is moved out of radio coverage, 2 x (4 min + Timer t3512) expires

Result: UE is implicitly de-registered, PDU session is not released

The steps of implicit de-registeration:
  1. Implicit Timer Expiration
  2. UDM_SDM_Unsubscribe
  3. UDM_UECM_Deregistration
  4. PDU session release request
  5. PDUSessionResourceReleaseCommand + PDU session release command
  6. PDUSessionResourceReleaseResponse
  7. AM_Policy_Association_Termination

So PDU session release is performed after the confirmation of
UDM_UECM_Deregistration.
Since there is no UDM_SDM subscription, the UDM steps are skipped
and PDU session is not released.

Fix:

If the AMF does not have subscription data for the UE which registers,
the AMF registers with the UDM using Nudm_UECM_Registration and
retrieves subscription data with Nudm_SDM_Get.

[ETSI TS 123 502 V16.7.0](https://www.etsi.org/deliver/etsi_ts/123500_123599/123502/16.07.00_60/ts_123502v160700p.pdf), 4.2.2.2.2 General Registration, 14a-c:
> If the AMF does not have subscription data for the UE, the AMF retrieves the Access and Mobility Subscription data, SMF
> Selection Subscription data, UE context in SMF data and LCS mobile origination using Nudm_SDM_Get.
2023-11-27 22:19:29 +09:00
Sukchan Lee ee964f48dd
[AMF/MME] Fixed crash when receiving invalid packet (#2737) (#2755) 2023-11-27 22:16:11 +09:00
Sukchan Lee ab1c3493c6 [NRF] Fixed crash due to invalid PATCH body (#2735) 2023-11-25 22:03:28 +09:00
Sukchan Lee 7278714133 [AMF] Fixed Nudm_UECM_Registration crash (#2733)
1. UE sends RegistrationRequest to AMF.
2. AMF sends Nudm_UECM_Registration to UDM.
3. UE sends RegistrationRequest to AMF.
4. GMM state is gmm_state_authentication
5. UDM sends Nudm_UECM_Registration response to AMF.
6. AMF crashs since no Handler in gmm_state_authentication state
2023-11-25 21:21:23 +09:00
Bostjan Meglic adcdcf6426
[SBI] Change discovery option TAI from array to single item (#2725)
According to 3GPP TS 29.510, the search parameter "tai" should be a
single item, not an array of items.

TS 29.510: Table 6.2.3.2.3.1-1:
URI query parameters supported by the GET method on this resource

Revert "[SBI] Change discovery option TAI from array to single item"

This reverts commit b4beff1ae16c64b3c6d84d8bdb47c36e19b705f2.

wip
2023-11-22 20:37:06 +09:00
Sukchan Lee e92293e0af
[SEPP] Initial Update for 5G Roaming (#2739)
[SEPP] Initial Update for 5G Roaming
2023-11-19 19:34:51 +09:00
Pau Espin 9d7dc91f21
[SMF] Gy: Keep sending extra AVPs in INITIAL_REQUEST (#2721)
This commit splits filling Requested-Service-Unit, Used-Service-Unit and
QoS-Information into their own helper functions for better readibility,
and then partially reverts 125740727e,
where lots of AVPs were left out of INITIAL_REQUEST messagesi during the
changes made.
After looking through 3GPP TS 32.299 and rfc4006, it seems expected to
send Requested-Service-Unit only during INITIAL_REQUEST, and
Used-Service-Unit during UPDATE_REQUEST, so that part is kept.

However, I am not able to find clear indications that AVPs such as QoS
Information and RAT-Type should not be sent during INITIAL_REQUEST.
So, since we have the info, better set it already during
INITIAL_REQUEST, since the OCS may want to grant different resources
based on that information if available too.
2023-11-01 03:19:10 +09:00
Šimon Lukašík 490a3ecb99
A minor typo fix (#2707)
* minor typo fix

* typo fix: faimly -> family
2023-10-28 22:11:58 +09:00
Sukchan Lee e9c15f57e3 Follow-up on #2706 2023-10-28 21:51:08 +09:00
Bostjan Meglic 18fba0d3db
Delete authentication data on UE deregistration (#2706)
* [AUSF] Fix removing UE context on authentication removal request

AUSF crashed when trying to access ausf_ue->sm fields after they were
already deleted.

* [AMF] Delete UE authentication result after UE deregisters from 5G core

Based on TS 29.509 - 5.2.2.2.5 Authentication Result Removal with 5G AKA
method:
In the case that the Purge of subscriber data in AMF after the UE
deregisters from the network or the NAS SMC fails following the
successful authentication in the registration procedure, the NF Service
Consumer (AMF) requests the AUSF to inform the UDM to remove the
authentication result.
2023-10-28 21:48:33 +09:00
Sukchan Lee b2be7393a0
[AMF] Fixed TAC configuration error (#2700) (#2711) 2023-10-28 21:30:32 +09:00
Sukchan Lee e3c2fd00d9 [SBI] Do not raise ASSERT when not enough CLIENT pool (#2701) 2023-10-25 21:40:37 +09:00
Sukchan Lee d406fbeb92 Fixed incorrect SMF selection in Multi-SMF (#2557) 2023-10-23 22:40:35 +09:00
Sukchan Lee 783defc52f [SMF] Remove unused varaible in gy-handler.c 2023-10-18 07:09:54 +09:00
Sukchan Lee de7b094191
Merge branch 'main' into sigscale-ocs 2023-10-18 06:54:29 +09:00
Sukchan Lee 7da45cde66 [AMF] mac_failed should be initialized (#2679)
amf_ue->mac_failed flag to be cleared during security mode procedure but it was not.
At this point, the only way to cleare the amf_ue->mac_failed flag is by UE Context Release.
But I'd like to connect UEs as fast as possible without UE Context Release.
2023-10-17 22:28:23 +09:00
Pau Espin 79d3c7078f hss: Don't send IDR for Operator-Determined-Barring changes if Subscriber-Status=SERVICE_GRANTED 2023-10-14 11:41:43 +09:00
Pau Espin e108d6297c HSS: Add support for Operator-Determined-Barring field
* Add "subscriber_status" cmd to open5gs-dbctl to set values for
  "subscriber_status" and "operator_determined_barring" DB fields.
* Add webui View+Edit for those same fields.
* open5gs-hssd now takes those values into account and submits
  Operator-Determined-Barring AVP with DB-retrieved value if
subscriber_status is set to OPERATOR_DETERMINED_BARRING.

For more information, see TS 29.272 section 5.2.2.1.3  and 7.3.30.
2023-10-12 07:17:54 +09:00
Emanuele Di Pascale 7ea37ef618 smf: don't assert if we run out of IPs
currently if no IP address is available from the configured
subnets in the SMF when attempting to assign an IP to an UE
we assert and the SMF crashes. Handle the error more gracefully
by returning an error cause instead.
2023-10-11 20:42:31 +09:00
Sukchan Lee 53fe8f1e6d [MME] SGaAP-MO-CSFB-INDICATION w/ TAI/ECGI (#2664)
Added TAI/ECGI to the SGaAP-MO-CSFB-INDICATION message.
2023-10-11 20:37:12 +09:00
Pau Espin cb114eca5e cosmetic: HSS: Fix trailing whitespace 2023-10-10 08:04:01 +09:00
Sukchan Lee 3f9ca906da [PCF] Remove SM Policy Association Terminatation (#2650) 2023-10-04 20:27:47 +09:00
Sukchan Lee 445bf26ef2 [AUSF] Fixed crash due to ausf_ue_add (#2637) 2023-09-25 22:33:03 +09:00
Sukchan Lee d4f2b545a3 [SBI] Fixed invalid format of subscrCond (#2630)
The format of subscrCond must be 'oneOf'.
2023-09-24 09:01:59 +09:00
Sukchan Lee 8a3dbd44ae [MME] Protection code for No IMSI (#2613, #2614) 2023-09-16 22:27:21 +09:00
Sukchan Lee a3a683e5a6 [MME] Implement ENBConfigurationUpdate (#2589) 2023-09-16 20:58:58 +09:00
Sukchan Lee 05ed95d623 [GTPU] Fixed PDCP SN handling (#2584, #2477)
Scenario is handover on S1AP, data forwarding is enabled, and
the Source ENB is forwarding DL PDCP packets to EPC(SGWU)
with PDCP SN included. SGWU is also forwarding these packets
to the Target ENB.

However the PDCP SN is not present in the forwarded packets
from SGWU to Target ENB.

I modified this part, and there was the same problem in 5GC, fixed it as well.

A lot of code in GTP-U has been modified,
so if you have any problems, please let us know right away.
2023-09-10 22:37:42 +09:00
Sukchan Lee 260eabb317 [SMF] Invalid Message(SmContextCreateData) (#2590)
curl --noproxy '*' --http2-prior-knowledge -X POST --header "Content-Type: multipart/related" --data-binary @pdu http:/192.168.29.231:7777/nsmf-pdusession/v1/sm-contexts
Attaching file 'pdu'

SMF crashes as not able to decode the message properly. SmContextCreateData is not accessible.
2023-09-07 22:38:45 +09:00
Sukchan Lee 2aa12449aa [NRF] Fixed NRF crash when Custom nfType (#2576)
NF Instance Registration to reproduce crash:

curl -v -X PUT -d '{"nfInstanceId":"0b8a8d59-af80-4fb7-8645-b832fd69d94a","nfType":"CUSTOM_INF","nfStatus":"REGISTERED","ipv4Addresses":["127.0.13.37"]}' --http2-prior-knowledge http://127.0.0.10:7777/nnrf-nfm/v1/nf-instances/0b8a8d59-af80-4fb7-8645-b832fd69d94a
2023-09-05 22:11:19 +09:00
Sukchan Lee 2f8ae91b0b Fixed dynamic-stack-buffer-overflow (#2578, #2577) 2023-09-05 21:58:05 +09:00
Sukchan Lee 298fed260b [UDM] Fixed crash for invalid SUCI (#2571)
Modifications were made to resolve the following assertion..

Invalid HNET PKI Value [0] (../lib/sbi/conv.c:135)
ogs_supi_from_supi_or_suci: Expectation `supi' failed. (../lib/sbi/conv.c:262)
udm_ue_add: Assertion `udm_ue->supi' failed. (../src/udm/context.c:144)
backtrace() returned 8 addresses (../lib/core/ogs-abort.c:37)
2023-09-04 07:03:16 +09:00
Sukchan Lee dcdf821542 [AMF] amf_ue_set_suci: Assertion `suci` (#2567)
Cannot convert SUCI in `Not implemented SUPI format [4]`
2023-09-03 17:59:10 +09:00
theodorsm d5eff9e24a Fix typo and remove trailing whitespaces in nas-security 2023-09-02 08:24:24 +09:00
Sukchan Lee 654fe4010c [GTP] gtp_message_fuzz: Abrt in ogs_abort
See below for details.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59414
2023-08-24 22:19:42 +09:00
Sukchan Lee 04f7958420 [SMF] Deregister issue during sess release (#2537)
A situation in which you establish two sessions and release both of them.

In the first SESSION, the UE normally sent PDUSessionResourceReleaseResponse
and PDU session release complete. However, these were not sent when releasing
the second SESSION.

At this point, when the UE tried to do a deregistration,
the SMF was not properly handling the exception.

I've just fixed this.
2023-08-24 21:26:23 +09:00
Sukchan Lee 4b0bade80e [TLV] PFCP parser crash from FuzzingLabs (#2523) 2023-08-18 22:19:46 +09:00
Sukchan Lee fc4072590e [SMF] Added SMF registrations (#2514, #2524) 2023-08-18 20:21:08 +09:00
Sukchan Lee e01f46eb6c
Use x1000 multiplier for Kbps, Mbps, ... etc. (#2515)
NAS, GTP, PFCP, SBI, all except S1AP/NGAP use x1000 multiplier for Kbps, Mbps, Gbps ... etc.

From now on in WebUI all units also use a multiplier of x1000.
2023-08-13 18:19:45 +09:00
Sukchan Lee af67b2486b [SBI] UDR stores PEI instead of PCF 2023-08-13 11:49:01 +09:00
Sukchan Lee d33d67b2af [AMF/MME] Defaults 9 minutes for T3412/T3512 2023-08-13 11:16:06 +09:00
Sukchan Lee e625f9222a [AMF/MME] Follow-up on #2491 2023-08-11 09:44:19 +09:00
Sukchan Lee e7f7c4274e [SMF] Fix crash on double policy deletion (#2489) 2023-08-10 22:14:48 +09:00
Sukchan Lee 93e05f481b S1Setup failure with invalid MCC/MNC (#2491) 2023-08-10 15:40:05 +09:00
Sukchan Lee 84ed9a0dd3 UE slice shall be also available in RAN (#2482)
Changed to that registration can be accepted only
when the UE slice is available in the RAN slice.
2023-08-09 16:06:39 +09:00
gstaa f22fbb45da
[UPF] Fix wrong number of QoS flows metric (#2490) 2023-08-08 22:32:06 +09:00
Sukchan Lee 9f19210f22 Add trace log for debugging #2287 2023-08-07 22:13:35 +09:00
Sukchan Lee 5764f7267d Fixed security vulnerability for malformed packet 2023-07-26 16:32:46 +09:00
Sukchan Lee b116f077a5
UPF HA - release/establish new PDU session in CM_IDLE (#2471)
See also #2396, #2418
2023-07-25 22:38:38 +09:00
Sukchan Lee b08b2adc6c [AMF/MME] Remove code that doesn't work (#2013)
Based on the standard document below, when the UE is in the IDLE state,
we checked the implicit timer and tried to send a message to the UE,
but it doesn't work properly.

So, first of all, I deleted the related code.

- TS 24.301 Ch 5.3.7
If ISR is not activated, the network behaviour upon expiry of
the mobile reachable timer is network dependent, but typically
the network stops sending paging messages to the UE on the
first expiry, and may take other appropriate actions

- TS 24.501 Ch 5.3.7
The network behaviour upon expiry of the mobile reachable timer is network dependent,
but typically the network stops sending paging messages to the UE on the first expiry,
and may take other appropriate actions.
2023-07-23 14:54:06 +09:00
Robert Dash 04d402dee6 fix tap mode arp table poisoning 2023-07-22 06:41:44 +09:00
Sukchan Lee 3d62100071 Added missing memory release (#2441, #2450) 2023-07-20 09:40:01 +09:00
Pau Espin e222557f88 [MME] rework sgsn default route config in mme.yaml
Move the config to the sgsn node instead of having a specific route with
specific format "default: route", since anyway internally it's already
applied to the sgsn object.
2023-07-20 06:29:20 +09:00
Sukchan Lee 178d1ff986 Fixed build failure in osmocom/open5gs 2023-07-18 23:20:43 +09:00
Sukchan Lee 7a9d5e57b0 [AMF] Implicit Deregistration (Reset, ConnRefused)
When AMF release the NAS signalling connection,
ran_ue context is removed by ran_ue_remove() and
amf_ue/ran_ue is de-associated by amf_ue_deassociate().

In this case, implicit deregistration is attempted
by the mobile reachable timer according to the standard document,
and amf_ue will be removed by amf_ue_remove().

TS 24.501
5.3.7 Handling of the periodic registration update timer and

Start AMF_TIMER_MOBILE_REACHABLE
mobile reachable timer
The network supervises the periodic registration update procedure
of the UE by means of the mobile reachable timer.
If the UE is not registered for emergency services,
the mobile reachable timer shall be longer than the value of timer
T3512. In this case, by default, the mobile reachable timer is
4 minutes greater than the value of timer T3512.
The mobile reachable timer shall be reset and started with the
value as indicated above, when the AMF releases the NAS signalling
connection for the UE.
2023-07-18 22:27:14 +09:00
Pau Espin 11d10fb009 mme: s1ap: Split rx HandoverRequired handling based on HandoverType
This is a preparation towards adding other handover types in the future.
2023-07-18 10:09:30 +09:00
Emanuele Di Pascale 154bff2764 mme: fix missing memset in mme_fd_init
The 'data' struct used to specify the diameter dispatch options for the
MME callbacks was not being initialized properly, which meant that the
App id could contain garbage. This was preventing the callbacks from
being invoked when receiving ISD/CLR requests.
2023-07-18 09:59:20 +09:00
Sukchan Lee 00415b857b Follow-up on #2443 2023-07-18 09:51:45 +09:00
mitmitmitm 02dd09e122 [SMF] Reply with error instead of crashing when IP pool is exhausted 2023-07-18 09:47:22 +09:00
Sukchan Lee eb34bf6e2c Follow-up on #2428 2023-07-18 08:48:22 +09:00
Sukchan Lee 70ec192d8e Fixed the build error 2023-07-17 10:53:17 +09:00
Sukchan Lee 8535ceab8c [HSS] Modify where to check mongodb version (#2425) 2023-07-15 23:52:13 +09:00
Pau Espin 5c0c8ec4f2 mme: s1ap: Implement tx of MME DIRECT INFORMATION TRANSFER
Triggered when receiving a GTPv1C RAN Information Relay message on
Gn interface, targeted at one of the eNBs under the MME.
2023-07-15 23:44:57 +09:00
Pau Espin 158bd79bdd mme: s1ap: Implement rx of eNB DIRECT INFORMATION TRANSFER
If destination is a GERAN network, attempt to use the new Gn interface
to forward it to an SGSN if configured to do so.
2023-07-15 23:44:57 +09:00
Pau Espin 84ed735204 mme: Introduce initial Gn iface (GTPv1C) support
This interface allows supporting several inter-RAT mobility features
towards pre-rel8-SGSNs (SGSNs without S3/S4 GTPV2C interface).

Related specs:
- 3GPP TS 23.401:
-- "5.6 Network Assisted Cell Change"
-- "5.15 RAN Information Management (RIM) procedures"
--  "Annex D"
- 3GPP TS 23.060 (general GERAN<->GERAN mobility)
- 3GPP TS 29.060
2023-07-15 23:44:57 +09:00
Sukchan Lee 9ba20f6e22 Follow-up on #2428 2023-07-15 23:30:32 +09:00
mitmitmitm c43444233b [SMF] Don't abort session tear-down on PCF error 2023-07-15 23:29:24 +09:00
mitmitmitm 6273ca5c43 [SMF] Reject session on PFCP sess. est. timeout 2023-07-15 23:29:24 +09:00
mitmitmitm 9cef0f14e3 [SMF] On sess. est. fail, don't reply to AMF twice on the same stream 2023-07-15 23:29:24 +09:00
mitmitmitm bae6444262 [AMF] Handle N1N2MessageTransfer sess. est. reject from SMF 2023-07-15 23:29:24 +09:00
Pau Espin 715038b6d9 cosmetic: mme: Fix trailing whitespace in several files 2023-07-11 21:52:24 +09:00
Matthias Bräuer 946a28ab6c [NRF] Fix crash due to failing assertion on OPTIONS request 2023-07-11 11:14:27 +09:00
Robert Dash 26141ee2b5 fix boot-looping of UPF with interface in TAP mode 2023-07-01 23:48:46 +09:00
Sukchan Lee d1f3ce304d Follow-up on #2399 2023-07-01 23:20:56 +09:00
Bostjan Meglic f616037460 [AMF] Fix search for correct SMF based on SmfInfo
Each SMF's NfProfile can contain multiple SmfInfo items. The issue was
that AMF checked only the first SmfInfo for correct S-NSSAI/NR-TAI
information.

In case of a 5G core setup with SMF handling 2 or more slices, and UE
trying to establish multiple PDU sessions, AMF would report an error
when trying to find the correct serving SMF.

[amf] ERROR: [1:0] (NF discover) No [nsmf-pdusession] (../src/amf/nnrf-handler.c:85)
2023-07-01 23:18:48 +09:00
Gaber Stare 12c0310328 [SMF] Decrease sessions metric on OLD Session Release
Since [redesign](8553c77733)
of fivegs_smffunction_sm_sessionnbr gauge, the metric doesn't
expose some decrements. The decreasing of gauge had been
moved out of function stats_remove_smf_session.

It should be decreased every time stats_remove_smf_session
is called, but this particular case is easily reproducible
by killing UPF while the session is established.
2023-06-21 22:11:52 +09:00
Daniel Willmann ef60207c1e [SMF] Fix Gx/Gy assert() if more than 64 CCRs are sent
The current code uses the cc request number as an index to the
transaction array (xact/xact_data). Since cc request number is a 32 bit
integer this is unfeasible for longer sessions and if more than a
handful of messages are exchanged per session.

The array size was already increased in #2038 which simply delays the
issue.
Furthermore, the current code asserts that cc_request_number is <=
MAX_CC_REQUEST_NUMBER which leads to an out-of-bounds write if
cc_request_number == MAX_CC_REQUEST_NUMBER.

Instead use a smaller array and index into it using cc_request_number
% array size. More than 2 requests should never be in flight at any one
time (initial or update request together with a termination request) so
an array size of 4 should be fine.
2023-06-21 22:07:32 +09:00
Bostjan Meglic 93bcd7fda7 [SMF] Fix a use-after-free bug 2023-06-15 18:33:20 +09:00
Bostjan Meglic 1e64d6602a [AMF,SMF,PCF] Rename the function for calculating NF Instance load
- have a more consistent naming among the NF's
- always have the same prefix (amf_/smf_/pcf_) depending on the NF
- function name is always the same, how the function calculates the load
is NF specific and internal to the function itself (but not the function
name).
2023-06-13 20:44:48 +09:00
Bostjan Meglic 8671b0cc78 [PCF] Fix calculation of NF Instance load information
- the 'if' clause was comparing some value with an always '1' due to
wrong calculation. Consequently, this 'if' statement never executed.
- sizes for session pool and UE pools are directly linked between each
other. We need to count the number of items only in one of the pools to
correctly represent the NF load
- if anything, we should also check the load of the application pool to
determine correct load of the NF
2023-06-13 20:44:48 +09:00
EugeneBogush 31deecb03f fix Gy for 3GPP-User-Location-Info 2023-06-13 06:02:15 +09:00
Pau Espin 3a4116123f [SMF] Fix typo in log line 2023-06-07 22:34:22 +09:00
mitmitmitm 9f5be6c356 [SMF/PFCP] Send framed routes in both UL and DL pdrs 2023-06-03 09:20:16 +09:00
Sukchan Lee f969309f11 [CORE] Rollback ogs_pool_init/final (#2339)
ogs_pool_init() shall be used in the initialization routine.
Otherwise, memory will be fragment since this function uses system malloc()

Compared with ogs_pool_init()

ogs_pool_create() could be called while the process is running,
so this function should use ogs_malloc() instead of system malloc()
2023-05-28 22:50:28 +09:00
Sukchan Lee 31f95ce2e0 [SBI] Fixed Invalid S-NSSAI format (#2337) 2023-05-28 21:53:52 +09:00
Alexander Couzens c8b81094db [HSS] SWx: SAR & MAR: set mandatory User-Name on failure cases
Multimedia-Auth-Answer and Server-Assignment-Answer
defines the AVP User-Name as mandatory. It must also be
present on failure cases.

See 3GPP TS 29.273 Rel 17.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2023-05-25 22:48:54 +09:00
mitmitmitm 928a80ef26 [PFCP] Support PFCP advertise address in F-SEID 2023-05-25 22:46:52 +09:00
Eugene Bogush b391cc589d relocation of user-location-info on top level 2023-05-25 22:42:54 +09:00
Gaber Stare 6856dfd6b7 [SMF] Expose metrics for nr. of PDU session creations
[ETSI TS 128 552 V16.9.0](https://www.etsi.org/deliver/etsi_ts/128500_128599/128552/16.09.00_60/ts_128552v160900p.pdf):

Registration type label is not provided.
A nonstandard PLMNID label is added to achieve uniqueness.

- 5.3.1.3 Number of PDU sessions requested to be created by the SMF

PLMNID and SNSSAI are defined during PDU session creation processing.
Some requests can be rejected during processing before label values are known.
Those requests are not counted under particular labels.
To count also such requests, the basic metric with empty labels is exposed too.

```
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="",snssai=""} 1
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="00101",snssai="1000009"} 1
```

- 5.3.1.4 Number of PDU sessions successfully created by the SMF
```
fivegs_smffunction_sm_pdusessioncreationsucc{plmnid="00101",snssai="1000009"} 1
```

- 5.3.1.5 Number of PDU sessions failed to be created by the SMF
```
fivegs_smffunction_sm_pdusessioncreationfail{cause="400"} 1
```

Example for one successful and one failed (during creation processing) PDU session creation:

```
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="",snssai=""} 2
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="00101",snssai="1000009"} 1

fivegs_smffunction_sm_pdusessioncreationsucc{plmnid="00101",snssai="1000009"} 1

fivegs_smffunction_sm_pdusessioncreationfail{cause="400"} 1
```
2023-05-25 21:38:15 +09:00
Sukchan Lee 34f3faba47 [PCF] Always expose SNSSAI label (#2320) 2023-05-25 21:15:01 +09:00
Sukchan Lee 691d8ea13a [AMF] Fixed crashes with assertion (#2312)
AMF crashes with amf_nnssf_nsselection_handle_get assertion failure.
2023-05-21 07:51:43 +09:00
Sukchan Lee 5c7263a5e5 [AMF/MME] Fixed crashes by M-TMSI (#2307) 2023-05-14 10:37:29 +09:00
Sukchan Lee e567a01ae8 [SGWU/UPF] Fixed crashed by gTPTunnel (#2313)
SGWU/UPF crashes with ogs_pfcp_setup_far_gtpu_node
by a special crafted gTPTunnel.transportLayerAddress
2023-05-14 10:19:37 +09:00
Sukchan Lee 16387078cd [AMF] Fixed crash if served_tai_index < 0 (#2059) 2023-05-14 09:07:32 +09:00
Sukchan Lee 63df530bb4 [SBI] Fixed a bug with encoder/decoder of scpPorts
(#2310, #2274)
2023-05-14 07:05:23 +09:00
Sukchan Lee 7ce1137a10 [SMF] Disable Network Service request while ACTIVATING
Disable Network triggered service request
while UE triggered service request

(#2294)
2023-05-08 22:33:50 +09:00
Sukchan Lee 4265b2a2bc [MME] try to fix the #2287 issue 2023-05-05 18:06:25 +09:00
Shigeru Ishida 0c3fd10c24 [MME] add facility to select smf(pgwu) by tac and e_cell_id.
[mme.yaml]
# o SMF selection by eNodeB TAC
#   (either single TAC or multiple TACs, DECIMAL representation)
#
#   gtpc:
#     - addr: 127.0.0.4
#       tac: 26000
#     - addr: 127.0.2.4
#       tac: [25000, 27000, 28000]
#
# o SMF selection by e_cell_id(28bit)
#   (either single or multiple e_cell_id, HEX representation)
#
#   gtpc:
#     - addr: 127.0.0.4
#       e_cell_id: abcde01
#     - addr: 127.0.2.4
#       e_cell_id: [12345, a9413, 98765]
2023-05-05 10:23:46 +05:00
Sukchan Lee 7580d3df16 Follow-up #2551 2023-04-22 07:53:22 +09:00
Sukchan Lee e0f6ba3571 Merge branch 'gh_upf_metrics_wrong_dnn' of https://github.com/gstaa/open5gs into gstaa-gh_upf_metrics_wrong_dnn 2023-04-22 07:30:28 +09:00
Sukchan Lee 01d3db4b6e [MME/SMF] Added Extended-PCO in 4G/LTE (#2261) 2023-04-22 00:06:50 +09:00
Sukchan Lee de7e0d3b45 [SBI] Fixed an issue with FQDN/TLS (#2252) 2023-04-21 22:37:07 +09:00
gstaa 9e0467e534
Merge branch 'main' into gh_upf_metrics_wrong_dnn 2023-04-17 06:47:15 +02:00
Sukchan Lee aed52a9ad8 [GTP-U] Send Error Indication for unknown PDR 2023-04-16 12:30:36 +09:00
Sukchan Lee d2e2a58232 [PFCP] Implement the Restoration Indication 2023-04-16 12:30:36 +09:00
Sukchan Lee 642d9e2e18 [PFCP/GTP] SEID/TEID Randomness (#1303) 2023-04-16 12:30:36 +09:00
Gaber Stare 2e3d287afc [UPF metrics] Use APN/DNN to expose dnn label
SMF started to provide APN/DNN in PFCP Establishment.
APN/DNN is used to provide dnn label of metric fivegs_upffunction_upf_qosflows.
2023-04-14 05:14:23 +00:00
Bostjan Meglic 7686507eaa [AMF] Fix N2 Handover - copy PDU session info
After N2 Handover (1 AMF, multiple gNB's) was successfully executed, the
PDU session was not properly released afterwards on PDU Session Release
Request from UE.

The reason was that after N2 Handover the new 'ran_ue' context did not
have any information about the active PDU sessions.

Copy the information about PDU sessions from old ran_ue context to the
new one.
2023-04-13 21:27:40 +09:00
Abdelmuhaimen Seaudi 69831c43f5 add support for sigscale ocs
added several changes to correctly work with sigscal ocs offline charging
2023-04-12 22:31:01 +02:00
Bostjan Meglic bc3b27339e [SMF] Check if session has been removed already between different events
This fix is needed to prevent SMF crash in case that one of the
neighbouring NF (AMF) crashed in the middle of the procedure.
2023-04-05 21:25:54 +09:00
Bostjan Meglic 200414ccca [AMF] Check if session has been removed already between different events
This fix is needed to prevent AMF crash in case that one of the
neighbouring NF (SMF) crashed in the middle of the procedure.
2023-04-05 21:25:54 +09:00
Sukchan Lee 32019df0f0 Fixed MacOSX compile error 2023-04-04 21:53:39 +09:00
Sukchan Lee e828f98bb6 [SMF] Fixed Gy Service-Context-Id 2023-04-04 21:33:55 +09:00
Sukchan Lee b9a3157467
[PFCP] SGWU/UPF Restoration (#2223)
TS23.007 17.4.1
19A PFCP based restart procedures

After a PFCP entity has restarted, it shall immediately update all local Recovery Time Stamps and shall clear all remote
Recovery Time Stamps. When peer PFCP entities information is available, i.e. when the PFCP Association is still alive,
the restarted PFCP entity shall send its updated Recovery Time Stamps in a Heartbeat Request message to the peer
PFCP entities before initiating any PFCP session signalling.
2023-04-04 21:22:03 +09:00
Sukchan Lee 939b311b2d [UPF] Remove Metrics in Data Plane (#2210) 2023-04-01 11:48:24 +09:00
Gaber Stare 65f379640c [SMF] Release PDU session with skipInd
Follow-up on [#2048](https://github.com/open5gs/open5gs/pull/2048)

AMF crashes when 'skipInd' field is missing:
```
amf  | 03/21 07:45:04.092: [amf] FATAL: [imsi-001010000000000] No skipInd (../src/amf/namf-handler.c:392)
amf  | 03/21 07:45:04.092: [amf] FATAL: amf_namf_comm_handle_n1_n2_message_transfer: should not be reached. (../src/amf/namf-handler.c:393)
```
In case of CM_CONNECTED skipInd is not important.
In case of CM_IDLE the proper relase would contain skipInd.
2023-03-27 22:17:40 +09:00
Sukchan Lee d469809192 [AMF/MME] PLMN access control
These mechanisms are described in the GSMA roaming guidelines.
Chapters called Access Control.

For 4g: https://www.gsma.com/newsroom/wp-content/uploads//IR.88-v21.0.pdf
For 5g: https://www.gsma.com/newsroom/wp-content/uploads//NG.113-v6.0.pdf
2023-03-25 09:59:20 +09:00
Gaber Stare 6f593432a4 [AMF metrics] Initial histogram support
Version of histogram support without ogs_metrics_spec_new_ex().
Buckets are now, just like labels, passed to ogs_metrics_spec_new() as a pointer.
2023-03-24 23:03:49 +09:00
Sukchan Lee 84e46a0ff1 [MME] Add protection code for INVALID S1AP (#2184) 2023-03-23 20:50:41 +09:00
Bostjan Meglic df25013e54 [AMF] Do not issue SBI requests to other NF's if RAN UE already disconnected 2023-03-23 20:33:43 +09:00
Sukchan Lee 424f382265 [AMF/MME] Support TAI Range 2023-03-19 18:31:45 +09:00
Sukchan Lee 2944fa2549 [AMF/MME] for num_of_XXX variable (uint8_t -> int) 2023-03-19 18:31:45 +09:00
Gaber Stare e923f204aa [AMF, PCF] Don't free unallocated memory
SMF already handles the freeing in labels correctly.
In the same manner the memsets are moved to the beginning of the
problematic functions in AMF and PCF.
2023-03-18 16:39:31 +09:00
Bostjan Meglic a73814dad2 [AMF] Fix Network Initiated Deregistration
When UDM issues a SDM Data Change Notification with request to modify
RAT restrictions, AMF would crash when it tried to send a SDM
subscription delete as part of Network Initiated Deregistration.

Function amf_ue_sbi_discover_and_send() changed from returning boolean,
to returning integer (one of OGS_OK/OGS_ERROR/...).
2023-03-18 16:35:44 +09:00
Bostjan Meglic 5f377d0126 [PCF] Fix crash when both IPv4 and IPv6 Frame Routes are set
When both IPv4 and IPv6 Frame Routes are set, IPv4 Frame Route list
was subsequently cleared.
When UE tried to deregister, PCF would crash when it tried to free the
Frame Routing list.
2023-03-15 17:59:53 +09:00
Sukchan Lee 7c87389b16 [SBI] Check POST format in Subscription (#2152)
POST requests to {apiRoot}/nnrf-nfm/v1/subscriptions/{subscriptionID} return an error
2023-03-12 23:00:14 +09:00
Sukchan Lee dd2c85b1b0 [SBI] Conforms standard in Subscription API(#2152)
POST requests to {apiRoot}/nnrf-nfm/v1/subscriptions return
a HTTP Location header in 201 respose
in the form {apiRoot}/nnrf-nfm/v1/subscriptions/{subscriptionID}
2023-03-12 23:00:14 +09:00
Sukchan Lee ad9e5b28cf [SBI] Added Handler for Subscription PATCH (#2152) 2023-03-12 22:06:19 +09:00
Bostjan Meglic 359882fd49 [AMF] Fix handling Service Request
In case that handling Service Request results in an error, AMF sends a
Service Reject and sets UE's context to exception state. Without the
'break', the code would set UE's context to registered state.
2023-03-11 18:45:52 +09:00
Sukchan Lee 69c080c8f2 [NAS/GTP/PFCP] Upgrade IE to Release-17
As raised in #2147, AMF fails to decode S1 UE Network Capability.

So I reviewed all IE in NAS, GTP and PFCP and fixed it for Release-17.
2023-03-11 18:42:30 +09:00
Sukchan Lee ff4eab2e51 [SMF] Fixed crash during UPF-HA process (#2115) 2023-03-06 21:04:43 +09:00
Gaber Stare e6ba84bbef [AMF] Expose more metrics
[ETSI TS 128 552 V16.9.0](https://www.etsi.org/deliver/etsi_ts/128500_128599/128552/16.09.00_60/ts_128552v160900p.pdf)

5.2.2 Registration procedure related measurements

SNSSAI labels are not provided.

- Number of registration requests received by the AMF is
exposed for each registration type.
```
fivegs_amffunction_rm_reginitreq 1
fivegs_amffunction_rm_regmobreq 0
fivegs_amffunction_rm_regperiodreq 0
fivegs_amffunction_rm_regemergreq 0
```

- Number of successful initial registrations at the AMF is
exposed for each registration type.
```
fivegs_amffunction_rm_reginitsucc 1
fivegs_amffunction_rm_regmobsucc 0
fivegs_amffunction_rm_regperiodsucc 0
fivegs_amffunction_rm_regemergsucc 0
```

- The existing counter of failed registrations at the AMF
is exposed separately for each registration type.
```
fivegs_amffunction_rm_reginitfail
fivegs_amffunction_rm_regmobfail
fivegs_amffunction_rm_regperiodfail
fivegs_amffunction_rm_regemergfail
```

5.2.5.2 Measurements for 5G paging

Number of 5G paging procedures initiated at the AMF:
```
fivegs_amffunction_mm_paging5greq 1
```
Number of successful 5G paging procedures initiated at the AMF:
```
fivegs_amffunction_mm_paging5gsucc 1
```

5.2.11 Authentication procedure related measurements

Number of authentication requests:
```
fivegs_amffunction_amf_authreq 2
```
Number of authentication rejections:
```
fivegs_amffunction_amf_authreject 1
```
Number of failed authentications due to parameter error:
```
fivegs_amffunction_amf_authfail{cause="21"} 1
```

5.2.8 UE Configuration Update procedure related measurements

Number of UE Configuration Update commands requested by the AMF:
```
fivegs_amffunction_mm_confupdate 2
```
Number of UE Configuration Update complete messages received by the AMF:
```
fivegs_amffunction_mm_confupdatesucc 1
```
2023-03-06 20:18:35 +09:00
Sukchan Lee c3f0c57554 Follow-up on #2100 2023-03-04 23:43:36 +09:00
Bostjan Meglic 10168f1f19 [AMF] Disallow handling service requests unless UE is already registered 2023-03-04 23:43:14 +09:00
Sukchan Lee 4d44b1843e [Release-17] Upgrade SBI to v17.x.0 2023-03-01 19:56:49 +09:00
Sukchan Lee ce668c556c [SBI] Fixed openapitools MAP generation (#2103)
MAP was generated incorrectly because {{#items}}..{{#items}} was
missing.

Because of this, If scpInfo has scpPort, NRF crashes.
2023-02-26 10:01:08 +09:00
mitmitmitm 1d8324af9f [PFCP] Support pfcp advertise address 2023-02-24 20:53:28 +09:00
Sukchan Lee 10477ecdc9 [Release-17] Upgrade S1AP/NGAP to v17.3.9 2023-02-21 21:48:06 +09:00
mitmitmitm 22be888dae Don't left-shift by negative amount, which is UB according to C17 2023-02-20 21:00:16 +09:00
Sukchan Lee 82e9016164 [AMF/SMF] Fixed a crash (#2030, #2074, #2085) 2023-02-20 20:49:48 +09:00
Sukchan Lee 0df402bd49 [SBI] Move HNET PKI conf inside UDM 2023-02-18 12:41:08 +09:00
Sukchan Lee 05fbaf6958 [SBI] HTTP2-TLS verification - ConfFile Changed
You should add the following configuration if you would not use TLS.

sbi:
    server:
      no_tls: true
    client:
      no_tls: true
2023-02-18 10:58:29 +09:00
Spencer Sevilla 5f55ece521 [gtpc] silently handle OGS_GTP2_CAUSE_UE_ALREADY_RE_ATTACHED (#17)
no need to log "GTP Failed"; just handle silently or move on.
2023-02-16 11:57:00 -10:00
Sukchan Lee 74fdb14f7a [MME] KeNB derive from TAU(active flag=1) (#2063)
TS33.401
7 Security procedures between UE and EPS access network elements
7.2 Handling of user-related keys in E-UTRAN
7.2.7 Key handling for the TAU procedure when registered in E-UTRAN

If the "active flag" is set in the TAU request message or
the MME chooses to establish radio bearers when there is pending downlink
UP data or pending downlink signalling, radio bearers will be established
as part of the TAU procedure and a KeNB derivation is necessary.
2023-02-13 06:33:22 -10:00
Sukchan Lee 888e58a94e [AMF] Network Deregister (#2056, #2014, #2021)
Fixed a crash on explicit network-initiated deregister
with SUBSCRIPTION_WITHDRAWN
2023-02-10 23:09:39 +09:00
Bostjan Meglic 474b2d4134 [SBI,NF] Don't treat SBI connection errors as asserts 2023-02-07 22:49:11 +09:00
Sukchan Lee 8973a0bfdc [AMF] Delete UERadioCapability (#2040, #1917)
23.501 (5G NAS stage 2)
5.4.4.1:
"When the AMF receives Registration Request with the Registration type set
to Initial Registration or when it receives the first Registration Request
after E-UTRA/EPC Attach with Registration type set to Mobility Registration
Update, the AMF deletes the UE radio capability."
2023-02-07 22:29:53 +09:00