← Back to Pull requests

nr_pdcp: support independent UL and DL PDCP SN sizes for DRBs #1005

Open
unknown opened this pull request with 329 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 06, 2026 07:24 UTC
Author

Summary

Implements independent uplink (pdcp-SN-SizeUL) and downlink (pdcp-SN-SizeDL) PDCP sequence number lengths for DRBs per 3GPP TS 38.331 §6.3.2 (PDCP-Config) and 3GPP TS 38.323 §6.3.2 / §7.2, eliminating the exit(1) termination in nr_pdcp_add_drb() and the AssertFatal in nr_pdcp_reconfigure_drb() when UL and DL SN lengths differ (e.g., UL = 18 bits, DL = 12 bits).

Root Cause & 3GPP Specification Context

Per 3GPP TS 38.331 §6.3.2 (PDCP-Config), drb specifies pdcp-SN-SizeUL and pdcp-SN-SizeDL as independent ENUMERATED {len12bits, len18bits} fields. Per 3GPP TS 38.323 §7.2, Window_Size is a constant of the receiving PDCP entity ($2^{ ext{pdcp-SN-SizeRX} - 1}$), while the transmitting PDCP entity wraps TX_NEXT modulo $2^{ ext{pdcp-SN-SizeTX}}$.

Previously:
1. nr_pdcp_add_drb() in openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c rejected sn_size_ul != sn_size_dl with exit(1), and nr_pdcp_reconfigure_drb() aborted via AssertFatal.
2. nr_pdcp_entity_t held only a single sn_size / sn_max for both nr_pdcp_entity_process_sdu() (TX) and nr_pdcp_entity_recv_pdu() (RX).

Changes

  • openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h & openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c:

  • - Add nr_pdcp_entity_set_sn_sizes(nr_pdcp_entity_t *entity, int sn_size_ul, int sn_size_dl) to configure sn_size_ul, sn_size_dl, directional sn_size_tx (is_gnb ? sn_size_dl : sn_size_ul), sn_size_rx (is_gnb ? sn_size_ul : sn_size_dl), tx_sn_max, rx_sn_max, and receiving window_size = 1 << (sn_size_rx - 1).
    - Update nr_pdcp_entity_process_sdu() to frame 2-byte (SHORT_SN_SIZE) or 3-byte (LONG_SN_SIZE) headers using sn_size_tx and tx_sn_max.
    - Update nr_pdcp_entity_recv_pdu() to parse headers, compute HFN/COUNT, and evaluate window_size using sn_size_rx and rx_sn_max.
  • openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c:

  • - Validate drb->pdcp_SN_SizeUL, drb->pdcp_SN_SizeDL, and drb->discardTimer for NULL in nr_pdcp_add_drb().
    - Remove the sn_size_ul != sn_size_dl exit(1) block in nr_pdcp_add_drb() and AssertFatal in nr_pdcp_reconfigure_drb(), applying both UL and DL SN lengths via nr_pdcp_entity_set_sn_sizes().
  • openair2/LAYER2/nr_pdcp/tests/test_nr_pdcp_sn_sizes.cpp & CMakeLists.txt:

  • - Add GoogleTest regression suite test_nr_pdcp_sn_sizes verifying bidirectional UE $\leftrightarrow$ gNB PDCP SDU/PDU transfer (with NEA2 ciphering and NIA2 integrity enabled) across 12/12, 18/18, 18/12 (UL 18-bit / DL 12-bit), and 12/18 (UL 12-bit / DL 18-bit) configurations.

    Closes #980

    Diff: 329 lines (+246 / -83) across 4 files Reviewer: Paramveersingh-S Review duration: 35776m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 329 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1005"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.1% (MEDIUM) · Higher = larger blast radius
    47.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 25.1% · Safe to merge
    25.1%