Commit Graph

5989 Commits

Author SHA1 Message Date
Neels Hofmeyr 8c5cd5d86d log protocol discriminators and message types by name
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
Change-Id: If1c49faf6e1757cb16b383dd2db87b48bc94eee6
2017-03-16 15:32:34 +01:00
Neels Hofmeyr aebf791bce adjust msc_vlr_test_reject_concurrency
Change-Id: Ic4e6ebd8973e9e7f7c578fb559c741cbe10bef5a
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 8df9683b68 log: ciphering/security are implicit CM Service Accept
Log just as prominently to mark CM Service Accept.

Change-Id: I7afe9d4f69e5525ede7a7c380a2c48fb2c5054b6
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 406284e897 debug log: upon bumping a conn, say why it is kept
Change-Id: I378af1fa06d8a45c01a80a381be143572e1dc41f
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 33513ae19a allow CM Service Request on already open connection
Change-Id: I3c4687aafe495e60b1568e6505dbf847adab37f1
2017-03-16 15:32:34 +01:00
Neels Hofmeyr c1ebe963f4 more specifically conclude cm service requests
Don't end a CM Service Request "lock" too indiscriminately. Trigger only on new
transactions that start.

Change-Id: I4f64b8d91cfb1e61be4563594b2d6b23144af5bc
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 3e82738b74 remove cruft: old anchor and auth code
Change-Id: I16ceeeede46f244fd454758cc223673dd51cfc72
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 525a8ac9d7 mostly cosmetic: have one msc_conn_close() with cause argument
Change-Id: Ied7663f856cfce6e7ed1c0314fd558af85091dcc
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 78fc746b10 Reinstate msc subscriber conn ref counting
Indeed the easiest way of ensuring all code paths can cause conn discarding
while still all code paths can check on whether a conn needs to be discarded.

Change-Id: I641fe36d9fa2077e3caf63cc583aaa380603bff0
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 952c9b033c compiler warning mgcp fu
Change-Id: I79a891dbaff3cd6aec5a0ab08435e4619ade62d2
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 5f443298fe mgcp: hack RAB success from nano3G: patch first RTP payload
The ip.access nano3G needs the first RTP payload's first two bytes to read hex
'e400', or it will reject the RAB assignment. Add flag
patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on
a stream, and overwrite its first bytes with e400. This should probably be
configurable, but seems to not harm other femto cells (as long as we patch only
the first RTP payload in each stream). Only do this when sending to the BTS
side.

Change-Id: If0887b0b7714fc204f2addab2d43d44bb283ba21
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 1804823c92 mgcp hack: don't change payload type when passing RTP thru
Change-Id: I9c43704a4c1e26d434c0d7e7ee370b2c21fb3399
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 028387be8f vlr: fix: don't send CM Service Accept after Ciphering Command
Ciphering Mode Command is an implicit CM Service Accept, if we're sending
both we're confusing the MS.

