Commit Graph

4094 Commits

Author SHA1 Message Date
Pau Espin 7ae55ea29c Update pcap pkt size to 1520 bytes
I see packets of 1520 bytes in the generated pcap running under the
docker setup. This happens when a lot of IPA concurrent clients send
messages and end up in the same TCP packet due to naggle algorithm.

Change-Id: I362371508ba83acc48376b6ed012a97a59d4b31b
2024-02-28 14:15:19 +01:00
Pau Espin 4ecc808f1d pgw: Introduce test TC_s2b_createSession_v4_apco
Make sure APCO IE is properly handled and answered back.

Change-Id: Ib01fe0512866924a5afc4d6719ceacb0b4b54df2
2024-02-28 12:54:21 +00:00
Pau Espin 518e24b861 pgw: Introduce test TC_s2b_createSession_v4_no_apco
This test allows initial testing of a session creation through the S2b
interface (emulating an ePDG).

A follow-up test will be added to test the APCO IE (feature which
open5gs-smfd still doesn't support).

Change-Id: I38e469edf0e00feca5a648035b64645e2c905937
2024-02-28 12:54:21 +00:00
Vadim Yanitskiy 4199a701c3 msc/MSC_Tests.cfg: remove commented out testcase list
Change-Id: I573b55e235ebb093b1166c1fe78feaa4f296ce8c
2024-02-28 15:30:10 +07:00
Pau Espin 355a133048 PGW_Tests: refactor/improve several parameters to accomodate for different GTPv2C interfaces
So far we were only testing s5/s8 interface, but we'll want to test s2b
soon.
This commit is a mixture of refactorings and code improvements as a step
towards testing S2b interface.

Change-Id: I22b3e18d02ca828e2ea43bde2e0a602db236cf50
2024-02-23 17:44:17 +01:00
Pau Espin f29258602e epdg: Make sure PCO is forwarded from strongswan to PGW and back
Related: OS#6369
Change-Id: Ie01d6e88b3ccc55fecc97c2ba75bb31bba5b9ef7
2024-02-22 20:12:37 +01:00
Pau Espin cacd707fbf GTPv2_Templates: Allow specifying APCO IE in CreateSessionReq/Resp
Change-Id: I860a9424d6109434a953b1aa39d1fa6035fc7e94
2024-02-22 20:12:04 +01:00
Pau Espin ce1d3cb08c gsup: Add PCO IE
This commit adds a new file PCO_Types.ttcn which allows generically
encoding decoding PCOs.

Change-Id: I9a1ae74712d6e8e0cd524ccd7fc2529b1a15dd97
2024-02-21 20:00:24 +01:00
Pau Espin 78598b51ed epdg: Validate assigned PDP Address and APN
Change-Id: I440a7379c6dab5448d4c57c498ad9d086d0c456b
2024-02-14 19:23:59 +01:00
Pau Espin 24b0859e4c epdg: Fix FTEID interface in CreateSessionResponse
Change-Id: If7ce6580c4690473d9c34ca58f704c8ff535f166
2024-02-09 18:48:53 +01:00
Pau Espin 8586b2675a epdg: Fix UsernMame being NAI instead of IMSI in S6b AAR
Change-Id: Ifa5b262db40b649c6dfe7b5ac43098208b3e8300
2024-02-09 18:12:21 +01:00
Pau Espin df00c4fe94 epdg: Fix instance in CreateSession Re S2b-U PGW F-TEID IE
According to 3GPP TS 29.274 Table 7.2.2-1, instance=1.

Change-Id: If0e2425e0a64e528990bfd589b858d0955a4677a
2024-02-08 19:23:14 +01:00
Pau Espin b351cd6e20 epdg: Fix instance in CreateSession Resp BearerCtx S2b-U PGW F-TEID IE
According to 3GPP TS 29.274 Table 7.2.2-2, instance=4.

Change-Id: Ie60605f39b4c43f186aee67f966708a1efe70412
2024-02-08 18:21:22 +01:00
Pau Espin c2cfd550db epdg: Add PDP-Info IE to GSUP Auth Info Req
Strongswan already has this information during first IKE_AUTH message,
see 3GPP TS 24.302 7.2.2.1.

Change-Id: I42e4dc4bbcef969aae5867dbb103f8a5db157c89
2024-02-07 17:53:24 +01:00
Pau Espin 14abac5302 epdg: Introduce test TC_ho_lte_to_wifi
This test emulates a UE doing handover to ePDG, when it may create extra
dedicated bearers.

Change-Id: Ibdfeda1fa5d7016b1952d64b306cd501cb33f61b
2024-02-07 16:36:35 +00:00
Pau Espin cbe6eba269 epdg: Expect GSUP CancelLocationReq as consequence of DeleteBearerReq
Change-Id: Ibc37a9ef53315edab18f7b97a55cf504a40a4bf1
2024-02-07 16:36:35 +00:00
Pau Espin af8ba5823b epdg: Avoid tx PurgeMS before doing handover in TC_ho_wifi_to_lte
Change-Id: Ic6db92c79e055bc98d502620930ab36e9a4fd4fd
2024-02-07 16:36:35 +00:00
Vadim Yanitskiy 090759a297 library/L1CTL_Types: add definition of L1CTL_GPRS_UL_BLOCK_CNF
Change-Id: I772bb0ace0efbc7e7fe788fd49218fe398097943
Related: osmocom-bb.git I56e0b5631c7446390adbfc5664e56f56ebb88cc1
2024-02-05 21:43:05 +07:00
Pau Espin 4944a5cee6 epdg: Test UE-initiated Detach Procedure
Related: OS#6333
Change-Id: I19114c69119e42622f323378dd356217d107cb32
2024-01-31 19:27:55 +01:00
Pau Espin a518d05e9b GSUP: Fix spare and pdp_type_org fields swapped in PDPAddress IE
A recent commit added records to separate 2 binary octets into known
fields, but 2 fields filling 1 byte were actually written swapped. Fix
it now.

Fixes: 7b7a1e8ed1
Change-Id: I884bddb0e1e5f1cfc5615c11d6c7d602d0df9224
2024-01-30 12:35:35 +01:00
Pau Espin 1cbbf9edb6 NS_Emulation: expect altstep timeout entry only if timer is running
Should fix the following log message:
NS_Emulation.ttcnpp:784 Timeout operation on timer Tns_alive failed: The timer is not started.

Change-Id: If1fae965659f73fde2508b0e9158099025fa65f2
2024-01-30 11:15:48 +01:00
Pau Espin f7926c070a BSSGP_Emulation: expect altstep timeout entry only if timer is running
Should fix the following log message:
BSSGP_Emulation.ttcnpp:1118 Timeout operation on timer g_T1 failed: The timer is not started.

Change-Id: Id7d1b76a6bc1fc2f0f4896c59673c01293b526e9
2024-01-30 11:12:47 +01:00
Pau Espin c119ba0171 epdg: expect AAA_server tx SAR against HSS upon AA on s6B interface
The AAA-Server informs the HSS when the session is created at the PGW.

Change-Id: I1b81f1a2225f54d0f8f679e53d87f342feb495be
2024-01-29 11:55:54 +01:00
Pau Espin cff72f8d16 ggsn: Validate IPCP identifier in answer matches the one in the request
Related: https://github.com/open5gs/open5gs/pull/2920
Related: SYS#6582
Change-Id: I0e0cefaeb303b4e284173011231170554e225561
2024-01-26 16:59:09 +01:00
Pau Espin 867b13025b DIAMETER: Split Gy and Gx messages to their own TS files
Those interfaces reuse messages from other Diameter RFCs, but changing
the contents of the messages, eg some Mandatory fields like
Service-Context-Id which are mandatory in RFC5006, doesn't even appear
in Gx CCR in TS 29.212.

Keeping them well separated helps in avoiding confusion on users fo the
messages.

Change-Id: Ibe0d5f263813d5083e020c942283f214983162b4
2024-01-24 16:14:30 +01:00
Pau Espin a6b0c1c128 GSUP: Fix build of IEs in f_gen_tr_ies(), add PdpInfo(Compl) IEs to it
The previous conditions "isvalue()" were wrong. Passing an array of
templates to isvalue() returns false, which is unexpected here.

Change-Id: Iaad47b1ec7e2a7477fa554df9caeb866ffa594eb
2024-01-23 11:21:42 +01:00
Pau Espin c63fa8ee87 GSUP: Fix missing and wrongly sorted IEs in ts_GSUP_IE_PdpInfo
Sort them to follow libosmocore implementation.

Change-Id: I65e586187d7230f122644c101f8467becae6e204
2024-01-23 11:21:37 +01:00
Pau Espin bb76d7a0a9 GSUP: Fix PDPInfoCompl IE
Change-Id: I7b6e584f12828019fc9c0f961a0c8692c0b44b1c
2024-01-22 19:56:13 +01:00
Pau Espin 7b7a1e8ed1 GSUP: Convert PDP-Type IE to PDP-Address IE
The previous PDP-Type IE should have been a PDP-Address from the
start, since having only PDP-Type with no address is only a specific
case (dynamic addressing).
This becomes clear by looking at other similar protocols like:
* MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs
* Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains
  Served-Party-IP-Address AVPs
* Diameter SWx, 3GPP TS 29.273 APN-Configuration.
* GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address.

Since PDP-Type on its own really makes no sense, being it a special case
of PDP-Address, let's keep the IE by renaming it (keeping old name too
for API backward compat) and extend it to support lengths > 2 bytes.

Old implementation of libosmogsm gsup actually ignored lengths > 2
bytes, so we are safe acting against older implementations here, both
on the sending and receiving side on the wire.

Change-Id: I3e92368fff61694bcef6a48320595b59ae8f54ca
Related: OS#6091
Related: libosmocore.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
Related: osmo-gsm-manuals.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 20:56:18 +01:00
Pau Espin 8f1403a471 Move templates from GSUP_Types.ttcn to GSUP_Templates.ttcn
Follow similar structure that we have for other protocols.

Change-Id: I54cc8c99d1e91d57c3d5a92f6529ef2055e9d4ed
2024-01-18 20:22:34 +01:00
Pau Espin 88659de9cf GSUP_Types: Add missing message_class to EPDGTunnel* messages
Related: OS#6091
Change-Id: Ib7d6156402645867cadc8d3e0ffdd07247a1abd2
2024-01-18 20:12:09 +01:00
Pau Espin 2f66a597cb GSUP_Types: add message type for osmo-epdg CEAI interface
The CEIA interface is an interface between osmo-epdg and
strongswan.
It is used by the osmo-epdg to synchronize state.

Related: OS#6091
Related: libosmocore.git Change-Id I6f7c20340c99f94b1326a8a7dc99c86cf6a0dbc3
Change-Id: I3da4f731597eee3736a9aab513f5257a78e8d8eb
2024-01-18 14:07:34 +01:00
Pau Espin b1ce3ad159 epdg: Remove unneeded register by message
Since recently GTP2 Emulation got improved routing, and it should simply
match by the already registered imsi.

