SCCP connection identifiers on the SCCP User SAP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Harald Welte laforge at gnumonks.org
Mon Mar 11 20:48:17 UTC 2019


Hi Neels, from your IRC question today:

> when opening a new conn on SCCP, what's the proper way to get a
> conn_id? I want to feed OSMO_SCU_PRIM_N_CONNECT into
> osmo_sccp_user_sap_down(), but it seems the caller needs to pick a
> conn_id??

Whatever way you can think of to cough up a unique identifer for that connection.

> I assumed that libosmo-sccp implicitly picks an unused local conn
> reference, but that's not the case.

Note that in this sentence you're now talking about the "SCCP local
reference", which is something communicated on the wire between two SCCP
providers (implementations).  Hence, it is managed inside the
SCCP provider[s] and can be seen in the source local reference /
destination local reference field of the SCCP messages.

That's *not strictly* the SCCP connection identifier which has
significance only across the SCCP User SAP (i.e. between SCCP User and
SCCP Provider on the same system), and which never is visible on any
SCCP message on the wire.  It's just an implementation shortcut of the
Osmocom implementation that uses the same identifiers on both sides,
rather than allocating separate ones.

But getting back to your question:  If the SCCP provider was to receive
a N-CONNECT.req without some kind of identifier, and simply allocate
one, how would that identifier be communicated back to the user?  Those
primitives work asynchronosuly.  You'd have to come up with
yet-another-identifier, like a "primitive tag" where that tag then would
be eacho'ed back in the N-CONNECT.resp - and you end up again having to
allocate some unique identifier :P

> sccp_scoc.c has conn_create() which seems to pick an unused id, but
> that part is static in a .c file

> hnbgw just uses 1:1 the same conn_id from RUA to RANAP and thus doesn't invent new ones

Now I'm confused.  RUA isn't running over SCCP, right?

> osmo-bsc goes through its list of &bsc_gsmnet->subscr_conns to pick an unused id
> I can do that in osmo-msc, but it seems to me libosmo-sccp should have common API for that

The SCCP User SAP is modelled strictly after the ITU specs.  Always
imagine yourself in a situation where the SCCP user and SCCP provider
are running in different processes and they don't have access to each
others's state - and all they can exchange are the SCCP User SAP
primitives in some serialized form.  While libosmo-sccp doesn't work
like this (so far), we should always keep that in mind and keep the SAP
boundary clean.

As there's no primitive in ITU-T Q.7xx for "allocate me a local
reference", we don't have one :/

I'm not sure what we should do here.  If we introduce that kind of SCU
primitive, then the questions is how are they allocated/released?  Who
is in charge of that?  What kind of object would the SCCP provider use
to keep track of allocated IDs for which there is no connection yet, as
the N-CONNECT.req was not yet received?

The current situation is not great.  After all, theoretically there
could be an incoming new SCCP connection for which the provider choses
the same ID that the user at the same time choses for a new outbound
connection -> boom.  One could use something like the highest-order bit
to distinguish between user-allocated and provider-allocated
identifiers.

Regards,
	Harald
-- 
- Harald Welte <laforge at gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)



More information about the OpenBSC mailing list