[osmocom-bb] MT call fails: CONNECT transmitted on different timeslot (chan_nr 0x90) in virtphy setup

Hello everyone,

I hope this is the right place to post this. I’ve been working on a software-only osmocom GSM setup for a university project and have run into a problem I haven’t been able to resolve. I’m not a GSM or osmocom expert, so I apologise if I’ve missed something obvious or described anything incorrectly, any guidance would be greatly appreciated.

The problem

Mobile-terminated voice calls between two osmocom-bb mobile instances always fail. The call proceeds normally up to ALERTING (the called phone rings, the user answers) but the call is released roughly 30 seconds later with the message Call has been released (cause 47) (mnccms.c:714) to the callee and Call has been released (cause 18) (mnccms.c:714) to the caller. Sending SMS between the two phones works correctly.

Looking at the virtphy log for the callee (MS2), I can see that the CONNECT message is emitted with chan_nr=0x90 which virtphy interprets as timeslot 0, whereas the assigned dedicated channel remains chan_nr=0x0a (timeslot 2). The BTS is not listening for this phone’s dedicated channel on TS0, so it never receives the CONNECT, and the call times out.

Environment

  • libosmocore: built from git master (commit c812e5805c534966dc65fa07368a319361d2970c)
  • osmocom-bb: built from git master (commit 6fef14bc6dbdd0370ce1cfff856fc6b10827db50); mobile links the above libosmocore
  • OsmoBSC: 1.14.0.38
  • OsmoMSC: 1.15.0.6-97eea
  • OsmoMGW: 1.15.0.1-8afba
  • OsmoBTS: 1.11.0.23-b4ff (osmo-bts-virtual)
  • OsmoHLR, OsmoSTP: current packages
  • MNCC: internal
  • Two virtphy instances and two mobile instances:
    • virtphy -s /tmp/osmocom_l2 + mobile -c mobile1.cfg (MS1, caller)
    • virtphy -s /tmp/osmocom_l2.2 + mobile -c mobile2.cfg (MS2, callee)
  • OS: Linux x86_64

Configuration

MS2 config (mobile2.cfg):

ms 2
 layer2-socket /tmp/osmocom_l2.2
 imei 222222222222222 0
 imei-fixed
 sim test
 test-sim
  imsi 901700000000002
  ki comp128 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 
  no barred-access
  rplmn 901 70
  hplmn-search everywhere
  no locigprs
 mncc-handler internal
 network-selection-mode auto
 no emergency-imsi
 sms-service-center 2
 no call-waiting
 no auto-answer
 no force-rekey
 no clip
 no clir
 tx-power auto
 no simulated-delay
 no stick
 location-updating
 neighbour-measurement
 codec full-speed prefer
 no abbrev
 support
  sms
  a5/1
  a5/2
  p-gsm
  e-gsm
  r-gsm
  dcs
  class-900 4
  class-dcs 1
  channel-capability sdcch+tchf
  full-speech-v1
  min-rxlev -106
  dsc-max 90
 c7-any-timeout 30
 uplink-release-local
 no asci-allow-any
 tch-voice
  io-handler l1phy
 tch-data
  io-handler none
  io-tch-format osmo
  call-params type-rate 71
  call-params ce transparent
  call-params async
  call-params async nr-stop-bits 1
  call-params async nr-data-bits 8
  call-params async parity none
 no shutdown

BSC config (relevant section):

