Project

General

Profile

Actions

Feature #3624

closed

ipaccess-config: Investigate if possible to get OML_IP currently set in nanobts

Added by pespin over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
10/03/2018
Due date:
% Done:

100%

Spec Reference:

Description

Currently, one can set the OML IP config in a nanotbts by running "ipaccess-config --oml-ip 1.2.3.4 5.6.7.8". However, in order to have nanobts use the new value one must restart the nanobts after setting it (by using -r parameter in ipaccess-config). There's however no way to get the current value set in the nanobts.

In order to speed up osmo-gsm-tester tests using a nanobts (by aprox 2 minutes each), it would be really handy to be able to somehow get current value being used for OML_IP in a nanobts. That's because the BSC IP addr can change per test basis, and then we always need to make sure the OML IP is set correctly by:
  • Powering on nanobts (and waiting for it with abisip-find)
  • Setting the new OML IP and rebooting the nanobts
  • Waiting again for it to be available with abisip-find (which can take around 2 minutes).

If we can get the OML IP, we can check if the OML IP is the same we are currently using for our BSC, then avoid rebooting it unnecessarily and avoid loosing 2 minutes waiting for nanobts to powercycle.

This task is about investigating whether fetching this information from nanobts is possible, and in case it is, implementing it in ipacces-config or abisip-find.


Files

nanobts-get-attr.pcap nanobts-get-attr.pcap 386 Bytes laforge, 10/03/2018 03:00 PM
0001-WIP.patch 0001-WIP.patch 9.49 KB pespin, 11/06/2018 05:35 PM
0002-WIP-Request-and-parse-UNIT_ID.patch 0002-WIP-Request-and-parse-UNIT_ID.patch 1.79 KB pespin, 11/06/2018 05:51 PM
get_attr_example.pcapng get_attr_example.pcapng 596 Bytes pespin, 11/07/2018 04:58 PM
nanobts_supports_getari.pcapng nanobts_supports_getari.pcapng 684 Bytes pespin, 11/07/2018 07:31 PM
Actions #1

Updated by laforge over 5 years ago

Should be possible rather simply, IMHO. Just use NM_MT_IPACC_GET_NVATTR
rather than NM_MT_IPACC_SET_NVATTR and request
NM_ATT_IPACC_PRIM_OML_CFG_LIST ?

Attaching a pcap file that can be used as an example/template. It was
taken back in 2009 when we were fist playing with nanoBTss.

Actions #2

Updated by roox over 5 years ago

ipaccess-telnet could also be used to get the current OML_IP

echo "db::getprimaryomlipaddr" | ipaccess-telnet 192.168.200.150 3210 | perl -nle 'print "$1" if (/Primary OML IP Address: ([\d.]*)/)'

Actions #3

Updated by pespin over 5 years ago

With attached file I can request the OML IP Addr against a nanoBTS using "ipaccess-config -O 192.168.30.100".

It answers correctly the OML IP of my BSC:

<0004> /home/pespin/dev/sysmocom/git/osmo-bsc/src/osmo-bsc/abis_nm.c:544 OC=BASEBAND-TRANSCEIVER(04) INST=(00,00,ff): Get Attributes Response for BTS0
<0004> /home/pespin/dev/sysmocom/git/osmo-bsc/src/osmo-bsc/abis_nm.c:555 (bts=0,trx=0) Get Attributes Response: OML IP is 192.168.30.1:0
<0004> /home/pespin/dev/sysmocom/git/osmo-bsc/src/osmo-bsc/abis_nm.c:563 OC=BASEBAND-TRANSCEIVER(04) INST=(00,00,ff): BTS0: Get Attr Response without Response Info?!

It seems however that getting attributes from nanoBTS (aka !osmo-bts type) is not supported, I had to patch following code in src/osmo-bsc/abis_nm.c:

@@ -1649,10 +1663,12 @@ int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class, uint8_t bts_nr, uin
        if (bts->type != GSM_BTS_TYPE_OSMOBTS) {
                LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s is not supported.\n",
                      bts->nr, btstype2str(bts->type));
-               return -EINVAL;
+               //return -EINVAL;
        }

Then, function abis_nm_rx_get_attr_resp receiving the Get Attribute Response message doesn't support nanoBTS, because instead it looks for some information which nanoBTS doesn't provide in the response (while osmo-bts probably does).

I now need to find the way to send the received OML IP addr up to the stack so ipaccess-config can print it. Probably we want to pass the content of TLVP_VAL(&tp, NM_ATT_IPACC_PRIM_OML_CFG_LIST);

Actions #4

Updated by pespin over 5 years ago

With follow up patch I can read the Unit_ID too (to show case how to request several attributes at once).

<0004> /home/pespin/dev/sysmocom/git/osmo-bsc/src/osmo-bsc/abis_nm.c:558 (bts=0,trx=0) Get Attributes Response: OML IP is 192.168.30.1:0 UNIT_ID=666/0/0

So Basically OML IP is a TV of 4 bytes IP and 2 bytes port, and UNIT_ID is a TLV where L=len of string including EOS character (which is also in the buffer of course).

Actions #5

Updated by pespin over 5 years ago

It seems only requested NM_ATT_IPACC_PRIM_OML_CFG attr is enveloped in NM_ATT_IPACC_PRIM_OML_CFG_LIST when getting the response from the nanoBTS. Other attributes, such as NM_ATT_IPACC_UNIT_ID or NM_ATT_IPACC_SEC_OML_CFG, come directly and not under that OML_CFG_LIST attr.

I attach a pcap example with Get Attr and Get Attr response for NM_ATT_IPACC_PRIM_OML_CFG and NM_ATT_IPACC_UNIT_ID.

I fixed a bug still present in wireshark master which prevented from decoding NM_ATT_IPACC_PRIM_OML_CFG_LIST and as a result the whole message:
https://code.wireshark.org/review/30532 gsm_abis_oml: Support decoding IPA Primary OML Config List

It seems there's another bug in master wireshark which shows IP in incorrect format (ntohl/htnol required). I'll submit another patch for that one.

Actions #6

Updated by pespin over 5 years ago

Here you can find the patch decoding the OML Primary IP Addr correctly:
https://code.wireshark.org/review/30533 gsm_abis_oml: Decode Primary OML IP Address as big endian

Actions #7

Updated by pespin over 5 years ago

I started reworking some code in abis_nm_rx_get_attr_resp and I can now parse OML Primary IP ad Unit ID in there.

I first thought nanoBTS didn't support the "SW Configuration" and "Get ARI" ones and that's why we blocked sending Get Attributes for nanobts, but it actually supports it. I attach a pcap file showing the req and response. I need to rework a bit my code after seeing this.

Next step will be to add a signal in abis_nm_rx_get_attr_resp or abis_nm_rcvmsg_fom which sends content of the foh or similar, and then in ipaccess-config I can parse it and add code to print json format or similar which I can then use in osmo-gsm-tester.

Actions #8

Updated by pespin over 5 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 90

I submitted a patch set containing several fixes and imrovements in osmo-bsc abis_nm.c, and some code in ipaccess-config to add a -G parameter which can be used by osmo-gsm-tester to get OML IP and Unit_ID:
https://gerrit.osmocom.org/#/c/osmo-bsc/+/11686/

Actions #9

Updated by pespin over 5 years ago

Draft patch to use this feature to speed up osmo-gsm-tester tests:
https://gerrit.osmocom.org/#/c/osmo-gsm-tester/+/11750 nanobts: Use -G parameter of ipaccess-config to avoid need to restart nanoBTS

Actions #10

Updated by pespin over 5 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Merged. closing.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)