Project

General

Profile

Feature #3624

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

Added by pespin over 2 years ago. Updated over 2 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.

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

Associated revisions

Revision 3416c77a (diff)
Added by pespin over 2 years ago

abis_nm: Split handling of Attribute Response Info into its own func

In future commits, nanoBTS support will be added, which implements its
own format not exactly equal to specs Attribute Response Info.

Related: OS#3624
Change-Id: I346dacc58faac70e6d224ca49484f9211cb8a046

Revision 14955320 (diff)
Added by pespin over 2 years ago

abis_nm: Split reported attr list parsing from Attribute Response Info into its own func

nanoBTS uses same format for the attribute list from Attribute Response
Info, but without using the later as an evelope. By splitting we can
later reuse the code handling the Attribute list.

While at it, take the chance to remove functions parse_attr_resp_info_*
which expect TLVs following an specific order, which is not mandatory.

Related: OS#3624
Change-Id: Iec7a6e4d27639d0e5adc0d9a01cd3c3e7a46f558

Revision 36394122 (diff)
Added by pespin over 2 years ago

abis_nm: Allow sending and receiving Get Attributes (Response) against nanoBTS

  • Allow sending Get Attributes message in abis_nm_get_attr.
  • Don't try to decode Get Attribute Response Info for nanoBTS, since it
    uses a different formatting than the one defined in specs.

Related: OS#3624
Change-Id: I53d01e73791cf5450aa34b1ac8f051730e3a70f9

Revision 6597b54b (diff)
Added by pespin over 2 years ago

abis_nm: Add support to parse some nanoBTS Attribute Response attributes

nanoBTS actually supports regular formatting. There are a few differences
with spec though:
  • The attributes are listed directly in the message instead of being inside
    the Get Attributes Response Info after the unsupported attribute ID list.
  • The Get Attributes Response Info can be at any position in the
    attribute list, and it only contains the unsupported attribute ID list.
As a result, parsing is currently split into 3 main parts or functions:
  • Parsing regular (per spec) Get Attributes Response Info attr and get a
    pointer to the list of attributes.
  • A function that parses the list of attributes, called directly in case
    of nanoBTS, and called by the former parser of Get Attributes Response
    Info for regular (per spec) OML endpoints.
  • A function to parse the unsupported attribute ID list, also used in the
    first function to get a pointer to the list of attributes.

Related: OS#3624
Change-Id: I52e9f177c14fec1ec3f5c4ddb244594409008357

Revision f535cc84 (diff)
Added by pespin over 2 years ago

abis_nm: parse_attr_resp_info_unreported: Fix offset calculation

See following specs for related information:
  • 3GPP TS 52.021 §8.11.3 Get Attribute Response
  • 3GPP TS 52.021 §9.4.64 Get Attribute Response Info

Related: OS#3624
Change-Id: Ie61d70bc28427d5d879638516a36f590ce98bdc7

Revision c74daf00 (diff)
Added by pespin over 2 years ago

abis_nm: Introduce new signal S_NM_GET_ATTR_REP

This signal can be used for tools willing to request and parse Attribute Response
and do something with the information. ipaccess-config tool will use
this signal in later patch Change-Id Ida416a969a3309868d6f4e50f34b34f224c32dd6.

Related: OS#3624
Change-Id: I9a121bbfe1b96904d4e16845abc90bb6ef20d2c9

Revision 0329c70a (diff)
Added by pespin over 2 years ago

ipaccess-config: Fix whitespace

Related: OS#3624
Change-Id: I190752000a73d7600a946c7535661550b1fe3520

Revision 05d6644e (diff)
Added by pespin over 2 years ago

ipaccess-config: Add -G cmdl opt to query OML IP and Unit ID

Related: OS#3624
Change-Id: Ida416a969a3309868d6f4e50f34b34f224c32dd6

Revision c4ee002f (diff)
Added by pespin over 2 years ago

ipaccess-config: cosmetic: Remove unneeded comment with hex values

Same type of message parsing is already implemented in code, no need to
keep them.

Related: OS#3624
Change-Id: I715bd9582f9289b5674aaa8d8de1164ebef2fd11

Revision 5188a315 (diff)
Added by pespin over 2 years ago

ipaccess-config: Introduce -q quiet param

This way only formated output is pinted to stdout when using -G and can
be used by other tools (osmo-gsm-tester) to get a json dictionary with interesting
information.

Related: OS#3624
Change-Id: I257bfc8d82b49a3641be6b6777e472ecf561a21e

History

#1 Updated by laforge over 2 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.

#2 Updated by roox over 2 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.]*)/)'

#3 Updated by pespin over 2 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);

#4 Updated by pespin over 2 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).

#5 Updated by pespin over 2 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.

#6 Updated by pespin over 2 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

#7 Updated by pespin over 2 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.

#8 Updated by pespin over 2 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/

#9 Updated by pespin over 2 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

#10 Updated by pespin over 2 years ago

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

Merged. closing.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)