Change-Id: I3a04debe9b01c086e7f44b6139cb8796fcc71d38
2017-03-16 15:32:34 +01:00
Neels Hofmeyr 0a25cde339 remove all 3G authentication dev hacks -- it works!
Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
2017-03-16 15:32:33 +01:00
Neels Hofmeyr e31a381b72 implement utran security mode with vlr
Change-Id: Ib1e285b54cd7aaa0895e9c51a47720f446a07183
2017-03-16 15:32:33 +01:00
Neels Hofmeyr c332a4e49d move iucs_ranap.[hc] to include / libmsc to use in msc_vlr tests
Change-Id: I99ca36857f5e4c9ae113017955611fd92256123c
2017-03-16 15:32:33 +01:00
Neels Hofmeyr c4914d9c4f vlr tests: umts auth with tmsi
Change-Id: I136fa85b234dfeb0e8017d8c3401f7f42114b6ff
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 8eacc1a6f0 vlr: allow setting assign_tmsi per-subscriber
Change-Id: I7469da0ed19e1e8b292422aadfd3ae2ebc2afd57
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 0adc5c1060 ensure authentication is required on UTRAN
Change-Id: I9b9ad1379324f1405bd02a05fcd7ef8c53bacbde
2017-03-16 15:32:33 +01:00
Neels Hofmeyr ab23a1e05b vlr on utran: transmit CommonID
Change-Id: Ice3c71f048b097f2c2de8bd4f4508a7ca2cb1cf5
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 1983131cdc msc: decouple from bsc_api and bts
Change-Id: I3564291a6d20da13a8d75c71b0c425da4948d412
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 6bd5d09507 make python tests pass for new OsmoMSC
Change-Id: I59bf6503a2f822e9b6078c0fd24643df9a2dab3c
2017-03-16 15:32:33 +01:00
Neels Hofmeyr e48c9d13ae Make the code work so that the msc_vlr tests pass
Change-Id: Ie8814d856bbe4c111007a696a4d26576854c134f
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 443a180a81 mark fixme: rate counters
Change-Id: I45651fd4cf3f4da8ad67251bbb3b627888e76d9c
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 7b414bee43 mgcp: log payload type change
Change-Id: Iee5fa667dece12174b1933345c1ed640a264ed97
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 4c26f9c3de comment: fixme: rab failure
Change-Id: I6e21f2d7dd560ab15675f3e432c37a13c4ab6792
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 2f5704113b mgcp parsing, set port from mgcp response
Change-Id: I90e2c1aa7575d5fa6e0374f5022cbb25fc3f7699
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 601002ad4c mgcp parsing, mgcp test
Change-Id: Ibe2ab17b3fa3a506a2e841ba979ea4175e3a21e8
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 7c8a62a940 mgcp: handle responses from the MGCP GW
Change-Id: I5c0493feaec775461b5a017c36b93cc2ad63c896
2017-03-16 15:32:33 +01:00
Neels Hofmeyr 978e72e500 IuCS and IuPS: add VTY config for RAB Assignment address kind
To accomodate the ip.access nano3G without having to recompile, make the
RAB Assignment's Transport Layer Address IE's format configurable, in both
osmo-msc and osmo-sgsn.

The long term perspective is to somehow detect which address encoding a given
3G cell prefers, but for the time being just configure it globally and set each
ue_conn_ctx to the global setting upon creation.

Add VTY command to iu_vty.c, with args passed to iu_vty_init() to insert
at an arbitrary VTY node, so that it can be used both for osmo-msc and
osmo-sgsn. Add generic iu_vty_config_write() to write out the config.

Call iu_vty_init() from msc_vty_init(); msc_vty_init() is in libmsc,
hence linking of osmo-msc now needs libiu to come after libmsc, so move
that further down.

Change-Id: I93728314742b327336f3fb6de98e6457f687e1f9
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 1ad6a2e515 IuCS, IuPS: move flag to use X.213 NSAP addr into ue_conn_ctx
The future perspective is to remember the preferred RAB Transport Layer Address
encoding for each 3G cell that is connected, so store per UE conn instead of
globally hardcoding.

Add rab_assign_addr_enc member to ue_conn_ctx. Thus the iu_rab_act_cs() and
iu_rab_act_ps() functions no longer need the explicit use_x213_nsap argument.

