Change in osmo-ttcn3-hacks[master]: hnodeb: Updates in HNBLLIF and HNBGW_COnnectioNHandler to support and...

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 Dec 23 14:51:29 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26672 )

Change subject: hnodeb: Updates in HNBLLIF and HNBGW_COnnectioNHandler to support and test IuUP
......................................................................

hnodeb: Updates in HNBLLIF and HNBGW_COnnectioNHandler to support and test IuUP

Depends: osmo-hnodeb.git Change-Id Ibe356fa7b1abaca0091e368db8478e79c09c6cb0
Related: SYS#5516
Change-Id: I19612fce8190dfe14f98d346adb5db4e1c2a08d9
---
M hnodeb/HNBGW_ConnectionHandler.ttcn
M hnodeb/HNB_Tests.ttcn
M library/HNBLLIF_Templates.ttcn
M library/HNBLLIF_Types.ttcn
4 files changed, 116 insertions(+), 20 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/hnodeb/HNBGW_ConnectionHandler.ttcn b/hnodeb/HNBGW_ConnectionHandler.ttcn
index a3ff32f..ac280b0 100644
--- a/hnodeb/HNBGW_ConnectionHandler.ttcn
+++ b/hnodeb/HNBGW_ConnectionHandler.ttcn
@@ -248,13 +248,14 @@
 }
 
 /* Initialize and start the RTP emulation component for a ConnHdlr */
-function f_HNBGW_rtpem_activate(inout octetstring payload,
-				 HostName remote_host,
-				 PortNumber remote_port,
-				 RtpemConfig cfg := c_RtpemDefaultCfg,
-				 RtpemMode mode := RTPEM_MODE_BIDIR)
+function f_HNBGW_rtpem_activate(inout octetstring payload)
 runs on HNBGW_ConnHdlr {
-	/* Step 0: initialize, connect and start the emulation component */
+	/* Initialize, connect and start the emulation component */
+	var RtpemConfig cfg := c_RtpemDefaultCfg;
+	cfg.iuup_mode := true;
+	cfg.iuup_tx_init := false;
+	cfg.tx_payload_type := 96;
+
 	vc_RTPEM := RTP_Emulation_CT.create(testcasename() & "-RTPEM") alive;
 	map(vc_RTPEM:RTP, system:RTP);
 	map(vc_RTPEM:RTCP, system:RTCP);
@@ -274,11 +275,15 @@
 	/* Bind the RTP emulation to the configured address */
 	f_rtpem_bind(RTPEM_CTRL, g_pars.hnbgw_addr, g_pars.hnbgw_rtp_port);
 
-	/* Connect to the IUT's address/port parsed from CRCX ACK */
-	f_rtpem_connect(RTPEM_CTRL, remote_host, remote_port);
-
 	/* Set the given RTP emulation mode */
-	f_rtpem_mode(RTPEM_CTRL, mode);
+	f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_RXONLY);
+}
+
+function f_HNBGW_rtpem_connect(HostName remote_host, PortNumber remote_port)
+runs on HNBGW_ConnHdlr {
+	f_rtpem_connect(RTPEM_CTRL, remote_host, remote_port);
+	/* Set the given RTP emulation mode */
+	f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_BIDIR);
 }
 
 }
diff --git a/hnodeb/HNB_Tests.ttcn b/hnodeb/HNB_Tests.ttcn
index c801ee6..a58e203 100644
--- a/hnodeb/HNB_Tests.ttcn
+++ b/hnodeb/HNB_Tests.ttcn
@@ -56,6 +56,8 @@
 import from GTP_Templates all;
 import from GTP_Emulation all;
 
+import from IuUP_Types all;
+
 modulepar {
 	/* IP address at which the HNodeB can be reached */
 	charstring mp_hnodeb_ip := "127.0.0.1";
@@ -297,6 +299,10 @@
 	var PortNumber hnodeb_rtp_port;
 	timer Tu;
 	var uint32_t audio_conn_id;
+	var IuUP_FQC fqc := IuUP_FQC_GOOD;
+
+	rtp_payload := f_rnd_octstring(6);
+	f_HNBGW_rtpem_activate(rtp_payload);
 
 	f_handle_hnbap_hnb_register_req();
 
@@ -326,11 +332,22 @@
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "hnodeb RTP local address doesn't match expectations");
 	}
 	hnodeb_rtp_port := sd.data.u.audio.u.conn_establish.u.cnf.local_rtp_port;
