Skip to content

Commit

Permalink
Merge pull request #13 from Jerry0666/main
Browse files Browse the repository at this point in the history
modified article
  • Loading branch information
ianchen0119 authored Jul 20, 2023
2 parents 7c90fdc + e6f548e commit 036708e
Showing 1 changed file with 127 additions and 21 deletions.
148 changes: 127 additions & 21 deletions docs/blog/UDM_introduce.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ In this article, I will introduce UDM and its three services that will be used i
Unified Data Management is responsible for managing information related to UE. When other NFs need to use the UE subscription information, they will obtain it from UDM through the SBI of UDM.

### Nudm_UEAuthentication Service
This service is used by ASUF to retrieve authentication-related information and, after authentication, confirm the result.
This service is used by AUSF to retrieve authentication-related information and, after authentication, confirm the result.

![upload_dde9cead3e40f645128a006d5bc56681](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/94313ad4-c325-4010-8ee9-4105748f4c3c)
*ts33.501*
>[3GPP TS33.501 v15.2.0](https://www.etsi.org/deliver/etsi_ts/133500_133599/133501/15.02.00_60/ts_133501v150200p.pdf)
In Authentication, AUSF uses the GET operation to retrieve authentication information for the UE. The request contains the UE’s identity (supi or suci) and the serving network name. The serving network name is used in the derivation of the anchor key, which is used by subsensual authentication. UE’s identity will be contained in the URI, and the serving network name will be contained in the request body.

Expand Down Expand Up @@ -42,9 +42,9 @@ if err != nil {
return nil, openapi.ProblemDetailsSystemFailure(err.Error())
}
authSubs, res, err := client.AuthenticationDataDocumentApi.QueryAuthSubsData(context.Background(), supi, nil)
```

*udm/internal/sbi/producer/generate_auth_data.go GenerateAuthDataProcedure function*
//in the udm/internal/sbi/producer/generate_auth_data.go, GenerateAuthDataProcedure function.
```

From the code, we can see UDM first de-conceal SUCI (line 5), then use QueryAuthSubsData to get authSub from UDR. After that, UDM uses this information to create the authentication vector.

Expand All @@ -57,7 +57,7 @@ Open the response packet, and we can see the response body matches the Authentic
![upload_3acf4b96a27e13f8b35712d5efc402da](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/36534f56-d487-4277-9395-88a1b09f4ef5)

![upload_f24e1640d05c1614d277517d35b6520f](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/93a1b4db-77ad-42a7-91f9-8fdfcf99a9b6)
*ts29.503*
>[3GPP TS29.503 v15.2.1](https://www.etsi.org/deliver/etsi_ts/129500_129599/129503/15.02.01_60/ts_129503v150201p.pdf)
After AUSF authenticates the UE, it will confirm the result with UDM. These details will be used in linking authentication confirmation to the Nudm_UECM_Registration procedure from AMF.

Expand Down Expand Up @@ -131,14 +131,15 @@ func communicateWithUDM(ue *context.AmfUe, accessType models.AccessType) error {
ue.ContextValid = true
return nil
}
```

*amf/internal/gmm/handler.go*

//in the amf/internal/gmm/handler.go.
```

Next, let's take a look at this function. It is called in HandleInitialRegistration, which handles UE's initial registration. UeCmRegistration will use the Nudm_UECM (UECM) service to store related UE Context Management information in UDM. In lines 40, 47, and 54, AMF uses the Nudm_SubscriberDataManagement (SDM) Service to get some subscribe data.

### Nudm_UEContextManagement Service
In the UeCmRegistration function, AMF registers as UE's serving NF on UDM and stores related UE Context Management information in UDM. Looking at the packet, you can see that the request body contains amfInstanceId and guami, representing the amf identity, and ratType, representing the radio access technology type used by UE.
In the UeCmRegistration function, AMF registers as UE's serving NF on UDM and stores related UE Context Management information in UDM. Looking at the packet, you can see that the request body contains `amfInstanceId` and `guami`, representing the amf identity, and `ratType`, representing the radio access technology type used by UE.

![upload_c3e5e7c63f1bb7a934877e7fa29b82ec](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/c24e6f2e-4193-4830-aa4f-e6edb97c1490)

Expand Down Expand Up @@ -200,19 +201,18 @@ func RegistrationAmf3gppAccessProcedure(registerRequest models.Amf3GppAccessRegi
}
}

//in the udm/internal/sbi/producer/ue_context_management.go
```

*udm/internal/sbi/producer/ue_context_management.go*

In the RegistrationAmf3gppAccessProcedure function, UDM first checks whether the context has been established for that UE; if UDM has such a context, it initiates a Nudm_UECM_DeregistrationNotification to the old AMF later. UDM used the received information to create context and stored it in UDR.


### Nudm_SubscriberDataManagement (SDM) Service
The SDM service is used to retrieve the UE's individual subscription data relevant to the consumer's NF from the UDM. In the SDMGetAmData function, AMF gets subscription data used in registration and mobility management. In the response packet, AMF got gpsis, subscribedUeAmbr, and nssai.
The SDM service is used to retrieve the UE's individual subscription data relevant to the consumer's NF from the UDM. In the SDMGetAmData function, AMF gets subscription data used in registration and mobility management. In the response packet, AMF got `gpsis`, `subscribedUeAmbr`, and `nssai`.

![upload_6793e16d2435baf3f235d61178245873](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/6b1c0bcb-2b79-4523-ad8b-1cdaad758b52)

The GPSI is used to address a 3GPP subscription in data networks outside the realms of a 3GPP system. It contains either an External ID or an [MSISDN](https://en.wikipedia.org/wiki/MSISDN).The subscribedUeAmbr is The Maximum Aggregated uplink and downlink MBRs (max. bit rate) to be shared across all Non-GBR (non-guaranteed Bit Rate) QoS Flows according to the subscription of the user. (ts23502 Table 5.2.3.3.1-1).
The GPSI (Generic Public Subscription Identifier) is used to address a 3GPP subscription in data networks outside the realms of a 3GPP system. It contains either an External ID or an [MSISDN](https://en.wikipedia.org/wiki/MSISDN) (Mobile Subscriber ISDN Number).The `subscribedUeAmbr` is The Maximum Aggregated uplink and downlink MBRs (max. bit rate) to be shared across all Non-GBR (non-guaranteed Bit Rate) QoS Flows according to the subscription of the user.

![upload_e45012750cc609c51d59437c24f8fc4f](https://github.com/Jerry0666/Network-function-UDM-introduction/assets/131638457/311a2b76-efe3-4afc-84e3-fcc95f65047e)

Expand All @@ -235,11 +235,11 @@ func HandleInitialRegistration(ue *context.AmfUe, anType models.AccessType) erro
if err := handleRequestedNssai(ue, anType); err != nil {
return err
}
```

*amf/internal/gmm/handler.go*
//in the amf/internal/gmm/handler.go.
```
In the initialization of HandleInitialRegistration, AMF sends a request to the UDM to receive the UE's NSSAI. After receiving subscribed NSSAI, AMF will compare it to UE's requested NSSAI. If there is a S-NSSAI that has not been subscribed before, AMF will request NSSF for Allowed NSSAI.
In the initialization of HandleInitialRegistration, AMF sends a request to the UDM to receive the UE's NSSAI (Network Slice Selection Assistance Information). After receiving subscribed NSSAI, AMF will compare it to UE's requested NSSAI. If there is a S-NSSAI that has not been subscribed before, AMF will request NSSF for Allowed NSSAI.
```golang
func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
Expand Down Expand Up @@ -296,13 +296,119 @@ func handleRequestedNssai(ue *context.AmfUe, anType models.AccessType) error {
gmm_message.SendRegistrationReject(ue.RanUe[anType], nasMessage.Cause5GMMProtocolErrorUnspecified, "")
return fmt.Errorf("Handle Requested Nssai of UE failed")
}

//in the amf/internal/gmm/handler.go.
```
```golang=
for _, requestedSnssai := range param.SliceInfoRequestForRegistration.RequestedNssai {
if param.Tai != nil && !util.CheckSupportedSnssaiInTa(requestedSnssai, *param.Tai) {
// Requested S-NSSAI does not supported in UE's current TA
// Add it to Rejected NSSAI in TA
authorizedNetworkSliceInfo.RejectedNssaiInTa = append(
authorizedNetworkSliceInfo.RejectedNssaiInTa,
requestedSnssai)
continue
}

var mappingOfRequestedSnssai models.Snssai
// TODO: Compared with Restricted S-NSSAI list in configuration under roaming scenario
if param.HomePlmnId != nil && !util.CheckStandardSnssai(requestedSnssai) {
// Standard S-NSSAIs are supported to be commonly decided by all roaming partners
// Only non-standard S-NSSAIs are required to find mappings
targetMapping, found := util.FindMappingWithServingSnssai(requestedSnssai,
param.SliceInfoRequestForRegistration.MappingOfNssai)

if !found {
// No mapping of Requested S-NSSAI to HPLMN S-NSSAI is provided by UE
// TODO: Search for local configuration if there is no provided mapping from UE, and update UE's
// Configured NSSAI
checkInvalidRequestedNssai = true
authorizedNetworkSliceInfo.RejectedNssaiInPlmn = append(
authorizedNetworkSliceInfo.RejectedNssaiInPlmn,
requestedSnssai)
continue
} else {
// TODO: Check if mappings of S-NSSAIs are correct
// If not, update UE's Configured NSSAI
mappingOfRequestedSnssai = *targetMapping.HomeSnssai
}
} else {
mappingOfRequestedSnssai = requestedSnssai
}

hitSubscription := false
for _, subscribedSnssai := range param.SliceInfoRequestForRegistration.SubscribedNssai {
if mappingOfRequestedSnssai == *subscribedSnssai.SubscribedSnssai {
// Requested S-NSSAI matches one of Subscribed S-NSSAI
// Add it to Allowed NSSAI list
hitSubscription = true

var allowedSnssaiElement models.AllowedSnssai
allowedSnssaiElement.AllowedSnssai = new(models.Snssai)
*allowedSnssaiElement.AllowedSnssai = requestedSnssai
nsiInformationList := util.GetNsiInformationListFromConfig(requestedSnssai)
if nsiInformationList != nil {
// TODO: `NsiInformationList` should be slice in `AllowedSnssai` instead of pointer of slice
allowedSnssaiElement.NsiInformationList = append(
allowedSnssaiElement.NsiInformationList,
nsiInformationList...)
}
if param.HomePlmnId != nil && !util.CheckStandardSnssai(requestedSnssai) {
allowedSnssaiElement.MappedHomeSnssai = new(models.Snssai)
*allowedSnssaiElement.MappedHomeSnssai = *subscribedSnssai.SubscribedSnssai
}

// Default Access Type is set to 3GPP Access if no TAI is provided
// TODO: Depend on operator implementation, it may also return S-NSSAIs in all valid Access Type if
// UE's Access Type could not be identified
var accessType models.AccessType = models.AccessType__3_GPP_ACCESS
if param.Tai != nil {
accessType = util.GetAccessTypeFromConfig(*param.Tai)
}

util.AddAllowedSnssai(allowedSnssaiElement, accessType, authorizedNetworkSliceInfo)

checkIfRequestAllowed = true
break
}
}

if !hitSubscription {
// Requested S-NSSAI does not match any Subscribed S-NSSAI
// Add it to Rejected NSSAI in PLMN
checkInvalidRequestedNssai = true
authorizedNetworkSliceInfo.RejectedNssaiInPlmn = append(
authorizedNetworkSliceInfo.RejectedNssaiInPlmn,
requestedSnssai)
}
}

if !checkIfRequestAllowed {
// No S-NSSAI from Requested NSSAI is present in Subscribed S-NSSAIs
// Subscribed S-NSSAIs marked as default are used
useDefaultSubscribedSnssai(param, authorizedNetworkSliceInfo)
}
} else {
// No Requested NSSAI is provided
// Subscribed S-NSSAIs marked as default are used
checkInvalidRequestedNssai = true
useDefaultSubscribedSnssai(param, authorizedNetworkSliceInfo)
}

