diff --git a/src/osmo_gsm_tester/obj/enb.py b/src/osmo_gsm_tester/obj/enb.py index f15bbe30..906164ee 100644 --- a/src/osmo_gsm_tester/obj/enb.py +++ b/src/osmo_gsm_tester/obj/enb.py @@ -30,6 +30,9 @@ def on_register_schemas(): 'gtp_bind_addr': schema.IPV4, 'id': schema.UINT, 'num_prb': schema.UINT, + 'duplex': schema.STR, + 'tdd_uldl_config': schema.UINT, + 'tdd_special_subframe_pattern': schema.UINT, 'transmission_mode': schema.LTE_TRANSMISSION_MODE, 'tx_gain': schema.UINT, 'rx_gain': schema.UINT, @@ -83,6 +86,7 @@ class eNodeB(log.Origin, metaclass=ABCMeta): self.set_name('%s_%s' % (name, self._run_node.run_addr())) self._txmode = 0 self._id = None + self._duplex = None self._num_prb = 0 self._num_cells = None self._epc = None @@ -144,6 +148,8 @@ class eNodeB(log.Origin, metaclass=ABCMeta): config.overlay(values, dict(enb=self._conf)) self._id = int(values['enb'].get('id', None)) assert self._id is not None + self._duplex = values['enb'].get('duplex', None) + assert self._duplex self._num_prb = int(values['enb'].get('num_prb', None)) assert self._num_prb self._txmode = int(values['enb'].get('transmission_mode', None)) diff --git a/src/osmo_gsm_tester/obj/enb_amarisoft.py b/src/osmo_gsm_tester/obj/enb_amarisoft.py index 9bed63ee..ef281009 100644 --- a/src/osmo_gsm_tester/obj/enb_amarisoft.py +++ b/src/osmo_gsm_tester/obj/enb_amarisoft.py @@ -263,6 +263,12 @@ class AmarisoftENB(enb.eNodeB): return rfemu_obj def ue_max_rate(self, downlink=True, num_carriers=1): + if self._duplex == 'fdd': + return self.ue_max_rate_fdd(downlink, num_carriers) + else: + return self.ue_max_rate_tdd(downlink, num_carriers) + + def ue_max_rate_fdd(self, downlink, num_carriers): # The max rate for a single UE per PRB configuration in TM1 with MCS 28 QAM64 max_phy_rate_tm1_dl = { 6 : 3.2e6, 15 : 9.2e6, @@ -299,4 +305,19 @@ class AmarisoftENB(enb.eNodeB): return max_rate + def ue_max_rate_tdd(self, downlink, num_carriers): + # Max rate calculation for TDD depends on the acutal TDD configuration + # See: https://www.sharetechnote.com/html/Handbook_LTE_ThroughputCalculationExample_TDD.html + # and https://i0.wp.com/www.techtrained.com/wp-content/uploads/2017/09/Blog_Post_1_TDD_Max_Throughput_Theoretical.jpg + max_phy_rate_tdd_uldl_config0_sp0 = { 6 : 1.5e6, + 15 : 3.7e6, + 25 : 6.1e6, + 50 : 12.2e6, + 75 : 18.4e6, + 100 : 54.5e6 } + if downlink: + max_rate = max_phy_rate_tdd_uldl_config0_sp0[self.num_prb()] + else: + return 1e6 # dummy value, we need to replace that later + # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl index c5b8a1e6..a0f22ff8 100644 --- a/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl +++ b/src/osmo_gsm_tester/templates/amarisoft_enb.cfg.tmpl @@ -100,6 +100,11 @@ "${'{0:03}'.format(int(enb.mcc))}${'{0:02}'.format(int(enb.mnc))}", ], +% if enb.get('duplex') == "tdd": + uldl_config: ${enb.tdd_uldl_config}, + sp_config: ${enb.tdd_special_subframe_pattern}, +% endif + % if int(enb.get('transmission_mode')) == 1: n_antenna_dl: 1, /* number of DL antennas */ n_antenna_ul: 1, /* number of UL antennas */ @@ -180,7 +185,10 @@ /* TDD ack/nack feedback mode when a rel 10 UE is detected. It can be "bundling", "multiplexing", "cs" or "pucch3". By default is it the same as tdd_ack_nack_feedback_mode. */ +% if enb.get('duplex') == "tdd": + tdd_ack_nack_feedback_mode: "bundling", // tdd_ack_nack_feedback_mode_r10: "cs", +% endif /* number of PUCCH 1b CS resources. It determines the maximum number of UEs that can be scheduled in one TTI diff --git a/sysmocom/defaults.conf b/sysmocom/defaults.conf index 419c3a46..8201d051 100644 --- a/sysmocom/defaults.conf +++ b/sysmocom/defaults.conf @@ -110,6 +110,7 @@ enb: id: 0x19B mcc: 901 mnc: 70 + duplex: fdd transmission_mode: 1 num_cells: 1 inactivity_timer: 20000 diff --git a/sysmocom/scenarios/mod-enb-tdd.conf b/sysmocom/scenarios/mod-enb-tdd.conf new file mode 100644 index 00000000..3f6355b1 --- /dev/null +++ b/sysmocom/scenarios/mod-enb-tdd.conf @@ -0,0 +1,13 @@ +# TDD cell +modifiers: + enb: + - duplex: tdd + tdd_uldl_config: 0 + tdd_special_subframe_pattern: 4 + cell_list: + - cell_id: 0x01 + pci: 0x01 + dl_earfcn: 40620 + rf_port: 0 + scell_list: [] + ncell_list: []