Skip to content
Success

Changes

Summary

  1. Split most of iu_client.{c,h} into sccp.{c,h} and iu_rnc.{c,h} (details)
  2. sccp: Introduce helper func sgsn_scu_iups_tx_data_req() (details)
  3. iu_rnc: Constify function params (details)
  4. ranap: Clean up RANAP rx path param passing (details)
  5. Split Iu RANAP RAB PS act/deact over different layers (details)
  6. Split Iu RANAP conn release over different layers (details)
  7. Apply uniform prefix to remaining APIs in gprs_ranap.h (details)
  8. iu_rnc: Use API osmo_sccp_addr_ri_cmp() to compare addresses (details)
  9. ranap: Reject InitialUE without RAC IE (details)
  10. iu_rnc: Split iu_rnc_register API into 2 steps (details)
  11. ranap: Improve error handling in Rx RESET (details)
  12. ranap: Create iu_rnc upon rx RESET (details)
  13. Store scu_iups in iu_rnc instead of ue_ctx (details)
  14. iu_rnc: Introduce helper API iu_rnc_discard_all_ue_ctx() (details)
  15. Introduce iu_rnc FSM (details)
  16. stats: Introduce stats sgsn.iu_peers.{total,active} (details)
  17. ranap: Take into account RNC availability during paging (details)
Commit 265bc33b05d2a7459bcaf286565a6ba524ef09f2 by Pau Espin Pedrol
Split most of iu_client.{c,h} into sccp.{c,h} and iu_rnc.{c,h}

* iu_rnc is easily spotted as an object class in the data domain which
  can be put into its own file, handling its specific logic and data.

* SCCP code can also be moved into own specific file, which eases
  self-containment of the layer logic and data.

* As a result, lots of RANAP Rx/Tx code in iu_client.{c,h} can also be
  moved to the already existing gprs_ranap.{c,h}.

All these changes improve a lot readibility of code and makes it a lot
easier to improve/extend the different layers/objects in future patches.

Change-Id: I4c792ae665720460b5a954b5c7cbfe5acbc37473
The file was addedsrc/sgsn/iu_rnc.c
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/gprs_gmm_attach.c
The file was addedsrc/sgsn/sccp.c
The file was modifiedinclude/osmocom/sgsn/Makefile.am
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedtests/sgsn/Makefile.am
The file was addedinclude/osmocom/sgsn/sccp.h
The file was modifiedtests/gprs_routing_area/Makefile.am
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedsrc/sgsn/Makefile.am
The file was modifiedinclude/osmocom/sgsn/sgsn.h
The file was modifiedsrc/sgsn/sgsn.c
The file was modifiedinclude/osmocom/sgsn/iu_client.h
The file was modifiedsrc/sgsn/sgsn_main.c
The file was addedinclude/osmocom/sgsn/iu_rnc.h
Commit 203676d0476bd5afeae6a2c472a7fa958bfa40e7 by Pau Espin Pedrol
sccp: Introduce helper func sgsn_scu_iups_tx_data_req()

This avoid code deduplication plus moving SCCP SAP logic into sccp.c.

Change-Id: Id34f86b4f5e40ddceac4066ec18ebc60529cafab
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/sccp.c
The file was modifiedinclude/osmocom/sgsn/sccp.h
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit 20d032bdd294ea5cc84bafc995b534c4c26439ce by Pau Espin Pedrol
iu_rnc: Constify function params

Change-Id: I288bc21d24aa5abd3d9bd97e796ac9f8590290bd
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
Commit a0203ce7ffdb3d17991dde2a0e123eac6a87d75e by Pau Espin Pedrol
ranap: Clean up RANAP rx path param passing

Use the osmo-iuh ranap_cn_rx_*_decode2() APIs directly. This
allows getting rid of extra "ctx" temporary structs and another level of
cb indirection.

Take the chance to update most pointers consitfying them.

Depends: osmo-iuh.git Change-Id I667dc2ef377c1ceb5b11315458f00b282c143c81
Change-Id: Ib3c00b5105b7ba4bb1a2dad1a14bea233a03c358
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedTODO-RELEASE
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit c1f2de579012e9d79d53f6f71e255bc10894563f by Pau Espin Pedrol
Split Iu RANAP RAB PS act/deact over different layers

Properly separate logic acting on objects vs logic building and
generating RANAP msg on the wire.

