Project

General

Profile

Actions

Feature #5502

open

MS-side LLC implementation

Added by laforge 10 months ago. Updated 10 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
OsmocomBB mobile (host)
Target version:
Start date:
07/01/2022
Due date:
% Done:

50%

Resolution:
Spec Reference:
LLC: 3GPP TS 44.064, SNDCP: 3GPP TS 44.065
Tags:

Description

The LLC + SNDCP protocols are rather symmetrical, so the existing code from the network side (in osmo-sgsn should be possible to generalize rather easily


Related issues

Related to OsmocomBB - Feature #5501: MS-side GPRS Mobility Management (GMM) + Session Management (SM)New07/01/2022

Actions
Related to OsmocomBB - Feature #5500: MS-Side GPRS RLC/MAC implementationIn Progressfixeria07/01/2022

Actions
Actions #1

Updated by laforge 10 months ago

  • Related to Feature #5501: MS-side GPRS Mobility Management (GMM) + Session Management (SM) added
Actions #2

Updated by laforge 10 months ago

  • Tracker changed from Bug to Feature
Actions #3

Updated by laforge 7 months ago

  • Tags set to ARDC
Actions #4

Updated by pespin 2 months ago

  • Spec Reference set to 3GPP TS 44.064

Related primitives to use towards other layers can be found in 3GPP TS 44.064 section 7.1.2 "LLC layer service primitives"

Actions #5

Updated by fixeria 2 months ago

  • Assignee set to pespin
Actions #6

Updated by pespin 2 months ago

I started looking at this and took over the code initially pushed by fixeria to libosmo-gprs-llc.

Status there was that the enc/dec functionalitites were already ported, and the primitives and types descriptions were already put into a header file.

I looked at the related specs and I started adding what is going to be the public API based on "struct osmo_gprs_llc_prim" being pushed up and down by upper/lower layers.
Code I am working on can be found in libosmo-gprs.git branch "pespin/master".

Once I'm finished adding the required public APIs to generate the primitives, I'll continue implementing the osmo_gprs_llc_prim_upper_down() and osmo_gprs_llc_prim_lower_up() APIs.

For that, I'll basically need to integrate the data structures available already in osmo-sgsn. The code should be imported and modified to use the newly enc/dec functions prepared by fixeria.
OsmoSGSN already implements the 3GPP TS 44.064 C.2 FSM but without using an osmo-fsm. The idea is to try to import is first as it is, and later on move it to an osmo_fsm.

Hence the FSM and the dec/enc functions remain mainly private and not accessible from the upper/lower layers, which are expected to use mainly the primitive-based API.

Regarding the primitive API, something still not clear is what I should pass as "SAP" to them. I could add a "enum osmo_gprs_llc_sap { LLGM, LL, GRR, BSSGP }" and split enum osmo_gprs_llc_prim_type into per SAP enums, but I'm not sure if it's worth it?

Actions #7

Updated by pespin 2 months ago

  • Status changed from New to In Progress
  • Spec Reference changed from 3GPP TS 44.064 to LLC: 3GPP TS 44.064, SNDCP: 3GPP TS 44.065
Actions #8

Updated by fixeria 2 months ago

pespin wrote in #note-6:

For that, I'll basically need to integrate the data structures available already in osmo-sgsn. The code should be imported and modified to use the newly enc/dec functions prepared by fixeria.
OsmoSGSN already implements the 3GPP TS 44.064 C.2 FSM but without using an osmo-fsm. The idea is to try to import is first as it is, and later on move it to an osmo_fsm.

Ack.

Hence the FSM and the dec/enc functions remain mainly private and not accessible from the upper/lower layers, which are expected to use mainly the primitive-based API.

Full ack.

Regarding the primitive API, something still not clear is what I should pass as "SAP" to them. I could add a "enum osmo_gprs_llc_sap { LLGM, LL, GRR, BSSGP }" and split enum osmo_gprs_llc_prim_type into per SAP enums, but I'm not sure if it's worth it?

AFAIR, something like that was already proposed during code review. I don't have a strong preference here.

Actions #9

Updated by pespin about 2 months ago

  • % Done changed from 0 to 20

I already have a big part of LLC layer from osmo-sgsn imported into libosmo-gprs-llc, and today I started importing some of the SNDCP code into a new libosmo-gprs-sndcp.

Importing the code is taking quite a while due to osmo-sgsn having lots of code of different layers mangled together. Also some code paths which are expected to be async were done synchronously (like XID response from XID request).

Work done so far can be found at libosmo-gprs.git branch "pespin/master".

Once I have ported most of the code and it's in good enough shape, I may try to modify osmo-sgsn to use the new libraries in order to test them some more with an existing program.
In parallel also the "modem" app from osmocom-bb can be extended to use the SNDCP layer, and whatever comes/goes down LLC layer can be feed through a UDP packet to osmo-sgsn.

Actions #10

Updated by pespin about 2 months ago

  • % Done changed from 20 to 30

I'm half way with the initial SNDCP public API and import implementation from osmo-sgsn. Work done so far is kept in libosmo-gprs.git branch "pespin/master".

I submitted both commits (LLC & SNDCP) to gerrit. I'd for merging the LLC one already, so that other people working on adjacent stack parts can already make some uf of it or at least reuse some of the working infrastructure, spot bugs, reuse data structures, etc.

https://gerrit.osmocom.org/c/libosmo-gprs/+/30489 llc: Proper separation of public & private APIs, Introduce llc_prim API
https://gerrit.osmocom.org/c/libosmo-gprs/+/30490 sndcp: Initial libosmo-gprs-sndcp support

Next steps:
- Keep porting stuff from osmo-sgsn gprs_sndcp.c to libosmo-gprs-sndcp.git
- Attempt porting osmo-sgsn to use libosmo-gprs-{llc,sndcp} and have as many tests passing.
- Start using the SNDCP upper and LLC lower interface in modem, by pushing down an IP pkt and transmitting the generated LLC to osmo-sgsn through a UDP socket.

Actions #11

Updated by pespin about 2 months ago

I'm still WIP importing the SNDCP layer from osmo-sgsn.

I realized I need to create a new data structure to hold management data shared by all sne (sndcp_entity). What's called in TS 44.065 "SNDCP management entity". This is used to keep track of the XID params at SNDCP layer. In osmo-sgsn this data structure doesn't exist, because the data is stored doing layer violation in "llme" pointer, which is 1 to 1 with the new data structure I need to create.
Then I also have that structure "snme" accessible and refcounted by all "sne" (sndcp_entity" pointers.

Actions #12

Updated by pespin about 1 month ago

  • % Done changed from 30 to 40

I finished the initial integration of osmo-sgsn code for both LLC and SNDCP into libosmo-gprs-*.
The biggest LLC patch has already been merged.
Initial SNDCP support in libosmo-gprs has been submitted to gerrit:
https://gerrit.osmocom.org/c/libosmo-gprs/+/30490 sndcp: Initial libosmo-gprs-sndcp support

I am now working on modifying osmo-sgsn to use the new libraries, which is also quite a lot of work, but that's the best way to test the library is working and to debug several aspects of it. Also to make sure we have everything we need in the API.
I have WIP state in osmo-sgsn.git branch "pespin/llc".

Actions #13

Updated by pespin 28 days ago

I have been doing quite a lot of osmo-sgsn clean up and refactoring (bunch of patches in gerrit), in order to split stuff into different modules and make it easier to replace code with libosmo-gprs.

self note: Some info on TLLI+RAI and NSAPI to identify MS can be found at 3GPP TS 23.060 section "14.3 NSAPI and TLLI for A/Gb mode"

Actions #14

Updated by pespin 10 days ago

  • % Done changed from 40 to 50

Today I added initial support to forward GRR unitdata primitive up/down the stack in libosmo-gprs:
https://gerrit.osmocom.org/c/libosmo-gprs/+/31049

I also tested sending a GMM Attach Req LLC->GRR with the modem app and verified it was forwarded to the modem app callback.

This will allow start testing against the RLC/MAC (libosmo-gprs-rlcmac) API.

Actions #15

Updated by pespin 7 days ago

  • Related to Feature #5500: MS-Side GPRS RLC/MAC implementation added
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)