laforge submitted this change.

View Change

Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
RTP IuUP Emulation: Avoid spamming with retransmitted Init

Until now, an Init was sent on each RTP transmit period, clogging the
pcap files. Moreover, this is break by design, since transmitting
another Init so close the the previous one would give no time to the
transmitter to receive the Init ACk and move state, which means the
other end would potentially be reconfigured each time (for each Init).

Change-Id: I8e299a3fe49f9d31cae182f7ed4dc0ea3fc22ba2
---
M library/IuUP_Emulation.ttcn
M library/RTP_Emulation.ttcn
2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn
index b35602c..19c2c84 100644
--- a/library/IuUP_Emulation.ttcn
+++ b/library/IuUP_Emulation.ttcn
@@ -105,6 +105,7 @@
} else if (match(pdu, tr_IuUP_INIT_ACK)) {
if (st.cfg.active_init == true) {
log("IuUP INIT_ACK Received");
+ st.pending_tx_pdu := omit; /* Drop pending Init retrans */
st.state := ST_DATA_TRANSFER_READY;
} else {
setverdict(fail, "INIT_ACK received in PASSIVE role");
@@ -124,8 +125,12 @@
select (st.state) {
case (ST_INIT) {
if (st.cfg.active_init) {
- /* send INIT */
- pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+ if (not isvalue(st.pending_tx_pdu)) {
+ /* send INIT */
+ pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+ st.pending_tx_pdu := pdu;
+ } /* else: wait for INIT-ACK return ''O at the end */
+
} else {
/* wait for INIT */
if (isvalue(st.pending_tx_pdu)) {
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index b2360dc..bdca75d 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -345,6 +345,10 @@
private function f_tx_rtp(octetstring payload, BIT1 marker := '0'B) runs on RTP_Emulation_CT {
if (g_cfg.iuup_mode) {
payload := f_IuUP_Em_tx_encap(g_iuup_ent, payload);
+ if (lengthof(payload) == 0) {
+ /* Nothing to transmit, waiting for INIT-ACK */
+ return;
+ }
}
var PDU_RTP rtp := valueof(ts_RTP(g_cfg.tx_ssrc, g_cfg.tx_payload_type, g_tx_next_seq,
g_tx_next_ts, payload, marker));

To view, visit change 26685. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8e299a3fe49f9d31cae182f7ed4dc0ea3fc22ba2
Gerrit-Change-Number: 26685
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-MessageType: merged