Commit Graph

1001 Commits

Author SHA1 Message Date
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 cc3894b612 gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)
Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d
Closes: SYS#5210
2020-12-10 22:13:25 +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 86bdcaa79d Osmocom_Gb_Types: Fix t_BVC_FC_BVC_ACK() TAG IE length
Change-Id: Ib9a09fea85110a4f0966c07d911e37234aa06391
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 da9d9387f6 NS_Emulation: Tolerate late NS-BLOCK-ACK / NS-UNBLOCK-ACK
Particularly in case both sides initiate a BLOCK or UNBLOCK procedure
at almost the same time, it can happen thet we're already in BLOCKED
state and receive a late BLOCK-ACK or in UNBLOCKED state and receive a
late UNBLOCK-ACK.

Let's just silently discard them instaed of generating NS-STATUS which
may confuse the peer.

Change-Id: I2e5b934e1cf6c6cf982d5ab1dbb32e8920b91071
2020-12-07 15:55:20 +01:00
Neels Hofmeyr 2a5670be4f add f_vty_cfg_bts(), f_vty_cfg_msc()
These allow passing N vty configurations on the bts / msc node without
requiring subsequent 'exit'.

As an example, use f_vty_cfg_msc() in BSC_Tests.ttcn AMR config.

Change-Id: I9f3e485f692acb3d2a7620e9b454b372651be78e
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 1a1f854ed2 add f_vty_config3(), to run N commands on a sub-node
f_vty_config2() makes it convenient to enter a specific vty node without
needing to send 'exit'/'end' explicitly. However, to pass multiple
commands on the same node, the VTY would enter and exit the node for
each call of f_vty_config2(). The new f_vty_config3() also allows
multiple commands to be run on that same node without intermediate
exiting.

Change-Id: If969ac645aa82e5a36245d974de2a251633de111
2020-11-30 15:59:14 +00: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 c0351d1015 gbproxy: Introduce TC_llc_discarded
This tests the LLC-DISCARDED message, which relates to a BVCI but
is itself sent on BVCI=0.  We expect it transparently passes from BSS
to SGSN.

Change-Id: I98d02d6fa68bddf15b732d06dab00e91e72995d1
2020-11-28 16:12:27 +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
Neels Hofmeyr 9ebabc8b0e vty: log failed vty command
Add a log label argument to f_vty_wait_for_prompt(), and feed the sent
command from f_vty_transceive*(), so that the failure verdict already
lists the vty command that caused the failure.

A common error is to issue insufficient 'exit' commands, so that I often
think the newly added VTY command failed, even though it is a subsequent
command causing the failure. I want to shorten the "time-to-aha" there.

Change-Id: Icfd739db150d86e9256a224f12dc979dcd77879f
2020-11-26 01:04:57 +00: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
Daniel Willmann 00c0bbf272 Add templates for LLC_DISCARDED
Change-Id: I587ec89471083e339065f6371ffe6253d49007bf
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 7f1d78e164 Add templates for FLUSH_LL_ACK
Change-Id: I57ef98b9a3022ed5915381504aa129979799bee8
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 379fc250de Add templates for FLUSH_LL
Change-Id: Id432022fdd7f96bc014f0fd81658fa4aa796a688
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Vadim Yanitskiy 42d8bd5012 BTS_Tests: re-organize configuration of TRX/TS params
Change-Id: I9b225249d135399f63d3c7e4c567121dfea63f75
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 802508e696 library/RSL_Types: add 'bs_power_params' to 'RSL_IE_Body'
The value part of this IE is defined as vendor-specific.

Change-Id: I48703c45d26cd88c1d9b5fda1a9df42616cb7cc0
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy bc8ebce10e library/GSM_RR_Types: make ts_MEAS_REP more user-friendly
Change-Id: Ica1ea41ebba5c518d515a211e77ca6651c4173d6
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 05a236a2fc library/GSM_Types: add the Uplink flag to GsmBandArfcn
Change-Id: Ib9bd7268b8a0fd8ed64064871c09fab35e15a761
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 1acc7bb184 library: move Osmocom_Types.Arfcn to GSM_Types.GsmBandArfcn
In some cases GsmArfcn itself is not enough.  It case of L1CTL
and GSMTAP, it needs to be equipped with a band discriminator:

  - DCS / PCS (as the numbers may overlap),
  - Downlink / Uplink (not yet there).

Let's rename this record and move it to GSM_Types.  Also, add
send / receive tamplates, so we can add new fields later.

