[PATCH] osmo-pcu[master]: EGPRS: add test case to show EPDAN BSN out of window bug

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

arvind.sirsikar gerrit-no-reply at lists.osmocom.org
Tue Sep 20 09:13:39 UTC 2016


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/861

to look at the new patch set (#2).

EGPRS: add test case to show EPDAN BSN out of window bug

This patch adds a test case test_tbf_egprs_epdan which
expects a current bug with EPDAN for Interpretation of the bitmap
explained in section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7.
the specification explains that A bit within the uncompressed bitmap
whose corresponding BSN is not within the transmit window shall be
ignored. But current PCU implementation ignores EPDAN
The test's expectation is corrected along with the bug
fix in a subsequent commit

Change-Id: If32b67f5c05707155281128b776a90a1e3d587b2
Related: OS#1789
---
M src/rlc.h
M tests/tbf/TbfTest.cpp
M tests/tbf/TbfTest.err
M tests/tbf/TbfTest.ok
4 files changed, 164 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/61/861/2

diff --git a/src/rlc.h b/src/rlc.h
index b693418..2baf134 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -302,6 +302,9 @@
 	const uint16_t v_a() const;
 	const int16_t distance() const;
 
+	void set_v_s(int);
+	void set_v_a(int);
+
 	/* Methods to manage reception */
 	int resend_needed();
 	int mark_for_resend();
@@ -509,6 +512,16 @@
 	return m_v_s;
 }
 
