Commit Graph

56 Commits

Author SHA1 Message Date
Pau Espin 297333a423 mme, pgw: Fix GTPv2_Emulation setup after recent changes
The fields were added to be used in EPDG_Tests, but they need to be
explicitly set to omit here.

Fixes: 65a7f762ef
Change-Id: I3ed3c185310082f36bbce22817b903232825567c
2024-03-05 11:26:13 +01:00
Pau Espin 4b090c95d5 Split GTP_CodecPort/GTP_Templates into C and U variants
The Types are already split in the dependent modules in GTPC_Types and
GTPU_Types.
There's no point in keeping them together in the same file since those 2
protocols are mostly independent.
Furthermore, testsuites using GTPv2C + GTPv1U don't need GTPv1C.

Change-Id: Ic15c9a2e92828cbafb4dda7355ee534107051e2d
2024-03-01 10:28:22 +00:00
Pau Espin 7b2cc9219a epdg: Introduce test TC_s2b_CreateSession_rejected
Related: OS#6371
Change-Id: Ide1df9e359b12094f82e54a7824c83f515aedcc3
2024-03-01 10:28:22 +00:00
Pau Espin 3561887070 mme: Introduce test TC_ue_cell_reselect_geran_to_eutran
This test allows reproducing an idle mobility GERAN->EUTRAN.

Related: OS#6294
Change-Id: I6f8f077b99e83e6467d2b0c05148b81dbcf2ede4
2024-01-15 18:47:39 +01:00
Pau Espin 20f3514d70 mme: Fix seq_nr=0 being used everytime in Tx SGSNContextReq
Change-Id: I9a1a2dbceb4c4f30a8408c6f58bf645656e900bc
2024-01-15 18:47:39 +01:00
Pau Espin 3be4d92cb2 mme: Add code to derive NAS token from NAS ul_count
NAS Token is derived from kasme and NAS ul_count as specified in 3GPP TS
33.401 A.9, and its LSB 16 bits passed to the network when mapping the GUTI to
RAI+PTMSI+PTIMSI_SIG.

Take the chance to move guti2rai_ptmsi() up to before the place it is
used.
Change-Id: I5e6003a2fe3e74cc93cfe4a288e6c114aa288d0b
2024-01-15 15:30:35 +01:00
Pau Espin 41f4d90829 LTE_CryptoFunctions: Fix rx_count increment
The previous logic was wrong, since it was increasing the rx_count at
the time where the msg is received and before checking it. Instead, it
should be increased after having validated and accepted it.
This fixes the case where rx_count will have to be reset (to zero) when
doing mobility GERAN->EUTRAN.

Change-Id: I712d95f7784a6a9855fe36300b0ebfcd4c6ef377
2024-01-08 20:49:42 +01:00
Pau Espin a88e51d7ad mme: TC_s1ap_tau_unknown_guti: expect UeContextReleaseCmd
The MME is sending the message after TAU Reject, and it may be forwarded
through TTCN3 components while some of them are already being torn down
since the test is finished.

Change-Id: I6b915d0e32a46fa9546b3b1b96aa69ad43baae9e
2024-01-08 15:52:31 +01:00
Pau Espin 209d0a4ce1 mme: Use LAC from SGSN with most significat bit set to 0
According to 3GPP TS 23.003 sec 2.8.2.2.2, LACs from GERAN are
configured with MSB 0 in order to differentiate it from EUTRAN ones.
This is used by MMEs to figure out if the peer is an SGSN, based on
the the LAC mapped into MME group ID in GUTI .

Change-Id: Iaf89228f6f026e04d5f583211959025e6d8d4a1d
2024-01-03 13:15:13 +01:00
Pau Espin 11625856eb mme: Parametrize RAI+CI used by emulated SGSN
This will be used further in subsequent tests, plus it is configured in
the sgsn peer list of open5gs-mmed.cfg, so it knows how to route/find
SGSN peers.

Change-Id: Ia7d807bb5d75d711be7d4f6fbccd8fd123da171f
2024-01-03 13:15:13 +01:00
Pau Espin 78c5e4128d mme: TC_ue_cell_reselect_eutran_to_geran: Make sure oI flag is not set in DeleteSessionReq
Make sure Operation Indication is set to 0, to tell the SGW to keep the Session up at the PGW.

Change-Id: If863f260a274fec5921ed888216c1688ff115ade
2024-01-03 13:15:13 +01:00
Pau Espin 35c0cc2d2a mme: Trigger last parts of procedure TC_ue_cell_reselect_eutran_to_geran
Some later parts of the 4G->2G cell reselection where missing, mostly
related to tear down after MS has successfuly moved to the new SGSN. mainly:
- S6a Diameter Cancel Location Req + Answer initiated by HSS.
- Handle UeReleaseContextCommand and answer with
  UeReleaseContextComplete, emulating the ENB.
- handle S11 GTPv2C Delete Session Request and answer with Delete
  Session Response, emulating the SGW.

Change-Id: Ic0263a3aec922194aad22b031b2c82a99954354d
2024-01-03 13:15:03 +01:00
Pau Espin 278f543102 mme: expect EMM Information received after attach
open5gs-mmed transmits it after attach  complete.
Read it so that it's not kept queued in the port and follow-up uses of
the port don't provide unexpected results.

Change-Id: I6f19a18cced7acd2b831c943e8b3a1f462378435
2023-12-21 19:21:31 +01:00
Pau Espin 117a94f333 Split Diameter TS 29.272 templates into its own file
This allows more easily finding, understanding and using the tons of
templates coming from different specs.

Change-Id: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4
2023-12-21 16:16:17 +01:00
Pau Espin ae747ac46f mme: Fix tests reusing IMSI suffix
Use value 0 to indicate that the test is not really using the generated
imsi, to easily increment it for tests requiring it.

Change-Id: Ia9d70c125b92352f50adfa80a6cb916bfc8acf99
2023-12-20 20:55:34 +01:00
Pau Espin ca651b54ad mme: Fix TEID values used in test
Related: OS#6294
Change-Id: I5a32491a00eb6bad505e4bcf9a88017382073138
2023-12-20 18:54:44 +01:00
Pau Espin 408e0ae554 mme: Introduce test TC_ue_cell_reselect_eutran_to_geran
Initial bits to be able to test SGSN Context Request+Response emulating
an UE doing cell reselection from 4G to 2G.

Related: OS#6294
Change-Id: I707cb8c6b39c1440db5ccc2f02d08337b38fb564
2023-12-19 13:35:22 +01:00
Pau Espin acb5b8f28d LTE_CryptoFunctions.ttcn: Increment nus.rx_count on each pkt read
Before this patch, the rx_count field was never set to anything other
than zero.

There's still a problem with counter not being incremented when a
S1AP_IntialCtxSetupReq message containing a NAS_PDU is received. This
will be fixed ina follow-up patch.

Change-Id: I1ee25fd8fde6fbce95444ee4b73918ce1f61b427
2023-12-15 19:09:42 +01:00
Pau Espin ecfc7d61e6 mme: Implement missing UE attach steps
Related: OS#6294
Change-Id: Ib4a69aef40bf9dd17d640f650e459668f8415aaa
2023-12-15 15:05:31 +01:00
Pau Espin 9ad1980774 LTE_CryptoFunctions.ttcn: Log NAS_UE_State on failure
Change-Id: Ib95d496f06f07f4c28d9b08b6a8059d8453e8acd
2023-12-15 13:18:09 +00:00
Pau Espin 4976217518 LTE_CryptoFunctions.ttcn: Immediate termination upon failure
Change-Id: I09170c17c5cbb552a8aeef31b4b8fa5c89a00887
2023-12-15 13:18:09 +00:00
Pau Espin cc9b804d69 mme: Fix local port passed as remote port in Gn interface
Change-Id: Ia94f50a11292a83dcbd2da8d6df608ef71842b50
2023-09-21 17:45:11 +02:00
Philipp Maier f74f319ea5 TC_s1ap_attach: setup S11 interface, catch Create Session Request
The testcase TC_s1ap_attach is not complete yet. Since the testsuite
lacked the S11 interface, it was not possible to develop the testcase
beond the S1AP/NAS-EPS Security Mode Command. However, the S11 interface
is now available to the testsuite, so let's show that it works by
catching the Create Session Request. Let's also put a TODO that the
testcase needs to be completed still.

Related: OS#5760
Change-Id: I6350a3d5cab33fa4f43e4cdcbd7bf3241821d233
2023-09-12 09:26:44 +00:00
Philipp Maier 26a09f39bd MME_Tests: add new testcase TC_s1ap_tau_unknown_guti
A tracking area update that contains an OldGUTI (TMSI) that is unknown
to the MME should be rejected.

Related: OS#5760
Change-Id: I9306fea69ac930b9642528e2fd32a7091147081e
2023-09-01 17:23:45 +02:00
Philipp Maier ce50b12034 MME_Tests: remove unused timer variable
The Timer T in TC_RIM_RAN_INF is not used, let's remove it.

Related: OS#5760
Change-Id: I3d18cda38789e5a42536fd17b6641efa725f757b
2023-09-01 17:23:35 +02:00
Philipp Maier 9abb8c920b MME_Tests: Add S11/GTPv2 interface
The S11 interface is used by the MME to talk to the SGW-C. At the moment
we do not simulate the S11 interface in our testcases. This is in particular
a problem for TC_s1ap_attach, which needs to answer the Create Session
Request, comming from the MME in order to continue.

As a first step, lets add evrything that is required to run an S11
interface in the testsuite.

Change-Id: I545dd6cef3cef7283f2e04c2406a2703c2fdd01a
Related: OS#5760
2023-09-01 17:23:25 +02:00
Pau Espin db017f49ae DIAMETER_Emulation: Support forwarding messages identified by ete_id to a client component
This is useful in the scenarios where the client component submits a
IMSI-based transaction such as AIR, but its answer (AIA) contains no
IMSI (as per what's specified in TS 29.272 5.2.3.1). As a result, the
received AIA message would be enqueued in the DIAMETER_UNIT.

With this new feature, the test can create an expect using the
End-to-End Identifier of the message it is going to transmit, and
receive the answer in the same DIAMETER_CLIENT port the request was
transmitted, even if it contains no IMSI.

Related: OS#5757
Change-Id: I25e44146d2c49e308c1fb490b499e70ac6045f2f
2023-08-26 07:27:15 +00:00
Philipp Maier 46059f081c MME_Tests: add testcase TC_s1ap_reset
There is currently no testcase that makes sure that the S1AP reset
works.

Related: OS#5760
Change-Id: I23f4d5f2c39790b6cb0dacaec1e31912177af3ec
2023-08-22 14:39:41 +00:00
Philipp Maier a9306201f0 MME_Tests: add testcase TC_RIM_RAN_INF
The proposed testcase models a full RIM RAN INFORMATION REQUEST that
originates at the eNB (S1AP), is forwarded by the MME towards GERAN
(GTP) and goes back towards the MME (GTP) and is eventually forwarded
by the MME back to the eNB (S1AP).

Related: OS#5760
Related: OS#5759
Change-Id: I22d5aaab64df2824099977fb574afb86a4b7e91f
2023-08-09 11:33:55 +02:00
Philipp Maier 74d776a2b1 MME_Tests: add Gn interface
To test the planned Gn connectivity support in open5gs MME the testsuite
also requires support for such an interface. This patch adds the
connection handler, provided by GTP_Emulation.ttcn to the connection
handler in MME_Tests.ttcn, along with a simple GTP ECHO REQUEST
testcase.

Related: OS#5760
Change-Id: I38b668df15b3dd10542b4aa8790b9ea33c1f9635
2023-07-17 12:37:53 +00:00
Philipp Maier 7147c92010 S1AP_Emulation: add missing create_cb
At the moment we do not have a default implementation for the create_cb.
The create_cb is called to resolve the vc_conn to which a subscriber
communication belongs in case it is not found in the S1apAssociationTable,
then it is resolved from an S1apExpectTable instead.

The current implementation uses the IMSI as key to resolve the vc_conn
from the S1apExpectTable, this might not work since in S1AP the UE
context is identfied by an MME_UE_S1AP_ID / ENB_UE_S1AP_ID pair.

Related: OS#5760
Change-Id: I758e7c8d8cc445cf18acdd7a25dcde8846fd84e5
2023-07-11 12:48:52 +02:00
Philipp Maier 4a1e5dceb4 MME_Tests: add expected-results.xml
The MME_Tests miss an expected-results XML file

Related: OS#5760
Change-Id: I8cc1ef762fcdff8fe73d23a3945496aa995b4ae5
2023-07-04 15:20:04 +02:00
Pau Espin 33b4749fcf lib/DIAMETER: Allow sending CEA with AuthAppId
The new message is to be used by Gy interface emulation, which according
to RFC4006 uses AppId 4 "Credit Control Application". The application
is apparently not 3GPP vendor specific.

Change-Id: I0e33673d65140aad34d2efcae3c7f49154ceb99f
2022-03-14 12:05:37 +01:00
Vadim Yanitskiy b46f01e130 library/DIAMETER_Emulation: implement 'raw' mode of operation
This patch implements a new mode of operation, which allows to
have direct communication between the emulation component and
the other component connected via the 'DIAMETER_UNIT' port.
This eliminates the need to have dedicated components for each
IMSI, what is not necessarily needed in some specific cases.

Change-Id: I52e22ac70cc85be5b0436b68c77356aabc4f05e1
Related: SYS#5602
2022-01-31 09:56:51 +00:00
Vadim Yanitskiy 2dba494201 library/DIAMETER_Templates: prettify & enrich AIR/AIA templates
* Make both {hbh,ete}_id parameters last among the others;
* Use more elegant and consistent template formatting;
* Make DestinationRealm value configurable;
* Make SessionId value configurable.

Change-Id: Iaf6472fecbadd58e86b78c59348d9924ab57f97d
Related: SYS#5602
2021-12-15 05:12:13 +03:00
Vadim Yanitskiy 0e8f516d22 library/DIAMETER_Templates: rework existing ULR/ULA templates
* Make both {hbh,ete}_id parameters last among the others;
* Use more elegant and consistent template formatting;
* Make Origin{Host,Realm} values configurable;
* Make DestinationRealm value configurable;
* Make SessionId value configurable.

Change-Id: I0585e306a87453c212c6b5ac5635181c47b34b4f
Related: SYS#5602
2021-12-15 05:00:54 +03:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith f92ccad16b mme: link against gnutls
Fix for:
/usr/bin/ld: key_derivation.so: undefined reference to `gnutls_hmac_fast'

Related: OS#5252
Change-Id: Iacddc22ecda187e250db9cfb1ca1d1d341ce78f4
2021-10-12 16:35:01 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Harald Welte 18ed23cda5 regen-makefile.sh: Put libraries in LINUX_LIBS, not LDFLAGS
Additional libraries to be linked should be in LINUX_LIBS (appended at
the end of the linker command), not part of LDFLAGS (prepended to
the beginning of the linker command).

On binutils 2.35.1 / Debian unstable, without this patch, I get

/usr/bin/ld: IPL4asp_PT.so: undefined reference to `sctp_bindx'
/usr/bin/ld: IPL4asp_PT.so: undefined reference to `sctp_connectx'

which is resolved by this patch

Change-Id: I8a339076f445e3c650e407ae982c7c2dc4a760b2
2020-10-04 21:09:11 +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 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
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 56071b7d7d mme: Add missing link to DIAMETER_EncDec.cc from TITAN
Change-Id: I9214ba6778ed6fc8c576e9d97217ecbb9996fb12
2019-08-18 19:31:26 +02:00
Harald Welte 6ec643950e mme: Integrate DIAMETER support into MME testsuite
The test suite can now send/receive DIAMETER messages via related test
ports.

Change-Id: I1691f87e19cced79ab0f9c3bb87608fc63e21eab
2019-08-18 17:14:20 +00:00
Harald Welte 0f7d03a787 mme: Add GTPv2 support
this includes a GTPv2_CodecPort (for the usual transcoding)
as wella as an empty GTPv2_PrivateExtensions.ttcn without which
the TITAN GTPv2 ProtocolModule won't compile.

Change-Id: I1c1b8409077103dd4e64e467d21d33d8c9c4ac95
2019-08-18 17:14:20 +00:00
Harald Welte 95333a16eb mme: Extend MME tests to also include S1AP interface testing
The tests so far only tested SGsAP alone, which doesn't get us very
far.  Let's add interfacing with the S1, too.

Change-Id: Id54071b901db720a0f88b91cdc5a8e09bea0fb58
2019-08-18 17:14:20 +00:00
Harald Welte c918e4e373 TTCN-3 native function wrapper for SNOW-3G
Change-Id: I7fca69ea8b4aed48d5a64885b762ab85be71ef03
2019-08-18 17:14:20 +00:00
Harald Welte 4a2bfcb77f remove ogslib dependency from snow
* don't use ogslib specific header files
* don't use ogs_{malloc,free} but simply use the stack

Change-Id: I5604c594934b03d2fd83e1e465fc150fc542a475
2019-08-18 17:14:20 +00:00