-	rtp_payload := f_rnd_octstring(6);
-	f_HNBGW_rtpem_activate(rtp_payload, hnodeb_rtp_addr, hnodeb_rtp_port);
+	f_HNBGW_rtpem_connect(hnodeb_rtp_addr, hnodeb_rtp_port);
+
+	/* We should eventually receive some RTP/IUUP from the HNBGW once Init phase goes on: */
+	Tu.start(2.0);
+	alt {
+	[] LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_DATA_IND(audio_conn_id, ?, enum2int(fqc), ?, rtp_payload)));
+	[] Tu.timeout {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for Downlink speech frames");
+		}
+	}
+	Tu.stop;
+	f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_RXONLY);
+
 	/* Make sure that Uplink frames are received at the HNBGW */
 	RTPEM_DATA.clear;
-	LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_DATA_REQ(audio_conn_id, rtp_payload)));
+	LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_DATA_REQ(audio_conn_id, 1, enum2int(fqc), 0, rtp_payload)));
 	Tu.start(2.0);
 	alt {
 	[] RTPEM_DATA.receive(PDU_RTP:?) -> value rtp_pdu {
@@ -345,10 +362,9 @@
 		}
 	}
 	Tu.stop;
-	/* We should also have received some RTP from the HNBGW: */
-	LLSK.receive(f_llsk_rx(tr_HNBLLIF_AUDIO_CONN_DATA_IND(audio_conn_id, rtp_payload)));
 
 	f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_NONE);
+	f_sleep(0.5); /* give some time to RTP_Emu to stop sending RTP packets... */
 
 	LLSK.send(f_llsk_tx(ts_HNBLLIF_AUDIO_CONN_RELEASE_REQ(audio_conn_id)));
 
diff --git a/library/HNBLLIF_Templates.ttcn b/library/HNBLLIF_Templates.ttcn
index fc82a72..6aee659 100644
--- a/library/HNBLLIF_Templates.ttcn
+++ b/library/HNBLLIF_Templates.ttcn
@@ -251,11 +251,42 @@
 /**********************
  * AUDIO SAPI
  **********************/
