Bug #2010
closedipa stream support is not using buffered read
0%
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.
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.
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.
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
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.
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
Updated by stsp over 5 years ago
The BSC control interface now supports IPA ping:
https://gerrit.osmocom.org/c/libosmocore/+/11287
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/11288
Updated by stsp over 5 years ago
Another test case (chopped payload) has been proposed: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/11357
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?
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.