Project

General

Profile

Feature #4336

Convert vlr_lu_fsm.c to use osmo_tdef (and drop vlr_timer())

Added by pespin 9 months ago. Updated 9 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
VLR
Target version:
-
Start date:
12/17/2019
Due date:
% Done:

0%

Resolution:
Spec Reference:

Description

vlr.h:

enum vlr_timer {
    VLR_T_3250,
    VLR_T_3260,
    VLR_T_3270,
    _NUM_VLR_TIMERS
};

struct vlr_instance {
...
uint32_t timer[_NUM_VLR_TIMERS];
}

struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops);
uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer);

vlr.c:

uint32_t vlr_timer(struct vlr_instance *vlr, uint32_t timer)
{
    uint32_t tidx = 0xffffffff;

    switch (timer) {
    case 3270:
        tidx = VLR_T_3270;
        break;
    case 3260:
        tidx = VLR_T_3260;
        break;
    case 3250:
        tidx = VLR_T_3250;
        break;
    }

    OSMO_ASSERT(tidx < sizeof(vlr->cfg.timer));
    return vlr->cfg.timer[tidx];
}

vlr_lu_fsm.c:

    osmo_fsm_inst_state_chg(fi, LU_COMPL_VLR_S_WAIT_TMSI_CNF,
                vlr_timer(vlr, 3250), 3250);

I could not see those values in timer ever being set to something different than 0 during vlr_alloc()....

The idea is to drop those and use interation with osmo_tdef instead. Something similar to what is done in ran_infra.c and msc_a.c:

#define RAN_TDEFS \
    { .T = -1, .default_val = 5, .desc = "RAN connection Complete Layer 3, Authentication and Ciphering timeout" }, \
    { .T = -2, .default_val = 30, .desc = "RAN connection release sanity timeout" }, \
    { .T = -3, .default_val = 10, .desc = "Timeout to find a target BSS after Handover Required" }, \

struct osmo_tdef msc_tdefs_geran[] = {
    RAN_TDEFS
    {}
};

static const struct osmo_tdef_state_timeout msc_a_fsm_timeouts[32] = {
    [MSC_A_ST_VALIDATE_L3] = { .T = -1 },
    [MSC_A_ST_AUTH_CIPH] = { .keep_timer = true },
    [MSC_A_ST_WAIT_CLASSMARK_UPDATE] = { .keep_timer = true },
    [MSC_A_ST_AUTHENTICATED] = { .keep_timer = true },
    [MSC_A_ST_RELEASING] = { .T = -2 },
    [MSC_A_ST_RELEASED] = { .T = -2 },
};

/* Transition to a state, using the T timer defined in msc_a_fsm_timeouts.
 * The actual timeout value is in turn obtained from network->T_defs.
 * Assumes local variable fi exists. */
#define msc_a_state_chg_always(msc_a, state) \
    osmo_tdef_fsm_inst_state_chg((msc_a)->c.fi, state, msc_a_fsm_timeouts, (msc_a)->c.ran->tdefs, 5)

BTW, similar stuff is currently done by SGs code, grep for "sgs->cfg.timer" and it can be spotted easily.


Related issues

Related to OsmoMSC - Bug #4337: osmo-msc: Don't send LU-Reject after LU-Accept if no TMSI Realloc Complete is receivedNew12/17/2019

History

#1 Updated by pespin 9 months ago

Default values for timers T3250, T3260 and T3270 are defined in TS 24.008 Table 11.2/3GPP TS 24.008: Mobility management timers - network-side

#2 Updated by laforge 9 months ago

  • Tracker changed from Bug to Feature

#3 Updated by pespin 9 months ago

Currently there's no timeout because the value is 0, it can be see in logs:

lu_compl_vlr_fsm(IMSI-262420000000005:MSISDN-491230000005:GERAN-A-0:LU)[0x555d2d9f30f0]{LU_COMPL_VLR_S_WAIT_SUB_PRES}: State change to LU_COMPL_VLR_S_WAIT_TMSI_CNF (no timeout)

Once timers are in place, timers from msc_a_fsm_timeouts need to be tweaked (increased), otherwise T-1 may trigger before T3250 (eg 5 sec vs 5 sec but they are started before in time).

Current situation (timeout of T-1 and T3250 not implemented) can be seen with TC_lu_imsi_timeout_tmsi_realloc.

#4 Updated by pespin 9 months ago

  • Related to Bug #4337: osmo-msc: Don't send LU-Reject after LU-Accept if no TMSI Realloc Complete is received added

#5 Updated by neels 9 months ago

AFAIR the factual timeouts that abort an invalid attempt are in the incoming conn, i.e. msc_a FSM;
Maybe we don't need any VLR timeouts at all? (Except the periodic LU timeout)

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)