Change-Id: I410242d6597db10b97edf72b92e749db28520c39
2024-01-17 18:00:00 +01:00
Pau Espin c13a4cda43 epdg: Add module param to configure initial diameter watchdog time
Change-Id: I9eb42d7664d8e607b913e23c87477388f70662b9
2024-01-17 18:00:00 +01: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 bbff8b7870 GTP_Templates: Add gtp1_requests template to match GTPv1C req messages
I'm finally not using it for now, but since it takes a while to write,
leave it there for some lucky future user.

Change-Id: Ibf4b98e19ff13f23c552f50ca91832f0d317bbbf
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 bddba3aa10 pgw: Expect EchoResp in CLIENT port of component who sent EchoReq
A recent commit in GTPv2_Emulation improved the routing of incoming
messages from network towards clients.
After that change, the GTPv2_Emulation properly matches the originating
component of the procedure and forwards the reply to it.
Hence, TC_tx_echo() needs to be adapter to expect the reply on its
CLIENT port.
TEID0 is now left for incoming initiating messages which have no seqnr
match.

Change-Id: I1764fdf81192597e393d79d34cb8f221aa79bbd9
Fixes: 1d2cc67036
2024-01-15 10:38:27 +01:00
Pau Espin 167bca418f GTPv2_Emulation: routing improvements: Prioritize response, fallback to TEID
First try forwarding to component transmitting the originating request,
since this is the most fine-grained match.
Finally, if no specific match was found and if messages belongs to
TEID0, send it over that port as a fallback.

Fixes: 1d2cc67036
Change-Id: Ie96d65085fb352489150183415dbd6cc8237a47c
2024-01-15 10:38:27 +01:00
Pau Espin 9411082cc5 GTPv2_Templates: Fix tEID field optional tr_PDU_GTP2C_msgtypes()
The TEID field is optional, based on t_Bit. Hence, we also want to
match by type if there's no TEID.

Change-Id: I65044b8758046704e22f9057f34ce5fdbb7aabfe
2024-01-15 10:38:27 +01:00
Pau Espin e016346359 S1AP_Emulation: Add port message to reset NAS count values
It is sometimes needed to reset them to zero as per spec, like when
moving GERAN/UTRAN->EUTRAN.
This will be used by a follow-up patch.

Change-Id: I61d7b919aba8f58a020c18ae9b9bba4108d59010
2024-01-15 10:38:27 +01:00
Pau Espin b5ad4aef27 NAS_Templates: Introduce template tr_PDU_NAS_EPS_TrackingAreaUpdateAccept
Change-Id: Iba19ac8293fecfe0b150155cebe50cbe4d32fe4d
2024-01-15 10:38:27 +01:00
Pau Espin a94e823416 NAS_Templates: Allow passing old_guti and ptmsi_sig to TAU Req template
Change-Id: I5e0204e772edefc49a63b73fc4aad2fed5c14cac
2024-01-15 10:38:14 +01:00
Andreas Eversberg a8aa16e1eb ASCI: Correctly confirm talker, so originator can be identified
Fix the issue that MSC rejects call termination, because talker can't
be identified as originator of the call.

Fixes: OS#6325
Change-Id: I0381e25e15624e6b7577910c95700a355ed3f811
2024-01-10 16:06:13 +00:00
Pau Espin f95460b55b GTP_Templates: Add templates for some GTPv1C IEs
Change-Id: I84aac34ca40a2707dc9da28e112fd7684e706c8e
2024-01-09 15:55:25 +00:00
Vadim Yanitskiy 5389e3a625 library/GSUP_Types: add Source Name IE to receive templates for SMS
Old osmo-msc versions do not include the Source Name IE in SMS related
GSUP messages, unless it's set explicitly in the config file ('hlr' /
'ipa-name').  Recent osmo-msc versions (see the related osmo-msc patch)
do include this IE even if it's not set explicitly ('unnamed-MSC').

Because of this, some testcases in ttcn3-msc-test are currently
failing for osmo-msc master, but still passing for the -latest.

Let's set the 'ipa-name' explicitly in osmo-msc.cfg, and expect the
Source Name IE to be present in SMS related receive templates.

Change-Id: Ic24d3082fe3dce08e43e8f3ecb6d6132503c55c6
Related: docker-playground.git I7757aae1d01b679f530b5c0a6c95b224cb9f204f
Related: osmo-msc.git I7bacd001b81326c32bc262c7d0c0491ded822fa8
Related: OS#6135
2024-01-09 19:34:49 +07:00
Vadim Yanitskiy 6eb7ac6db8 library/GSUP_Types: set Message Class IE in send templates for SMS
We do expect it in receive templates for SMS, so let's also
indluce it in the send templates.

Change-Id: I6468d8606eb85c811d86e4a1407ee60c8a36fbea
Related: OS#6135
2024-01-09 19:19:07 +07:00
Vadim Yanitskiy 286b042b53 MSC_Tests: indicate the failure reason in setverdict()
... so that there is no need to check logs to see why a test failed.

Change-Id: I159bc54f6f4561d42aeabe825e16fa77e60c2dae
2024-01-09 18:11:27 +07: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