From bbf4cd4a90109dcae1e996e6d79488e4fe0621d8 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 1 Aug 2025 13:38:05 +0200 Subject: [PATCH 1/6] gNB: fix scheduling of rel-17 SIBs --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index a6d48037a7..134b43f583 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -775,7 +775,7 @@ static bool test_other_sib_sched_occasion(int window_pos, int rel_frame, int rel_slot) { - int x = window_pos * window_len; + int x = (window_pos - 1) * window_len; int T = 8 << period; int test_frame = (frame - rel_frame) % MAX_FRAME_NUMBER; int si_slot = (x % n_slots_frame) + rel_slot; @@ -848,7 +848,7 @@ void schedule_nr_other_sib(module_id_t module_idP, for (int ssb = 0; ssb < num_ssb; ssb++) { for (int i = 0; i < schedInfo->schedulingInfoList.list.count; i++) { NR_SchedulingInfo_t *schedulingInfo = schedInfo->schedulingInfoList.list.array[i]; - if (test_other_sib_sched_occasion(i, + if (test_other_sib_sched_occasion(i + 1, window_length_sl, schedulingInfo->si_Periodicity, n_slots_frame, From 53208bd163ab9aad4387a30597b1bb561a468b46 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 1 Aug 2025 13:39:28 +0200 Subject: [PATCH 2/6] NR UE: fix calculation of SI window expiry --- .../NR_MAC_UE/nr_ue_dci_configuration.c | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 7a2e9c6ed9..4b0623d6fe 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -385,12 +385,14 @@ bool search_space_monitoring_ocasion_other_si(NR_UE_MAC_INST_t *mac, return false; } -bool is_window_valid(NR_UE_MAC_INST_t *mac, int window_slots, int abs_slot) +static bool is_window_valid(NR_UE_MAC_INST_t *mac, int window_slots, int abs_slot, int slots_per_frame) { if (mac->si_SchedInfo.si_window_start == -1) { // out of window return false; - } else if (abs_slot > mac->si_SchedInfo.si_window_start + window_slots) { + } else if ((abs_slot - mac->si_SchedInfo.si_window_start + MAX_FRAME_NUMBER * slots_per_frame) + % (MAX_FRAME_NUMBER * slots_per_frame) + >= window_slots) { // window expired mac->si_SchedInfo.si_window_start = -1; return false; @@ -407,33 +409,18 @@ static bool monitor_dci_for_other_SI(NR_UE_MAC_INST_t *mac, { // according to 5.2.2.3.2 in 331 const int abs_slot = frame * slots_per_frame + slot; + const si_schedinfo_config_t *config = mac->si_SchedInfo.si_SchedInfo_list.array[si_idx]; + const int window_slots = 5 << mac->si_SchedInfo.si_WindowLength; + const int x = (config->si_WindowPosition - 1) * window_slots; + const int T = 8 << config->si_Periodicity; // radio frame periodicity - si_schedinfo_config_t *config = mac->si_SchedInfo.si_SchedInfo_list.array[si_idx]; - int window_slots = 5 << mac->si_SchedInfo.si_WindowLength; - int x = (config->si_WindowPosition - 1) * window_slots; - int T = 8 << config->si_Periodicity; // radio frame periodicity - bool check_valid; - switch (config->type) { - case NR_SI_INFO : - if (mac->si_SchedInfo.si_window_start == -1) { - if ((frame % T) == (x / slots_per_frame) && (x % slots_per_frame == 0)) - mac->si_SchedInfo.si_window_start = abs_slot; // in terms of absolute slot number - } - check_valid = is_window_valid(mac, window_slots, abs_slot); - if (check_valid && search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame)) - return true; - break; - case NR_SI_INFO_v1700 : - if (mac->si_SchedInfo.si_window_start == -1) { - if ((frame % T == floor(x / slots_per_frame)) && (slot == x % slots_per_frame)) - mac->si_SchedInfo.si_window_start = abs_slot; - } - if (is_window_valid(mac, window_slots, abs_slot)) - return search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame); - break; - default : - AssertFatal(false, "Invalid SI-SchedulingInfo case\n"); + if (mac->si_SchedInfo.si_window_start == -1) { + if ((frame % T) == (x / slots_per_frame) && (slot == x % slots_per_frame)) + mac->si_SchedInfo.si_window_start = abs_slot; // in terms of absolute slot number } + if (is_window_valid(mac, window_slots, abs_slot, slots_per_frame)) + return search_space_monitoring_ocasion_other_si(mac, ss, abs_slot, frame, slot, slots_per_frame); + return false; } From d4f4cefd6bb15d4021b2dee0ca0d0999c3e110ff Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Jul 2025 11:54:43 +0000 Subject: [PATCH 3/6] set ntn-UlSyncValidityDuration-r17 to 5 seconds for LEO scenario Now that we reliably receive SIB19, we can set the ntn-UlSyncValidityDuration-r17 to a sane value and thus make sure that the UE always has up-to-date SIB19 information. --- .../conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf index d08d900098..59438e8800 100644 --- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf +++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf @@ -150,6 +150,8 @@ gNBs = #ext2 #ntn_Config_r17 + # This can be of values {s5, s10, s15, s20, s25, s30, s35, s40, s45, s50, s55, s60, s120, s180, s240, s900} + ntn-UlSyncValidityDuration-r17 = 5; cellSpecificKoffset_r17 = 40; ta-Common-r17 = 4627000; # 18.84 ms ta-CommonDrift-r17 = -230000; # -46 µs/s From 7827a40f19c2d1e19377e518decd6f39ce1ed526 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Jul 2025 11:57:54 +0000 Subject: [PATCH 4/6] NTN config: setting sib1_tda is not required anymore --- ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf | 1 - ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf index 59438e8800..010e8be87e 100644 --- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf +++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn-leo.conf @@ -16,7 +16,6 @@ gNBs = ////////// Physical parameters: - sib1_tda = 5; min_rxtxtime = 6; num_dlharq = 32; num_ulharq = 32; diff --git a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf index 7fbaac5f5b..bf3e6b295f 100644 --- a/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf +++ b/ci-scripts/conf_files/gnb.sa.band254.u0.25prb.rfsim.ntn.conf @@ -16,7 +16,6 @@ gNBs = ////////// Physical parameters: - sib1_tda = 5; min_rxtxtime = 6; disable_harq = 1; cu_sibs = [2]; From 16fd1bb67cd0e3b3adcc1232a08d6d1946034aff Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 25 Jul 2025 12:00:04 +0000 Subject: [PATCH 5/6] gNB: fix case when multiple Rel-17 SIBs would be defined The boolean value v17_sib was not set to true when allocating si_schedulingInfo_v17 and schedulingInfo2_r17. So multiple Rel-17 SIBs would lead to multiple allocations and only the last SIB being actually configured. Fix this by removing the redundant v17_sib variable and directly check if the memory was already allocated. Also move the definition and allocation of si_schedulingInfo_v17 closer to its actual usage. --- openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c index eba1152cd0..13e3014ca9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c +++ b/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c @@ -2418,9 +2418,7 @@ void update_SIB1_NR_SI(NR_BCCH_DL_SCH_Message_t *sib1_bcch, int num_sibs, int si schedulingInfo->si_BroadcastStatus = NR_SchedulingInfo__si_BroadcastStatus_broadcasting; schedulingInfo->si_Periodicity = NR_SchedulingInfo__si_Periodicity_rf16; bool reg_sib = false; - NR_SI_SchedulingInfo_v1700_t *si_schedulingInfo_v17 = NULL; NR_SchedulingInfo2_r17_t *schedulingInfo2_r17 = NULL; - bool v17_sib = false; for (int i = 0; i < num_sibs; i++) { int sib_num = sibs[i]; AssertFatal(sib_num > 1 && sib_num < 21, "other SIB invalid type\n"); @@ -2438,8 +2436,7 @@ void update_SIB1_NR_SI(NR_BCCH_DL_SCH_Message_t *sib1_bcch, int num_sibs, int si } asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list, mapping); } else { - if (v17_sib == false) { - si_schedulingInfo_v17 = calloc(1, sizeof(*si_schedulingInfo_v17)); + if (schedulingInfo2_r17 == NULL) { schedulingInfo2_r17 = calloc(1, sizeof(*schedulingInfo2_r17)); schedulingInfo2_r17->si_BroadcastStatus_r17 = NR_SchedulingInfo2_r17__si_BroadcastStatus_r17_broadcasting; schedulingInfo2_r17->si_Periodicity_r17 = NR_SchedulingInfo2_r17__si_Periodicity_r17_rf16; @@ -2458,7 +2455,8 @@ void update_SIB1_NR_SI(NR_BCCH_DL_SCH_Message_t *sib1_bcch, int num_sibs, int si AssertFatal(reg_sib, "At least 1 SIB from SchedulingInfo (SIB2 to SIB14 included) needs to be present\n"); asn1cSeqAdd(&info->schedulingInfoList.list, schedulingInfo); sib1->si_SchedulingInfo = info; - if (si_schedulingInfo_v17) { + if (schedulingInfo2_r17) { + NR_SI_SchedulingInfo_v1700_t *si_schedulingInfo_v17 = calloc_or_fail(1, sizeof(*si_schedulingInfo_v17)); asn1cSeqAdd(&si_schedulingInfo_v17->schedulingInfoList2_r17.list, schedulingInfo2_r17); NR_SIB1_v1610_IEs_t *sib1_v1610 = NULL; if (sib1->nonCriticalExtension) From 506dc7da52b05b3806775e11fe6425ffd576520b Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Fri, 1 Aug 2025 16:04:23 +0200 Subject: [PATCH 6/6] NR UE: invalidate SI window on successful SI reception to avoid wrongly reusing this old SI window for new SI reception This fix was suggested by Francesco Mani --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index fb0645560e..7752fcad4d 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -310,6 +310,7 @@ void nr_ue_decode_BCCH_DL_SCH(NR_UE_MAC_INST_t *mac, if (mac->get_otherSI[i]) mac->get_otherSI[i] = false; } + mac->si_SchedInfo.si_window_start = -1; T(T_NRUE_MAC_DL_PDU_WITH_DATA, T_INT(SI_RNTI), T_INT(-1 /* frame, unavailable here */),