Commit Graph

741 Commits

Author SHA1 Message Date
Vadim Yanitskiy 0df8c94d69 library: implement SI3 Rest Octets as per 3GPP TS 44.018
Change-Id: Iaf86f1451a956bf1deef0a9d98fa0513aeb8164b
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-02 17:06:33 +07: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
Pau Espin 2456dad91e RLCMAC_EncDec.cc: Fix egprs data block encode alignment
Selftests I'm using in the pcu testsuite to verify encoding are attached
too.

Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
2020-05-01 15:54:17 +02:00
Pau Espin 27d6af5edb RLCMAC_Templates: Add functions to convert HeaderType<->MCS<->CPS
They will be used by tests, templates and RLCMAC_EncDec.cc itself.

MCS HEader Type 1 and 2 to CPS conversion lefts as a TODO with
placeholder functions to easily implement when needed.

Change-Id: I18ff55a8067165bf081bf21473b4f88af955bf5b
2020-04-30 20:22:25 +02:00
Pau Espin 0b8e22be46 RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
2020-04-30 20:10:17 +02:00
Pau Espin 82d22bc326 RLCMAC_EncDEc.cc: Use copied structure as other parts of the function
Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
2020-04-30 20:09:12 +02:00
Pau Espin d3da797249 RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul HdeaderType3
Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
2020-04-30 20:07:01 +02:00
Pau Espin 331f52507b RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder
Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
2020-04-30 20:05:29 +02:00
Pau Espin a2c5b6e9d9 RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi uninitialized instead of omit
Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
2020-04-30 20:00:02 +02:00
Pau Espin ecaeb89648 cosmetic: RLCMAC_EncDEc.cc: fix typos in comments
Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
2020-04-30 19:58:15 +02:00
Pau Espin e8d7d16f13 Split templates in RLCMAC_{CSN1_}Types into their own _Templates file
RLCMAC blocks have a lot of fields and we will potentially require lots
of different templates, as well as functions to handle related structs.

Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545
2020-04-29 19:07:38 +02:00
Pau Espin 372af7a116 library/RLCMAC: Add partial support for EGPRS data block encoding/decoding
* RlcmacUlBlock and RlcmacDlBlock gain a new union field "egprs_data",
  which is chosen when msg contains an egprs data block. Hence one can
  use same structure for both gprs/egprs data and simply check
  "ischosen(block.data_egprs)" to know whether it contains egprs or gprs
  data block.
* C++ code in RLCMAC_EncDec.cc takes care of encoding and decoding of
  each data header type and exposes a generic ttcn3 struct
  "UlMacDataHeader" and "DlMacDataHeader". Decoded header type can be
  found in mac_hdr.header_type. This can be used t5ogether with CPS to
  get the MCS of the message received. Similarly, the encoder will use the
  same field to know how to encode the ttcn3 structure.
* In RLCMAC_EncDec.cc order of functions has been ordered to split
  between encoding and decoding, and inside these split between Ul and
  Dl messages.
* Only encoding of UL HeaderType3 and decoding of Dl HeaderType3 is
  implemented so far in RLCMAC_EncDec.cc. However, all code is already
  arranged and functions prepared (with FIXME fprintf) to easily add the
  missing header types once needed.
* Actually only the decoding of DL HeaderType3 has been tested to work so far.
  Encoding may still be missing to octet-align the data block after the header.
  All these wil lbe fixed once a test using them exists.

Change-Id: I2bc4f877a5e17c57ffa8cf05565dc8593b45aae8
2020-04-29 09:06:34 +00:00
Pau Espin fe3ae511e2 cosmetic: RLCMAC_Types.ttcn: Make different PTCCH types section more visible
On top there's a lot of types related to data blocks. Having more
stylish section header helps orientating one self while looking through
the data blocks.

Change-Id: I87d4694031ea6874b233626818824cdc4f3505c6
2020-04-29 09:06:34 +00: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
Pau Espin 8f24571e56 pcu: Introduce test TC_mo_ping_pong_with_ul_racap
Test sending MS RA capabilities through Packet Resource Request to
update GPRS multislot class.
EGPRS multislot will come in a later commit.

Change-Id: I5026d8b78a3fb82093956b65989d18fa6f6d5424
2020-04-28 16:01:18 +00: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
Harald Welte f400151003 pgw: Add support for PCRF emulation (CCR/CCA)
If mp_pcrf_local_ip is set to a non-empty string, the PGW testsuite
now emulates a PCRF and expects the PGW to perform the related
transactions - so far Credit-Control-Request INITIAL_REQUEST
at session creation, and TERMINATION_REQUST at session deletion.

Change-Id: I5f0c7a66d38e5c8b5f36b45717d49648a14ed7b2
2020-04-26 22:08:34 +02:00
Harald Welte d01b5d0af0 DIAMETER_Emulation: Notify user of CapabilityExchange
During start of the test case, we must wait until the IUT has
established a DIAMETER/SCTP connection to the testsuite.  Implement
this by means of a message on the DIAMETER_UNIT port and an associated
helper function.

Change-Id: I95434307efc67025ee6d373561f6d22398f959c5
2020-04-26 22:08:34 +02:00
Harald Welte 61f73d553b DIAMETER: parametrize CEA template
So far, we hard-coded the Capabilities-Exchange-Answer for
HSS emulation.  As we want to emulate other DIAMETER network
elements, let's parametrize the template as well as the respective
parameters for the emulation component.

Change-Id: Ie30ff1bac40ab3dc6058587f0586b643ff2b0cb6
2020-04-26 22:08:34 +02:00
Harald Welte f9fb63ec98 DIAMETER_Emulation: Add support for IMSI in Subscription-Id
Ths IMSI on the Gx interface is encoded into a different AVP than
on the S6a/S6d interfaces.  Let's make sure our DIAMETER_Emulation
knows both formats.

Change-Id: I299fcc2e01e908914df32fda4fb93b1114402c77
2020-04-26 22:08:34 +02:00
Harald Welte 24de8caffd DIAMETER_Types: Add IETF RFC4006 CreditControl + related
This adds more DIAMETER types to our TTCN-3 module, specifically those
encountered on Gx between PGW and PCRF.

./AVP.sh Base_IETF_RFC3588.ddf BaseTypes_IETF_RFC3588.ddf AAAInterface_3GPP_TS29272_f10.ddf GxInterface_PCC_3GPP_TS29212_f10.ddf S6Interfaces_3GPP_TS29336_f00.ddf MobileIPv6_HA_IETF_RFC5778.ddf RxInterface_PCC_3GPP_TS29214_f20.ddf NetworkAccessServer_IETF_RFC4005.ddf CreditControl_IETF_RFC4006.ddf CxDxInterface_3GPP_TS29229_c30.ddf GiSGiInterface_3GPP_TS29061_d70.ddf

Change-Id: Ibe7321e695337ff62fdc912270f6e13e6c6d6cf2
2020-04-26 22:08:34 +02:00
Pau Espin 1860bf8391 library/Osmocom_Gb_Types.ttcn: Fix typo presece->presence in function name
Change-Id: I50f1c23e83e9b87de09844226b110d2c48b7cfdb
2020-04-26 14:44:35 +00:00
Pau Espin 55cb2ce675 L3_Templates.ttcn: Fix trailing whitespace
Change-Id: I46ff86b981ef649c89073f155566af35848aef8d
2020-04-22 17:09:25 +02:00
Harald Welte 88b3ccbf5b Add GTPv2_Emulation component
Change-Id: If73aa453e44ebf28032c60d207feb03e8061dc0c
2020-04-21 22:57:31 +02:00
Harald Welte e53a23db70 HACK: avoid compilation error with TITAN > 6.5.0
it seems TITAN no longer supports 'ifpresent' in certain situations,
see https://www.eclipse.org/forums/index.php/m/1826175/#msg_1826175

Let's make the tests fail if we actually run in those cases, but at
least compile fine and be able to execute all the other tests.

Change-Id: Ia401c2d696979c0062872bca8da62c2ea153427b
2020-04-20 18:02:45 +02:00
Harald Welte 885de1cdb5 CBSP_Templates: fix copy+paste error
Change-Id: Idd07dce8ccdbfa3d65a78ccfcaa9f43eb04979cd
2020-04-20 18:02:45 +02:00
Vadim Yanitskiy 3911d1177e library/RLCMAC_CSN1_Types: add EGPRS Packet Channel Request definition
For more details, see 3GPP TS 44.060, table 11.2.5a.2.

Change-Id: I762b932ed67d9e67a5e13290209cc9017dd650a7
Related: OS#1548
2020-04-20 02:56:41 +00:00
Harald Welte af763aaef5 Fix/complete the partial GTPv2_CodecPort we already had
Change-Id: Idb9f492863d31e9decffeb0d71215fe581fdd4bb
2020-04-19 17:25:02 +00:00
Harald Welte 0ee2297e97 Initial SIMTRACE testsuite
This doesn't really do much yet in terms of test coverage, but it
adds all related infrastructure

Change-Id: If9fa66b6c5fbddd742ff61fa2c1345736d07accd
2020-04-01 10:16:02 +00:00
Vadim Yanitskiy fb3edf951d library/L3_Templates: remove tr_PAGING_REQ1_MI1_TMSI, use existing MI templates
Change-Id: Id35477ffc4a914e71100f129bbc4833b48ed5da4
2020-03-30 14:47:08 +07:00
Vadim Yanitskiy cc4623dff2 library/RSL_Types: use MobileIdentityLV for MS Identity IE
Change-Id: I5436dcbbc961d5b572e10e4f1a3f806d252d7818
2020-03-28 06:21:02 +07:00
Vadim Yanitskiy 7e0022697c library/BSSGP_Types: use tr_MI_IMSI from library/L3_Templates
Change-Id: Ibb02c1c545418bef34ee1e42d34857bda655e12f
2020-03-28 05:20:41 +07:00
Vadim Yanitskiy c94c572698 library/L3_Templates: add more templates for Mobile Identity IE
Change-Id: Ife954becab8c51605da05618a721541e7a4de319
2020-03-28 05:17:23 +07: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
Vadim Yanitskiy 7b2242157b PCU: also test GSGN originated PS/CS Paging containing TMSI
This additional couple of test cases reveals several bugs:

  1) the IUT encodes a erroneous RR Paging Request message
     containing P-TMSI, so TITAN fails to decode it;

  2) the IUT prints an invalid P-TMSI in its log output
     due to load of misaligned address (found by UBSan).

[1] I97fd5ffc15a4a58112d7c37c69b7ac42b0741a0e
[2] Icf8836f216793e342b239c8e6645aac1e82bf324

Change-Id: I7fbec5b2c5c3943a7413417b623f55c135c152d7
2020-03-26 16:27:50 +07:00
Pau Espin dc9666ff9c pcu: Verify CodingScheme of received data blocks
Change-Id: I0a5247650548f8a03f7b025aae65652fb424c156
2020-03-20 20:03:59 +01:00
Pau Espin 2422d1fa82 pcu: Introduce TC_mt_ping_pong_with_dl_racap
Allows checking how pcu parses MS RA Capabilities coming from SGSN.

Change-Id: Iedd8ab278547471b72252743d93a0f9e11d7e787
2020-03-18 15:53:17 +01:00
Harald Welte 4895d7a1d3 BSSGP/IuUP: Fix license disclaimer copy+paste
The license disclaimer already stated GPLv2-or-later, it just stated
confusingly you should look at the AGPL for reference.  Fix that.

Change-Id: I673c5c177a8e4010921f1fed747ce376f274da54
2020-03-01 20:27:19 +01:00
Harald Welte 625faadb76 Native_Functions: Add f_str_to{lower,upper}()
TTCN-3 interestingly doens't seem to have any case-insensitive string
matching or functions to convert to uppwer/lowercase.

Change-Id: I2e6e0fd2da001a3cc6d9c31c9e766ae54bf17b2f
2020-02-19 19:52:22 +01:00
Harald Welte 6effabbd62 DIAMETER: Add tr_DIA_AIR() to send AuthInfoRequest
Change-Id: Ib30fafaa2c660d32e864a57f4d3b0f50a158de6c
2020-02-18 21:39:59 +01:00
Oliver Smith b51a53fdfa hlr: add TC_MSLookup_GSUP_proxy
Let OsmoHLR act as proxy between MSC and home HLR during Location
update.

Related: OS#4380
Change-Id: I945e651f1346e56dbe3c02d9d08ccd95cc8d6626
2020-02-06 16:21:47 +00:00
Oliver Smith d5696eb56e library/DNS_Helpers: add f_enc_IPv4
Used by upcoming D-GSM test, to pass the IP of the emulated GSUP server.
The code is based on f_enc_dns_hostname() in the same file.

Related: OS#4380
Change-Id: I8a5450988711680c93cfd657a34db759a56bc41e
2020-02-06 16:21:47 +00:00
Oliver Smith 07786da45b library/GSUP_Types: add dest name to some messages
Prepare for upcoming D-GSM test, that lets OsmoHLR act as proxy. It
forwards the messages based on the destination name, so the testsuite
must set it correctly.

Related: OS#4380
Change-Id: I7623b7a7c7a18ba18a38d0834979d18ab0fbb961
2020-02-06 16:21:47 +00:00
Oliver Smith 6e81f7e940 hlr: add emulated GSUP server (second HLR)
Prepare for upcoming D-GSM test, which needs to emulate a GSUP server.

Related: OS#4380
Change-Id: Idbfe8a145c90a524145089a06d9bbefac4d7edd8
2020-02-06 16:21:47 +00:00
Oliver Smith deb80a6a82 hlr: add TC_MSLookup_mDNS_service_other_home
Send an mslookup mDNS request to the home HLR, asking about a service
that is not "gsup.hlr". Hence the "_other" in the test name, service
"gsup.hlr" has different code paths, and related tests will be added in
follow-up patches.

This is the first test using MSLookup_mDNS_Emulation, so add related
test infrastructure.

Related: OS#4380
Depends: osmo-hlr I2fe453553c90e6ee527ed13a13089900efd488aa
Change-Id: Ia7f92d33691f910549353b16a7b0efc18e521719
2020-02-06 16:21:47 +00:00
Pau Espin e30d543576 sccp: Introduce test TC_it_avoids_tiar
Related: OS#4343
Change-Id: I3a970a9b7ed7fb178095760025dd83c570dcff5e
2020-01-21 14:22:20 +01:00
Pau Espin a2473da683 sccp: Introduce test TC_tiar_timeout
Existing templates are moved to SCPP_Templates.ttcn and new ones
required for the test are added there.

Related: OS#4343
Change-Id: I7b56fe77ac3b350d722c74b043e6ecabc48dcf31
2020-01-20 20:15:26 +01:00