//in the nssf/internal/sbi/producer/nsselection_for_registration.go, nsselectionForRegistration funcion.
```
*amf/internal/gmm/handler.go*
If NSSF needs to select S-NSSAI, it first finds the mapping of requested NSSAI to configured NSSAI for the HPLMN and converts requested S-NSSAI to S-NSSAI in configured NSSAI for the HPLMN. Then compare these S-NSSAIs with Subscribed S-NSSAIs; if NSSF find one match, set it as `AllowedSnssai`. If NSSF can't find such a mapping or no S-NSSAI in the mapping matches subscribed S-NSSAIs, it will use default subscribed S-NSSAIs.
### Reference
* 3GPP TS29.503 v15.2
* 3GPP TS23.502 v15.2
* 3GPP TS23.501 v15.2
* 3GPP TS33.501 v15.2
* free5GC v3.3.0
* [3GPP TS29.503 v15.2.1](https://www.etsi.org/deliver/etsi_ts/129500_129599/129503/15.02.01_60/ts_129503v150201p.pdf)
* [3GPP TS23.502 v15.2.0](https://www.etsi.org/deliver/etsi_ts/123500_123599/123502/15.02.00_60/ts_123502v150200p.pdf)
* [3GPP TS23.501 v15.2.0](https://www.etsi.org/deliver/etsi_ts/123500_123599/123501/15.02.00_60/ts_123501v150200p.pdf)
* [3GPP TS33.501 v15.2.0](https://www.etsi.org/deliver/etsi_ts/133500_133599/133501/15.02.00_60/ts_133501v150200p.pdf)
* [free5GC v3.3.0](https://github.com/free5gc/free5gc)
### About
Hello! My name is 張哲睿, and my current research topic is ATSSS (Access Traffic Steering, Switching and Splitting), I will continue to write articles related to 5G networks in the future. If you find any mistakes in my articles or have any topics you want to know about, please contact me.
* [Linkedln](https://www.linkedin.com/in/%E5%93%B2%E7%9D%BF-%E5%BC%B5-77096621a/)

0 comments on commit 036708e

Please sign in to comment.