Add include/openbsc/common.h in order to define the enum nsap_addr_enc, in a
separate file to be able to easily include it in all of libmsc, libiu and
gprs/* without creating include cycles.

Set the rab_assign_addr_enc when an MM ctx is created for iu, and whenever the
ue_conn_ctx for an Iu MM ctx is updated. This looks a bit clumsy so far, the
hope is that there will be a nice way to setup the ue_conn_ctx prior to that.

Change-Id: I49bb5736df7bdfdd55d3e7b74ee559595cfd2f7d
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 7cb4778a1c iu: sort out confusion around asn_debug and asn1_xer_print
Before, I confused asn_debug with asn1_xer_print. Have two distinct VTY
commands and fix documentation.

Put the asn_debug and asn1_xer_print implementations in iu.c.

Since they are globally defined, don't pass a pointer to iu_vty_init()
but just use it directly. Might be considered less clean, but is also less
bloat.

Change-Id: Iccbadfe1585ba224f74cdfb5273b5ce29b6d78f0
2017-03-16 15:32:32 +01:00
Neels Hofmeyr f365565d8d iu.h: add missing includes and type defs
So far it was included only in files that also include all needed headers,
but make it so that it can be included on its own.

Change-Id: I08a756031b995bd01a6e15c678b845fd98de960b
2017-03-16 15:32:32 +01:00
Neels Hofmeyr e90baa384d IuCS: rapidly release connections
Do the same as we do in 2G: release the connection as soon as nothing else
is pending for a given subscriber.

Before, osmo-msc would wait for the UE "to get bored" and send an Iu
release. But the CN should stay lean on connections. Also, 25.413[1] in section
7, 6th point states:
"While the Iu release is managed from the CN, the RNC has the capability to
request the release of all Iu connection resources from the corresponding Iu
connection."
So far we did not manage Iu release from osmo-msc at all.

Use the same mechanism we use in 2G: from msc_release_connection(), just before
freeing the gsm_subscriber_conn, invoke a CN initiated Iu Release command to
the UE.

This works around OS#1816 ("USSD only works when IuCS is released", on nano3G),
because the Iu conn is now released right after every signalling, so that
typically no two requests will use the same conn.

In iu.h/iu.c, add iu_tx_release(), absorbing almost all of the code from
ranap_handle_co_iu_rel_req().

Add stub to db_test.c, necessary to build it without linking libiu.

[1] 3GPP TS 25.413 v12.4.0 Release 12 / ETSI TS 125 413 V12.4.0 (2015-04)

Related: OS#1816
Change-Id: Ic12bd6f3666f6fd42bd6d9fdae1c93abee3b6786
2017-03-16 15:32:32 +01:00
Neels Hofmeyr bb36fae3b5 IuCS: don't remove Iu conn until release FIXME
Don't remove the gsm_subscriber_connection without an Iu Release.

The 2G paradigm is to close a subscriber connection as soon as nothing else is
pending.

In 3G however, the conn is often discarded even though the IuCS stays open and
valid, which confuses the situation: before the UE releases a bit later, we
would try to page the subscriber unsuccessfully, because the UE expects to
already be connected.

To first fix the discrepancy of Iu vs. subscr release, never discard
gsm_subscriber_connections when msc_release_connection() is called.

This creates a "lazy" CN that keeps connections open as long as the UE will
tolerate. It is really fast in sending many SMS in close succession, but is
certainly a bad CN design choice: we should rather stay lean on connections.

A subsequent commit will change this, but I decided to keep this commit as a
reference, for when we'd like to test situations that should re-use an
established connection.

Change-Id: I012378cfa432d791146db387554ec1909de05297
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 8be9087ca4 mgcp dbg log
Change-Id: I56fda48edaa92abfc6e3886cdfce733bb0686f73
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 87387b70ff IuCS: store assigned rab_id in gsm_subscriber_connection
Change-Id: I7fda4304631fc24bbd1bebe911b8403a942fcf53
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 390c9e1989 bridge calls via mgcpgw
Change-Id: Ie259e30bc532fe9817c96562022ac33443d5747a
2017-03-16 15:32:32 +01:00
Neels Hofmeyr d6036fd38f also do call assignment for MT calls, upon Call Confirmed
Change-Id: I863fa73948f61aaffd7f4472f3abc3e44228e31f
2017-03-16 15:32:32 +01:00
Neels Hofmeyr fcf34f8c1b IuCS: implement msc_call_assignment() for IuCS
Send IuCS RAB Activation upon MNCC_CALL_PROC_REQ.

Implement function msc_call_assignment(): decide between sending A-iface BSSMAP
Assignment Request or IuCS RAB Assignment Request.

Implement iu_rab_act_cs() to send the IuCS RAB Assignment Request. The IP
address and port of the MGCPGW sent in the RAB Assignment are still hardcoded.

The A-interface extension is not implemented yet.

Declare ranap_new_msg_rab_assign_voice() to avoid including
ranap_msg_factory.h, which would require adding ASN1 CFLAGS to Makefile.am.

The mgcpgw_client as well as some more osmo-iuh functions are now linked from
libmsc, hence add some dummy stubs to libiudummy and db_test.c.

Change-Id: Iaae51d1fbbfc28fad1c0b85e161d53d80a420a19
2017-03-16 15:32:32 +01:00
Neels Hofmeyr c852f12748 msc: add mgcpgw client (with dummy read cb so far)
Store the mgcpgw client data in struct gsm_network.
Initialize VTY and bind the client.

Change-Id: Ifc4efb1ca44fa34c29bf23b35addb54155296d68
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 5d88beeab2 libmgcp: add mgcpgw client API
Add an API to send MGCP messages to an MGCP GW, from the perspective of
an MSC instructing the GW to setup RTP streams.

Rationale: the mgcp_protocol.h is mostly for the MGCP GW itself, other
implementations forward incoming MGCP messages. So a simpler approach for an
MGCP GW client is useful.

Add general VTY commands that can be used to configure mgcpgw_client.

osmo-msc is going to use this to route RTP streams (for 3G at first).

Change-Id: I6fe365c4c89207f2172943cc456b508a207b1135
2017-03-16 15:32:32 +01:00
Neels Hofmeyr aee3a12634 libmgcp: add value strings for mgcp_connection_mode
Add file mgcp_common.c to implement the value strings for the
mgcp_connection_mode.

Add in a separate file because of the upcoming mgcpgw_client.c implementation,
introducing a file that contains implementations commonly used in MGCP GW as
well as its clients.

Change-Id: I6fe365c4c89207f2172943cc456b508a207b1135
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 7be6e7f37c libmgcp: move mgcp_connection_mode to public header
mgcp_connection_mode will be used by the upcoming mgcpgw_client.h API.

Change-Id: I7a3f8905723320d968f1a53c1036904107b4fb2d
2017-03-16 15:32:32 +01:00
Neels Hofmeyr fbd19b52ae IuCS: cosmetic prep for msc_call_assignment()
Rename gsm48_cc_tx_call_proc() to gsm48_cc_tx_call_proc_and_assign() to mark
the place where the A-interface will send a BSSAP Assignment Request / where
the IuCS-interface will send a RAB Assignment Request.

Add function msc_call_assignment() to decide between A-iface and IuCS
assignment, to be implemented in subsequent commit.

Change-Id: I0695e233d57d13658793b0e63bb7c3ff224909a0
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 25aa8fe597 IuCS: send RANAP CommonID
Add libiu function to send a CommonID message down a UE connection,
iu_tx_common_id(); add also a corresponding stub to libiudummy for linking with
tests.

Add libmsc function msc_tx_common_id() to call the above. Add this mostly to
clearly indicate in msc_ifaces.h that libmsc is calling out of the MSC; also
to do conn->via_iface checking.

Call msc_tx_common_id() after ciphering is established, in
_gsm48_rx_mm_serv_req_sec_cb()'s GSM_SECURITY_SUCCEEDED case.

Change-Id: I576ddd5bbabfc989149debd2f8a9743db6d26043
2017-03-16 15:32:32 +01:00
Neels Hofmeyr 19d27e5fe3 cosmetic: msc_handler, bsc_handler: drop extra whitespace
The extra ws made me not find these lines when grepping for 'dtap ='.

Change-Id: I45e5c9e7df4704546872aab15adf407298943435
2017-03-16 15:32:32 +01:00
Neels Hofmeyr a23a4109a5 cosmetic: make gsm0408_loc_upd_rej() static 2017-03-16 15:32:32 +01:00
Neels Hofmeyr 35c5d6962a LU counters: count completion and failure, not messages sent
From a human admin viewpoint it doesn't make sense to count the messages sent:

When we use TMSIs, we first send a LU Accept with a new TMSI, and then expect
the MS to respond with a TMSI Realloc Complete message. When that fails to come
through, the LU actually ends in failure, even though a LU Accept was sent.

In 3G, if a UE sends an Iu Release during LU (e.g. user enables flight mode),
we cancel the LU without sending any reply at all, so nothing would be counted.

Instead, count Location Updating results, i.e. completion and failures.
2017-03-16 15:32:32 +01:00
Neels Hofmeyr c31f8d2633 remove handle_abisip_signal()
Change-Id: I9cf80f9c2c8a53a29e42f000029e680a9922cb41
2017-03-16 15:32:32 +01:00