Commit Graph

35 Commits

Author SHA1 Message Date
Daniel Willmann ef8e50ef30 BSSGP_Emulation: Handle FLUSH_LL_ACK differently
The BVCI that this message might contain should not be used to route it.
It referes to the BVCI that the PDUs were transferred to (BVCI (new)).

Instead broadcast to all components.

Change-Id: Ia1df35da44ef28d91501bb898e1059bf1390129b
2021-11-26 12:05:20 +01:00
Daniel Willmann c5bbcc6279 gbproxy: Check SGSN-orignated BVC RESET if BSS BVC is gone
IF the BSS-BVC is gone gbproxy blocks the BVC towards the SGSN (this is
the only thing it can do since there is no BVC-REMOVE). If the SGSN ever
decides to reset that BVC the gbproxy should not ACK it, but instead
consider the BVCI unknown.

Change-Id: Ic57b39a77adf71abda99ef8af7da1592e2225a0d
Related: SYS#5628, OS#5236
2021-09-27 12:10:17 +00:00
Pau Espin eef4607203 BSSGP+pcu: Get rid of mp_tolerate_bvc_reset_cellid
Since we have new releases in -latest, we don't need this param since
it's never set to true.

Related: OS~5042
Change-Id: Ic496407fd2139b3a5221c30f1798797320cdee24
2021-02-26 13:39:45 +01:00
Pau Espin Pedrol 6ee0126971 Osmocom_Gb_Types: Fix tons of template restriction warnings
Change-Id: I3da153ce5e83b231501e74b958fcac9f10c00849
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 847a1651cd BSSGP_Emulation: Fix indentation whitespace
Change-Id: Iade336832e7045cd29bae52c7907c6a1c57813cd
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 011e32f8fc BSSGP_Emulation: Fix warning: control reaches end of non-void function
Change-Id: I9a44afc81b5b6b35a32a12efcf2dd1cb15e73e12
2021-02-08 12:31:14 +01:00
Harald Welte 633805b1c8 BSSGP_Emulation: Support up to 64 BVCs with 64 users each
Increase this from the previous limit of 16 BVC with 16 users each

Change-Id: I8abca1c020d0ba4b89a6045e99d3a9eb7bcc4648
2021-02-03 19:28:00 +01:00
Harald Welte f536524b07 BSGSP_Emulation: Route STATUS to GLOBAL port for both SIG and PTP
Change-Id: I6573562c0e7638f153798ee178c7c69d07c26756
Related: OS#4951
2021-01-17 18:15:32 +01:00
Harald Welte 650bd72849 BSSGP_Emulation: f_bssgp_get_tlli(): TLLI is optional in RADIO-STATUS
We must not dereference the TLLI IE unconditionally

Related: OS#4951
Change-Id: I463b25f5395127d155727d785eb7795ac0165fac
2021-01-17 17:39:29 +01:00
Harald Welte 9b461a94a3 sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port
For 12+ days, suspend/resume related SGSN + PCU TTCN3 tets have been failing.

It was the introduction of the BSSGP_CT:GLOBAL test port in
I40d973d80709f5d56f59247e8647b52754f09bc8 +
I805372f3024a0ec2491a24422e02c0bc6dc669d2 which caused the related PDUs
now to no longer show up where they used to.

Change-Id: I1977302fef4868dc1c330bc6f48f6a6608949393
Closes: OS#4902
2020-12-10 23:42:03 +01:00
Harald Welte 71449b0a13 bssgp: Introduce "GLOBAL" port for PTP BVC
There are some messages/procedures on a PTP BVC which are not related
to one specific TLLI, but affect the whole PTP BVC.  First and foremost
that is the FLOW-CONTROL-BVC. Let's check if the user is interested in
handling those internally (by connecting to the GLOBAL port).  If not,
fall back to acknowledging all incoing FC-BVC and ignoring all ACKs.

Related: OS#4891
Change-Id: Ib80a6a522dbcb33fd0e7bd31a73ef28fdc636f57
2020-12-09 15:31:30 +01:00
Harald Welte 27a70cc453 bssgp: rename tr_GLOBAL to tr_GLOBAL_SIG
... to indicate this is about the signaling BVC only.

Change-Id: I646db452c89842465902b5167c9c86de51df1241
2020-12-09 15:30:52 +01:00
Harald Welte 0083ea6b69 BSSGP_Emulation: Add RIM port to BSSGP_CT
This port is used for sending/receiving RIM related BSSGP messages. It
exists once per BSSGP_CT Component (i.e. once per NSE), as RIM is global
for the entire NSE.

