Project

General

Profile

Actions

Bug #2010

closed

ipa stream support is not using buffered read

Added by laforge about 7 years ago. Updated over 5 years ago.

Status:
Resolved
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.

Actions #1

Updated by laforge almost 6 years ago

  • Assignee set to stsp
Actions #2

Updated by laforge over 5 years ago

  • Priority changed from Normal to High
Actions #3

Updated by stsp over 5 years 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.

Actions #4

Updated by stsp over 5 years ago

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

Actions #5

Updated by stsp over 5 years ago

Actions #6

Updated by stsp over 5 years ago

  • Status changed from New to In Progress
Actions #7

Updated by stsp over 5 years ago

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

Actions #8

Updated by stsp over 5 years 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.

Actions #9

Updated by stsp over 5 years ago

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

Actions #11

Updated by stsp over 5 years ago

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

Actions #12

Updated by stsp over 5 years ago

BSC and BTS are being tested since above patches have been merged.

Which other components should be tested?

Actions #13

Updated by stsp over 5 years ago

  • Status changed from In Progress to Resolved

Closing this. If more tests are needed, please file a new issue or just re-open this one and add your suggestions here.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)