Skip to content

Commit

Permalink
fix: amf determine ue.rattype in registration
Browse files Browse the repository at this point in the history
  • Loading branch information
donald1218 committed Sep 19, 2024
1 parent fbdf75e commit f0a32ec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions internal/context/amf_ran.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const (
RanPresentGNbId = 1
RanPresentNgeNbId = 2
RanPresentN3IwfId = 3
RanPresentTngfId = 4
RanPresentTwifId = 5
RanPresentWagfId = 6
)

type AmfRan struct {
Expand Down Expand Up @@ -131,3 +134,26 @@ func (ran *AmfRan) RanID() string {
return ""
}
}

func (ran *AmfRan) UeRatType() models.RatType {
// In TS 23.501 5.3.2.3
// For 3GPP access the AMF determines the RAT type the UE is camping on based
// on the Global RAN Node IDs associated with the N2 interface and
// additionally the Tracking Area indicated by NG-RAN
switch ran.RanPresent {
case RanPresentGNbId:
return models.RatType_NR
case RanPresentNgeNbId:
return models.RatType_NR
case RanPresentN3IwfId:
return models.RatType_VIRTUAL
case RanPresentTngfId:
return models.RatType_TRUSTED_N3_GA
case RanPresentTwifId:
return models.RatType_TRUSTED_N3_GA
case RanPresentWagfId:
return models.RatType_WIRELINE
default:
return models.RatType_NR
}
}
6 changes: 6 additions & 0 deletions internal/gmm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ func HandleRegistrationRequest(ue *context.AmfUe, anType models.AccessType, proc
if ue.RanUe[anType] != nil {
ue.Location = ue.RanUe[anType].Location
ue.Tai = ue.RanUe[anType].Tai
if ue.RanUe[anType].Ran != nil {
// ue.Ratype TS 23.502 4.2.2.1
// The AMF determines Access Type and RAT Type as defined in clause 5.3.2.3 of TS 23.501 .
ue.RatType = ue.RanUe[anType].Ran.UeRatType()
}
}

// Check TAI
Expand Down Expand Up @@ -565,6 +570,7 @@ func HandleRegistrationRequest(ue *context.AmfUe, anType models.AccessType, proc
context.GetSelf().AllocateGutiToUe(ue) // refresh 5G-GUTI
}
}

return nil
}

Expand Down

0 comments on commit f0a32ec

Please sign in to comment.