Change-Id: I98788468b7e50619cfd99b3aef2311bb601fb6be
The file was modifiedsrc/sgsn/mmctx.c
The file was modifiedsrc/sgsn/sgsn_libgtp.c
The file was modifiedinclude/osmocom/sgsn/mmctx.h
The file was modifiedinclude/osmocom/sgsn/pdpctx.h
The file was modifiedsrc/sgsn/gprs_gmm.c
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedsrc/sgsn/pdpctx.c
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
Commit eb5959f6b91893b2b98251ed791fe7fa6e900b96 by Pau Espin Pedrol
Split Iu RANAP conn release over different layers

Move and rename functions acting on mmctx to mmctx.{c,h}.
From there, call functions acting on ranap ue_ctx.

Change-Id: I4acdbc857df36b7409c8210d364758192dfdb0bb
The file was modifiedsrc/sgsn/gprs_mm_state_iu_fsm.c
The file was modifiedsrc/sgsn/mmctx.c
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedsrc/sgsn/sccp.c
The file was modifiedinclude/osmocom/sgsn/mmctx.h
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedinclude/osmocom/sgsn/iu_client.h
The file was modifiedsrc/sgsn/gprs_gmm.c
Commit ecaa198fa0d514068650218d3b3ef89a92a04bb2 by Pau Espin Pedrol
Apply uniform prefix to remaining APIs in gprs_ranap.h

Change-Id: I4f253f35013085bdebf80e94ab0d2f771e40dba6
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/gprs_gmm.c
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedsrc/sgsn/gprs_gmm_attach.c
Commit 202039ed0268d24ef643f4705a9123b6c39a6b2d by Pau Espin Pedrol
iu_rnc: Use API osmo_sccp_addr_ri_cmp() to compare addresses

Change-Id: I04fb37f28b52da9eecb1f8ea40c38ee3eced1c29
The file was modifiedsrc/sgsn/iu_rnc.c
Commit 009c25f9688fc781234f9e72f5e29aec0633ab98 by Pau Espin Pedrol
ranap: Reject InitialUE without RAC IE

According to 3GPP TS 25.413 clauses 8.22.2 and 9.1.33,
RAC IE is mandatory in PS domain.

Change-Id: I7d6b996ddf1c5a7cde1bf06b500d3ed19c6090c6
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit dfcb514076f17b58727cae8fe3e0e156769370f8 by Pau Espin Pedrol
iu_rnc: Split iu_rnc_register API into 2 steps

Split lookup+allocation from RAI updating.
This will be needed once we start creating iu_rnc objects upon SCCP
rx RANAP RESET messages, which hold Global RNC-ID but no RAI
information.

Change-Id: I3761cc539c63a7ed680b04bb8136a43d397c10aa
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit b9c9271a1f7a54a22034dec80e90e29970b02aad by Pau Espin Pedrol
ranap: Improve error handling in Rx RESET

* Verify the CN Indicator is set to PS to avoid reacting on content from
  unexpected peers (eg. IuCS). If none is set, be permissive on rx and
  assume PS.

* If GlobalRNC-ID IE is missing, reject the RESET with an Error
  Indication towards the peer to notify about the rejection.
  Same if we couldn't decode properly it.

* Introduce Tx helpers for generic SCCP UNITDATA.req and RANAP Error
  Indication helpers to simplify code and avoid duplication.

Depends: osmo-iuh.git Change-Id I58c75b3e0e0f33f48d077385ffac820a6b2be59e
Change-Id: I2a53e10c3903992a42d081e3ec300fbdb9b3c34c
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedTODO-RELEASE
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit 7673bbd7ad45bdced262e79796d1870bacb59427 by Pau Espin Pedrol
ranap: Create iu_rnc upon rx RESET

RANAP RESET, the first message an SGSN usually receives from an RNC,
contain the GlobalRNC-ID we can already use to register the iu_rnc
object.
This allows keeping track of peers since first message, before first
InitialUE message is received.
Once we start tracking peer RNC state within osmo-sgsn (as we already do
in other osmo-* programs), this will be needed.

Change-Id: Iaf31271feb4d88881382ed8594d0d8e20e22b194
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit 611b32811e4458082da789a5c4eb0ae4c3943faa by Pau Espin Pedrol
Store scu_iups in iu_rnc instead of ue_ctx

All the ue_ctx belong to a given peer RNC, which holds the SCCP User to
talk to it.

Change-Id: I3969af765b7b0d1375b5e6ad8f3f2e9845f939ef
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
The file was modifiedsrc/sgsn/sccp.c
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedinclude/osmocom/sgsn/iu_client.h
The file was modifiedsrc/sgsn/gprs_ranap.c
Commit a24ebc7051a693ee0a35775e9ec69713f6985034 by Pau Espin Pedrol
iu_rnc: Introduce helper API iu_rnc_discard_all_ue_ctx()