Change-Id: I04511df5dffbfe19faabf22014acc72b7673b7d6
2020-12-08 08:30:20 +01:00
Harald Welte f20af41003 gbproxy: Introduce TC_overload
When the SGSN is sending an OVERLOAD message, we expect that to
propagate down to every BSS on the other side.

Change-Id: Ic61fabd9c633bcb3f256fe7aa5834e66cc66a4fb
2020-11-28 16:14:59 +01:00
Harald Welte f8e5c5dfc7 gbproxy: Test for SGSN-INVOKE-TRACE
Change-Id: I1e46e5c403712eb7972c57e6b6f6eb0850b96ae3
2020-11-28 16:12:27 +01:00
Harald Welte e588792562 BSSGP_Emulation: reo-rder altsteps of per-NSE component
the existing ordering of altsteps unfortunately caused some
receive clauses never to be hit, as they are only in the default
altstep, while more generic receive clauses are already in the
state-specific altsteps.

Let's introduce an as_allstate_pre() and an as_allstate_post() to
solve this ordering problem.

Change-Id: Icc4da95833557931d6685826fb30bdc60bf460c1
2020-11-27 19:18:28 +01:00
Harald Welte bdf96d8412 BSSGP_Emulation: Add MGMT port to per-NSE (BVCI=0) component
We recently introduced a MGMT port in the per-BVC component for the
PTP BVC.  Let's add this also to the signaling BVC.

Change-Id: I24df4cb290c9f9dc1a7398994af101711f12d42e
2020-11-27 19:18:28 +01:00
Harald Welte 3c90515272 BSSGP_Emulation: Send BssgpResetIndication when PTP BVC are being reset
This notifies the user via the MGMT port about the fact that an inbound
BVC-RESET procedure just happened.

Change-Id: I54d0d5e0e06a330a90dfb1da06062d65022efe81
2020-11-27 19:16:58 +01:00
Harald Welte 52cecbb340 BSSGP_Emulation: Fix handling of BsgpResetRequest
We need to change to BLOCKED local state in order to activate
the altstep which handles the inbound BVC-RESET-ACK.

Change-Id: I32ede586f0977b7d96af9fe3ea5fae485184ea98
2020-11-27 19:16:43 +01:00
Harald Welte ab50cc295b BSSGP_Emulation: Fix inbound BVC-RESET
We cannot handle this in as_ptp_allstate(), as the respective clauses
are never hit:  In as_ptp_unblocked() we broadcast all BSSGP messages
without a TLLI, "hiding" the BVC-RESET handling.

Change-Id: Ie3e7a997554e6af42ae7e7294829b6f8d2447d60
2020-11-26 20:57:54 +01:00
Harald Welte ddfc6676d5 BSSGP_Emulation: Implement handling of BVC-UNBLOCK in SGSN role
Change-Id: I7c9cda916f6583613fbf3cdf31f3f08ceadf58d4
2020-11-26 20:57:54 +01:00
Harald Welte fba7afdd89 BSSGP_Emulation: Include NSEI in BsgpStatusIndication for PTP BVC
Change-Id: I0d8f18d0e6438a98c75ff24e2a9c8136d8b417d2
2020-11-25 17:14:25 +01:00
Harald Welte 57de220cdb BSSGP_Emulation: Introduce a GLOBAL port in the BSSGP_CT
The per-NSE BSSGP_CT gets a new GLOBAL port which is used for procedures
that are not specific to one BVC, such as the SUSPEND/RESUME related
PDUs, which all are on the signalling BVC without any BVCI in the BSSGP.

Change-Id: I40d973d80709f5d56f59247e8647b52754f09bc8
2020-11-25 17:14:25 +01:00
Harald Welte 80a249aa07 NS_Emulation: Include NS-VCI in NsUnitdataIndication
The primitive normally only contains NSE + BVCI, but in a tester
we actually want to verify which NS-VC a given message has arrived on,
and hence it makes sense to add the NSVCI, too.

Change-Id: I9402bf0be47e5b93c9cfb081eb8f9fa6734c9227
2020-11-21 22:52:51 +01:00
Harald Welte 199f386e89 BSSGP_Emulation: Introduce MGMT port to per-BVC component
This port can (optionally) be connected to, and it will receive
state change notifications as well as permit the user to block/unblock
and reset the specific PTP BVC.

