Skip to content

feat: Add policy-data endpoints and API versioning for PCF integration - #3

Draft
tariromukute wants to merge 2 commits into
developfrom
fix-ueid-extraction-and-api-versions
Draft

feat: Add policy-data endpoints and API versioning for PCF integration#3
tariromukute wants to merge 2 commits into
developfrom
fix-ueid-extraction-and-api-versions

Conversation

@tariromukute

Copy link
Copy Markdown

Related Issue(s) / Merge Request(s)

Fixes PCF (free5gc) integration - policy-data endpoints returning 404 errors
Adds support for policy-data endpoints

Description

Implements the complete policy-data backend for UDR to support PCF queries per 3GPP TS 29.519 V18.8.0.

API Versioning & Route Handling:

  • Added support for both v1 and v2 API versions (UdrDataRepositoryServiceBaseV1, UdrDataRepositoryServiceBaseV2)
  • Enhanced UE ID extraction logic in HTTP/2 server to differentiate between policy-data and subscription-data paths
  • Updated route paths from incorrect subscription-data paths to correct policy-data paths for policy endpoints See common-src patch attached

Policy-Data Backend Implementation:

  • Created database tables: AccessAndMobilityPolicyData, SessionManagementPolicyData, UePolicySet with proper schemas per 3GPP TS 29.519
  • Implemented query functions: query_am_policy_data(), query_sm_policy_data(), query_ue_policy_set()
  • Added SNSSAI key transformation from JSON format ({"sst":222,"sd":"00007b"}) to hex format (de00007b)
  • Fixed URL-decoding for SNSSAI parameters with special characters
  • Implemented field ordering compliance with OpenAPI specifications (e.g., snssai before smPolicyDnnData)

NF Service Management:

  • Added NF service registration in udr_profile with version and endpoint information
  • Enhanced NRF registration with nudr-dr service details

Technical Details:

  • SNSSAI keys stored as JSON in DB, transformed to hex for API responses (SST as 2-digit hex + SD)
  • SD values normalized to lowercase for consistent matching
  • Filtering by SNSSAI/DNN implemented with hex key comparison

Tested Environment (e.g., radios, interfaces, CN)

  • PCF → UDR policy-data queries via HTTP/2
  • Endpoints: /policy-data/ues/{ueId}/am-data, /sm-data, /ue-policy-set
  • v1 and v2 API version compatibility

Core Network Components:

  • SMF: OAI-CN5G SMF (on branch feat-send-accesstype-and-servingnetwork-to-pcf)
  • AMF: OAI-CN5G AMF (on branch fix-pcf-am-policy-control-request)
  • PCF: free5gc PCF
  • UDR: OAI-UDR (with these changes)
  • Rest of OAI NFs

Configuration Updates (e.g., files, parameters)

  • New SQL script: oai_db_policy_data.sql - database schema and sample data
  • No configuration file changes required

Known Issues / Limitations

Common-src Submodule Patch:

  • Due to a known bug preventing sync between the common-src submodule and the develop branch, SBI related changes are provided as a patch file
  • The patch file udr-sbi-helper-fix.diff contains all changes to common-src components
  • These changes should be applied to the common-src repository once the submodule sync issue is resolved

Checklist

  • Code follows project coding standards.
  • Relevant tests have been added or updated.
  • Documentation has been updated where necessary.
  • Configuration changes have been validated in the target environment(s).

Log files or packet captures (PCAPs)

Successful PCF queries returning policy data with correct JSON structure and field ordering for both v1 and v2 API versions.

Additional Notes

This MR completes the policy-data backend implementation and adds API versioning support, enabling full PCF-UDR integration for session management and access mobility policies with backward compatibility.

udr-sbi-helper-fix.diff

… and API layers

Signed-off-by: Tariro Mukute <tariro.mukute@phine.tech>
@tariromukute tariromukute added the do-not-trigger-ci Indicates that CI should not be triggered. label Aug 10, 2026
@tariromukute
tariromukute force-pushed the fix-ueid-extraction-and-api-versions branch from 1c7746f to 0a5f89d Compare August 17, 2026 11:28
@tariromukute tariromukute self-assigned this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-trigger-ci Indicates that CI should not be triggered.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants