Project

General

Profile

Bug #4731

LAPDm does not implement SAPI priorities between data link layers

Added by laforge about 2 months ago. Updated about 2 months ago.

Status:
Stalled
Priority:
Normal
Assignee:
Category:
libosmogsm
Target version:
-
Start date:
08/26/2020
Due date:
% Done:

80%

Spec Reference:

Description

AFAIR, The 3GPP specifications contain some very strict rules regarding priorities among different concurrent LAPDm data links for the same subscriber. For example, SAIP0 always has higher priority than SAPI3.

We've just encountered a situation where in MT-SMS, the SAPI3 SABM from BTS to MS was sent before the BTS replied with the UA for SAPI0 (contetion resolution procedure, where we echo the PAGING RESPONSE back to the MS).

A quick look at the LAPDm code in libosmocore reveals that it is doing a round-robin rather than implementing the rules.

TS 44.005 Section 4.2.2 states the priorities for SDCCH and SACCH. I guess we can think of FACCH == SDCCH in this context.


Checklist

  • implement test case
  • fix priority in LAPDm code

Related issues

Related to OsmoMSC - Bug #4714: SMS Message Lost Although Delivery Ack SentResolved08/16/2020

Related to OsmoBTS - Bug #1979: Priority of SAPI=0/SAPI=3 on SABMResolved03/10/2017

History

#1 Updated by laforge about 2 months ago

btw: We think this situation never happened so far due to the fact that we had NAGLE enabled on the TCP connections used for RSL. As we have started to disable NAGLE by enabling TCP_NODELAY, the latency of the BSC getting back to the BTS has significatnly been reduced,changing the timing at which a RLL EST REQ for SAPI3 is received by the BTS.

#2 Updated by fixeria about 2 months ago

  • Status changed from New to In Progress

#3 Updated by fixeria about 2 months ago

  • Checklist item implement test case set to Done
  • % Done changed from 0 to 40

I have just submitted a unit test that reproduces the problem:

https://gerrit.osmocom.org/c/libosmocore/+/19847 lapd_test: add a test checking SAPI0/SAPI3 prioritization

together with a bunch of misc/cosmetic changes:

https://gerrit.osmocom.org/c/libosmocore/+/19843 lapdm_pad_msgb(): cosmetic: use GSM_MACBLOCK_PADDING
https://gerrit.osmocom.org/c/libosmocore/+/19844 lapd_test: fix wrong comment in lapdm_establish()
https://gerrit.osmocom.org/c/libosmocore/+/19845 lapd_test: rename func=UA (RR) CM Service Request: s/ua/ua_cm/
https://gerrit.osmocom.org/c/libosmocore/+/19846 lapd_test: fix: print all messages to stdout, not stderr

#4 Updated by fixeria about 2 months ago

  • Related to Bug #4714: SMS Message Lost Although Delivery Ack Sent added

#5 Updated by fixeria about 2 months ago

  • Checklist item fix priority in LAPDm code set to Done
  • Status changed from In Progress to Feedback
  • % Done changed from 40 to 80

TS 44.005 Section 4.2.2 states the priorities for SDCCH and SACCH. I guess we can think of FACCH == SDCCH in this context.

During a voice call, SMS/SAPI=3 always goes over SACCH. So don't need to worry about FACCH.

The fix for DCCH has been submitted to Gerrit:

https://gerrit.osmocom.org/c/libosmocore/+/19853 lapdm: fix SAPI-0/SAPI-3 frame prioritization on DCCH

We still need to add some testing coverage for SACCH. Unfortunately it's much more complicated.

#6 Updated by fixeria about 2 months ago

  • Status changed from Feedback to Stalled
  • Priority changed from High to Normal

I'll continue to work on this as soon as I have more time.

#7 Updated by laforge 20 days ago

  • Related to Bug #1979: Priority of SAPI=0/SAPI=3 on SABM added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)