Skip to content

fix: notify PCF with AN_CH_COR trigger after N2 handover completes#201

Open
timyl wants to merge 1 commit into
free5gc:mainfrom
timyl:fix/n2-ho-notify-pcf-location-change
Open

fix: notify PCF with AN_CH_COR trigger after N2 handover completes#201
timyl wants to merge 1 commit into
free5gc:mainfrom
timyl:fix/n2-ho-notify-pcf-location-change

Conversation

@timyl

@timyl timyl commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

After N2 handover completes, SMF now reports the UE's new location to
PCF using the AN_CH_COR (Access Network Change Correlation) trigger,
as required by 3GPP TS 29.512 §5.6.3.

Changes

internal/sbi/consumer/pcf_service.go

Added SendSMPolicyAssociationUpdateByLocationChange() which sends
SmPolicyUpdateContextData with:

  • repPolicyCtrlReqTriggers: [AN_CH_COR]
  • userLocationInfo: UE's post-handover location

internal/sbi/processor/pdu_session.go

  1. In HoState_COMPLETED handler: save ueLocation from AMF request
    into smContext.UeLocation
  2. In SessionUpdateSuccess (after PFCP path-switch): launch async
    goroutine to notify PCF and apply returned policy decision via PFCP

The goroutine is async to avoid blocking the 200 OK to AMF — a sync
call would delay UEContextReleaseCommand to the source gNB and cause
DL traffic outage of ~3 minutes in testing.

Related PR

Requires AMF change to populate ueLocation in HoState=COMPLETED:
free5gc/amf#204

Testing

Verified with free5gc v4.2.0 + UERANSIM + OAI rfsim + vendor PCF

  • SMF correctly stores post-handover UE location from AMF
  • PCF notified with AN_CH_COR + userLocationInfo after path-switch
  • PCF-returned AMBR update applied to UPF via second PFCP modification
  • First PFCP (path-switch) remains synchronous per TS 23.502 §4.9.1.3

After N2 handover, SMF receives HoState=COMPLETED from AMF along with
the UE's post-handover location. SMF now:
1. Saves the incoming ueLocation to smContext
2. After PFCP path-switch succeeds, asynchronously notifies PCF with
   AN_CH_COR trigger and the new userLocationInfo (TS 29.512 §5.6.3)
3. Applies the returned SmPolicyDecision (e.g. AMBR update) and sends
   a second PFCP modification to enforce updated QoS at the UPF

The PCF notification is async to avoid blocking the 200 OK response to
AMF, which would delay UEContextReleaseCommand to the source gNB.
Depends on: free5gc/amf#204
@Alonza0314

Copy link
Copy Markdown
Member

Hi @timyl ,
This ci failed in lint check. Please help to fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants