Commit Graph

41 Commits

Author SHA1 Message Date
Vadim Yanitskiy e2a6fdf304 fixup library/GSM_RR_Types: fix BYTEORDER in MobileAllocation
The following bitstring in TITAN:

   0                 N    // N = NF - 1
  -------------------->
   0001 1011 1110 0100    // '0001101111100100'B

needs to be be encoded as follows 'on the wire':

   N                 0    // N = NF - 1
  <--------------------
   0010 0111 1101 1000    // '0010011111011000'B

so it basically gets inversed => we need to use BYTEORDER(first).

Change-Id: Iea2e3a9a7a0557d1ab5d935877d2161ee0988077
Fixes: I70b1baf01859d0cf3b8cec1aed04d73fc097a9b1
Related: SYS#4868, OS#4547
2020-07-23 04:53:16 +07:00
Vadim Yanitskiy 3ddb3abdc0 library/GSM_RR_Types: fix bit/byte order in MobileAllocation
For more details, see 3GPP TS 44.018, figure 10.5.2.21.1.

Change-Id: I70b1baf01859d0cf3b8cec1aed04d73fc097a9b1
Related: SYS#4868, OS#4547
2020-07-20 04:32:44 +07:00
Vadim Yanitskiy cf1ed3f960 library/GSM_RR_Types: also match MobileAllocation in tr_IMM_TBF_ASS()
Change-Id: Icb13b8414d4a784eccaae2daa85232f066f92f08
2020-07-20 04:06:16 +07:00
Vadim Yanitskiy f7181ed9c9 library/GSM_RR_Types: share send templates for ChannelDescription
They're going to be used in other modules too, not only in BTS_Tests.
Also, take a chance to rearrange the list of arguments, so the ones
with default values are placed after mandatory ones.

Change-Id: Ia33ebf2e680f16f774a981fc33422dfe5036637f
2020-07-14 20:31:07 +07:00
Vadim Yanitskiy 5bcd91996a library/GSM_RR_Types: add ts/tr templates for MaioHsn
Change-Id: I0c5581c3d95018d808907bd2bc5e8ddd0a730bea
2020-07-14 20:31:07 +07:00
Vadim Yanitskiy ff0072cb50 library/GSM_RR_Types: fix MaioHsn: add missing MAIO and HSN fields
Change-Id: I76a05e0ee8e46241b1d3bbc71b7ec01f193dd40e
Related: OS#4546
2020-05-27 20:14:08 +07:00
Vadim Yanitskiy 16e24aa4e7 library/GSM_RR_Types: add receive templates for IMM ASS Reject
Change-Id: Icece9245f4a85dcf59021a76d51d419cf1c13990
2020-05-22 20:14:35 +07:00
Vadim Yanitskiy 7ef121d2d9 library/GSM_RR_Types: add IAR Rest Octets definition
See 3GPP TS 44.018, section 10.5.2.17 "IAR Rest Octets".

Change-Id: Ib1f16b310d6ca94f19a1700c78cb37e8b35ac570
2020-05-22 03:24:34 +07:00
Vadim Yanitskiy c3cebd31d9 library/GSM_RR_Types: fix definition of FeatureIndicator
Change-Id: I06ad58f25aa97bf13de87127e7e2c6237a90557e
2020-05-22 02:43:22 +07:00
Pau Espin 2ec84fd0e5 Move some types from GSM_RR_Types.ttcn to RLCMAC_CSN1_Types.ttcn
Some types already available in GSM_RR_Types.ttcn will also be required
by messages sent over PDCH and which belong to RLCMAC_CSN1_Types. Since
GSM_RR_Types.ttcn already requires RLCMAC_CSN1_Types.ttcn, let's move
them there so they can be used in both places.

Change-Id: Iccaaa2743dc44a36046c19d4d4ff882dc02fb479
2020-05-15 11:27:08 +00:00
Vadim Yanitskiy e05d7162a2 library/GSM_RR_Types.ttcn: fix: work around TITAN bug 562488
Commit [1] introduced multiple regressions, because it basically
changed the byte order in all fields of the whole module from
'first' (implicit default) to 'last'. This is not what we need.

Instead, let's apply BYTEORDER(last) to 5 bit 'ext_ra' fields
unless the bug [2] in TITAN's RAW codec is fixed.

[1] I481a40daef3eed4a3daa687ad87c4128a13181b4
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: If998ef72c13787f04fee79e1e646cd9a6787028a
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-02 17:06:33 +07:00
Vadim Yanitskiy b021ed49b7 library/GSM_RR_Types.ttcn: use 'CSN.1 L/H' attribute where needed
Thanks to Harald, TITAN's RAW codec now supports the L/H syntax.

Change-Id: I279901aeffd09de071d274944cd0f1a93d711f85
2020-04-29 09:04:38 +00:00
Vadim Yanitskiy 0a71fcadbd library/GSM_RR_Types.ttcn: fix BYTEORDER of MCC/MNC in RAI
Change [1] introduced a regression: PCU_Tests_RAW.TC_pcuif_suspend
fails since build #443. I have no idea why the BYTEORDER should be
set to 'first' (and not 'last'), but this is the only way I could
make TITAN's RAW encoder generate a valid MCC/MNC pair again.

[1] I481a40daef3eed4a3daa687ad87c4128a13181b4

Change-Id: I70a5b2eed3788be10d62fa421e3ba7444d66c655
2020-04-29 15:32:17 +07:00
Vadim Yanitskiy a0b47cf825 PCU: add test cases for EGPRS Packet Channel Request
This change introduces three similar test cases:

  - TC_egprs_pkt_chan_req_signalling,
  - TC_egprs_pkt_chan_req_one_phase,
  - TC_egprs_pkt_chan_req_two_phase,

which basically send several 11 bit RACH.ind messages to the IUT
containing different variations of EGPRS Packet Channel Request.

Depending on the establisment cause, for each RACH.ind we expect
to receive an Immediate Assignment containing an EGPRS Packet
Uplink Assignment in its Rest Octets.

All test cases make sure that Request Reference in the received
Immediate Assignment messages is set to 127 as required by 3GPP
TS 44.018 (see table 9.1.8.1, note 2b), and the Extended RA IE in
the Rest Octets matches 5 LSBs of the RA value that was sent.

Change-Id: Ib5732956ea160f93d82f06bf82bea45501f439d2
Related: OS#1548
2020-04-28 11:18:50 +00:00
Vadim Yanitskiy 1175b5e509 library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) globally
By default, the BYTEORDER for BIT1..N sub-types is set to 'first'.
This may result in incorrect decoding of bit-fields located on the
boundary of two octets. For example:

  IA Rest Octets
    L... .... = First Discriminator Bit: Low
    .H.. .... = Second Discriminator Bit: High
    ..0. .... = Discriminator bit: EGPRS Packet Uplink Assignment
    ...0 .... = Downlink/Uplink: EGPRS Packet Uplink Assignment
    EGPRS Packet Uplink Assignment
      .... 0001  1... .... = Extended_RA: 3  // <------------ (!)
      .0.. .... = Access Technologies Request: Not Present
      ..1. .... = TFI/Multiblock: TFI Assignment Present
      ...0 0000 = TFI_Assignment: 0

As can be seen, the field 'Extended_RA' in this particular case
occupies 4 LSBs of the first octet and 1 MSB of the second. So
instead of '00011'B, TITAN's RAW codec decodes '10001'B.

For more details, see:

https://www.eclipse.org/forums/index.php/m/1826511/
https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: I481a40daef3eed4a3daa687ad87c4128a13181b4
2020-04-28 11:18:50 +00:00
Vadim Yanitskiy 9781ecb4f9 library/GSM_RR_Types: Paging Request Type 1 may contain second MI
Change-Id: I1c443a875d048f51fcf8c5ea4d2a5ab8114d0a4f
2020-03-28 04:27:05 +07:00
Vadim Yanitskiy 98bb2d5eea library/GSM_RR_Types: do not duplicate Mobile Identity records
All the records related to Mobile Identity IE (see 3GPP TS 24.008,
section 10.5.1.4) are defined in [1], so there is no real need to
dumplicate them. Moreover, most of the related templates in
library/L3_Templates.ttcn are based on these records.

[1] titan.ProtocolModules.MobileL3_v13.4.0/src/MobileL3_CommonIE_Types.ttcn

Change-Id: I27c2743c59db770d6f7e9447dc8c1f539b228ced
2020-03-28 03:29:22 +07:00
Pau Espin 461ed61e4d GSM_RR_Types.ttcn: Support encoding of EGPRS Packet Uplink Assignment
Change-Id: Idf3bd12318480e8cdd26fce35e52d0a9e8c39608
2019-12-31 17:01:51 +00:00
Pau Espin 88bf537b35 pcu: Introduce tests for CS and PS paging from SGSN/Gb
CS Gb paging and PTP CS/PS paging implemented in osmo-pcu:
I9501e02e1d7f6944497e724dbccb9a19c3f5221f
I5c52b5af740460c48bb3ba858243b1d20e624268

Related: OS#3927, OS#2406
Change-Id: I90b5a792c1d91e38ea7b8c060ff0b459673df951
2019-12-23 14:46:07 +01:00
Vadim Yanitskiy 06ca64dcf7 library/GSM_RR_Types.ttcn: fix 'Assignment' vs 'Allocation' confusion
Change-Id: I8cbdfa891c56fda539d5997201c90f07c7f8307e
2019-09-29 20:17:10 +07:00
Vadim Yanitskiy eb57062ab8 library/GSM_RR_Types.ttcn: fix 'presence' in tr_PacketUlSglAssign
According to 3GPP TS 44.018, section 10.5.2.16 "IA Rest Octets",
the first bit of Packet Uplink Assignment defines whether it is
a dynamic (1) or single block (0) allocation.

Change-Id: If2bee9b1b065fcfedd0e57a6487040cefe2e50c5
2019-09-29 20:11:44 +07:00
Vadim Yanitskiy 6edd4f5a06 library/GSM_RR_Types.ttcn: introduce generic tr_IMM_TBF_ASS
Both 't_IMM_ASS_TBF_DL' and 't_RR_IMM_ASS_TBF_DL' templates were
introduced for a specific task - matching Packet Immediate
Assignment (Downlink TBF) by TLLI.

In the upcoming changes we will also need to match Uplink TBF
assignment, and more generic fields such as Timing Advance.
Let's add a generic template for Packet Immediate Assignment
and allow passing IaRestOctets as a parameter.

Change-Id: I492cf990820ba153ea71469b8b623e56e031e549
2019-09-09 16:30:47 +02:00
Vadim Yanitskiy 7091e8de88 library/GSM_RR_Types.ttcn: refactor IaRestOctHH coding
According to 3GPP TS 44.018, section 10.5.2.16, IA Rest Octets IE
starting with 'HH' bits may contain one of the following CSN.1
encoded components:

  7 6 5 4 3 2 1 0  Bit Numbers
  H H 0 0 . . . .  Packet Uplink Assignment
  H H 0 1 . . . .  Packet Downlink Assignment
  H H 1 . . . . .  Second Part Packet Assignment

We already have (partial) support for the first two, while the
last type has not been supported so far. Let's add it.

Also, this change introduces several templates for IA Rest Octets
IE and some of its components mentioned above. This would allow
us to abstract the API users from dealing with further changes,
e.g. adding a coding attribute 'CSN.1 L/H' and missing fields.

Change-Id: Ib3a21e7c5fa1cad4466e3a09fa70540de7f6ecc5
2019-09-09 16:30:47 +02:00
Vadim Yanitskiy a4aacc2179 library/GSM_RR_Types.ttcn: fix: apply '2B'O padding to GsmRrMessage
For some reason TITAN starts padding not from the beginning of
record ImmediateAssignment, but from it's wrapper GsmRrMessage.
As a result, dec_GsmRrMessage() warns about undecoded octets:

  Data remained at the end of the stream after successful decoding '2B2B2B'O

Similarly enc_GsmRrMessage() generates a shorter payload. Let's
work this around by applying PADDING attribute to GsmRrMessage.

Change-Id: I5fe327383402956213c20a68b18b8a48381156b5
2019-09-09 16:30:21 +02:00
Vadim Yanitskiy d4205c3da0 library/GSM_RR_Types.ttcn: fix hard-coded L2 pseudo length in tr_IMM_ASS
Change-Id: I1d3b0fbd01875cdb94b923a1521b1387a33adcd8
2019-09-09 16:18:04 +02:00
Vadim Yanitskiy 9b2a3e8cb8 library/GSM_RR_Types.ttcn: fix ImmediateAssignment coding regressions
Since I403d2141536303a966be7ff51b06c3de202412e6, IA Rest Octets is
a mandatory IE. When changing the definition of ts_IMM_ASS, I forgot
to mark its optional 'lh', 'hl', and 'hh' as omitted explicitly.

As a result, many of our TTCN-3 test cases were broken:

  Dynamic test case error: Using an unbound optional field.

Also, in Ifdcdcf50709fcc03195cb8ef6092977e26f910ec I added an
optional field 'pad' to record 'IaRestOctets'. That was not the
best solution, because padding should be handled transparently.

Let's get rid of that dummy field and equip both 'ImmediateAssignment'
and 'IaRestOctets' records with proper padding attributes. The later
one needs to be marked with 'CSN.1 L/H' attribute in the future, but
for now we should keep it octet-aligned.

Change-Id: I69d5fbd8e3388e287bfa54f02454d207e62ee640
2019-09-08 19:21:27 +00:00
Vadim Yanitskiy 1f4486cfe3 library/GSM_RR_Types.ttcn: fix: IA Rest Octets may have optional padding
According to 3GPP TS 04.08 (version 7.21.0), section 10.5.2.16 and
table 10.5.45, IA Rest Octets IE may contain spare bits. Let's add
an optional field 'pad' to record 'IaRestOctets'.

NOTE: somehow this change crashes my TITAN runtime:

  dec_GsmRrMessage(): Stream before decoding: '2D063F100FE3673A096B0000C800300B2B2B2B2B2B2B2B'O
  *** Error in `././PCU_Tests': malloc(): memory corruption: 0x000000000074a790 ***

while the recent version works just fine.

Change-Id: Ifdcdcf50709fcc03195cb8ef6092977e26f910ec
2019-09-05 17:25:46 +02:00
Vadim Yanitskiy f10bb45899 library/GSM_RR_Types.ttcn: fix: IA Rest Octets is mandatory IE
According to 3GPP TS 04.08 (version 7.21.0), table 9.18, IA Rest
Octets (see 10.5.2.16) is a mandatory IE, not optional.

Change-Id: I403d2141536303a966be7ff51b06c3de202412e6
2019-09-05 17:25:40 +02:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Harald Welte b16516c0af GSM_RR_Types: Add enc_RoutingAreaIdentification()
This allows us to encode a stand-alone RAID as needed in some places.

Change-Id: I28222304b2bac893b216c47e6dc002886fab6406
2019-03-27 11:17:49 +00:00
Stefan Sperling 59c15d67ca resolve ambiguity of MobileIdentityLV type name
There are two distinct types defined for a Mobile Identity LV IE.

One type definition lives in GSM_RR_Types and defines the "canonical"
IE form, with a full octet for the length.

Another one lives in RLCMAC_CSN1_Types which defines how a mobile
identity appears in paging requests. In this case, the length field
is only 4 bits in size. Rename this latter type from MobileIdentityLV to
MobileIdentityLV_Paging and add a comment to highlight this distinction.
TS 144 060 Table 11.2.10.2 explicitly states that only the value
part of this IE matches the definition of the canonical IE as
"defined in 3GPP TS 44.018" (actually, TS 44.018 further redirects
the reader to TS 124 008; see section 10.5.1.4 there).

As an aside, a third definition of the MobileIdentityLV type exists
in MobileL3_CommonIE_Types, which matches the "canonical" form.

Change-Id: I990316cd5ef5aaf079b03c344e3185ae6ab8ba6d
Related: OS#2404
2018-10-10 11:09:25 +02:00
Pau Espin 0aad596264 L1CTL_Types: Add support to set L1 Header params during SACCH tx
Change-Id: Id014f790ee2ede8ae796c37b1c6b25c4af9034d2
2018-10-03 21:39:10 +00:00
Harald Welte e8d750e668 bts: More complete AGCH / IMM.ASS testing
The existing test simply sent 1000 messages via RSL without checking
what actually arrived on the radio interface, or without
expecting/counting any RSL DELETE IND.

Let's fix this by introducing test sending IMM.ASS at three different
rates, with related expectations in terms of nubmer of IMM.ASS arriving
on Um vs. RSL DELETE IND arriving at BSC.

Change-Id: Ib6043b76ba1d7aaff107bb612f63b5a747d8720c
Related: OS#2990
Related: SYS#2695
2018-06-10 21:44:29 +02:00
Harald Welte f8df4cb339 L1CTL/bts: Fix tons of compiler warnings by splitting rx+tx templates
Change-Id: I9c8be0856516a6a168795c792f76d14c08c3dabb
2018-03-12 16:04:22 +01:00
Harald Welte b669ee029e pcu: First DL TBF hack
Change-Id: Ib3f09e125a7a4492d9072f8e9f5896eaac7ed03b
2018-03-12 15:50:03 +01:00
Harald Welte 82ccef7c18 Merge duplicate SI3 in GSM_RR_Types and GSM_SystemInformation
Let's have one SI3 definition rather than multiple...

Change-Id: I3c4754c9a69cb2fa51d88ef6358d5399dbb29860
2018-02-25 16:17:33 +01:00
Harald Welte 7484fc41b4 bts: Type Definition + Template for SI3; Send SI3 at start of test
The BTS needs some of the SI3 parameters like BS_AG_BLKS_RES for
internal computations, so make sure we send it after the connection
has been established.

Change-Id: I5dc3724f79e669f52593cd776806d84b4dd4bf5c
2018-02-25 12:57:21 +01:00
Harald Welte eb1e6813c7 GSM_RR_Types: Fix inverted "valid" logic in measurement report
Change-Id: I3ebdd30639b45ba1a9c0fbda7bf2775035833300
2018-02-23 19:03:54 +01:00
Harald Welte cbc947f709 GSM_RR_Types: Add ts_IMM_ASS and ts_MEAS_REP
which allows us to send RR IMMEDIATE ASSIGNMENT (DL/AGCH) and
RR MEASUREMENT REPORT (UL/SACCH) messages from tests.

Change-Id: Ic75041e84c15c77805ecafb823bf7108920675ca
2018-02-22 00:29:00 +01:00
Harald Welte 1b9b77096d GSM_RR_Types: Parse PacketChannelDescription 2017-07-30 04:19:14 +02:00
Harald Welte 9419c8aff7 Split RR portion of GSM_Types into GSM_RR_Types 2017-07-30 04:07:35 +02:00