aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tbf/TbfTest.cpp
diff options
context:
space:
mode:
authoraravind sirsikar <arvind.sirsikar@radisys.com>2016-12-30 12:24:38 +0530
committeraravind sirsikar <arvind.sirsikar@radisys.com>2016-12-30 12:24:38 +0530
commit9ddc3c7845b094911b3eba1d17e6a74d7e7503ee (patch)
tree035d753a3f4770dbc6c7a2ffb551fae78d27276b /tests/tbf/TbfTest.cpp
parentd3ae14c18f44d24c0a5c592fa9bdc9350b90cfd3 (diff)
PDCH allocation across two TRXradisys/egprs_features
Implementation: PCU keeps track of number PDCH across all the TRXs at BTS context and also keeps number of active PDCHs in each TRX context. This ratio gives the CAPACITY of each TRX. 1st Phase: While selection of TRX, functions get_possible_trxs(for multiple TS) and get_possible_trxs_sba(Single block allocation, Ex: during RACH) gets possible TRXs based on TFIs availability. 2nd Phase: outcome of TRXs(from get_possible_trxs, get_possible_trxs_sba) will be fed to get_suitable_trx function. Which does actual load balancing on each TRX. And selects the best fit TRX, based on below equation PROBABILITY = MAX_PROBABILITY – ((LOAD * 100)/CAPACITY); If same PROBABILITY Select the one with higher capacity Else Find the TRX with higher PROBABILITY MAX_PROBABILITY = 65535; LOAD: Initialized to 0, Later gets incremented with number of TS allocated. and decremented whle TBF deletion, based on number of TS allocated Below are the test executed on Unit test environment 1) 2 TRXs, with same Capacity 2) 2 TRX with ½ capacity 3) 2 TRXs with ¼ capacity 4) 2 TRX with UL and DL allocation to ensure Tbfs on both direction is hosted on same TRX 5) 2 TRX with same Capacity and DL TBF creation and deletion scenarios to ensure proper load balancing criteria for actual Load. Below are the Test executed on Integration setup with Ettus B200 setup with 2 TRXs with same CAPACITY. 1) TRX allocation during RACH procedure(SBA allocation) 2) TRX allocation during DL TBF creation with multi time slots(4 time slots) 3) TRX allocation while Ping Test 4) TRX allocation while UDP test 5) TRX allocation for web browsing. 6) 2 MS test with each TRX sharing 1 MS. Received aggregate throughput of 446 kbps(223 Kbps each) Limitation: 1) BSSGP flow control needs to be tuned since test with 2 MS with each MS on different TRX runs for 20 mins 2) USF resource availibility is not checked while selecting the TRX as existing implementation Change-Id: Ifb61a7862d55af828383b6dfe728628e546ed12b Related: OS# 1775
Diffstat (limited to 'tests/tbf/TbfTest.cpp')
-rw-r--r--tests/tbf/TbfTest.cpp258
1 files changed, 258 insertions, 0 deletions
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 675cc8a..4bca8a8 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -3350,6 +3350,263 @@ static void test_packet_access_rej_prr()
printf("=== end %s ===\n", __func__);
}
+void test_multi_trx_test_same_capacity()
+{
+ BTS the_bts;
+ static gprs_rlcmac_dl_tbf *dl_tbf;
+ uint8_t trx_no = 0xff;
+ uint8_t ms_class = 1;
+ uint8_t egprs_ms_class = 1;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, 4);
+ the_bts.bts_data()->trx[0].pdch[5].enable();
+ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_b;
+ the_bts.bts_data()->trx[1].pdch[4].enable();
+ the_bts.bts_data()->trx[1].pdch[5].enable();
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+
+ printf("=== end %s ===\n", __func__);
+
+}
+
+void test_multi_trx_test_1_2_capacity()
+{
+ BTS the_bts;
+ static gprs_rlcmac_dl_tbf *dl_tbf;
+ uint8_t trx_no = 0xff;
+ uint8_t ms_class = 1;
+ uint8_t egprs_ms_class = 1;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, 4);
+ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_b;
+ the_bts.bts_data()->trx[0].pdch[5].enable();
+ the_bts.bts_data()->trx[1].pdch[4].enable();
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+
+ printf("=== end %s ===\n", __func__);
+
+}
+
+void test_multi_trx_test_1_4_capacity()
+{
+ BTS the_bts;
+ static gprs_rlcmac_dl_tbf *dl_tbf;
+ uint8_t trx_no = 0xff;
+ uint8_t ms_class = 1;
+ uint8_t egprs_ms_class = 1;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, 4);
+ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_b;
+
+ the_bts.bts_data()->trx[0].pdch[5].enable();
+ the_bts.bts_data()->trx[0].pdch[6].enable();
+ the_bts.bts_data()->trx[0].pdch[7].enable();
+ the_bts.bts_data()->trx[1].pdch[0].enable();
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+
+ printf("=== end %s ===\n", __func__);
+}
+
+void test_multi_trx_test_release_alloc()
+{
+ BTS the_bts;
+ static gprs_rlcmac_dl_tbf *dl_tbf;
+ uint8_t trx_no = 0xff;
+ uint8_t ms_class = 1;
+ uint8_t egprs_ms_class = 1;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, 4);
+ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_b;
+
+ the_bts.bts_data()->trx[0].pdch[5].enable();
+ the_bts.bts_data()->trx[1].pdch[0].enable();
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ tbf_free(dl_tbf);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ tbf_free(dl_tbf);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ tbf_free(dl_tbf);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+
+ printf("=== end %s ===\n", __func__);
+}
+
+void test_multi_trx_test_same_capacity_dl_ul_combined()
+{
+ BTS the_bts;
+ static gprs_rlcmac_dl_tbf *dl_tbf;
+ static gprs_rlcmac_ul_tbf *ul_tbf;
+ uint8_t trx_no = 0xff;
+ uint8_t ms_class = 1;
+ uint8_t egprs_ms_class = 1;
+
+ printf("=== start %s ===\n", __func__);
+
+ setup_bts(&the_bts, 4);
+ the_bts.bts_data()->alloc_algorithm = alloc_algorithm_b;
+ the_bts.bts_data()->trx[1].pdch[4].enable();
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ ul_tbf = tbf_alloc_ul(the_bts.bts_data(),
+ dl_tbf->trx->trx_no,
+ dl_tbf->ms_class(), dl_tbf->ms()->egprs_ms_class(),
+ dl_tbf->tlli(), dl_tbf->ta(), dl_tbf->ms());
+ OSMO_ASSERT(ul_tbf->trx->trx_no == 0);
+
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 1);
+ dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, trx_no,
+ ms_class, egprs_ms_class, 1);
+ OSMO_ASSERT(dl_tbf->trx->trx_no == 0);
+ ul_tbf = tbf_alloc_ul(the_bts.bts_data(),
+ dl_tbf->trx->trx_no,
+ dl_tbf->ms_class(), dl_tbf->ms()->egprs_ms_class(),
+ dl_tbf->tlli(), dl_tbf->ta(), dl_tbf->ms());
+ OSMO_ASSERT(ul_tbf->trx->trx_no == 0);
+
+ printf("=== end %s ===\n", __func__);
+
+}
+
+void test_multi_trx_test()
+{
+ printf("=== start %s ===\n", __func__);
+ test_multi_trx_test_same_capacity();
+ test_multi_trx_test_1_2_capacity();
+ test_multi_trx_test_1_4_capacity();
+ test_multi_trx_test_release_alloc();
+ test_multi_trx_test_same_capacity_dl_ul_combined();
+ printf("=== end %s ===\n", __func__);
+
+}
void test_packet_access_rej_epdan()
{
BTS the_bts;
@@ -3420,6 +3677,7 @@ int main(int argc, char **argv)
test_tbf_egprs_two_phase_puan();
test_packet_access_rej_prr();
test_packet_access_rej_prr_no_other_tbfs();
+ test_multi_trx_test();
if (getenv("TALLOC_REPORT_FULL"))
talloc_report_full(tall_pcu_ctx, stderr);