Skip to content

Rework ngap

Thomas Laurent requested to merge rework-ngap into develop

This MR simplifies the internal data model:

  • ue_initial_id removed
  • local_uid removed
  • ue_id_rnti removed
  • ngap specific ue ids removed
  • GNB_INSTANCE_TO_MODULE_ID removed
  • initial_id2_s1ap_ids removed
  • s1ap_id2_s1ap_ids removed
  • initial_id2_ngap_ids removed
  • ngap_id2_ngap_ids removed
  • ngap_ue_head removed
  • removed functions associated to these keys like rrc_gNB_NGAP_get_ue_ids() (i don't even understand how this function was working) rrc_gNB_NGAP_remove_ue_ids() , ...
  • rrc_gNB_create_ue_context() new function clearly create a new UE
  • most of direct calls to RB_FIND, ... removed to make a proper UE context storage, isolated and accessed only by key
  • gNB_RRC_UE_t *UE = &ue_context_p->ue_context added in a lot of places to prepare the fix of incorrect usage of RB_TREEs (today we have to make a rrc_gNB_ue_context_t of 600KB to search for a ue id, and this model prevents to use multiple search keys, so the function rrc_gNB_get_ue_context_by_rnti() perform sequential search)
  • separated access by rnti from by 5GC dialog ue id (RRC uniq ue id)
  • ngap and RRC uses the same UE id, allocated by uid_linear_allocator_new()
  • multiple copies of the same key (rnti, various ue ids) removed
  • rrc still search ue by rnti in multiple cases, but it is now identified by a separate function

It simplifies the pdusession transfer and it's management: no decoding in a intermediate structure before NGAP gives it to RRC
RRC now decoded the QoS values in the data usage place

it removes partially the multiple states in RRC for pdu sessions (pdusession_admitted_tobe_added_t, pdusession_tobe_added_t disappear), but "modify pdu session", and several redundant RRC data structures related to pdu session remain and are still incoherent (locks and make impossible to manage correctly states during the UE life cycle, with re-establisment for example). A future MR will remove more redundant data structures. it fixes the multi pdu sessions wrong array indexes such as in drb_config_gtpu_create() that hardcoded to index 0
removed the attribute ((packed)) on pdu session params, that has no need and reduce code performance

it compacts in a readable code several on asn1c calls, using intermediate pointers to avoid 200+ characters lines, impossible to read

NR_SRB_INFO_TABLE_ENTRY data type used in srb1, srb2 variables, replaced by a array, as srb3 may be used later, we won't continue with different variable names

move one source local functions to this source scope when i found it (static functions)

start to remove const protocol_ctxt_t *const ctxt_pP passed everywhere in RRC to make something comprehensive and accurate
after other MRs, the target is to remove entirely this struct and associated unreadable macros like PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP)

removed/grouped bad itti trace usage like passing "const char *msg_name" in many functions while it is useless

fixed several memory leaks

Edited by Thomas Laurent

Merge request reports