Change in osmo-ttcn3-hacks[master]: fr: Randomize packet size used in TC_ul2dl_ud()

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

laforge gerrit-no-reply at lists.osmocom.org
Thu Feb 4 13:58:40 UTC 2021


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


Change subject: fr: Randomize packet size used in TC_ul2dl_ud()
......................................................................

fr: Randomize packet size used in TC_ul2dl_ud()

This allows us to test with a variety of packet sizes up to [close to]
the MTU of the underlying transport (configurable by modulepar)

Change-Id: I8e38ecf6b270c81bd73ee43b1fa0b259a999c14b
---
M fr/FR_Tests.ttcn
1 file changed, 15 insertions(+), 1 deletion(-)



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

diff --git a/fr/FR_Tests.ttcn b/fr/FR_Tests.ttcn
index 974765e..5e4f9e8 100644
--- a/fr/FR_Tests.ttcn
+++ b/fr/FR_Tests.ttcn
@@ -10,6 +10,8 @@
 import from LLC_Templates all;
 
 modulepar {
+	/* NS transport layer MTU (NS header and anything after it) */
+	integer mp_ns_mtu := 1500;
 	/* number of BVCs to bring up in one Gb instance */
 	integer mp_num_bvc := 10;
 	/* number of UEs to start in each PTP BVC */
@@ -59,6 +61,15 @@
 	};
 }
 
+/* 4 bytes NS-UNITDATA,
+ * >= 12 Bytes DL-UNITDATA or 18 bytes BSSGP UL-UNITDATA
+ * 3 bytes LLC UI header
+ * 3 bytes LLC  FCS
+ * <= 3 bytes optional padding
+ * --> at least 31 bytes required
+ */
+const integer c_LLC_BSSGP_NS_overhead := 40;
+
 type record GbInstance {
 	NS_CT vc_NS,
 	BSSGP_CT vc_BSSGP,
@@ -259,15 +270,18 @@
 
 private function f_ul2dl_ud(charstring id) runs on UE_CT
 {
+	var integer max_llc_payload_len := mp_ns_mtu - c_LLC_BSSGP_NS_overhead;
+
 	for (var integer num_pkts := 0; num_pkts < 50; num_pkts := num_pkts + 1) {
 		var integer ran_index := 0;
 		var template (value) PDU_LLC llc_tx;
 		var template (present) PDU_LLC llc_rx_exp;
+		var octetstring llc_payload := f_rnd_octstring(f_rnd_int(max_llc_payload_len));
 		var PDU_LLC llc_rx;
 		timer T := 5.0;
 
 		/* SAPI '0010'B is looped back by FRNET_Tests.ttcn */
-		llc_tx := ts_LLC_UI(f_rnd_octstring(512), '0010'B, '1'B, 0);
+		llc_tx := ts_LLC_UI(llc_payload, '0010'B, '1'B, 0);
 		llc_rx_exp := llc_tx;
 		llc_rx_exp.pDU_LLC_UI.fCS := ?;
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22697
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: I8e38ecf6b270c81bd73ee43b1fa0b259a999c14b
Gerrit-Change-Number: 22697
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210204/e44985aa/attachment.htm>


More information about the gerrit-log mailing list