network
 network country code 1
 mobile network code 1
 encryption a5 0
 neci 1
 paging any use tch 0
 handover 0
 handover algorithm 1
 handover1 window rxlev averaging 10
 handover1 window rxqual averaging 1
 handover1 window rxlev neighbor averaging 10
 handover1 power budget interval 6
 handover1 power budget hysteresis 3
 handover1 maximum distance 9999
 periodic location update 12
 timer net T3212 5
 bts 0
  type osmo-bts
  band DCS1800
  cell_identity 6969
  location_area_code 0x0001
  base_station_id_code 63
  ms max power 15
  cell reselection hysteresis 4
  rxlev access min 0
  radio-link-timeout 32
  channel allocator mode set-all ascending
  rach tx integer 9
  rach max transmission 7
  channel-description attach 1
  channel-description bs-pa-mfrms 5
  channel-description bs-ag-blks-res 1
  early-classmark-sending forbidden
  ipa unit-id 6969 0
  oml ipa stream-id 255 line 0
  codec-support fr
  gprs mode none
  trx 0
   rf_locked 0
   arfcn 871
   nominal power 23
   max_power_red 20
   rsl e1 tei 0
   timeslot 0
    phys_chan_config CCCH+SDCCH4
    hopping enabled 0
   timeslot 1
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 2
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 3
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 4
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 5
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 6
    phys_chan_config TCH/F
    hopping enabled 0
   timeslot 7
    phys_chan_config TCH/F
    hopping enabled 0

Steps to reproduce

  1. Start the full core network stack (OsmoHLR, OsmoSTP, OsmoMSC, OsmoBSC, OsmoMGW, osmo-bts-virtual).
  2. Start both virtphy instances and both mobile instances.
  3. Wait for both phones to register (this works reliably for me).
  4. On MS1 VTY: call 1 12341234126
  5. On MS2 VTY: call 2 answer

virtphy log for MS2

The virtphy log is the clearest evidence. The ASSIGNMENT COMMAND moves MS2 to TCH/F TS2 (chan_nr 0x0a), the SACCH and ASSIGNMENT COMPLETE frames go correctly to tn=2. But when MS2 answers and transmits CC CONNECT, it goes to tn=0:

# After assignment to TCH/F TS2 and everything appears to be correct:

L1CTL_DATA_REQ (chan_nr=0x0a -> type=0x08 ss=0 ts=2, link_id=0x40)
    07 00 01 03 49 06 15 ...             # SACCH measurement report
Tx VIRT_L1_SCHED_HANDLER -> Um (fn=7013, tn=2)   

L1CTL_DATA_REQ (chan_nr=0x0a -> type=0x08 ss=0 ts=2, link_id=0x00)
    01 00 0d 06 29 00 2b 2b ...          # RR ASSIGNMENT COMPLETE (06 29)
Tx VIRT_L1_SCHED_HANDLER -> Um (fn=7046, tn=2)   

# MS2 answers (~3 seconds later) and CONNECT goes to different timeslot:

L1CTL_DATA_REQ (chan_nr=0x90 -> type=0x90 ss=0 ts=0, link_id=0x00)
    01 02 09 83 07 2b 2b ...             # CC CONNECT (83 07)
Tx VIRT_L1_SCHED_HANDLER -> Um (fn=7972, tn=0)   

L1CTL_DATA_REQ (chan_nr=0x0a -> type=0x08 ss=0 ts=2, link_id=0x40)
    07 00 01 03 49 06 15 ...             # SACCH
Tx VIRT_L1_SCHED_HANDLER -> Um (fn=8098, tn=2) 

# This pattern repeats for ~30 seconds:
# CONNECT retransmit -> tn=0  
# SACCH              -> tn=2  
Then the call gets released.    

The full alternating sequence is visible in the log: CONNECT retransmits arrive at tn=0 every second while SACCH frames continue correctly on tn=2, for the full ~30 seconds until time out. The SACCH on the same dedicated channel never goes to the wrong timeslot, only the CONNECT does.

Questions

I would be grateful for any help with the following:

  1. Is there a known reason why the CONNECT frame would acquire a different chan_nr (0x90) than the one the dedicated channel was assigned (0x0a)?
  2. Could this be caused by something in my configuration or network topology that I’ve overlooked?
  3. Has anyone seen this before with osmocom-bb over virtphy, particularly when the TCH is allocated on a non-zero timeslot?

I can provide full debug logs for mobile2 and virtphy2 or the configs for the other components if that would help. I have not tested this outside the virtual (virtphy) setup.
Thank you very much for your time.