From f1ae1025ad5e92d9d1263064944f33db3eaf2a68 Mon Sep 17 00:00:00 2001 From: Thomas Schlichter Date: Mon, 3 Feb 2025 15:13:51 +0000 Subject: [PATCH] fix: ta-Common is a round-trip-time, not a one-way delay --- ci-scripts/conf_files/gnb.sa.band66.ntn.25prb.rfsim.conf | 2 +- .../conf_files/gnb.sa.band66.ntn.leo.25prb.rfsim.conf | 2 +- doc/RUNMODEM.md | 4 ++-- nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h | 4 ++-- openair2/LAYER2/NR_MAC_UE/config_ue.c | 7 +++---- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 6 +++--- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- .../CONF/gnb.sa.band254.ntn.mu0.25prb.rfsim.conf | 2 +- .../CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf | 2 +- .../CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf | 2 +- .../CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf | 2 +- .../CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf | 4 ++-- .../CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf | 4 ++-- 13 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ci-scripts/conf_files/gnb.sa.band66.ntn.25prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band66.ntn.25prb.rfsim.conf index 76957182e1..393a3d57ef 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.ntn.25prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.ntn.25prb.rfsim.conf @@ -148,7 +148,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 478; - ta-Common-r17 = 29314900; # 119.37 ms + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; diff --git a/ci-scripts/conf_files/gnb.sa.band66.ntn.leo.25prb.rfsim.conf b/ci-scripts/conf_files/gnb.sa.band66.ntn.leo.25prb.rfsim.conf index 2cd1186dcd..d7d086f52e 100644 --- a/ci-scripts/conf_files/gnb.sa.band66.ntn.leo.25prb.rfsim.conf +++ b/ci-scripts/conf_files/gnb.sa.band66.ntn.leo.25prb.rfsim.conf @@ -149,7 +149,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 40; - ta-Common-r17 = 2317000; # 9.435 ms + ta-Common-r17 = 4634000; # 18.87 ms ta-CommonDrift-r17 = -230000; # -46 µs/s positionX-r17 = 0; positionY-r17 = -2166908; # -2816980.4 m diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md index d027f8553e..1aeee6a4dd 100644 --- a/doc/RUNMODEM.md +++ b/doc/RUNMODEM.md @@ -247,7 +247,7 @@ These parameters can be provided to the gNB in the conf file in the section `ser ... # GEO satellite cellSpecificKoffset_r17 = 478; - ta-Common-r17 = 29314900; # 119.37 ms + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; @@ -256,7 +256,7 @@ These parameters can be provided to the gNB in the conf file in the section `ser velocityVZ-r17 = 0; # LEO satellite # cellSpecificKoffset_r17 = 40; -# ta-Common-r17 = 2317000; # 9.435 ms +# ta-Common-r17 = 4634000; # 18.87 ms # ta-CommonDrift-r17 = -230000; # -46 µs/s # positionX-r17 = 0; # positionY-r17 = -2166908; # -2816980.4 m diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h index b8228778b6..0cdede0725 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -556,9 +556,9 @@ typedef struct { } fapi_nr_ta_command_pdu; typedef struct { - // N_common_ta_adj represents common propagation delay received in SIB19 (ms) + // N_common_ta_adj represents common round-trip-time between gNB and SAT received in SIB19 (ms) double N_common_ta_adj; - // N_UE_TA_adj calculated propagation delay from UE and SAT (ms) + // N_UE_TA_adj calculated round-trip-time between UE and SAT (ms) double N_UE_TA_adj; // drift rate of common ta in µs/s double ntn_ta_commondrift; diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 57792ac2ee..1baa26304f 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -246,7 +246,7 @@ static void config_common_ue_sa(NR_UE_MAC_INST_t *mac, } -// computes delay between ue and sat based on SIB19 ephemeris data +// computes round-trip-time between ue and sat based on SIB19 ephemeris data static double calculate_ue_sat_ta(const position_t *position_params, NR_PositionVelocity_r17_t *sat_pos) { // get UE position coordinates @@ -259,9 +259,8 @@ static double calculate_ue_sat_ta(const position_t *position_params, NR_Position double posy_0 = (double)sat_pos->positionY_r17 * 1.3; double posz_0 = (double)sat_pos->positionZ_r17 * 1.3; - double distance = sqrt(pow(posx - posx_0, 2) + pow(posy - posy_0, 2) + pow(posz - posz_0, 2)); - // this computation will ensure 3 decimal precision - double ta_ms = round(((distance / SPEED_OF_LIGHT) * 1000) * 1000.0) / 1000.0; + double distance = 2 * sqrt(pow(posx - posx_0, 2) + pow(posy - posy_0, 2) + pow(posz - posz_0, 2)); + double ta_ms = (distance / SPEED_OF_LIGHT) * 1000; return ta_ms; } diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 24fefe47af..1b4abe4fb8 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -554,9 +554,9 @@ typedef struct { } si_schedInfo_t; typedef struct ntn_timing_advance_components { - // N_common_ta_adj represents common propagation delay received in SIB19 (ms) + // N_common_ta_adj represents common round-trip-time between gNB and SAT received in SIB19 (ms) double N_common_ta_adj; - // N_UE_TA_adj calculated propagation delay from UE and SAT (ms) + // N_UE_TA_adj calculated round-trip-time between UE and SAT (ms) double N_UE_TA_adj; // drift rate of common ta in µs/s double ntn_ta_commondrift; @@ -682,7 +682,7 @@ static inline int GET_NTN_UE_K_OFFSET(const ntn_timing_advance_componets_t *ntn_ static inline double GET_COMPLETE_TIME_ADVANCE_MS(const ntn_timing_advance_componets_t *ntn_ta) { - return (ntn_ta->N_common_ta_adj + ntn_ta->N_UE_TA_adj) * 2; + return ntn_ta->N_common_ta_adj + ntn_ta->N_UE_TA_adj; } static inline long GET_DURATION_RX_TO_TX(const ntn_timing_advance_componets_t *ntn_ta) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 8f6dc4cc8c..94986c48b4 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -3620,7 +3620,7 @@ static void schedule_ntn_config_command(fapi_nr_dl_config_request_t *dl_config, ntn_config_command_pdu->ntn_ta_commondrift = mac->ntn_ta.ntn_ta_commondrift; ntn_config_command_pdu->N_common_ta_adj = mac->ntn_ta.N_common_ta_adj; ntn_config_command_pdu->N_UE_TA_adj = mac->ntn_ta.N_UE_TA_adj; - ntn_config_command_pdu->ntn_total_time_advance_ms = (mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj) * 2; + ntn_config_command_pdu->ntn_total_time_advance_ms = mac->ntn_ta.N_common_ta_adj + mac->ntn_ta.N_UE_TA_adj; dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_NTN_CONFIG_PARAMS; dl_config->number_pdus += 1; } diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu0.25prb.rfsim.conf index b206be672a..c883a63d02 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu0.25prb.rfsim.conf @@ -148,7 +148,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 478; //GEO - ta-Common-r17 = 29319745; + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf index 60489ea6c2..67be3dbb44 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band254.ntn.mu1.24prb.rfsim.conf @@ -148,7 +148,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 478; //GEO - ta-Common-r17 = 29319745; + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf index edcee7ee98..5a14f4fae6 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band255.ntn.mu0.25prb.rfsim.conf @@ -147,7 +147,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 478; //GEO - ta-Common-r17 = 29319745; + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf index 67f8eb6e85..c4213eb0d3 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band256.ntn.mu0.25prb.rfsim.conf @@ -147,7 +147,7 @@ gNBs = #ext2 #ntn_Config_r17 cellSpecificKoffset_r17 = 478; //GEO - ta-Common-r17 = 29319745; + ta-Common-r17 = 58629666; # 238.74 ms positionX-r17 = 0; positionY-r17 = 0; positionZ-r17 = 32433846; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf index b0bbbf1671..013ca6663b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.24PRB.usrpx300.conf @@ -167,7 +167,7 @@ gNBs = #ntn_Config_r17 # GEO satellite # cellSpecificKoffset_r17 = 478; -# ta-Common-r17 = 29314900; # 119.37 ms +# ta-Common-r17 = 58629666; # 238.74 ms # positionX-r17 = 0; # positionY-r17 = 0; # positionZ-r17 = 32433846; @@ -176,7 +176,7 @@ gNBs = # velocityVZ-r17 = 0; # LEO satellite # cellSpecificKoffset_r17 = 40; -# ta-Common-r17 = 2317000; # 9.435 ms +# ta-Common-r17 = 4634000; # 18.87 ms # ta-CommonDrift-r17 = -230000; # -46 µs/s # positionX-r17 = 0; # positionY-r17 = -2166908; # -2816980.4 m diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf index 4fc4a07c21..c9dfd6c58a 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band66.fr1.25PRB.usrpx300.conf @@ -167,7 +167,7 @@ gNBs = #ntn_Config_r17 # GEO satellite # cellSpecificKoffset_r17 = 478; -# ta-Common-r17 = 29314900; # 119.37 ms +# ta-Common-r17 = 58629666; # 238.74 ms # positionX-r17 = 0; # positionY-r17 = 0; # positionZ-r17 = 32433846; @@ -176,7 +176,7 @@ gNBs = # velocityVZ-r17 = 0; # LEO satellite # cellSpecificKoffset_r17 = 40; -# ta-Common-r17 = 2317000; # 9.435 ms +# ta-Common-r17 = 4634000; # 18.87 ms # ta-CommonDrift-r17 = -230000; # -46 µs/s # positionX-r17 = 0; # positionY-r17 = -2166908; # -2816980.4 m