+inline void  gprs_rlc_dl_window::set_v_s(int v_s)
+{
+	m_v_s = v_s;
+}
+
+inline void  gprs_rlc_dl_window::set_v_a(int v_a)
+{
+	m_v_a = v_a;
+}
+
 inline const uint16_t gprs_rlc_dl_window::v_s_mod(int offset) const
 {
 	return mod_sns(m_v_s + offset);
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 3e17d8f..5be5686 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -26,6 +26,7 @@
 #include "pcu_utils.h"
 #include "gprs_bssgp_pcu.h"
 #include "pcu_l1_if.h"
+#include "decoding.h"
 
 extern "C" {
 #include "pcu_vty.h"
@@ -2016,6 +2017,117 @@
 
 	printf("=== end %s ===\n", __func__);
 }
+/*
+ * This test simulates the section 9.1.8.2.4 of 44.060
+ * version 7.27.0 Release 7. which explains the Interpretation of the bitmap
+ * as a bit within the uncompressed bitmap whose BSN is not within the transmit
+ * window shall be ignored. Which fails because of existing bug. This test case
+ * expects the same bug. which shall be fixed in subsequent patch
+ */
+static void egprs_tbf_epdan_outof_rx_window(BTS *the_bts, int mcs)
+{
+	unsigned i;
+	uint8_t ms_class = 11;
+	uint8_t egprs_ms_class = 11;
+	uint32_t fn = 2654167; /* 17,25,9 */
+	uint8_t trx_no;
+	int num_blocks;
+	uint32_t tlli = 0xffeeddcc;
+	uint8_t rbb[64/8];
+	gprs_rlcmac_dl_tbf *dl_tbf;
+	int ts_no = 7;
+	bitvec *block;
+	uint8_t bits_data[RLC_EGPRS_MAX_WS/8];
+	bitvec bits;
+	int bsn_begin, bsn_end;
+	EGPRS_PD_AckNack_t *ack_nack;
+	RlcMacUplink_t ul_control_block;
+	gprs_rlcmac_bts *bts;
+
+	/*
+	 * Over the Air message captured. The same has been used
+	 * used to simulate the EPDAN out of window scenario. During
+	 * over the air testing, v_a was 1176, vs was 1288, max sns was 2048
+	 * and window size of 480. same has been used below
+	 */
+	uint8_t data_msg[23] = {0x40, 0x20, 0x0b, 0xff, 0xd1,
+				0x61, 0x00, 0x3e, 0x0e, 0x51, 0x9f,
+				0xff, 0xff, 0xfb, 0x80, 0x00, 0x00,
+				0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+	bts = the_bts->bts_data();
+
+	bts->initial_mcs_dl = mcs;
+
+	dl_tbf = create_dl_tbf(the_bts, ms_class, egprs_ms_class, &trx_no);
+	dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
+
+	dl_tbf->m_window.set_v_s(1288);
+	dl_tbf->m_window.set_v_a(1176);
+	dl_tbf->m_window.set_sns(2048);
+	dl_tbf->m_window.set_ws(480);
+	dl_tbf->m_window.m_v_b.mark_unacked(1176);
+	dl_tbf->m_window.m_v_b.mark_unacked(1177);
+	dl_tbf->m_window.m_v_b.mark_unacked(1287);
+	dl_tbf->m_window.m_v_b.mark_unacked(1286);
+
+	OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW));
+
+	block = bitvec_alloc(23);
+
+	bitvec_unpack(block, data_msg);
+
+	bits.data = bits_data;
+	bits.data_len = sizeof(bits_data);
+	bits.cur_bit = 0;
+
+	decode_gsm_rlcmac_uplink(block, &ul_control_block);
+
+	ack_nack = &ul_control_block.u.Egprs_Packet_Downlink_Ack_Nack;
+
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1176));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1177));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1287));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1286));
+
+	num_blocks = Decoding::decode_egprs_acknack_bits(
+		&ack_nack->EGPRS_AckNack.Desc, &bits,
+		&bsn_begin, &bsn_end, &dl_tbf->m_window);
+
+	dl_tbf->rcvd_dl_ack(
+		ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION,
+		bsn_begin, &bits);
+
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1176));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1177));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1287));
+	OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1286));
+
+	bitvec_free(block);
+	tbf_free(dl_tbf);
+}
+
+static void test_tbf_egprs_epdan(void)
+{
+	BTS the_bts;
+	gprs_rlcmac_bts *bts;
+	uint8_t ts_no = 4;
+	int i;
+
+	printf("=== start %s ===\n", __func__);
+
+	bts = the_bts.bts_data();
+
+	setup_bts(&the_bts, ts_no);
+	bts->dl_tbf_idle_msec = 200;
+	bts->egprs_enabled = 1;
+	/* ARQ II */
+	bts->dl_arq_type = EGPRS_ARQ2;
+
+	egprs_tbf_epdan_outof_rx_window(&the_bts, 4);
+
+	printf("=== end %s ===\n", __func__);
+}
 
 static void test_tbf_egprs_two_phase_spb(void)
 {
@@ -2695,6 +2807,7 @@
 	test_tbf_puan_urbb_len();
 	test_tbf_update_ws();
 	test_tbf_li_decoding();
+	test_tbf_egprs_epdan();
 
 	if (getenv("TALLOC_REPORT_FULL"))
 		talloc_report_full(tall_pcu_ctx, stderr);
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 0c9c877..877e0ad 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -6521,3 +6521,39 @@
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0.
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append
+Searching for first unallocated TFI: TRX=0
+ Found TFI=0.
+********** TBF starts here **********
+Allocating DL TBF: MS_CLASS=11/11
+Creating MS object, TLLI = 0x00000000
+Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11
+Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11
+Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS
+Slot Allocation (Algorithm A) for class 0
+- Skipping TS 0, because not enabled
+- Skipping TS 1, because not enabled
+- Skipping TS 2, because not enabled
+- Skipping TS 3, because not enabled
+- Skipping TS 5, because not enabled
+- Skipping TS 6, because not enabled
+- Skipping TS 7, because not enabled
+- Assign downlink TS=4 TFI=0
+PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
+- Setting Control TS 4
+Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
+Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
+TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
+TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
+The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge
+- ack:  (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1288)  R=ACK I=NACK
+- ack range is out of V(A)..V(S) range TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Free TBF!
+DL packet loss of IMSI= / TLLI=0xffeeddcc: 100%
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to RELEASING
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free
+TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX!
+PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000.
+Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS)
+Destroying MS object, TLLI = 0xffeeddcc
+********** TBF ends here **********
diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok
index eb870ea..bbc0af6 100644
--- a/tests/tbf/TbfTest.ok
+++ b/tests/tbf/TbfTest.ok
@@ -66,3 +66,5 @@
 === end test_tbf_update_ws ===
 === start test_tbf_li_decoding ===
 === end test_tbf_li_decoding ===
+=== start test_tbf_egprs_epdan ===
+=== end test_tbf_egprs_epdan ===

-- 
To view, visit https://gerrit.osmocom.org/861
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If32b67f5c05707155281128b776a90a1e3d587b2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: arvind.sirsikar <arvind.sirsikar at radisys.com>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list