This is a preparation commit to introduce iu_rnc_fsm in follow-up patch.
The helper API will be used whenever the entire RNC is considered reset.

* Code inside handle_notice_ind() is moved to its own function
  iu_rnc_discard_all_ue_ctx().
* Dependent helper ue_ctx_link_invalidated_free() API is properly
  prefixed/renamed to ue_conn_ctx_link_invalidated_free(), where methods
  for ue_conn_ctx object are placed.
* ue_conn_ctx_find() is properly prefixed/renamed to
  sgsn_scu_iups_ue_conn_ctx_find() and made available to functions in
  other files.

Change-Id: Ie3a4732a85a69d115dd5756bfa64b296e9e5edd2
The file was modifiedinclude/osmocom/sgsn/sccp.h
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedsrc/sgsn/sccp.c
The file was modifiedinclude/osmocom/sgsn/iu_client.h
Commit d6c29beaf334e957b2fd4c146cae88150cac8b53 by Pau Espin Pedrol
Introduce iu_rnc FSM

This FSM is similar to the already existing ran_peer_fsm in osmo-msc,
which already had better logic around SCCP and RANAP state handling.
Similarly, osmo-sgsn's struct ranap_iu_rnc maps to osmo-msc's struct ran_peer.

With this FSM we can currently track the RANAP link state towards a given
RNC peer:
* Reject (RANAP Error Indication) all UE-related messages until a RANAP
  RESET from RNC is received first.
* Tear down all subsriber connections whenever the RANAP peer sends us a
  RESET message.
* Tear down all subscriber connections whenever the SCCP link towards
  RNC becomes unavailable.
* Send a RESET towards RNC peer once the SCCP link towrdards it becomes
  available again.

This commit only implements so far the Rx path of the FSM, ie. when
receiving events/messages from a peer over SCCP and pushing them locally
up the stack (RANAP). The Tx side will be implemented in a follow-up
commit, which will allow discarding messages if the lower layers towards
a given RNC are known to be down.

Related: OS#3403
Change-Id: I18b7803500163e78ff6a684095194174b0fb6ee1
The file was modifiedsrc/sgsn/sgsn_vty.c
The file was modifiedtests/sgsn/Makefile.am
The file was modifiedtests/osmo-sgsn_test-nodes.vty
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedtests/gprs_routing_area/Makefile.am
The file was modifiedinclude/osmocom/sgsn/sgsn.h
The file was modifiedinclude/osmocom/sgsn/Makefile.am
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/sccp.c
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
The file was addedsrc/sgsn/iu_rnc_fsm.c
The file was addedinclude/osmocom/sgsn/iu_rnc_fsm.h
The file was modifiedsrc/sgsn/sgsn.c
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedinclude/osmocom/sgsn/sccp.h
The file was modifiedsrc/sgsn/Makefile.am
Commit b062c3647e0353f802d57eb4013df059358d2b46 by Pau Espin Pedrol
stats: Introduce stats sgsn.iu_peers.{total,active}

Change-Id: I51b5227d92027f1251dc4debbbf59737e7c1a9ba
The file was modifiedinclude/osmocom/sgsn/sgsn.h
The file was modifiedsrc/sgsn/iu_rnc.c
The file was modifiedsrc/sgsn/sgsn.c
The file was modifiedsrc/sgsn/iu_rnc_fsm.c
Commit 1fd205f0b838392625303671b240aaaf7c9c4dac by Pau Espin Pedrol
ranap: Take into account RNC availability during paging

Avoid transmitting a RANAP paging message to an RNC if we already know
it's not currently available over SCCP.
Take into account that information when deciding/printing whether the
paging could be sent or not.

Take the chance to clean up the iu paging function helpers inherited
from osmo-iuh iu_client.c to better fit the data domain in osmo-sgsn
(iu_rnc).

Change-Id: I24e5446bcf4c958028577230b231960acea9e5b9
The file was modifiedinclude/osmocom/sgsn/iu_rnc.h
The file was modifiedinclude/osmocom/sgsn/gprs_ranap.h
The file was modifiedsrc/sgsn/gprs_ranap.c
The file was modifiedsrc/sgsn/iu_client.c
The file was modifiedsrc/sgsn/iu_rnc_fsm.c
The file was modifiedinclude/osmocom/sgsn/iu_rnc_fsm.h
The file was modifiedsrc/sgsn/iu_rnc.c