Add NGAP RAN Status Transfer enc/dec and handlers (UL and DL)

According to 4.9.1.3.3 of 3GPP TS 23.502:

> 2a. - 2c. The S-RAN sends the Uplink RAN Status Transfer message to the S-AMF,
> as specified in TS 36.300 [46] and TS 38.300 [9]. The S-RAN may omit sending
> this message if none of the radio bearers of the UE shall be treated with PDCP status preservation.

TS 38.300 says:
> For DRBs not configured with DAPS, the source gNB sends the SN STATUS TRANSFER message to the target
> gNB to convey the uplink PDCP SN receiver status and the downlink PDCP SN transmitter status of DRBs for
> which PDCP status preservation applies (i.e. for RLC AM). The uplink PDCP SN receiver status includes at
> least the PDCP SN of the first missing UL PDCP SDU and may include a bit map of the receive status of the out
> of sequence UL PDCP SDUs that the UE needs to retransmit in the target cell, if any. The downlink PDCP SN
> transmitter status indicates the next PDCP SN that the target gNB shall assign to new PDCP SDUs, not having a
> PDCP SN yet.

i.e., for DRBs for which PDCP status preservation applies (i.e. for RLC AM), which is is our case.

This commit introduces full support for NG-RAN Status Transfer message handling
(TS 38.413 §9.2.3.13-14) in CU. It enables correct state transfer of PDCP COUNT
values (SN + HFN) during mobility or recovery scenarios.

Summary of changes - NGAP:
* Added encoding/decoding support for UL/DL RAN Status Transfer message
* Defined structures for: ngap_drb_count_value_t, ngap_drb_status_t,
  ngap_ran_status_container_t, ngap_ran_status_transfer_t
This commit is contained in:
Guido Casati
2025-09-18 11:34:31 +02:00
parent 1015c1f5f0
commit bc9c59f186
9 changed files with 262 additions and 1 deletions
+2
View File
@@ -75,6 +75,8 @@ MESSAGE_DEF(NGAP_HANDOVER_REQUIRED, MESSAGE_PRIORITY_MED, ngap_handover_required
MESSAGE_DEF(NGAP_HANDOVER_FAILURE, MESSAGE_PRIORITY_MED, ngap_handover_failure_t, ngap_handover_failure)
MESSAGE_DEF(NGAP_HANDOVER_REQUEST_ACKNOWLEDGE, MESSAGE_PRIORITY_MED, ngap_handover_request_ack_t, ngap_handover_request_ack)
MESSAGE_DEF(NGAP_HANDOVER_NOTIFY, MESSAGE_PRIORITY_MED, ngap_handover_notify_t, ngap_handover_notify)
MESSAGE_DEF(NGAP_UL_RAN_STATUS_TRANSFER, MESSAGE_PRIORITY_MED, ngap_ran_status_transfer_t, ngap_ul_ran_status_transfer)
MESSAGE_DEF(NGAP_DL_RAN_STATUS_TRANSFER, MESSAGE_PRIORITY_MED, ngap_ran_status_transfer_t, ngap_dl_ran_status_transfer)
/* NGAP -> RRC messages */
MESSAGE_DEF(NGAP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, ngap_downlink_nas_t , ngap_downlink_nas )
+46
View File
@@ -76,6 +76,9 @@
#define NGAP_PDUSESSION_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_release_command
#define NGAP_PDUSESSION_RELEASE_RESPONSE(mSGpTR) (mSGpTR)->ittiMsg.ngap_pdusession_release_resp
#define NGAP_UL_RAN_STATUS_TRANSFER(mSGpTR) (mSGpTR)->ittiMsg.ngap_ul_ran_status_transfer
#define NGAP_DL_RAN_STATUS_TRANSFER(mSGpTR) (mSGpTR)->ittiMsg.ngap_dl_ran_status_transfer
//-------------------------------------------------------------------------------------------//
/* Length of the transport layer address string
@@ -963,4 +966,47 @@ typedef struct ngap_pdusession_release_resp_s {
} ngap_pdusession_release_resp_t;
/** 9.2.3.14 Uplink RAN Status Transfer (3GPP TS 38.413)
* COUNT value used for both UL and DL PDCP SN + HFN (12-bit or 18-bit SN) */
// Indicates PDCP SN length
typedef enum { NGAP_SN_LENGTH_12 = 0, NGAP_SN_LENGTH_18 = 1 } ngap_sn_length_t;
typedef struct {
// PDCP Sequence Number
uint32_t pdcp_sn;
// Hyper Frame Number
uint32_t hfn;
// SN length
ngap_sn_length_t sn_len;
} ngap_drb_count_value_t;
// DRBs Subject to Status Transfer Item
typedef struct {
// DRB ID
uint8_t drb_id;
// UL COUNT value
ngap_drb_count_value_t ul_count;
// DL COUNT value
ngap_drb_count_value_t dl_count;
} ngap_drb_status_t;
// RAN Status Transfer Transparent Container (9.3.1.108)
typedef struct {
// Number of DRBs in the list
uint8_t nb_drb;
// DRB Status List
ngap_drb_status_t drb_status_list[MAX_DRBS_PER_UE];
} ngap_ran_status_container_t;
// Uplink RAN Status Transfer message (9.2.3.14)
typedef struct {
// AMF UE NGAP ID (Mandatory)
uint64_t amf_ue_ngap_id;
// RAN UE NGAP ID (Mandatory)
uint32_t gnb_ue_ngap_id;
// RAN Status Transfer Transparent Container (Mandatory)
ngap_ran_status_container_t ran_status;
} ngap_ran_status_transfer_t;
#endif /* NGAP_MESSAGES_TYPES_H_ */