Commit Graph

1911 Commits

Author SHA1 Message Date
Sukchan Lee 1f165c1c33 Follow-up on #1747 2022-09-08 23:17:04 +09:00
Bostjan Meglic 31a3788021 [AMF] Handle APN/DNN names as case-insensitive
In case that APN name sent from UE does not case-match with the one
configured in the database, AMF would reject the registration with the
message:

[gmm] WARNING: [imsi-xxx] DNN Not Supported OR Not Subscribed in the
Slice (../src/amf/gmm-handler.c:1051)
2022-09-08 23:13:47 +09:00
Sukchan Lee f54bccacf5 Support service-based NF subscription 2022-09-08 22:12:01 +09:00
Bostjan Meglic 87cd34d300 Minor typo fix 2022-09-07 18:01:21 +09:00
Bostjan Meglic 51669d73a0
[AMF] Accept Deregistration Notification from UDM only for registered UE (#1737)
Add additional check when receiving Deregistration Notification from
UDM. UE should already be in registered state before accepting the
request and deregistering the UE.

Also add additional check that PCF association policy exists before
sending a delete request to PCF.
2022-09-06 19:47:42 +09:00
Sukchan Lee c716a1294a [CORE] Check if timer is double free in SBI module 2022-09-03 15:59:39 +09:00
Sukchan Lee acc36a344f [PCF] Check NF service configuration
* npcf-smpolicycontrol - enabled or disabled
* npcf-policyauthorization - enabled or disabled

Only one of npcf-smpolicycontrol and npcf-policyauthorization cannot be enabled. (../src/pcf/sbi-path.c:151)

They can be enabled or disabled together.
2022-09-03 13:07:00 +09:00
Sukchan Lee d87d61e851 Follow-up on #1729 2022-09-03 09:20:48 +09:00
mitmitmitm af1f8d4f4a [SMF] Handle upCnxState=ACTIVATING by replying with 200 instead of 204
According to TS 29.502 5.2.2.3.2.2., we should reply with a 200 response
including the upCnxState attribute.
2022-09-03 09:08:27 +09:00
Sukchan Lee fcb15b69f7 [MME] Fixed buffer overflow (#1728) 2022-09-02 23:39:59 +09:00
Sukchan Lee 1d17e68c56 [ALL] Removing trailing whitespace and tab 2022-09-02 23:38:39 +09:00
Sukchan Lee 5295c108ad Added Service-based NF discovery
== Known limitation ==
Placing npcf-smpolicycontrol and pcf-policyauthorization
in different NFs is not supported. Both npcf-smpolicycontrol
and pcf-policyauthorization should be placed in the same NF.
2022-09-02 23:04:57 +09:00
Alexander Couzens b175394839 [SMF] fixup send 3GPP-Charging-Characteristics on Gx if received on S5/8c
- Gy instead of Gx AVP was used.
- Use correct avp position and avp variables.

Fixes: 657eef9169 ("[SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c")
2022-08-31 06:38:08 +09:00
Sukchan Lee eab29fad9a Follow up on #1715
* Changed <TAB> to <SPACE>*4

* Changed snprintf to ogs_snprintf
2022-08-27 18:43:34 +09:00
Alexander Couzens 657eef9169 [SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and forwarded by the MME towards the SMF.
2022-08-27 18:36:54 +09:00
Sukchan Lee 9f98d421a0 [SBI] Added config for service-names discovery 2022-08-27 10:49:07 +09:00
Sukchan Lee f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Sukchan Lee 9b10d70c77 [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
Sukchan Lee 83a20b82c7 Follow up on #1714
* Changed sprintf to ogs_snprintf

* Limited to 80 column
2022-08-25 16:35:27 +09:00
jmasterfunk84 49349cdb75
[MME] Dictionary Updates and IDR Support (#1714)
* Add Diameter Dictionary Elements

* Initial IDR Framework

* Resolve Compile Issues

* Moving Closer

* Compile error

* Somewhat Working stuffing Code

* Add Timestamp Changes

* Cleanup some of this code.  mme_s6a_handle_idr in s6a-handler.c removed for now, since it will only come in handy when IDR flag is set to request current location, which would involve breaking out into paging.  I think there's a few other things we can do just within fd-path first.

* further removal of mme_s6a_handle_idr
2022-08-25 15:43:21 +09:00
Bostjan Meglic def99aff7f [SMF] Fix abort on app exit when no Diameter configuration
In case that SMF was configured to run without Diameter, it would crash
on application exit due to uninitialized variables/pointers.

ERROR  pid:unnamed in fd_sess_handler_destroy@sessions.c:324: ERROR: Invalid parameter '(handler && ( ((*handler) != ((void *)0)) && ( ((struct session_handler *)(*handler))->eyec == 0x53554AD1) ))', 22
[smf] FATAL: smf_gx_final: Assertion `ret == 0' failed. (../src/smf/gx-path.c:1353)
2022-08-24 01:39:24 +09:00
Sukchan Lee 242b138597 [MME] UE-initiated detach removes S1 only (#1698) 2022-08-20 01:08:20 +09:00
Sukchan Lee 9bb9a4cae9 [MME] Detach removed MME-UE context (#1698) 2022-08-20 00:17:55 +09:00
Sukchan Lee 321c8d4cf9 [SGsAP] Changed message if Paging failed (#1701)
The problem occurred in the following scenario:

1. VLR sent PAGING-REQUEST to the MME
2. MME sent S1-Paging to the UE
3. Paging failed
4. MME responded SERVICE-REQUEST to the VLR
5. VLR sent DOWNLINK-UNITDATA to the MME
6. Even though there is no S1 Context,
   MME try to sent DownlinkNASTransport message to the UE.
7. So, the problem occurred.

I've changed the number 4 PAGING-REJECT instead of SERVICE-REQUEST.
2022-08-19 18:58:55 +09:00
Sukchan Lee 909f407c20 [MME] Fixed GTP transaction crash (#1696) 2022-08-19 17:23:10 +09:00
Sukchan Lee a9694d6474 [MME] Follow-up Cancel Location Handling (#1698) 2022-08-19 16:52:39 +09:00
jmasterfunk84 c98333bbfe
[MME] Cancel Location Handling (#1698)
* CLR while idle is broken after 7031856cd7

Cancel Location Request arriving while UE is idle will not proceed to paging due to this check for S1 connection.  Using new flag "isAnswer" to bypass this check to allow paging to occur when we are not doing a AIA/ULA related procedure.

* No Context Setup is required when sending the detach request.  If the paging was due to wanting to send a Detach Request to the UE, then we fast track to sending the detach request.

* emm-sm.c:
In the case of MME initiated detach while UE is idle, there is no initial conext setup.  We go right from the service request after paging into sending the detach request.  TS23.401

mme-path.c:
Using nas_eps.type in the case of MME Initiated Detach while UE is idle does not work.  nas_eps.type would represent the service request.

mme-s11-handler.c:
After S11 action, no action should be taken.  We want to wait for the detach accept from the UE before proceeding with the S1 release (detach).

* InitialContextSetup should occur for detach.
2022-08-19 16:44:06 +09:00
herlesupreeth 7162684486 [SMF]: Update stored PCO IE requested over Gn in SMF context
As per 3GPP TS 29.060 version 15.3.0, section 7.3.3, 7.3.4, 7.3.5 and 7.3.6

Only if PCO IE is included in Update/Delete PDP Context Request then it
must be present in Update/Delete PDP Context Response.

In order to reflect on whether the request contained PCO IE or not
the SMF context containing the GTP request needs to be updated
i.e. update if present else clear the contents
2022-08-13 09:30:28 +09:00
herlesupreeth 16ea972937 [SMF]: Update stored PCO IE requested in GTPv2 over S5c in SMF context
As per 3GPP TS 29.274 version 10.5.0, section 7.2.9 and 7.2.10,
Only if PCO IE is included in Delete Session Request then it
must be present in Delete Session Response.

In order to reflect on whether the request contained PCO IE or not
the SMF context containing the GTP request needs to be updated
i.e. update if present else clear the contents
2022-08-13 09:30:28 +09:00
Sukchan Lee e6a14cb73d Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
Sukchan Lee 4cb657c804 [MME] Changed CauseNas_detach in DETACH (#1676) 2022-08-06 14:00:54 +09:00
Sukchan Lee 700c71ef4c Changed configuration name from gnb to peer
And restored gtp_peer configuration
2022-08-05 16:56:36 +09:00
Sukchan Lee f772bf3a62 [PFCP] Revert Changes 5e18b2b and d21e9aa
To protect malicious or buggy, we need to check that session context is NULL.
2022-08-04 09:55:17 +09:00
Sukchan Lee cca3027e90 [NRF] Fixed the nfInstanceUri (#1683) 2022-08-03 17:32:15 +09:00
Sukchan Lee e88c43e8df [Diameter] Fixed Coding convention (#1680) 2022-08-03 14:34:21 +09:00
jmasterfunk84 415e5276ba [MME+HSS] AVP Occurring Too Many Times
Do not Set Origin-Hosts with fd_msg_rescode_set before potential use of ogs_diam_message_experimental_rescode_set.  This results in multiple Origin-Host/Realm AVPs.
2022-08-03 14:32:57 +09:00
Sukchan Lee d21e9aa5e0 [PFCP] Revert Changes 5e18b2b 2022-08-03 14:13:35 +09:00
Sukchan Lee 7231dafbf1 [SBI] Fixed nf_instance memory leak
- Rollback commit ed3444eef5
- Do not modify reference count when REGISTER/DEREGISTER notified from NRF
2022-08-02 09:44:13 +09:00
Sukchan Lee 7031856cd7 [MME] Changed S1AP_Cause in S1AP Release (#1676)
S1AP_CauseNas_detach -> S1AP_CauseNas_normal_release
2022-07-31 12:38:11 +09:00
Sukchan Lee 5524dc5e29 Refact paging module (#1676) 2022-07-30 14:44:34 +09:00
jmasterfunk84 47cbaca149 [MME] Introduce support for S6a Cancel Location Request
- Added diameter dictionary definitions for Cancel Location
- Cancel Location will completely remove UE from MME, allow for a fresh IMSI attach to occur on next attempt.
- T3422 is used for detach request.
- Added new handling for s6a events in mme-sm, as not all s6a messages are at attach now.  Maybe there's something in a state machine I should've been using here instead of a new flag?

- Testing was completed with UE in idle and connected.  With CLR flags indicating re-attach required and without.  Also sending CLR after UE detach.  And then sending again when mme_ue is empty.
2022-07-30 14:37:43 +09:00
Sukchan Lee 9b762158a6 Refine code of discovery option param (#1671) 2022-07-24 19:47:04 +09:00
Sukchan Lee 4e8492e878 Oops! Warning removed! 2022-07-24 15:15:06 +09:00
Sukchan Lee a5010a61ef Support Discovery Optional Parameter (#1671)
To support target-nf-instance-id in the discovery,
Discovery optional parameter is implemeted
2022-07-24 15:10:09 +09:00
jmasterfunk84 eb03704015 Moving handling of assigning sub level cc into the pdn to s11. 2022-07-24 12:29:01 +09:00
jmasterfunk84 68140efce4 [MME] Handle Charging Characteristics
Found no support for HSS provided charging characteristics.  Following TS32.251 A.4:
- Use PDN level CC, if one wasn't provided then use subscription level CC
- Don't send CC in S11 if it wasn't included
2022-07-24 12:29:01 +09:00
jmasterfunk84 d2ef555ce4 Set default Network-Access-Mode to 0
For HSS's which do not include the NAM, the MME should not treat this as a fatal error.  MME should just assume PACKET_AND_CIRCUIT (0), as was decided in a previous PR.
2022-07-23 00:26:55 +09:00
Bostjan Meglic 7e6568d800 [SMF] Send PDU Session Establish Accept to serving AMF
In case there are multiple AMF registered to NRF, SMF would pick only
the first AMF from the list.
In the case of sending PDU Session Establishment Accept from SMF to
AMF, this would mean a high chance of failure since the AMF might
be different than the original requester, and would not know about a
particular UE.

Modify SMF to use ServingNfId field from original request
SmContextCreateData from AMF to determine to which AMF should it send
PDU Session Establishment Accept message.
2022-07-22 12:24:26 +09:00
Sukchan Lee eb50d64271 Add more protection code for (#1652) 2022-07-21 17:13:32 +09:00
Sukchan Lee 9aa5559c5f Refactor for the UERANSIM 500 test (#1652) 2022-07-21 12:41:19 +09:00