Commit Graph

2293 Commits

Author SHA1 Message Date
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
Sukchan Lee f7a4d64f00 [AMF] Network-Initiated Deregister (#2014, #2021)
I accidentally missed one so I added it again.
2023-02-06 21:09:19 +09:00
Sukchan Lee b44fa29a7d [AMF/MME] Delete UERadioCapability (#2040, #1917)
o TS24.301(4G/LTE)
  5.5.1 Attach procedure
  5.5.1.2 Attach procedure for EPS services
  5.5.1.2.4 Attach accepted by the network

If the attach request is accepted by the network,
the MME shall delete the stored UE radio capability information
or the UE radio capability ID, if any.

o TS24.501(5G)
  5.5.2 De-registration procedure
  5.5.2.1 General

When the AMF enters the state 5GMM-DEREGISTERED for 3GPP access,
the AMF shall delete the stored UE radio capability information
or the UE radio capability ID, if any.
2023-02-05 12:03:00 +09:00
Sukchan Lee b6aa3aba5b Follow-up on #2048 2023-02-04 22:41:11 +09:00
Flander Bojan af07cc75ec Support for UPF HA - release/establish new PDU session 2023-02-04 22:40:33 +09:00
Sukchan Lee bae3998c31 [SBI/NF] Follow-up on #2045 2023-02-04 21:35:12 +09:00
Bostjan Meglic c791d97ed7 [NF] Fix double-free crash when NF is under heavy load
<nf>/init.c:<nf>_main() :
ogs_pollset_poll() receives the time of the expiration of next timer as
an argument. If this timeout is in very near future (1 millisecond),
and if there are multiple events that need to be processed by
ogs_pollset_poll(), these could take more than 1 millisecond for
processing, resulting in the timer already passed the expiration.

In case that another NF is under heavy load and responds to an SBI
request with some delay of a few seconds, it can happen that
ogs_pollset_poll() adds SBI responses to the event list for further
processing, then ogs_timer_mgr_expire() is called which will add an
additional event for timer expiration. When all events are processed
one-by-one, the SBI xact would get deleted twice in a row, resulting in
a crash.

0  __GI_abort () at ./stdlib/abort.c:107
1  0x00007f9de91693b1 in ?? () from /lib/x86_64-linux-gnu/libtalloc.so.2
2  0x00007f9de9a21745 in ogs_talloc_free (ptr=0x7f9d906c2c70, location=0x7f9de960bf41 "../lib/sbi/message.c:2423") at ../lib/core/ogs-memory.c:107
3  0x00007f9de95dbf31 in ogs_sbi_discovery_option_free (discovery_option=0x7f9d9090e670) at ../lib/sbi/message.c:2423
4  0x00007f9de95f7c47 in ogs_sbi_xact_remove (xact=0x7f9db630b630) at ../lib/sbi/context.c:1702
5  0x000055a482784846 in amf_state_operational (s=0x7f9d9488bbb0, e=0x7f9d90aecf20) at ../src/amf/amf-sm.c:604
6  0x00007f9de9a33cf0 in ogs_fsm_dispatch (fsm=0x7f9d9488bbb0, event=0x7f9d90aecf20) at ../lib/core/ogs-fsm.c:127
7  0x000055a48275b32e in amf_main (data=0x0) at ../src/amf/init.c:149
8  0x00007f9de9a249eb in thread_worker (arg=0x55a483d41d90) at ../lib/core/ogs-thread.c:67
9  0x00007f9de8fd2b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
10 0x00007f9de9063bb4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
2023-02-04 21:25:46 +09:00
Sukchan Lee 79f73fae2a [Gx/Gy] MAX_CC_REQUESTER_NUMBER(32->64) (#2038)
Incrased MAX_CC_REQUESTER_NUMBER from 32 to 64
2023-02-04 20:53:44 +09:00
Sukchan Lee 8a92c7e219 [AMF] Network-Initiated Deregister (#2014, #2021)
Fixed a bug network-initiated implicit/explict deregistration
2023-02-04 20:43:31 +09:00
Sukchan Lee 8a6c36daca [AMF] Network Initiated De-Register (#2014, #2021)
Resolved Network Initiated Implicit/Explicit De-Registration
2023-01-29 22:44:44 +09:00
Sukchan Lee b7386284a7 [NRF] Fixed a crash during NRF discovery (#2034)
Other NF instances are obtained through NRF
or created directly through configuration files.

Other NFs created by the config file should not be passed
through NRF discovery or anything like that.

Since self-created NF Instances do not have an ID,
they are implemented to exclude them from NRF Discovery.
2023-01-29 11:22:45 +09:00
Sukchan Lee 610b998038 [AMX] Fixed a crash due to deregistration (#2021)
Fixed an issue where AMF would crash
if an implicit deregistration occurred twice.
2023-01-29 09:09:52 +09:00
Sukchan Lee f50591a8f7 Added Service-MAP to Requester-Features (#2027)
ALWAYS Added Service-MAP to Requester-Features in Discovery Option
2023-01-29 01:35:47 +09:00
Sukchan Lee 728ca41103 [MME] Fixed crash due to Paging routine (#2017) 2023-01-27 16:42:23 +09:00
mitmitmitm 739cb599d1 [UDR] Read framed routes from DB send them in sm-data
The framed routes are stored in mongo as

 {
     "imsi" : "$IMSI",
     ...,
     "slice" :
     [{
         ...,
         "session" :
             ...,
             "ipv4_framed_routes" : ["10.45.33.0/24", "10.45.35.0/24"],
         }],
     }],
 },
2023-01-26 22:37:58 +09:00
mitmitmitm 11568bbff7 ogs_session_s.framed_routes type change to (char **)
OpenAPI_list_t wasn't optimal as it created a dependency on ogs-sbi.h.
2023-01-26 22:37:58 +09:00
Sukchan Lee b82a898646 update it 2023-01-26 21:22:24 +09:00
Sukchan Lee 9e6cff7225 Merge branch 'MMENetworkDeregTimers' of https://github.com/jmasterfunk84/open5gs into jmasterfunk84-MMENetworkDeregTimers 2023-01-26 21:15:32 +09:00
Sukchan Lee 95e5d95faf [AMF] Fixed crashes from malformed 5GS-ID (#2020) 2023-01-26 20:48:55 +09:00
Sukchan Lee 85981effc7 [AMF/AMF] Not assert for ogs_asn_copy_ie() (#2018)
Does not raise an assertion even if open5gs cannot handle the ASN in
ogs_asn_copy_ie()
2023-01-25 23:16:59 +09:00
jmasterfunk84 ee2eded848
Merge branch 'main' into MMENetworkDeregTimers 2023-01-24 12:47:33 -06:00
jmasterfunk84 e96b6be245 no Purge Timer, no config, expanded code 2023-01-24 12:35:47 -06:00
Sukchan Lee 596a2f1b5e [SBI] Fixed crash if no BW Unit(Xbps) (#2000) 2023-01-24 21:55:06 +09:00
Sukchan Lee b108ae0aff [PFCP] buffer overflow in ALPINE (#1911, #2009)
A buffer overflow occurred in ALPINE
because the size of the pfcp message structure increased by

    ogs_pfcp_tlv_framed_route_t framed_route[8];
    ogs_pfcp_tlv_framed_ipv6_route_t framed_ipv6_route[8];
2023-01-24 19:03:00 +09:00
Sukchan Lee 11aac6a164 [CORE] Rollback ogs_pkbuf_copy() from (#2012)
In the previous #2012 working, I've added ogs_pkbuf_free() for original
buffer. But, this rasied double free. So, I've rollback it,
2023-01-24 00:17:10 +09:00
Sukchan Lee c6fd4ae6b8 [LOG] remove ogs_expect_or_return()/return_val() 2023-01-24 00:01:36 +09:00
Sukchan Lee ed5cd4d513 [MME] Fixed a crash when no UE context (#2016) 2023-01-23 18:49:12 +09:00
Sukchan Lee 54331d77ee [UPF] URR time threshold log to info (#1997) 2023-01-23 15:58:55 +09:00
Sukchan Lee 689574a2d9 [AMF/MME] Fixed crash when no NG/S1 context(#2012) 2023-01-23 10:37:22 +09:00
mitmitmitm f6439b998c [SMF] Handle framed routes, forward them to UPF and PCF 2023-01-23 09:26:26 +09:00
mitmitmitm 990abbab2c [UPF] Handle framed routes 2023-01-23 09:26:26 +09:00
mitmitmitm 3e980e006f [PCF] Handle framed routes, forward them to BSF 2023-01-23 09:26:26 +09:00
mitmitmitm 88209f52df [BSF] Handle Ipv4FrameRouteList, save it into context 2023-01-23 09:26:26 +09:00
Sukchan Lee ff261681c0 [PROTO] Increase SDU buffer 8k->16k (#2008) 2023-01-21 12:58:43 +09:00
Sukchan Lee df4c83372d [AMF] Fixed MEMORY LEAK (#1925) 2023-01-21 09:02:44 +09:00
Sukchan Lee a712d865cd [METRICS] Re-order init/final (#1985, #2001) 2023-01-20 21:16:45 +09:00
jmasterfunk84 5c3f10aa0e [MME] Introduce aging timers
* Creating three new timers
* mirroring work done by gstaa on the AMF
* Implicit detach procedures added
* Fix for detach from unknown UE
2023-01-18 20:39:27 -06:00
Sukchan Lee ce7b60dbb5 [AMF] Fixed RM metric RegisteredSubNbr (#2001) 2023-01-18 22:29:44 +09:00
Sukchan Lee 4933c7ee24 More follow-up on #1911 2023-01-14 10:34:21 +09:00
Sukchan Lee 01a7b3c9b8 Follow-up on #1991 2023-01-14 09:20:52 +09:00
jmasterfunk84 3fd7ecc9a2
[MME] Add Purge-UE Capability (#1991)
* [MME] Add Purge-UE Capability

* Add OGS_GTP_..._PURGE_AND_REMOVE to split CLR case
2023-01-14 09:13:48 +09:00
Sukchan Lee 5128ebc6c6 [SMF] Added User-ID, APP_DNN, S-NSSAI (#1986)
Added User-ID, APP_DNN, S-NSSAI in N4 PFCP Session Establishment Request
2023-01-13 10:28:40 +09:00
ridzafauzi 92efca1fbf changed error tagged log to info tagged log for handling 5g guti information during Configuration Update procedure 2023-01-11 23:12:20 +09:00
Sukchan Lee c0a61fb71e [PCRF] More fixes for crashes (#1981) 2023-01-10 16:13:44 +09:00
Sukchan Lee 7f9afa0213 [AMF] More Follow-up on #1987 2023-01-08 20:02:18 +09:00
Sukchan Lee 9f4a9790e3 [AMF] Follow-up on #1987
[AMF] Implicit Network-initiated Deregistration

    Two timers are introduced (both with duration of T3512 + 4 min):
    -MOBILE_REACHABLE
    -IMPLICIT_DEREGISTRATION
    MOBILE_REACHABLE is set when NAS connection for the UE is released.
    IMPLICIT_DEREGISTRATION is set when MOBILE_REACHABLE expires.

    On MOBILE_REACHABLE expiry Paging is ignored.
    On IMPLICIT_DEREGISTRATION expiry:
    -UE's RM_State is set to DEREGISTERED
    -UE is Nudm_SDM_Unsubscribed
    -UE is Nudm_UECM_Deregistered
    -PDU sessions are released
    -AM policies are deleted

    Existing flag amf_ue->network_initiated_de_reg is used.
2023-01-08 13:53:48 +09:00
Gaber Stare bfd5cefe53 [AMF] Implicit Network-initiated Deregistration
Two timers are introduced (both with duration of T3512 + 4 min):
-MOBILE_REACHABLE
-IMPLICIT_DEREGISTRATION
MOBILE_REACHABLE is set when NAS connection for the UE is released.
IMPLICIT_DEREGISTRATION is set when MOBILE_REACHABLE expires.

On MOBILE_REACHABLE expiry Paging is ignored.
On IMPLICIT_DEREGISTRATION expiry:
-UE's RM_State is set to DEREGISTERED
-UE is Nudm_SDM_Unsubscribed
-UE is Nudm_UECM_Deregistered
-PDU sessions are released
-AM policies are deleted

Existing flag amf_ue->network_initiated_de_reg is used.
2023-01-08 13:48:32 +09:00
Sukchan Lee 8553c77733 [METRICS] Fixed a core dump in SMF/UPF/PCF (#1985) 2023-01-07 21:17:14 +09:00
Sukchan Lee 2ec1f484b4 [PCRF] Fixed a crash (#1981)
An assertion was fired when switching between video and audio.
2023-01-07 15:21:17 +09:00
Sukchan Lee 4510176da2 [MME] Clear UE Context for Attach Reject (#1848)
Attach Reject + PDN Connectivity Reject need to clear UE Context
2022-12-27 21:08:48 +09:00
Sukchan Lee 8373d0e331 SIDF only required in UDM, not AUSF (#1779) 2022-12-25 20:12:26 +09:00
Sukchan Lee 0d2c31fe06 Fixed SMF-METRICS bug in EPC 2022-12-25 17:33:13 +09:00
Matej Gradisar 1d93e7a7bc New AMF ID in SMF session context for 'inter-AMF change or mobility' 2022-12-25 00:11:17 +09:00
Sukchan Lee 79d46be086 Introduced Subscription identifier de-concealing
o Generate the private key as below.
   $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key
   $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key

 o The private and public keys can be viewed with the command.
   The public key is used when creating the SIM.
   $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text
   $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text

In ausf/udm.yaml

 hnet:
    o Home network public key identifier(PKI) value : 1
      Protection scheme identifier : ECIES scheme profile A
    - id: 1
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 2
      Protection scheme identifier : ECIES scheme profile B
    - id: 2
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

    o Home network public key identifier(PKI) value : 3
      Protection scheme identifier : ECIES scheme profile A
    - id: 3
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 4
      Protection scheme identifier : ECIES scheme profile B
    - id: 4
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

Related to #1779
2022-12-24 20:22:45 +09:00
Bostjan Meglic 38aadb77e0 [SMF] Fix metric bearers_active
Metric 'bearers_active' was incremented in only one code path
(smf_bearer_add() for 4G only), while it was decremented from two paths
(smf_bearer_remove() for both 4G and 5G).
Increment metric also for 5G path (smf_qos_flow_add()), so it won't get
decremented into negative values.
2022-12-17 16:27:42 +09:00
Gaber Stare b56c33479e Add NF load to NRF Heartbeat
The current load percentage of the NF Service Consumer is provided
in the payload body of the PATCH request when periodically
contacting the NRF (heart-beat).

AMF: ratio between currently connected ran_ue and maximum number of them
SMF: ratio between current PDU sessions and maximum available
PCF: ratio between current AM+SM policy associations and maximum available
     or ratio between currently connected UEs and maximum number of them
     (the load which is higher)
AUSF, UDM: ratio between currently connected UE and maximum number of them
BSF: ratio between current sessions and maximum available
NSSF: ratio between currently used NSIs and maximum number of them

NRF currently doesn't determine that the NF Profile has changed.
2022-12-14 22:53:56 +09:00
mitmitmitm 6ad320a97c [AMF] Fix deletion of auth data from AUSF 2022-12-09 07:25:12 +09:00
Gaber Stare 3edceecf66 [SMF] Add SM metrics support
Expose SM metrics with labels according to ETSI TS 128 552 V16.13.0 in
SMF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>
Existing gauge sessions_active is renamed!

Since slice itself is not unique, the plmnid label is exposed in
addition to snssai.

Exposed metrics example:
-standard gauges:
fivegs_smffunction_sm_sessionnbr{plmnid="00101",snssai="1000009"} 0
fivegs_smffunction_sm_qos_flow_nbr{plmnid="00101",snssai="1000009",fiveqi="9"} 0

-nonstandard counters:
fivegs_smffunction_sm_n4sessionestabfail{cause="71"} 68
fivegs_smffunction_sm_n4sessionreport 1
fivegs_smffunction_sm_n4sessionreportsucc 1
fivegs_smffunction_sm_n4sessionestabreq 1
2022-12-08 20:57:11 +09:00
Gaber Stare 4c76a254ee [AMF] Add RM metrics support
Expose RM metrics with labels according to ETSI TS 128 552 V16.13.0 in
AMF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>

Since slice itself is not unique, the plmnid label is exposed in
addition to snssai.

RegInitFail is exposed as an alternative to RegInitReq and RegInitSucc
counters so cause label can be provided. It counts rejected registrations
and rejected authentications.
Rejected authentications are counted under label cause="0".

Exposed metrics example:
-standard gauge:
fivegs_amffunction_rm_registeredsubnbr{plmnid="00101",snssai="1000009"} 1

-nonstandard counter:
fivegs_amffunction_rm_reginitfail{cause="3"} 4
2022-12-08 20:57:11 +09:00
Bostjan Meglic 3e22059916 [SMF] fix crash due free-ing invalid pointer
In case that database is (manually) corrupted for a specific UE, SSC
mode and ARP preemption vulnerability fields are not set correctly,
SMF will crash when trying to build a request to create PCF association.

Function smf_npcf_smpolicycontrol_build_create() will end prematurely,
and when cleaning up resources it will try to free() up invalid pointer,
which was not set to 0 at beginning of the function.

[smf] ERROR: SSCMode is not allowed (../src/smf/nudm-handler.c:165)
[sbi] DEBUG: STATUS [201] (../lib/sbi/nghttp2-server.c:443)
[sbi] DEBUG: SENDING...: 3 (../lib/sbi/nghttp2-server.c:451)
[sbi] DEBUG: {
} (../lib/sbi/nghttp2-server.c:452)
[sbi] DEBUG: STREAM closed [1] (../lib/sbi/nghttp2-server.c:962)
[smf] ERROR: No Arp.preempt_cap (../src/smf/npcf-build.c:132)
<crash>

0  __GI_abort () at ./stdlib/abort.c:107
1  0x00007f9348fe43b1 in ?? () from /lib/x86_64-linux-gnu/libtalloc.so.2
2  0x00007f9349aef745 in ogs_talloc_free (ptr=0x7f9348e38dab <_int_free+1675>,
    location=0x5591b8675d27 "../src/smf/npcf-build.c:181") at ../lib/core/ogs-memory.c:107
3  0x00005591b8653c45 in smf_npcf_smpolicycontrol_build_create (sess=0x7f9343070010, data=0x0)
    at ../src/smf/npcf-build.c:181
4  0x00007f9349abc2b4 in ogs_sbi_xact_add (sbi_object=0x7f9343070010,
    service_type=OGS_SBI_SERVICE_TYPE_NPCF_SMPOLICYCONTROL, discovery_option=0x7f9338006d90,
    build=0x5591b86531d0 <smf_npcf_smpolicycontrol_build_create>, context=0x7f9343070010, data=0x0)
    at ../lib/sbi/context.c:1699
5  0x00005591b86580be in smf_sbi_discover_and_send (service_type=OGS_SBI_SERVICE_TYPE_NPCF_SMPOLICYCONTROL,
    discovery_option=0x0, build=0x5591b86531d0 <smf_npcf_smpolicycontrol_build_create>, sess=0x7f9343070010,
    stream=0x7f9344fce0a0, state=0, data=0x0) at ../src/smf/sbi-path.c:110
6  0x00005591b864e9da in smf_nudm_sdm_handle_get (sess=0x7f9343070010, stream=0x7f9344fce0a0,
    recvmsg=0x7f933f52d5a0) at ../src/smf/nudm-handler.c:290
7  0x00005591b8600c96 in smf_gsm_state_wait_5gc_sm_policy_association (s=0x7f9343070610, e=0x7f9338076730)
    at ../src/smf/gsm-sm.c:523
...
2022-12-07 21:21:01 +09:00
Sukchan Lee 1be6176e8d Follow-up on #1940 - Fixed compile error 2022-12-07 20:41:18 +09:00
Sukchan Lee fbd9ada101 Follow-up on #1940 2022-12-06 22:59:06 +09:00
Gaber Stare 0c2a3b0f39 [PCF] Add metrics support
Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in
PCF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>

Since slice itself is not unique, the plmnid label is exposed in
addition to snssai.

AM policy:
fivegs_pcffunction_pa_policyamassoreq and
fivegs_pcffunction_pa_policyamassosucc do not expose snssai label
since it is not available at the time of exposure.
plmnid is defined during AM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policyamassoreq is preserved.

SM policy:
snssai is defined during SM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policysmassoreq is preserved.

Those 2 basic metrics retain their position but are exposed with empty
labels.
Metrics with labels are called later, when the label values are known.

Exposed metrics example:
-standard counters:
fivegs_pcffunction_pa_policyamassoreq{plmnid=""} 3
fivegs_pcffunction_pa_policyamassoreq{plmnid="99970"} 3
fivegs_pcffunction_pa_policyamassosucc{plmnid="99970"} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="",snssai=""} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="99970",snssai="1000009"} 3
fivegs_pcffunction_pa_policysmassosucc{plmnid="99970",snssai="1000009"} 3

-nonstandard gauge (added for controlling purposes -
same metric as existing metric on AMF and SMF):
fivegs_pcffunction_pa_sessionnbr{plmnid="99970",snssai="1000009"} 0
2022-12-06 22:57:24 +09:00
Gaber Stare 40b4c9d1c9 [UPF] Add metrics support
Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in
UPF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>

5qi is not available in UPF.
To present 5qi to the user, MN will have to maintain a table qfi->5qi
for each QoS flow (will have to get information from SMF).
So UPF has to expose qfi. qfi itself is not useful. When used, UPF will
have to expose additional label to define the session (e.g. source
interface).

Label dnn is set to value of APN/DNN received in Establishment.
Since SMF does not add APN/DNN to Establishment, the label is empty.
When APN/DNN will be set by SMF, it should be added to sess in UPF
and used in metrics on Modification and Deletion.

Both datavolumeqosleveln3upf are exposed in bytes.
MN is providing the transformation to kbits.

fivegs_upffunction_upf_qosflows should expose the number of QFIs used in
sessions, but exposes number of QER rules, which is currently equal to
QFIs.
The label snsssai is not provided since the slice is not available on UPF.

Exposed metrics example:
Standard counters:
fivegs_ep_n3_gtp_indatapktn3upf 28637
fivegs_ep_n3_gtp_outdatapktn3upf 14729
fivegs_upffunction_sm_n4sessionestabreq 4
fivegs_upffunction_sm_n4sessionestabfail{cause="66"} 1
fivegs_upffunction_sm_n4sessionestabfail{cause="71"} 68
fivegs_upffunction_sm_n4sessionestabfail{cause="68"} 4
fivegs_upffunction_sm_n4sessionestabfail{cause="72"} 15
fivegs_upffunction_sm_n4sessionestabfail{cause="75"} 3
fivegs_upffunction_sm_n4sessionestabfail{cause="65"} 4
fivegs_upffunction_sm_n4sessionreport 0
fivegs_upffunction_sm_n4sessionreportsucc 0
fivegs_ep_n3_gtp_indatavolumeqosleveln3upf{qfi="1"} 39792997
fivegs_ep_n3_gtp_outdatavolumeqosleveln3upf{qfi="1"} 737548
Nonstandard gauge (added for controlling purposes -
same metric as existing metric on AMF and SMF):
fivegs_upffunction_upf_sessionnbr 1
Standard gauge:
fivegs_upffunction_upf_qosflows{dnn=""} 1
2022-12-06 22:57:24 +09:00
Lester 0fe904d593 free replybuf after sent replay message 2022-12-05 12:05:39 +09:00
Miguel Borges de Freitas f1aff3c233 amf: fix regression for smf selection 2022-12-04 15:12:15 +09:00
Sukchan Lee bd30e5534b [AMF] Fixed a crash while NGReset (#1928) 2022-12-04 15:01:43 +09:00
Sukchan Lee 817007d0ae [AMF] Wrongly sending PDU Session Release (#1925) 2022-12-04 14:32:19 +09:00
Sukchan Lee a4dc990bf1 Added more log in GTP Error (#1920) 2022-12-02 09:10:49 +09:00
Sukchan Lee fa5b2fe075 [SBI] Remove redundant code (#1923) 2022-11-30 17:01:30 +09:00
Sukchan Lee 944adaabbf [AMF/MME] Added Timer Configuration (#1905) 2022-11-29 23:22:16 +09:00
mitmitmitm ea09a7921a [AMF] Handle am-data/subscribedUeAmbr change notification
When such a notification arrives from UDM, notify the GNB of the new values
AMBR uplink/downlink values.
2022-11-29 23:10:49 +09:00
mitmitmitm 3b043b082a [AMF] Handle am-data/ratRestrictions change notification
When such a notification arrives from UDM, delete the corresponding SDM
subscription from the UDM and deregister the UE if it becomes RAT restricted.
2022-11-29 23:10:49 +09:00
mitmitmitm 3870216a6b [AMF] Add support for SDM subscription and authentication deletion 2022-11-29 23:10:49 +09:00
mitmitmitm 9364cd7513 [AMF] Allow unspecified (infinity) ue_ambr up/downlink limits 2022-11-29 23:10:49 +09:00
mitmitmitm 4ec5dedaf4 [AUSF] Handle UEAuthentication DELETE 2022-11-29 23:10:49 +09:00
mitmitmitm bdc9c1373f [UDM/UDR] Handle UEAuthentication authRemovalInd 2022-11-29 23:10:49 +09:00
mitmitmitm 89c3f3e1c0 [UDM] Handle SDM unsubscribe 2022-11-29 23:10:49 +09:00
Sukchan Lee 9170617df1 [AMF/MME] forget UE Radio Capability (#1917)
forgetting the UE Radio Capabilities
when UE is sending NAS "De-Registration Request" with "type = Switch-off
2022-11-27 09:03:44 +09:00
Sukchan Lee f85ff227c8 Continue to fix alpine stack overflow (#1911) 2022-11-27 00:11:34 +09:00
Sukchan Lee d82f338246 Fixed alpine stack overflow (#1911) 2022-11-27 00:03:56 +09:00
Sukchan Lee 8ce18b3828 [AMF/MME] Refactor SM to prevent crash (#1912) 2022-11-26 21:38:46 +09:00
Lester 3f772823a6 get amf_ue from sess
amf_ue will be null and cause a coredump when type is OGS_SBI_OBJ_SESS_TYPE.
2022-11-26 18:27:50 +09:00
mitmitmitm b85ad61e2b OpenAPI: Generate patch_item.[ch] from OpenAPI specifications 2022-11-24 17:30:38 +09:00
Sukchan Lee 982ac61894 Prometheus metrics set to default 2022-11-21 22:06:29 +09:00
Sukchan Lee 57f1f2c21a Fixed crash after 48 hours of running (#1893) 2022-11-18 23:28:35 +09:00
Bostjan Meglic b084edeee1 [metrics] Fix log output for metrics
Even if the configured log level for the application was set to "error",
the first "info" message of the metrics library was output to the log.
Reorder the initialization of the metrics library.
2022-11-15 23:50:15 +09:00
Sukchan Lee 0859dd4453 Follow-up on #1865 2022-11-12 09:37:43 +09:00
Bostjan Meglic ba8a7ce1af [AMF] Add implicit_unsubscribe field to SDMSubscription 2022-11-08 15:57:21 +09:00
Sukchan Lee ddf09f270a [SMF] Fixed PTI when PDU Session Reject 2022-11-07 16:51:51 +09:00
Sukchan Lee fa35b06963 Follow-up on #1876 2022-11-04 14:58:47 +09:00
Sukchan Lee cca53fb8e8 SCP had a serioud memory problem and fixed it 2022-10-30 13:35:25 +09:00
Sukchan Lee 243bf9850a [NAS] Discard message if Integrity failed (#1848) 2022-10-29 21:31:18 +09:00
Sukchan Lee 0df2cba257 Support SMF Security Indication IE (#1851) 2022-10-29 12:26:09 +09:00
mitmitmitm b9f6432e54 [AMF] Support REREGISTRATION_REQUIRED in dereg notify 2022-10-26 14:40:41 +09:00
Sukchan Lee e3ba32c85d Fixed the bug of SGW-C session deletion (#1825) 2022-10-25 21:22:14 +09:00
Sukchan Lee ec4acd4eca remove warning in MacOSX (#1797) 2022-10-25 21:14:53 +09:00
Sukchan Lee 5ccb5f0f99 SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
Sukchan Lee 24e20f2503 Follow-up on #1827 2022-10-13 17:52:02 +09:00
jmasterfunk84 8fb85db310 [DBI] Disable Change Streams with mongo Version
Support for change stream is only available in mongoc >=1.9.0
- Disabled related functions in dbi.
Support for bson to json used in debug statement only in libbson >=1.7.0
- Simple debug message in lower versions
2022-10-13 17:33:35 +09:00
Sukchan Lee 0daef1686a Follow-up on #1827 2022-10-11 17:50:41 +09:00