Change-Id: I1f0289c8805168e3daace4a7d76764b45cead3d0
2020-11-16 19:13:26 +00:00
Harald Welte 4d112c926c BSSGP_Emulation: Allow a "CreateCb" to handle unknown inbound TLLI
The existing BSSGP Code assumed that the TLLIs were always known "a
priori" by the test case.  With the newly-introduced create_cb,
the user can provide a function to handle any incoming messages for an
unknown TLLL.  The default handler behaves like before: fail +
terminate.

Change-Id: Ice0e145f5a6518ff79547dd851042b7965f38e00
2020-11-16 19:13:26 +00:00
Harald Welte c450552c59 NS_Emulation: Introduce Load Sharing Function
The Load Sharing Function distributes traffic among all unblocked NS-VC
within a NS-VCG.  The sharing is done based on a LSP (Link Selector
Parameter) which is passed with the NS-UNITDATA.req primitive from BSSGP
to NS.  Details are implementation specific, but NS must ensure that all
traffic of one LSP is always sent through the same NS-VC, as long as
that NS-VC is alive/unblocked.

We use the LSP as follows:
* Signaling BVC always only uses lsp 0
* PTP BVC messages unrelated to user straffic use a per-BVC static LSP,
  which is the BVCI
* User traffic can set whatever LSP it wants
* NS keeps an array of NSVCs currently unblocked and uses the LSP modulo
  the array size as an index into it

Change-Id: I8b960ec4d729f50cadca353bb52685311cd45eed
Related: SYS#5084
2020-11-12 20:02:07 +00:00
Harald Welte dc0a090ae1 NS+BSSGP: Only send BVC-RESET when _first_ NSVC of NSVCG becomes unblocked
In case of a NS-VCG with multiple NS-VC, we must BVC-RESET only when the
first NS-VC becomes unblocked, i.e. as soon as we have any connection
to the peer at all.  Whether we have further additional links doesn't
matter, at least not in the sense that all state should be reset.

Change-Id: I69b2e9bd919fc981f189b6671b4234c3642e2449
2020-11-12 20:02:07 +00:00
Harald Welte 445fc61dc7 BSSGP_Emulation: Match on proper NSEI from NS layer
Change-Id: I682574bc54b4432357adef2b4662b1f74495578c
2020-11-12 20:02:07 +00:00
Harald Welte 90f1974fb0 NS_Emulation: Support multiple NS-VC within one NSE (NS-VCG)
This is something we need to simulate more complex scenarios,
particularly in the context of frame relay.

Change-Id: If1220852785853f8a5d8de183d5053ddd6ccb958
2020-11-12 20:02:07 +00:00
Harald Welte 5339b2e372 BSSGP_Emulation: Support multiple PTP-BVC within one Entity
The existing BSSGP_Emulation is built around the assumption that every
instance of BSSGP_Emulation only servers one signaling-BVC and one
PTP-BVC.  While this is true for osmo-pcu at this point (BTS-colocated
PCU), other BSS/PCU implementations differ.

In general, there can always be any number of PTP BVC (one per cell)
next to the signaling BVC (one per BSS).  Let's represent this in
BSSGP_Emulation so we can create more comprehensive tests.

Change-Id: I7e30b4c4e188518a574e082962fba457b3a97ce3
2020-10-09 12:27:11 +02:00
Harald Welte 12d19b81a7 BSSGP_Emulation: Ensure BVC-RESET for BVCO=0 has no CellId IE
This is required by the spec, and implemented libosmocore since
Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1

So let's change our test expectations.  Meanwhile, introduce
mp_tolerate_bvc_reset_cellid for working around the bug in 'latest'.

Change-Id: If6245d73ed701e631b67146ace4ba028bdb4226c
2020-10-09 11:44:20 +02:00
Harald Welte c967d0e6f2 BSSGP_Emulation: Only add CellId to BVC-RESET[-ACK] conditionally
We always used to include the CellID IE, but 3GPP TS 48.018 is
actually quite specific about when it should be present and when not.

Change-Id: Iffd023f0272c9ccb087bdd225fcfb08424a46bdf
2020-10-04 21:09:11 +02:00
Harald Welte 07cb87a90c BSSGP_Emulation: Fix build without BSSGP_EM_L3
Change-Id: Ic58e2d6bc37cb8fd8f0235b8497f674db7cfdd85
2020-09-17 15:26:52 +00:00
Harald Welte 93331e736b BSSGP_Emulation: Make L3 (SM/GMM) decoding a compile-time option
This allows us to build low-level tests that don't require all of L3.

Change-Id: I7ef7e93e2cd1d37e7e4a62947ca8dfde30d93b95
2020-09-13 10:18:41 +02:00