Bug #5991


Forward TSNS-PROV bsc->[bts->]pcu

Added by pespin 11 months ago. Updated 2 months ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


Currently, we pass 3 types of GPRS related timer IEs BSC->BTS through OML, which are then forwarded to osmo-pcu through PCUIF: RLCMAC, BSSGP and NS timers

This ticket is about the 3rd type, NS timers.
In osmo-bsc:

/* BTS Site Manager */
struct gsm_bts_sm {
    struct gsm_bts *bts[1]; /* only one bts supported so far */
    struct gsm_abis_mo mo;
    /* nanoBTS and old versions of osmo-bts behaves this way due to
       broken FSMs not following TS 12.21: they never do
       Dependency->Offline transition, but they should be OPSTARTed
       nevertheless during Dependnecy state to work. This field is
       used by all dependent NM objects. */
    bool peer_has_no_avstate_offline;
    struct {
        struct gsm_gprs_nse nse;
        struct gsm_gprs_nsvc nsvc[2];
    } gprs;

struct gsm_gprs_nse {
    struct gsm_abis_mo mo;
    uint16_t nsei;
    uint8_t timer[7];

          "gprs ns timer " NS_TIMERS " <0-255>",
          GPRS_TEXT "Network Service\n" 
          "Network Service Timer\n" 
          NS_TIMERS_HELP "Timer Value\n")
    struct gsm_bts *bts = vty->index;
    int idx = get_string_value(gprs_ns_timer_strs, argv[0]);
    int val = atoi(argv[1]);


    if (idx < 0 || idx >= ARRAY_SIZE(bts->site_mgr->gprs.nse.timer))
        return CMD_WARNING;

    bts->site_mgr->gprs.nse.timer[idx] = val;

    return CMD_SUCCESS;
struct msgb *nanobts_gen_set_nse_attr(struct gsm_bts_sm *bts_sm)
    /* all timers in seconds */
    OSMO_ASSERT(ARRAY_SIZE(bts_sm->gprs.nse.timer) < sizeof(buf));
    memcpy(buf, bts_sm->gprs.nse.timer, ARRAY_SIZE(bts_sm->gprs.nse.timer));
    msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, 7, buf);

The NS_TIMERS(_HELP) from osmo-bsc VTY actually come from libosmcore:

#define NS_TIMERS "(tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov)" 
#define NS_TIMERS_HELP    \
    "(un)blocking Timer (Tns-block) timeout\n"        \
    "(un)blocking Timer (Tns-block) number of retries\n"    \
    "Reset Timer (Tns-reset) timeout\n"            \
    "Reset Timer (Tns-reset) number of retries\n"        \
    "Test Timer (Tns-test) timeout\n"            \
    "Alive Timer (Tns-alive) timeout\n"            \
    "Alive Timer (Tns-alive) number of retries\n"        \
    "SNS Provision Timer (Tsns-prov) timeout\n" 

First thing to notice: There are 8 timers in libosmocore, but the arrays of osmo-bsc are of size 7.
That's because the TSNS-PROV (3GPP TS 48.016 grep for "Tsns-prov") is missing, which is the 8ht one.

That's neither copied to the IE sent over Abis OML to the BTS, allegedly because ipaccess nanoBTS never supported SNS.

In our case, we do support SNS, and we want to pass that SNS timer (and maybe more timers if they exist in the same SNS spec?).