Change-Id: I7a63f03bbd15a06caafb786122dc12991d115771
2020-11-24 11:58:49 +01:00
Harald Welte 0e18824f3b gpborxy: Implement variety of paging tests for PS-PAGING and CS-PAGING
Change-Id: Ida44b62dfdb9c4ce2755de63d51a9907d34f247f
2020-11-23 14:51:38 +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
Daniel Willmann 670bbc0c4e Osmocom_Gb_Types: Fix indentation
Change-Id: I4ca156b53dfe9daa190d52a7de46be56cf74099a
2020-11-20 15:09:00 +00:00
Daniel Willmann 05d4638b9b Add templates for BSSGP Radio Status procedure
Change-Id: I6d49eb4907c4568d88da5d6fd7962e388a3607fb
Related: SYS#5210
2020-11-20 15:53:55 +01:00
Pau Espin e8db673d22 pcu: Implement ACKing EGPRS Dl TBF blocks
Change-Id: I9f1b621a8365e69d2e1a33d59cb8c7a59639ad94
2020-11-18 11:51:14 +00:00
Harald Welte e15299ab20 NS_Emulation: Fail if an unsupported NS provider is chosen
This took me quite some time: Tried to use NS_PROVIDER_FR, but the
code was compiled without support for it.  It just failed silently
without printing any error or ever sending any message on the FR link.

Change-Id: I96475127a2079830b3456a8e288adf4c6c908887
2020-11-17 17:42:23 +01:00
Daniel Willmann ace3ece7be gbproxy: Add test for RA Capability Update procedure
Change-Id: I023b3d24a31d117f05c7327b08e9f8f930720944
Related: SYS#5210
2020-11-16 20:32:20 +01:00
Harald Welte 6dc2ac471b gbproxy: Test for RA Capability procedure
Change-Id: If7e5a5cab1e445e0b4ef0466990e352143c31245
2020-11-16 20:32:20 +01:00
Harald Welte 2436fb5bcc BSSGP: parametrize tr_BSSGP_DL_UD
Change-Id: Ib4a1d64da634813b49474c13ae080d729bbabcf1
2020-11-16 19:13:26 +00: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
Pau Espin afdd28d73b RLCMAC: Implement type+template for EGPRS Dl Pkt ACK/NACK
Change-Id: I0d6555f8644e39da6124be2e861d57fda3b3d8a1
2020-11-16 10:48:25 +01:00
Pau Espin 68a7a49354 RLCMAC_EncDec: Implement decoding of Egprs Dl Data block HeaderType 2 and 1
Change-Id: I3b8199711e08bc128821e02c626ded1bc6aa30d7
2020-11-16 10:48:25 +01:00
Pau Espin cca530fbf4 RLCMAC_EncDEc: Fix decode of DlEgprsDataBlock without LI
Change-Id: Iec7e1a2d876abfdc911a65113cc6c9e888257c61
2020-11-16 10:48:25 +01:00
Pau Espin cb00c52b07 pcu: Specify (M)CS to use when sending UL rlcmac data blocks
Apply padding and spare bits in the encoder according to CS/MCS format.

Change-Id: I918acac81f550077daeda3374b3de9b426ff3572
2020-11-16 09:14:28 +00:00
Vadim Yanitskiy be33f6b158 library/L1CTL_Types: add missing template restrictions
The template restrictions are quite useful, becaue they give hints
to the TTCN-3 compiler, so it can spot more bugs.  For example,
the lack of thereof would not prevent one from passing 'omit' to
a template, that assigns a value to a non-optional field, so that
might lead to a DTE at run-time in some cases.

Since adding 'template (restriction) ' to each template parameter
obviously makes templates look more cumbersome, let's move the
part with template name and arguments onto a separate line, just
like it's sometimes done for function definitions in C.

Change-Id: I7e6846381e0b3fb611059fcfbafb19bd6c15cfd8
2020-11-14 21:38:15 +00:00
Harald Welte 8f66af1665 move f_gprs_tlli_{type,random} to Osmocom_Gb_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I6fc41ed94e97e0ec44dc4ea56d110bdd9ac77a72
2020-11-12 21:51:40 +01:00
Harald Welte 69b3a4839f move f_gen_{imsi,imei,msisdn} from L3_Templates to Osmocom_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I7880633a46afc607f16f8aa6ea1a277f7958c95b
2020-11-12 21:51:40 +01: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