https://osmocom.org/https://osmocom.org/favicon.ico?16647414092020-01-09T16:11:14ZOpen Source Mobile Communicationslibosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171352020-01-09T16:11:14Zpespin
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/17135/diff?detail_id=28352">diff</a>)</li></ul> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171362020-01-09T17:09:16Zpespin
<ul></ul><p>Related content from specs:<br /><pre>
CC message received -> The inactivity control timers, T(ias) and T(iar), are started.
N-DISCONNECT request or connection release sent -> The inactivity control timers, T(ias) and T(iar), if still running, are stopped.
RLSD message is received -> The inactivity control timers, T(ias) and T(iar), if still running, are stopped.
3.4
Inactivity control
When any message is sent on a connection section, the send inactivity control timer is reset.
When any message is received on a connection section, the receive inactivity control timer is reset.
When the send inactivity timer, T(ias), expires, an IT message is sent on the connection section.
The receiving SCCP checks the information contained in the IT message against the information
held locally. If a discrepancy is detected, then the following actions (Table 3) are taken:
Table 3/Q.714
Discrepancy
Action
Source reference number Release connection
Protocol class Release connection
Sequencing/segmenting (Note) Reset connection
Credit (Note) Reset connection
NOTE – Does not apply to class 2 connection.
When the receive inactivity control timer, T(iar), expires, the connection release procedure is
initiated on a temporary connection section and OMAP is informed for a permanent connection
section.
Timers
T(ias) Delay to send a message on a conn IT on a connection
section when there are no messages to send => 5 to 10 minutes
T(iar) Waiting to receive a message on a connection section => 11 to 21 minutes
</pre></p>
Related VTY commands (libosmo-sccp):
<ul>
<li>"sccp-timer iar <seconds>" (OSMO_SCCP_TIMER_IAR)</li>
<li>"sccp-timer ias <seconds>" (OSMO_SCCP_TIMER_IAS)</li>
</ul> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171372020-01-09T19:46:47Zpespin
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/17137/diff?detail_id=28355">diff</a>)</li></ul> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171382020-01-09T19:56:40Zpespin
<ul></ul>I started to add a TTCN3 test case against osmo-bsc in BSC_Tests. In there I added the infra to be able to set the sccp-timers to low values in order to test it, and I have a test already triggering an IT from BSC->STP->TTCN3. However, I see two issues:
<ul>
<li>For some reason, the IT message only shows up in wireshark in the STP->TTCN3 segment, despite I see from logs how it being sent first BSC->STP...</li>
<li>I'm still unsure how to catch the SCCP IT message, I don't seem to be able to find in in TTCN3 logs so far.</li>
</ul>
<p>I pushed what I have so far in osmo-ttcn3-hacks.git branch "pespin/sccp-timers".</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171392020-01-09T20:04:04Zpespin
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171402020-01-10T10:32:28Zlaforge
<ul></ul><blockquote>
<ul>
<li>I'm still unsure how to catch the SCCP IT message, I don't seem to be able to find in in TTCN3 logs so far.</li>
</ul>
</blockquote>
<p>I'm quite sure you cannot use the SCCP_Emulation (or anything on top)<br />to implement this test. It's a contradiction in terms. Imagine in TCP<br />you want to match on an ACK packet: Then you cannot use a TCP<br />implementation itself, but only the underlying IP implementation and send<br />hand-crafted TCP packets in order to match the ACK from the remote<br />implementation under test.</p>
<p>So here you would use the M3UA_Emulation directly and use raw SCCP<br />templates to create a connection (luckily just one message to transmit<br />and one to receive), and then wait until you see the IT coming in.</p>
<p>There's sccp/SCCP_Tests.ttcn which unfortunately also still uses<br />SCCP_Emulation. I can try to quickly create a template with the right<br />stacking / components.</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171422020-01-10T12:21:54Zlaforge
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-3 priority-2 priority-default closed" href="/issues/4355">Bug #4355</a>: osmo_sccp_simple_server_add_clnt() is broken</i> added</li></ul> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171502020-01-10T16:45:08Zpespin
<ul></ul><p>While you prepare the SCCP_Tests, I added a test to BSC_Tests to make sure channel is released fine in upper layers when the T(iar) timer times out:<br /><a class="external" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16798">https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16798</a> bsc: Introduce test TC_chan_rel_sccp_tiar_timeout</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=171512020-01-10T18:11:39Zpespin
<ul></ul><p>Similar test for osmo-msc:<br /><a class="external" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16799">https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16799</a> msc: Introduce test TC_(iu_)chan_rel_sccp_tiar_timeout</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=172322020-01-16T19:47:31Zpespin
<ul></ul><p>I have modified osmo-ttcn3-hacks/sccp files to use sccp_demo_user in server mode. I worked on a docker setup for docker-playground.git to easily run both SCCP_Tests and SCCP_Tests_RAW with the aim to have them running in jenkins.</p>
<p>I have work done so far in osmo-ttcn3-hacks and docker-playground.git in branch "pespin/sccp".</p>
<p>I have been fixing several bugs I found in our libosmo-sccp.git stack while running SCCP_Tests and SCCP_Tests_RAW against sccp_demo_user. Patches are in gerrit waiting for review.</p>
<p>Right now, I'm using TC_foo from SCCP_Tests_RAW which does:<br /><pre>
f_send_sccp(ts_SCCP_CR('000001'O, called));
</pre></p>
<p>However, libosmo-sccp.git doesn't seem to like it:<br /><pre>
DLSS7 osmo_ss7.c:1579 1: asp-asp-srv-client: xua_srv_conn_cb(): sctp_recvmsg() returned 36 (flags=0x80)
DLM3UA m3ua.c:722 1: asp-asp-srv-client: Received M3UA Message (XFER:DATA)
DLM3UA m3ua.c:541 1: asp-asp-srv-client: m3ua_rx_xfer
DLM3UA m3ua.c:580 1: asp-asp-srv-client: m3ua_rx_xfer(): M3UA data header: opc=23=0.2.7 dpc=1=0.0.1
DLSS7 osmo_ss7_hmrt.c:274 m3ua_hmdc_rx_from_l2(): found dpc=1=0.0.1 as local
DLSUA sccp2sua.c:333 IEI 259: Parsed Addr: RI=2,PC=1,SSN=254
DLSS7 sccp_scrc.c:449 scrc_rx_mtp_xfer_ind_xua: HDR=(CO:CORE,V=0,LEN=0), PART(T=Protocol Class,L=4,D=00000002), PART(T=Source Reference,L=4,D=00000001), PART(T=Destination Address,L=20,D=00020003800200080000000180030008000000fe)
DLSUA sua.c:385 sua_addr_parse_part(IEI=0x0103) (20) 00 02 00 03 80 02 00 08 00 00 00 01 80 03 00 08 00 00 00 fe
DLSUA sua.c:439 SUA IEI 0x0103 pos 4/20: subpart tag 0x8002, len 8
DLSUA sua.c:439 SUA IEI 0x0103 pos 12/20: subpart tag 0x8003, len 8
DLSS7 sccp_scrc.c:398 sccp_scrc_rx_scoc_conn_msg: HDR=(CO:COREF,V=0,LEN=0), PART(T=Routing Context,L=4,D=00000000), PART(T=Destination Reference,L=4,D=00000001), PART(T=Cause,L=4,D=00000213), PART(T=Source Address,L=20,D=00020003800200080000000180030008000000fe)
DLSCCP sccp_scrc.c:138 MTP-TRANSFER.req from SCCP without DPC?!? called=RI=0 <-- ERROR; discard message.
</pre></p>
<p>I'm now trying to add calling address to ts_SCCP_CR but I'm having build issues due to optionalPart.callingPAddress being SCCP_param_CPartyAddressEnc_opt which uses"paramLength + SCCP_CPartyAddressEnc_addr" instead of SCCP_CPartyAddressEnc, and as a result ConvertASPAddressToEncodedAddress_itu cannot be used in place.</p>
<p>Here's the issue:<br /><pre>
// type record SCCP_param_CPartyAddress_opt_itu
type record SCCP_param_CPartyAddressEnc_opt
{
SCCP_field_ParameterName paramName(con_SCCP_cdPA, con_SCCP_cgPA),
LIN1 paramLength,
SCCP_CPartyAddressEnc_addr addr
} with { variant (paramLength) "LENGTHTO( addr )"}
</pre></p>
<p>I'd make sense to change it to this imho, <a class="user active" href="https://osmocom.org/users/7">laforge</a> what do you think?:<br /><pre>
// type record SCCP_param_CPartyAddress_opt_itu
type record SCCP_param_CPartyAddressEnc_opt
{
SCCP_field_ParameterName paramName(con_SCCP_cdPA, con_SCCP_cgPA),
SCCP_CPartyAddressEnc addr
}
</pre></p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=172362020-01-17T09:23:25Zlaforge
<ul></ul><p>On Thu, Jan 16, 2020 at 07:47:31PM +0000, <a class="email" href="mailto:redmine@lists.osmocom.org">redmine@lists.osmocom.org</a> wrote:</p>
<blockquote>
<p>I have been fixing several bugs I found in our libosmo-sccp.git stack while running SCCP_Tests and SCCP_Tests_RAW against sccp_demo_user. Patches are in gerrit waiting for review.</p>
</blockquote>
<p>this is really good news, and I would say that alone was worth the effort!</p>
<blockquote>
<p>Right now, I'm using TC_foo from SCCP_Tests_RAW which does:<br /><pre>
> f_send_sccp(ts_SCCP_CR('000001'O, called));
> </pre></p>
</blockquote>
<p>I would sugges to compare that generated packet with a packet from a normal SCCP<br />connection e.g. from a trace between BSC and MSC.</p>
<blockquote>
<p>However, libosmo-sccp.git doesn't seem to like it:<br /><pre>
> DLSS7 osmo_ss7.c:1579 1: asp-asp-srv-client: xua_srv_conn_cb(): sctp_recvmsg() returned 36 (flags=0x80)
> DLM3UA m3ua.c:722 1: asp-asp-srv-client: Received M3UA Message (XFER:DATA)
> DLM3UA m3ua.c:541 1: asp-asp-srv-client: m3ua_rx_xfer
> DLM3UA m3ua.c:580 1: asp-asp-srv-client: m3ua_rx_xfer(): M3UA data header: opc=23=0.2.7 dpc=1=0.0.1
> DLSS7 osmo_ss7_hmrt.c:274 m3ua_hmdc_rx_from_l2(): found dpc=1=0.0.1 as local
> DLSUA sccp2sua.c:333 IEI 259: Parsed Addr: RI=2,PC=1,SSN=254
> DLSS7 sccp_scrc.c:449 scrc_rx_mtp_xfer_ind_xua: HDR=(CO:CORE,V=0,LEN=0), PART(T=Protocol Class,L=4,D=00000002), PART(T=Source Reference,L=4,D=00000001), PART(T=Destination Address,L=20,D=00020003800200080000000180030008000000fe)
> DLSUA sua.c:385 sua_addr_parse_part(IEI=0x0103) (20) 00 02 00 03 80 02 00 08 00 00 00 01 80 03 00 08 00 00 00 fe
> DLSUA sua.c:439 SUA IEI 0x0103 pos 4/20: subpart tag 0x8002, len 8
> DLSUA sua.c:439 SUA IEI 0x0103 pos 12/20: subpart tag 0x8003, len 8
> DLSS7 sccp_scrc.c:398 sccp_scrc_rx_scoc_conn_msg: HDR=(CO:COREF,V=0,LEN=0), PART(T=Routing Context,L=4,D=00000000), PART(T=Destination Reference,L=4,D=00000001), PART(T=Cause,L=4,D=00000213), PART(T=Source Address,L=20,D=00020003800200080000000180030008000000fe)
> DLSCCP sccp_scrc.c:138 MTP-TRANSFER.req from SCCP without DPC?!? called=RI=0 <-- ERROR; discard message.
> </pre></p>
</blockquote>
<p>So why is there no DPC? a few lines above for the CR it states "M3UA data header: opc=23 dpc=1". I'm not<br />entirely sure, but I would think that it should send that SCCP COREF packet simply back to the point code from which the CR has been received, i.e. 23.</p>
<p>So my initial guess is that there's some bug / something missing from our SCCP implementation.</p>
<blockquote>
<p>I'm now trying to add calling address to ts_SCCP_CR but I'm having build issues due to optionalPart.callingPAddress being SCCP_param_CPartyAddressEnc_opt which uses"paramLength + SCCP_CPartyAddressEnc_addr" instead of SCCP_CPartyAddressEnc, and as a result ConvertASPAddressToEncodedAddress_itu cannot be used in place.</p>
</blockquote>
<p>I would generally try to do as little changes as possible to the upstream SCCP code,<br />particularly as we don't fully understand their use cases and hence might not get it<br />merged.</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=172602020-01-20T19:17:18Zpespin
<ul></ul><p>First SCCP test checking t(ias) and T(iar) is available here:<br />remote: <a class="external" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16964">https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16964</a> sccp: Stop test on rx unexpected sccp msg<br />remote: <a class="external" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16965">https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16965</a> sccp: Introduce test TC_tiar_timeout</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=172622020-01-21T13:04:00Zpespin
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>90</i></li></ul><p>I added more tests which do test the required scenarios from this ticket:<br /><a class="external" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16976">https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16976</a> sccp: Introduce test TC_it_avoids_tiar</p>
<p>Apart from memleaks and crashes I spotted and fixed during TTCN3 developent, T(ias) and T(iar) seem to be working fine. I also submitted a patch to stop those timers when conn goes into pending disconnect state, since anyway when timer fires and the event is generated it was dropped by the FSM:<br /><a class="external" href="https://gerrit.osmocom.org/c/libosmo-sccp/+/16961">https://gerrit.osmocom.org/c/libosmo-sccp/+/16961</a></p>
<p>Once TTCN3 tests and libosmo-sccp.git patches are merged, we can close the ticket.</p> libosmo-sccp + libosmo-sigtran - Feature #4343: test SCCP inactivity timershttps://osmocom.org/issues/4343?journal_id=172872020-01-22T13:07:53Zpespin
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>100</i></li></ul><p>All tests from SCCP_Tests(_RAW) are passing now in jenkins:<br /><a class="external" href="https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-sccp-test/test_results_analyzer/">https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-sccp-test/test_results_analyzer/</a></p>
<p>closing the ticket.</p>