Hence, what needs to be done:
  • osmo-bsc: Update struct gsm_gprs_nse "uint8_t timer7;" to be of size NS_TIMERS_COUNT (maybe even better, update osmo-bsc to use new gprs_ns2.h?)
  • osmo-bsc: In nanobts_gen_set_nse_attr(), if BTS is nanoBTs keep sending 7 bytes (it's what nanoBTS expects). If it's an osmo-bts, then send the entire list of timers (8 bytes).
  • osmo-bts: Handle both 7-byte and 8-byte cases when receiving the OML IE.
  • osmo-bts/osmo-pcu: Update PCUIF to make the timer 8 bytes long (daniel , it would be great if you can provide feedback whether we may want to send more still not implemented timers later on, so that we can maybe extend the PCUIF array now to be 16 bytes).

So there's 2 independent steps here:
- Support passing TSNS-PROV BSC->BTS over Abis OML for osmo-bts
- Support passing TSNS-PROV BSC/BTS->PCU over PCUIF.

Related issues

Related to OsmoBSC - Bug #5335: osmo-bsc: Add VTY commands to configure T3.. and N3.. timers counters for gprsIn Progressjolly11/30/2021

Actions #1

Updated by pespin 11 months ago

Originating IRC discussion:

<pespin_> asdfuser, ping
<asdfuser> pespin_: pong
<pespin_> asdfuser, regarding TSNS-PROV, I see that osmo-pcu can already configure it through VTY because it's using NS2
<pespin_> src/pcu_main.cpp:273: gprs_ns2_vty_init(pcu->nsi);
<pespin_> asdfuser, now the question is also, do we really need to pass that from the bts/bsc to the PCU too? or having it in the PCU in the VTY is enough?
<asdfuser> Ah, true
<asdfuser> Yeah, good question. I would say VTY is enough, but it's tempting to have all configuration in one place and not distributed.
<pespin_> asdfuser, I'm actually trying to find where in osmo-bts and osmo-bsc that timer is supposed to be configured, but I cannot find it
<pespin_> (I told Alexander to connect here, he's configuring pidgin now)
<LaF0rge> I am generally ratther dissatisfied with every new pcu config setting that doesn't come from the BSC
<LaF0rge> but by now it might be too late to change that
<LaF0rge> thats one of the really nice parts of the nanoBTS, IMHO. all the config for BTS+PCU comes from the BSC
<asdfuser> We seem to configure the BSSGP timers, but not the NS ones so far. I also believe that the choice for the gb dialect lies with osmo-pcu and not osmo-bsc
<pespin_> asdfuser, iiuc in nanobts_gen_set_nse_attr() (osmo-bsc.git) we configure the BSSGP timers? (3GPP TS 48.018 )
<asdfuser> So if the bsc should control these timers we should also define the dialect there.
<asdfuser> Yeah, BSSGP seems to come from osmo-bsc
<pespin_> asdfuser, ok, and then all the NS timers are not being passed through Abis to nanobts/osmo-bts
<asdfuser> And the NS options that the original nanoBTS required
<pespin_> that's my question :D
<pespin_> because iiuc we only pass BSSGP and RLC timers
<pespin_> asdfuser,
<asdfuser> pespin_: There's cfg_bts_gprs_ns_timer that I can see in osmo-bsc
<LaF0rge> nanoBTS Abis/IP doesn't allow any NS configuration beyond IP/ports
<LaF0rge> NS Link configuration + NSVCI are the only two attributes valid for the "GPRS NSVC" MO
<LaF0rge> and NS Link config only contains remlte/local ports + remote IP
<asdfuser> gprs ns timer (tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov) ...
<LaF0rge> ah nevermind
<LaF0rge> there's also "NS Conbfiguration" with the timers
<LaF0rge> it's at the NSE MO, not NSVC.
<asdfuser> memcpy(info_ind->nse_timer, bts_sm->gprs.nse.timer, 7);
<asdfuser> In pcu_tx_info_ind
<LaF0rge> so whatever is covered there should be implemented that way [only] IMHO.
<pespin_> ah yeah now I see, so we are sending RLCMAC in some other function, and BSSGP and NS in nanobts_gen_set_nse_attr()
<asdfuser> LaF0rge: So we need a way to install these VTY commands selectively
<pespin_> asdfuser, but TSSNS-PROV I think is not sent to the nanoBTS in here: memcpy(buf, bts_sm->gprs.nse.timer, ARRAY_SIZE(bts_sm->gprs.nse.timer));
<LaF0rge> "RLC configuration" + "RLC configuration 2" + "RLC configuration 3" is an attribute of the "GPRS Cell" MO
<LaF0rge> asdfuser: why selectively? where? do we have any hardware where the PCU doesn't get configured via the BSC this way?
<pespin_> yeah TSNS-PROV in 8th in the array, and we only send 7 bytes there
<asdfuser> gbproxy uses bss-side NS
<pespin_> see NS_TIMERS_HELP
<pespin_> in libosmocore
<asdfuser> Haha, nice
<LaF0rge> in nanoBTS and osmoBTS case, they would take that path. And in RBS, the same information can be passed over the PCU socket directly from BSC to PCU.
<asdfuser> I was wondering about the magic number..
<pespin_> it's rpobably because that's an SNS timer and the other ones are NS? (not sure I know what I'm talking about)
<pespin_> so maybe nanoBTS didn't support SNS?
<LaF0rge> nanoBTS doesn't support SNS for sure
<asdfuser> Yeah, could be because of that
<pespin_> then it is expected that we are not sending the 8th timer whci his a SNS one :)
<pespin_> so as I see it, we either: extend the IE adding an 8th byte only for osmo-bts, we add a new IE for SNS timers only for osmo-bts. That means also breaking compat in PCUIF.
<pespin_> or we leave SNS out of thise and confiure it through PCU VTY
<LaF0rge> I'd say extend the IE on bts_model == osmo-bts
<pespin_> fine, since it's a TLV
<pespin_> memcpy(buf, bts_sm->gprs.nse.timer, ARRAY_SIZE(bts_sm->gprs.nse.timer));
<pespin_> msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, 7, buf);
<pespin_> and then we extend the related timer array in PCUIF breaking compat, reusing the version bump that dexter did a few days ago
<asdfuser> Sounds good. Do de remove the vty commands then? They are currently used in the field
<pespin_> I think it can be fine having them, but we should then define which overrides which ;)
<asdfuser> And if not - which takes precedence?
<asdfuser> Yeah :-)
<pespin_> asdfuser, I'm creating a separate ticket to track this TSNS-PROV
<asdfuser> pespin_: OK, thanks
<pespin_> asdfuser, I think it makes sense to have VTY ones as defaults, which are loaded at startup, and then let osmo-bts/osmo-bsc replace those (older ones won't because TSNS-PROV won't be forwarded)
<asdfuser> pespin_: Yeah, but what about interactive VTY?
<pespin_> asdfuser, interactive VTY would temporarily overwrite it until it is configured again by PCUIF

Actions #2

Updated by pespin 11 months ago

  • Related to Bug #5335: osmo-bsc: Add VTY commands to configure T3.. and N3.. timers counters for gprs added
Actions #3

Updated by laforge 2 months ago

  • Assignee changed from arehbein to jolly

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)