Skip to content

fix: preserve QoS and precedence when applying traffic influence - #87

Merged
Alonza0314 merged 5 commits into
free5gc:mainfrom
roundspring2003:fix/ti-default-qos-binding
Oct 21, 2026
Merged

Alonza0314 merged 5 commits into
free5gc:mainfrom
roundspring2003:fix/ti-default-qos-binding

Conversation

@roundspring2003

@roundspring2003 roundspring2003 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Traffic Influence currently creates dynamic PCC rules with routing and optional charging data but omits refQosData. Supply the necessary QoS reference while preserving existing service authorization and numeric precedence when applying TI routing.

Handle coverage explicitly:

  • Full coverage: update the existing service PCC rule's routing through its own Traffic Control data. Keep its PCC ID, filters, QoS reference, charging references and precedence. A fully covered GBR service also follows this path; no duplicate service rule or resource authorization is created.
  • Partial coverage: add a rule for the intersection with the existing service, retaining its authorized QoS and charging. Give the new rule an unused precedence between the source rule and the preceding higher-priority service. The original service handles the remaining traffic with its existing routing and precedence.
  • Default traffic: add a default-flow TI rule only when some requested traffic is not covered by the existing service filters. Supply defQosFlowIndication: true and keep this fallback below existing service rules and above the original default rule. A request wholly covered by one or several services needs no extra default-flow rule.

Coverage includes the union of request filters and service filters, using IPv4/IPv6 prefixes, protocol, source/destination ports and direction. Existing filters' additional restrictions are retained. This does not renumber existing PCC rules or impose a total-rule-count limit. If a required precedence interval has no free value, return an error without changing cached policy.

Updates and removal:

  • Save original routing references, rather than copies of the entire service authorization. Reapply active requests from those references so updates and out-of-order deletion preserve current service QoS. Earlier active TI requests retain priority where requests overlap.
  • Preserve unrelated Traffic Control settings and shared data. Saved routing references continue to own their original TC data while TI temporarily replaces them. Removing a source service also removes its generated rules and cannot resurrect that service when TI is later withdrawn.
  • If the original rule had no TC reference, withdrawing TI supplies an explicit normal-routing TC reference. Merely omitting refTcData in an update would leave the previously supplied TI reference valid.
  • Notify SMF only about changed PCC rules, changed decision data and explicit PCC deletion markers. Include referenced data when changing a PCC reference, including restored routes the SMF may no longer cache. Changed routing content uses a new TC reference on the affected PCC rule. This permits clearing optional TC fields whose omission under an existing reference would otherwise mean unchanged. Identical content keeps its reference and sends no callback.
  • Keep existing service charging when updating routing. The existing TI charging lookup/allocation is used only when a new default-flow TI rule is needed.
  • Stage in-memory routing changes for a complete UDR notification batch before committing them.

Standards basis:

  • TS 23.503 V19.8.0, §6.1.3.14 describes PCF control through provisioning and modifying traffic-steering information in PCC rules.
  • TS 29.512 V19.7.0, §4.2.6.2.6.2 defines the concerned traffic and the routing information, including DNAI, supplied through the referenced Traffic Control decision.
  • §4.2.6.2.1 requires QoS references for new dynamic PCC rules and defines modifications where omitted existing attributes remain valid. §4.2.6.2.10 defines the explicit default-flow indication.

The coverage algorithm, local allocation of unused precedence and ordering of concurrent TI requests are implementation choices; these clauses do not mandate a particular CIDR algorithm or require all TI services to use default QoS. PCF does not select numeric QFIs.

Scope and integration limits:

  • Supports explicit IP filters. Application-ID selectors and Ethernet filters remain unsupported.
  • Partial coverage with configured GBR fields, TSC assistance, alternative QoS sets or QoS monitoring still requires separate resource/binding handling and is rejected. The GBR-field check is conservative, including profiles with populated GBR fields and a Non-GBR 5QI. Full coverage does not have that blanket rejection.
  • Active requests are reconciled against current service filters and authorization when TI is processed. This does not add general reevaluation hooks for every unrelated service-policy update.
  • Staging covers the in-memory routing policy, not a distributed transaction with MongoDB, SMF or UPF.
  • SMF must honor defQosFlowIndication and correctly construct its marking QER. Complete UE/UPF free5gc/ci-test verification remains pending; this PR does not claim an end-to-end fix by itself.

Validation:

  • go test ./... passed.
  • go build ./... passed.
  • go test -race ./internal/context ./internal/util ./internal/sbi/processor passed.
  • golangci-lint v2.11.4 run passed with 0 issues.
  • Regressions cover disjoint TI with no/offline/online charging; full and partial coverage; unchanged existing precedence; full-coverage GBR; unions of CIDRs, ports and services; filter gaps; IPv6; shared TC data; implicit original routes; selective routing updates, optional-field clearing and no-op deltas; request/notification data ownership; authorization updates; source removal; precedence exhaustion; out-of-order TI removal; and actual HTTP/2 notification payloads.

@roundspring2003 roundspring2003 changed the title fix: bind traffic influence rules to default QoS flow fix: preserve authorized QoS when applying traffic influence Oct 16, 2026
@roundspring2003 roundspring2003 changed the title fix: preserve authorized QoS when applying traffic influence fix: preserve QoS and precedence when applying traffic influence Oct 17, 2026
@roundspring2003

Copy link
Copy Markdown
Contributor Author

@Alonza0314
Alonza0314 merged commit 1ada61c into free5gc:main Oct 21, 2026
3 checks passed
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