Update:
By commenting out the line of code that appends new QFIs, the problem disappears and COTS UEs successfully establish sessions and have internet connectivity. However this is a dirty workaround since now only the default QFI will spawn, thus limiting the QoS capabilities.
The illegal QFI=0 also appears when using UERANSIM, but since its a simulator, it doesnt complain and probably ignores the QoS settings altogether.
I attach 2 pcaps on the N2 interface of gNB (UERANSIM), one for each case.
nas_qfi_off.pcap (3.9 KB) nas_qfi_on.pcap (3.0 KB)
We still don’t understand how does a 2nd rule appears.
I also provide a part of the logs during the process for PCF and SMF:
2025-07-24T14:54:24.434993028Z [INFO][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] Allocated PDUAdress[10.60.0.1]
2025-07-24T14:54:24.455112524Z [INFO][PCF][SMpolicy] Handle CreateSmPolicy
2025-07-24T14:54:24.455186178Z [TRAC][PCF][SMpolicy] Handle Create SM Policy Request
2025-07-24T14:54:24.455225445Z [DEBU][PCF][Proc] Request SUPI:[imsi-001010000000001], SNSSAI:[&{1 }]
2025-07-24T14:54:24.471237754Z [TRAC][PCF][SMpolicy] put ratingGroup[1] for [imsi-001010000000001] to MongoDB
2025-07-24T14:54:24.472604590Z [TRAC][PCF][SMpolicy] FlowRules for ueId: imsi-001010000000001 snssai: 01
2025-07-24T14:54:24.485281821Z [INFO][PCF][SMpolicy] Matched [0] trafficInfluDatas from UDR
2025-07-24T14:54:24.494765497Z [DEBU][PCF][Consumer] Influence Data Subscription ID: d310416f
2025-07-24T14:54:24.503611021Z [TRAC][PCF][SMpolicy] SMPolicy PduSessionId[1] Create
2025-07-24T14:54:24.506379814Z [INFO][PCF][GIN] | 201 | 127.0.0.1 | POST | /npcf-smpolicycontrol/v1/sm-policies |
2025-07-24T14:54:24.509269639Z [INFO][SMF][PduSess] CHF Selection for SMContext SUPI[imsi-001010000000001] PDUSessionID[1]
2025-07-24T14:54:24.517417399Z [INFO][SMF][Charging] Handle SendConvergedChargingRequest
2025-07-24T14:54:24.543899956Z [INFO][SMF][Charging] Send Charging Data Request[Init] successfully
2025-07-24T14:54:24.543978213Z [DEBU][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] Install SessionRule[SessRuleId-1]: &{AuthSessAmbr:0xc0001c7
660 AuthDefQos:0xc000441420 SessRuleId:SessRuleId-1 RefUmData: RefUmN3gData: RefCondData:}
2025-07-24T14:54:24.544025608Z [TRAC][SMF][CTX] In GetDefaultUserPlanePathByDNN
2025-07-24T14:54:24.544157835Z [TRAC][SMF][CTX] selection: Dnn: internet
Sst: 1, Sd:
2025-07-24T14:54:24.544184561Z [TRAC][SMF][CTX] Find UPF with DNN[internet] S-NSSAI[sst: 1 sd: ] DNAI[]
2025-07-24T14:54:24.544296635Z [TRAC][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] CreatePccRuleDataPath: pcc rule: &{PccRule:0xc0000f4d80 QFI
:0 Datapath:}
2025-07-24T14:54:24.544329016Z [TRAC][SMF][PduSess] In AllocateLocalSEIDForDataPath
2025-07-24T14:54:24.544351089Z [TRAC][SMF][PduSess] NodeIDtoIP: 10.1.6.193
2025-07-24T14:54:24.544374433Z [TRAC][SMF][PduSess] In ActivateTunnelAndPDR
2025-07-24T14:54:24.544403245Z [TRAC][SMF][PduSess] DataPath Meta Information
Activated: false
IsDefault Path: true
Has Braching Point: false
Destination IP:
Destination Port:
DataPath Routing Information
1th Node in the Path
Current UPF IP: 10.1.6.193
Current UPF ID: 5276c6a0-9d82-4a7d-8716-454a2c092958
Previous UPF IP: None
Next UPF IP: None
2025-07-24T14:54:24.544446508Z [TRAC][SMF][PduSess] Current DP Node IP: 10.1.6.193
2025-07-24T14:54:24.544475963Z [TRAC][SMF][CTX] In ActivateUpLinkTunnel
2025-07-24T14:54:24.544537133Z [TRAC][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] PutPDRtoPFCPSession [&{PDRID:1 Precedence:0 PDI:{SourceInterface:{InterfaceValue:0} LocalFTeid: NetworkInstance: UEIPAddress: SDFFilter: ApplicationID:} OuterHeaderRemoval: FAR:0xc00033a330 URR:[] QER:[] State:0}]
2025-07-24T14:54:24.544569973Z [TRAC][SMF][CTX] In ActivateDownLinkTunnel
2025-07-24T14:54:24.544597687Z [TRAC][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] PutPDRtoPFCPSession [&{PDRID:2 Precedence:0 PDI:{SourceInte
rface:{InterfaceValue:0} LocalFTeid: NetworkInstance: UEIPAddress: SDFFilter: ApplicationID:} OuterHeaderRemoval: FAR:0xc00033a810
URR:[] QER:[] State:0}]
2025-07-24T14:54:24.544637173Z [TRAC][SMF][PduSess] Create URR: UrrReportTime [30s], UrrReportThreshold: [500000]
2025-07-24T14:54:24.544666347Z [TRAC][SMF][CTX] Calculate 10.1.6.193:8805
2025-07-24T14:54:24.544689458Z [TRAC][SMF][PduSess] Current DP Node IP: 10.1.6.193
2025-07-24T14:54:24.544709243Z [TRAC][SMF][PduSess] Before DLPDR OuterHeaderCreation
2025-07-24T14:54:24.544783990Z [TRAC][SMF][Charging] AddChargingRules: type[0], data:[&{ChgId:ChgId-1 MeteringMethod:VOLUME Offline:true Online:false SdfHan
dl:false RatingGroup:1 ReportingLevel:RAT_GR_LEVEL ServiceId:0 SponsorId: AppSvcProvId: AfChargingIdentifier:0 AfChargId:}]
2025-07-24T14:54:24.544814480Z [TRAC][SMF][PduSess] Successfully add URR 7 for Rating group 1
2025-07-24T14:54:24.544836430Z [TRAC][SMF][PduSess] UpLinkTunnel add URR for node 5276c6a0-9d82-4a7d-8716-454a2c092958 &{PDRID:1 Precedence:255 PDI:{SourceI
nterface:{InterfaceValue:0} LocalFTeid:0xc0001b2bc0 NetworkInstance:0xc000011fb0 UEIPAddress:0xc0001b2c40 SDFFilter: ApplicationID:} OuterHeaderRemoval
:0xc00020626f FAR:0xc00033a330 URR:[0xc000440b60 0xc000440c40 0xc0002fd730] QER:[0xc00033b8f0 0xc00033b4d0] State:0}
2025-07-24T14:54:24.544873273Z [TRAC][SMF][PduSess] DownLinkTunnel add URR for node 5276c6a0-9d82-4a7d-8716-454a2c092958 &{PDRID:2 Precedence:255 PDI:{Sourc
eInterface:{InterfaceValue:1} LocalFTeid: NetworkInstance:0xc000011fe0 UEIPAddress:0xc0001b2d00 SDFFilter: ApplicationID:} OuterHeaderRemoval:<nil
FAR:0xc00033a810 URR:[0xc000440b60 0xc000440c40 0xc0002fd730] QER:[0xc00033b8f0 0xc00033b4d0] State:0}
2025-07-24T14:54:24.544901936Z [INFO][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] Install PCCRule[PccRuleId-1]
2025-07-24T14:54:24.544928541Z [INFO][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] No srcTcData and tgtTcData. Nothing to do
2025-07-24T14:54:24.544982777Z [INFO][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] Has default path
2025-07-24T14:54:24.546986286Z [TRAC][SMF][PduSess][pdu_session_id:1][supi:imsi-001010000000001] In ActivateUPFSession
2025-07-24T14:54:24.547132063Z [INFO][SMF][PduSess] Sending PFCP Session Establishment Request
2025-07-24T14:54:24.547204211Z [TRAC][SMF][PduSess] [SMF] Send SendPfcpSessionEstablishmentRequest
2025-07-24T14:54:24.547230378Z [TRAC][SMF][PduSess] Send to addr 10.1.6.193:8805
2025-07-24T14:54:24.555432053Z [INFO][SMF][PduSess] Received PFCP Session Establishment Accepted Response