Change in osmo-ttcn3-hacks[master]: library/PCUIF_Types: version 10: add Mobile Allocation length field

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Sep 5 18:10:50 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19991 )


Change subject: library/PCUIF_Types: version 10: add Mobile Allocation length field
......................................................................

library/PCUIF_Types: version 10: add Mobile Allocation length field

My initial assumption was that we can skip redundant '0'B bits or
even '00'O octets in the Mobile Allocation IE, and thus reduce
the overall size of this element.  Unfortunately, this is wrong.

3GPP TS 44.018, section 10.5.2.21 clearly states that the Mobile
Allocation IE contains a bit-string of size NF, where NF is the
number of frequencies in the cell allocation.  If NF % 8 != 0,
then '0'B padding bits must be appended to make it octet-aligned.

In other words, if the cell allocation contains let's say 13
frequencies, but a hopping timeslot makes use of only a small
fraction of it (e.g. 4 first channels), we would still need to
transmit at least 13 bits (+padding), including all redundant
bits and octets.

In RLC/MAC frames though it's not required to make the bit-string
octet aligned, so we need to send exactly NF bits without padding.

In order to achieve that:

  a) add MA length field to INFO.ind (record PCUIF_InfoTrxTs);
  b) ajust the existing test cases to use this field.

It's safe to merge this change as the related patches have not
been merged to osmo-pcu and osmo-bts yet.

Change-Id: I2709673c90a0cd7d76de9db8b8ad82ac59ca84a0
Related: SYS#4868, OS#4547
---
M library/PCUIF_Types.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 15 insertions(+), 23 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/19991/1

diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 8144d97..f0200af 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -145,6 +145,7 @@
 	uint8_t			hopping,
 	uint8_t			hsn,
 	uint8_t			maio,
+	uint8_t			ma_bit_len,
 	bitstring		ma length(64)
 } with { variant (ma) "BYTEORDER(first), BITORDER(msb)" };
 private type record length(8) of PCUIF_InfoTrxTs PCUIF_InfoTrxTsList;
@@ -709,12 +710,14 @@
 	tsc := tsc,
 	hopping := 0,
 	hsn := 0, maio := 0,
+	ma_bit_len := 0,
 	ma := f_pad_bit(''B, 64, '0'B)
 };
 template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH0(template uint3_t tsc := ?) := {
 	tsc := tsc,
 	hopping := 0,
 	hsn := ?, maio := ?,
+	ma_bit_len := ?,
 	ma := ?
 };
 
@@ -726,16 +729,19 @@
 	hopping := 1,
 	hsn := hsn,
 	maio := maio,
+	ma_bit_len := lengthof(valueof(ma)),
 	ma := f_pad_bit(valueof(ma), 64, '0'B)
 };
 template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH1(template uint3_t tsc := ?,
 					      template uint6_t hsn := ?,
 					      template uint6_t maio := ?,
-					      template bitstring ma := ?) := {
+					      template bitstring ma := ?,
+					      template uint8_t ma_bit_len := ?) := {
 	tsc := tsc,
 	hopping := 1,
 	hsn := hsn,
 	maio := maio,
+	ma_bit_len := ma_bit_len,
 	ma := ma
 };
 
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 2d20975..a4596bf 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -2193,18 +2193,12 @@
 			   ia.pkt_chan_desc, " vs ", tr_pkt_chan_desc);
 	}
 
-	var MobileAllocationLV tr_ma := { len := 0, ma := ''B };
-	var octetstring ma_oct := bit2oct(ts.ma);
-
-	/* Calculate length of the useful part of Mobile Allocation */
-	for (var integer i := 0; i < lengthof(ma_oct); i := i + 1) {
-		if (ma_oct[i] != '00'O) {
-			tr_ma.len := i + 1;
-		}
-	}
-
-	/* Strip zero bytes from the right side of MA */
-	tr_ma.ma := substr(ts.ma, 0, tr_ma.len * 8);
+	/* Mobile Allocation is expected to be octet-aligned */
+	var uint8_t ma_oct_len := (ts.ma_bit_len + 8 - 1) / 8;
+	var template MobileAllocationLV tr_ma := {
+		len := ma_oct_len, /* in bytes */
+		ma := substr(ts.ma, 0, ma_oct_len * 8)
+	};
 
 	if (not match(ia.mobile_allocation, tr_ma)) {
 		setverdict(fail, "Mobile Allocation does not match: ",
@@ -2284,14 +2278,6 @@
 {
 	/* FIXME: TRX0/TS7 is a hard-coded expectation, make it configurable */
 	var PCUIF_InfoTrxTs ts := info_ind.trx.v10[0].ts[7];
-	var integer ma_bit_len := 0;
-
-	/* Calculate length of the useful part of Mobile Allocation */
-	for (var integer i := 0; i < lengthof(ts.ma); i := i + 1) {
-		if (ts.ma[i] == '1'B) {
-			ma_bit_len := i + 1;
-		}
-	}
 
 	/* Table 12.8.1: Frequency Parameters information elements */
 	var template FrequencyParameters tr_fp := {
@@ -2307,8 +2293,8 @@
 				rfl_number_list_present := '0'B,
 				rfl_number_list := omit,
 				ma_present := '0'B, /* inverted logic */
-				ma_length := ma_bit_len,
-				ma_bitmap := substr(ts.ma, 0, ma_bit_len)
+				ma_length := ts.ma_bit_len,
+				ma_bitmap := substr(ts.ma, 0, ts.ma_bit_len)
 			}
 		},
 		direct2 := omit

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19991
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2709673c90a0cd7d76de9db8b8ad82ac59ca84a0
Gerrit-Change-Number: 19991
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200905/7e9084a2/attachment.htm>


More information about the gerrit-log mailing list