+const HNBLLIF_AUDIO_IPTIs IPTIs_default := {
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+private function f_subflow_sizes_default() return HNBLLIF_AUDIO_SubflowSizes
+{
+	var HNBLLIF_AUDIO_SubflowSizes ss;
+
+	for (var integer i := 0; i < HNBLLIF_MAX_RFCIS; i := i + 1) {
+		for (var integer j := 0; j < HNBLLIF_MAX_SUBFLOWS; j := j + 1) {
+			ss[i][j] := 0;
+		}
+	}
+
+	ss[0][0] := 81; ss[0][1] := 103; ss[0][2] := 60;
+	ss[1][0] := 39; ss[1][1] := 0; ss[1][2] := 0;
+	ss[2][0] := 0;  ss[2][1] := 0;   ss[2][2] := 0;
+
+	return ss;
+}
 
 template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_ESTABLISH_REQ(template (value) uint32_t context_id,
 								     template (value) uint16_t remote_rtp_port,
 								     template (value) HNBLLIF_AddrType remote_rtp_address_type,
-								     template (value) HNBLLIF_Addr remote_addr) := {
+								     template (value) HNBLLIF_Addr remote_addr,
+								     template (value) uint8_t transparent := 0,
+								     template (value) uint8_t data_pdu_type := 0,
+								     template (value) uint16_t supported_versions_mask := 3,
+								     template (value) uint8_t num_rfci := 3,
+								     template (value) uint8_t num_subflows := 3,
+								     template (value) HNBLLIF_AUDIO_SubflowSizes subflow_sizes := f_subflow_sizes_default(),
+								     template (value) uint8_t IPTIs_present := 0,
+								     template (value) HNBLLIF_AUDIO_IPTIs IPTIs := IPTIs_default) := {
 	sapi := HNBLL_IF_SAPI_AUDIO,
 	u := {
 		audio := {
@@ -269,7 +300,15 @@
 							remote_rtp_port := remote_rtp_port,
 							reserved := 0,
 							remote_rtp_address_type := remote_rtp_address_type,
-							remote_addr := remote_addr
+							remote_addr := remote_addr,
+							transparent := transparent,
+							data_pdu_type := data_pdu_type,
+							supported_versions_mask := supported_versions_mask,
+							num_rfci := num_rfci,
+							num_subflows := num_subflows,
+							subflow_sizes := subflow_sizes,
+							IPTIs_present := IPTIs_present,
+							IPTIs := IPTIs
 						}
 					}
 				}
@@ -327,7 +366,10 @@
 }
 
 template (present) HNBLLIF_Message tr_HNBLLIF_AUDIO_CONN_DATA_IND(template (present) uint32_t audio_conn_id := ?,
-							        template (present) octetstring data := ?) := {
+								  template (present) uint8_t frame_nr := ?,
+								  template (present) uint8_t fqc := ?,
+								  template (present) uint8_t rfci := ?,
+								  template (present) octetstring data := ?) := {
 	sapi := HNBLL_IF_SAPI_AUDIO,
 	u := {
 		audio := {
@@ -338,6 +380,10 @@
 					u := {
 						ind := {
 							audio_conn_id := audio_conn_id,
+							frame_nr := frame_nr,
+							fqc := fqc,
+							rfci := rfci,
+							spare := 0,
 							data_len := ?,
 							data := data
 						}
@@ -349,6 +395,9 @@
 }
 
 template (value) HNBLLIF_Message ts_HNBLLIF_AUDIO_CONN_DATA_REQ(template (value) uint32_t audio_conn_id,
+							      template (value) uint8_t frame_nr,
+							      template (value) uint8_t fqc,
+							      template (value) uint8_t rfci,
 							      template (value) octetstring data) := {
 	sapi := HNBLL_IF_SAPI_AUDIO,
 	u := {
@@ -360,6 +409,10 @@
 					u := {
 						req := {
 							audio_conn_id := audio_conn_id,
+							frame_nr := frame_nr,
+							fqc := fqc,
+							rfci := rfci,
+							spare := 0,
 							data_len := lengthof(data),
 							data := data
 						}
diff --git a/library/HNBLLIF_Types.ttcn b/library/HNBLLIF_Types.ttcn
index a3a6c4c..fa44f11 100644
--- a/library/HNBLLIF_Types.ttcn
+++ b/library/HNBLLIF_Types.ttcn
@@ -241,14 +241,28 @@
 	HNBLL_IF_AUDIO_MSG_CONN_DATA		('0002'O)
 } with { variant "FIELDLENGTH(16)" };
 
+const integer HNBLLIF_MAX_RFCIS := 64;
+const integer HNBLLIF_MAX_SUBFLOWS := 7;
+type record length(HNBLLIF_MAX_RFCIS) of uint8_t HNBLLIF_AUDIO_IPTIs;
+type record length(HNBLLIF_MAX_SUBFLOWS) of uint16_t HNBLLIF_AUDIO_RFCI_SubflowSizes;
+type record length(HNBLLIF_MAX_RFCIS) of HNBLLIF_AUDIO_RFCI_SubflowSizes HNBLLIF_AUDIO_SubflowSizes;
+
 /* CONN_ESTABLISH */
 type record HNBLLIF_AUDIO_conn_establish_req {
 	uint32_t context_id,
 	uint16_t remote_rtp_port,
 	uint8_t reserved,
 	HNBLLIF_AddrType remote_rtp_address_type,
-	HNBLLIF_Addr remote_addr
-} with { variant "" };
+	HNBLLIF_Addr remote_addr,
+	uint8_t transparent, /* 1=transparent; 0=SMpSDU */
+	uint8_t data_pdu_type,
+	uint16_t supported_versions_mask, /* host byte order */
+	uint8_t num_rfci,
+	uint8_t num_subflows,
+	HNBLLIF_AUDIO_SubflowSizes subflow_sizes,
+	uint8_t IPTIs_present, /* 1=present; 0=not present */
+	HNBLLIF_AUDIO_IPTIs IPTIs /* values range 0-15, 4 bits */
+} with { variant ""  };
 
 type record HNBLLIF_AUDIO_conn_establish_cnf {
 	uint32_t context_id,
@@ -292,12 +306,20 @@
 /* CONN_DATA */
 type record HNBLLIF_AUDIO_conn_data_ind {
 	uint32_t audio_conn_id,
+	uint8_t frame_nr,
+	uint8_t fqc, /* enumerated IuUP_FQC */
+	uint8_t rfci,
+	uint8_t spare,
 	uint32_t data_len,
 	octetstring data /* RANAP message */
 } with { variant (data_len) "LENGTHTO (data)" };
 
 type record HNBLLIF_AUDIO_conn_data_req {
 	uint32_t audio_conn_id,
+	uint8_t frame_nr,
+	uint8_t fqc,  /* enumerated IuUP_FQC */
+	uint8_t rfci,
+	uint8_t spare,
 	uint32_t data_len,
 	octetstring data /* RANAP message */
 } with { variant (data_len) "LENGTHTO (data)" };

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/26672
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: I19612fce8190dfe14f98d346adb5db4e1c2a08d9
Gerrit-Change-Number: 26672
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211223/5db5d18c/attachment.htm>


More information about the gerrit-log mailing list