Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: amf determine ue.rattype in registration #144

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading