Project

General

Profile

Bug #2010

ipa stream support is not using buffered read

Added by laforge over 1 year ago. Updated 4 days ago.

Status:
In Progress
Priority:
High
Assignee:
Target version:
-
Start date:
04/14/2017
Due date:
% Done:

0%

Spec Reference:

Description

The IPA support in libosmo-netif seems to assume that one always receives an entire IPA packet (3-byte header + payload) during one read from a relaetd socket. This is of course known to be a wrong assumption, as we are reading from a stream without packet boundaries, and we're reading in non-blocking mode.

Other users of the (lower-lavel) IPA utility functions provided by libosmocore (such as osmo-bsc) are using ipa_msg_recv_buffered() to deal with this problem.

Would be worth implementing a test case that intenionally slowly writes heavily segmented IPA messages to test our various receivers.

History

#1 Updated by laforge 4 months ago

  • Assignee set to stsp

#2 Updated by laforge 19 days ago

  • Priority changed from Normal to High

#3 Updated by stsp 17 days ago

The following functions in libosmo-netif do indeed look suspicious (as in, they expect to parse an IPA message from a single msgb):

osmo_ipa_process_msg()
osmo_ipa_parse_msg_id_resp()
osmo_ipa_rcvmsg_base()

Are the any others?

From the above list, only osmo_ipa_process_msg() is actually used outside of libosmo-netif itself:

libosmo-sccp/src/osmo_ss7.c: if (osmo_ipa_process_msg(msg) < 0) {
libosmo-sccp/src/osmo_ss7.c: if (osmo_ipa_process_msg(msg) < 0) {

In both instances, ipa_msg_recv_buffered() is already used immediately before calling into libosmo-netif.

#4 Updated by stsp 17 days ago

Harald suggests we should have a TTCN3 test which "stutters" during IPA communication, i.e. sends incomplete IPA messages across a TCP connection.

#5 Updated by stsp 17 days ago

#6 Updated by stsp 15 days ago

  • Status changed from New to In Progress

#7 Updated by stsp 14 days ago

Initial version of an IPA test suite has been proposed: https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/11241

#8 Updated by stsp 10 days ago

A first test has now been merged to osmo-ttcn3-hacks master.
This test performs a byte-per-byte transmission of an IPA ping and expects a pong response.
Currently only the BSC is tested, as an IPA server on OML and RSL ports.
More tests to follow.

#9 Updated by stsp 4 days ago

Another test for the BTS test suite has been proposed: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/11356

#11 Updated by stsp 4 days ago

Another test case (chopped payload) has been proposed: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/11357

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)