lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

September 2026

  • 1 participants
  • 1894 discussions
[S] Change in osmo-remsim[master]: Add optional timeout to maintenance mapping
by jolly 30 Sep '26

30 Sep '26
jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/43746?usp=email ) Change subject: Add optional timeout to maintenance mapping ...................................................................... Add optional timeout to maintenance mapping To prevent a broken or crashed application from blocking a mapping for an undefined time, a timeout can be specified. The application that controls the mapping, chooses a timeout that is long enough to complete the operation before the timeout occurs. Related: SYS#8159 Change-Id: I2f7ee24e6c926b65876af2b14da3534555398769 --- M src/server/rest_api.c M src/server/rspro_server.c M src/slotmap.c M src/slotmap.h 4 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/46/43746/1 diff --git a/src/server/rest_api.c b/src/server/rest_api.c index 62e4c45..05ba3c1 100644 --- a/src/server/rest_api.c +++ b/src/server/rest_api.c @@ -316,6 +316,7 @@ static int api_cb_slotmaps_post(const struct _u_request *req, struct _u_response *resp, void *user_data) { const char *maintenance_str = u_map_get(req->map_url, "maintenance"); + const char *timeout_str = u_map_get(req->map_url, "timeout"); struct rspro_server *srv = g_rps; struct slot_mapping slotmap, *map, *other_map; struct rspro_client_conn *conn; @@ -323,9 +324,11 @@ json_t *json_req = NULL; bool suspending_map = false; bool maintenance; + int timeout; int rc; maintenance = (maintenance_str && !strcmp(maintenance_str, "true")); + timeout = (timeout_str) ? atoi(timeout_str) : 0; json_req = ulfius_get_json_body_request(req, &json_err); if (!json_req) { @@ -368,6 +371,8 @@ slotmap_state_change(map, SLMAP_S_INACTIVE, NULL); goto done; } + } else { + map->maintenance_timeout = timeout; } /* If we are suspended an exisisting maping, we stay inactive until the mapping was removed. */ diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c index 9fbdaa9..48ccd6b 100644 --- a/src/server/rspro_server.c +++ b/src/server/rspro_server.c @@ -407,6 +407,21 @@ } } +/* Handle timeout for maintenance mapping. */ +static void maintenance_timeout(void *data) +{ + struct slot_mapping *map = data; + struct rspro_client_conn *conn; + + conn = bankd_conn_by_id(g_rps, map->bank.bank_id); + if (!conn) + return; + + /* The timer is only running in ACTIVE state, so we trigger deletion now. */ + slotmap_state_change(map, SLMAP_S_DELETE_REQ, &conn->bank.maps_delreq); + osmo_fsm_inst_dispatch(conn->fi, CLNTC_E_PUSH, NULL); +} + static void clnt_st_connected_bankd(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct rspro_client_conn *conn = fi->priv; @@ -437,6 +452,11 @@ client_conn_send(conn, pdu); slotmap_state_change(map, SLMAP_S_DELETING, &conn->bank.maps_deleting); } + /* If maintenance mapping has been created, start maintenance timeout timer. */ + if (map->maintenance && map->maintenance_timeout) { + osmo_timer_setup(&map->maintenance_timer, maintenance_timeout, map); + osmo_timer_schedule(&map->maintenance_timer, map->maintenance_timeout, 0); + } break; case CLNTC_E_REMOVE_MAP_RES: /* Bankd acknowledges mapping was removed */ rx = data; @@ -478,6 +498,8 @@ } /* If maintenance mapping is to be deleted, reactivate inactive mapping. */ if (map->maintenance) { + /* Delete maintenance timeout timer. */ + osmo_timer_del(&map->maintenance_timer); /* Search for non maintenance mapping. */ other_map = slotmap_by_bank_and_maintenance(slotmaps, &map->bank, false); if (other_map) { diff --git a/src/slotmap.c b/src/slotmap.c index 84bebea..72eac8f 100644 --- a/src/slotmap.c +++ b/src/slotmap.c @@ -171,6 +171,7 @@ llist_del(&map->list); #ifdef REMSIM_SERVER + osmo_timer_del(&map->maintenance_timer); llist_del(&map->bank_list); #endif diff --git a/src/slotmap.h b/src/slotmap.h index 225d453..07a80db 100644 --- a/src/slotmap.h +++ b/src/slotmap.h @@ -3,6 +3,7 @@ #include <stdbool.h> #include <pthread.h> #include <osmocom/core/linuxlist.h> +#include <osmocom/core/timer.h> #define REMSIM_SERVER 1 @@ -62,6 +63,8 @@ enum slot_mapping_state state; /* this mapping is for maintenenance */ bool maintenance; + int maintenance_timeout; + struct osmo_timer_list maintenance_timer; /* this mapping is (to be) suspended */ bool suspend; #endif -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/43746?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I2f7ee24e6c926b65876af2b14da3534555398769 Gerrit-Change-Number: 43746 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: PFCP_Templates: Multiple improvements
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43731?usp=email ) Change subject: PFCP_Templates: Multiple improvements ...................................................................... PFCP_Templates: Multiple improvements These improvements will be used in SMF_tests later on. Change-Id: I6e6bc92d26e0b4041ef56f5c8d7eb23d4c302529 --- M library/PFCP_Templates.ttcn M s1gw/S1GW_ConnHdlr.ttcn M upf/UPF_Tests.ttcn 3 files changed, 165 insertions(+), 50 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/PFCP_Templates.ttcn b/library/PFCP_Templates.ttcn index 5cdc5cc..ae23414 100644 --- a/library/PFCP_Templates.ttcn +++ b/library/PFCP_Templates.ttcn @@ -559,6 +559,36 @@ ur_seqn := ur_seqn } +/* 8.2.79 PDN Type */ +const INT3b c_PFCP_PDN_Type_IPv4 := 1; +const INT3b c_PFCP_PDN_Type_IPv6 := 2; +const INT3b c_PFCP_PDN_Type_IPv4v6 := 3; +const INT3b c_PFCP_PDN_Type_Non_IP := 4; +const INT3b c_PFCP_PDN_Type_Ethernet := 5; +template (present) PDN_Type +tr_PFCP_PDN_Type(template (present) INT3b pdn_type := ?) := { + elementIdentifier := 113, + lengthIndicator := ?, + pdn_type := pdn_type, + spare := '00000'B +} +template (value) PDN_Type +ts_PFCP_PDN_Type(template (value) INT3b pdn_type) := { + elementIdentifier := 113, + lengthIndicator := 0, /* overwritten */ + pdn_type := pdn_type, + spare := '00000'B +} + +/* 8.2.118 3GPP Interface Type */ +template (present) ThreeGPP_Interface_Type +tr_PFCP_ThreeGPP_Interface_Type(template (present) INT6b interfacetypevalue := ?) := { + elementIdentifier := 160, + lengthIndicator := ?, + interfacetypevalue := interfacetypevalue, + spare := '00'B +} + /* 8.2.132 Quota Validity Time */ template (present) Quota_Validity_Time tr_Quota_Validity_Time(template (present) LIN4_BO_LAST validity_time_value := ?) := { @@ -808,6 +838,28 @@ ipv6_address := omit } +template (present) F_TEID +tr_PFCP_F_TEID(template (present) BIT1 v4 := ?, + template (present) BIT1 v6 := ?, + template (present) BIT1 ch := ?, + template (present) BIT1 chid := ?, + template OCT4 teid := *, + template OCT4 ipv4_address := *, + template OCT16 ipv6_address := *, + template OCT1 choose_id := *) := { + elementIdentifier := 21, + lengthIndicator := ?, + v4 := v4, + v6 := v6, + ch := ch, + chid := chid, + spare := '0000'B, + teid := teid, + ipv4_address := ipv4_address, + ipv6_address := ipv6_address, + choose_id := choose_id +} + template (value) F_TEID ts_PFCP_F_TEID_ipv4(OCT4 teid, OCT4 addr_v4) := { elementIdentifier := 21, lengthIndicator := 0, @@ -844,6 +896,12 @@ return qname; } +template (present) Network_Instance +tr_PFCP_Network_Instance(charstring netinst_name) := { + elementIdentifier := 22, + lengthIndicator := ?, + pdn_instance := f_netinst_str_to_qname(netinst_name) +}; template (value) Network_Instance ts_PFCP_Network_Instance(charstring netinst_name) := { elementIdentifier := 22, @@ -851,6 +909,33 @@ pdn_instance := f_netinst_str_to_qname(netinst_name) }; +template (present) SDF_Filter +tr_PFCP_SDF_Filter(template (present) BIT1 fd := ?, + template (present) BIT1 ttc := ?, + template (present) BIT1 spi := ?, + template (present) BIT1 fl := ?, + template (present) BIT1 bid := ?, + template octetstring flow_description := *, + template OCT2 ToS_Traffic_Class := *, + template OCT4 security_parameter_index := *, + template OCT3 flow_label := *, + template LIN4_BO_LAST SDF_filter_id := *) := { + elementIdentifier := 23, + lengthIndicator := ?, + fd := fd, + ttc := ttc, + spi := spi, + fl := fl, + bid := bid, + spare := '00000000000'B, + lengthFlowDesc := *, + flow_description := flow_description, + ToS_Traffic_Class := ToS_Traffic_Class, + security_parameter_index := security_parameter_index, + flow_label := flow_label, + SDF_filter_id := SDF_filter_id +} + template (value) PDI_IE ts_PFCP_PDI(e_PFCP_Src_Iface src_iface, template (omit) F_TEID local_F_TEID := omit, @@ -875,20 +960,26 @@ tr_PFCP_PDI(e_PFCP_Src_Iface src_iface, template F_TEID local_F_TEID := *, template UE_IP_Address ue_addr_v4 := *, - template Network_Instance network_instance := *) := { - elementIdentifier := 2, - lengthIndicator := ?, + template Network_Instance network_instance := *, + template Traffic_Endpoint_ID traffic_endpoint_id := *, + template SDF_Filter_list sdf_filter_list := *, + template Application_ID application_id := *, + template Ethernet_Packet_Filter_list ethernet_packet_filter_list := *, + template QFI_list qfi_list := *, + template ThreeGPP_Interface_Type source_interface_type := *) := { + elementIdentifier := 2, + lengthIndicator := ?, grouped_ie := { source_interface := tr_PFCP_Src_Iface(src_iface), local_F_TEID := local_F_TEID, pdn_instance := network_instance, ue_ip_address := ue_addr_v4, - traffic_endpoint_id := *, - sdf_filter_list := *, - application_id := *, - ethernet_packet_filter_list := *, - qfi_list := *, - source_interface_type := * + traffic_endpoint_id := traffic_endpoint_id, + sdf_filter_list := sdf_filter_list, + application_id := application_id, + ethernet_packet_filter_list := ethernet_packet_filter_list, + qfi_list := qfi_list, + source_interface_type := source_interface_type } } @@ -918,24 +1009,34 @@ template (present) Apply_Action tr_PFCP_Apply_Action(template (present) BIT1 forw := '0'B, template (present) BIT1 drop := '0'B, - template (present) BIT1 buff := '0'B) := { + template (present) BIT1 buff := '0'B, + template (present) BIT1 nocp := '0'B, + template (present) BIT1 dupl := '0'B, + template (present) BIT1 ipma := '0'B, + template (present) BIT1 ipmd := '0'B, + template (present) BIT1 dfrt := '0'B, + template BIT1 edrt := *, + template BIT1 bdpn := *, + template BIT1 ddpn := *, + template BIT1 fssm := *, + template BIT1 mbsu := *) := { elementIdentifier := 44, lengthIndicator := ?, /* octet 5: */ drop := drop, forw := forw, buff := buff, - nocp := ?, - dupl := ?, - ipma := ?, - ipmd := ?, - dfrt := ?, + nocp := nocp, + dupl := dupl, + ipma := ipma, + ipmd := ipmd, + dfrt := dfrt, /* octet 6: */ - edrt := *, - bdpn := *, - ddpn := *, - fssm := *, - mbsu := *, + edrt := edrt, + bdpn := bdpn, + ddpn := ddpn, + fssm := fssm, + mbsu := mbsu, spare := * } @@ -1024,38 +1125,50 @@ template (value) Forwarding_Parameters ts_PFCP_Forwarding_Parameters(e_PFCP_Dest_Iface dest_iface, + template (omit) Network_Instance network_instance := omit, + template (omit) Redirect_Information redirect_information := omit, template (omit) Outer_Header_Creation ohc := omit, - template (omit) Network_Instance network_instance := omit) := { - elementIdentifier := 4, - lengthIndicator := 0, - grouped_ie := { + template (omit) DL_Transport_Level_Marking transport_level_marking := omit, + template (omit) Forwarding_Policy forwarding_policy := omit, + template (omit) Header_Enrichment header_enrichment := omit, + template (omit) Traffic_Endpoint_ID traffic_endpoint_ID := omit, + template (omit) ThreeGPP_Interface_Type destination_interface_type := omit) := { + elementIdentifier := 4, + lengthIndicator := 0, + grouped_ie := { destination_interface := ts_PFCP_Destination_Interface(dest_iface), pdn_Instance := network_instance, - redirect_information := omit, + redirect_information := redirect_information, outer_header_creation := ohc, - transport_level_marking := omit, - forwarding_policy := omit, - header_enrichment := omit, - traffic_endpoint_ID := omit, - destination_interface_type := omit + transport_level_marking := transport_level_marking, + forwarding_policy := forwarding_policy, + header_enrichment := header_enrichment, + traffic_endpoint_ID := traffic_endpoint_ID, + destination_interface_type := destination_interface_type } } template (present) Forwarding_Parameters tr_PFCP_Forwarding_Parameters(e_PFCP_Dest_Iface dest_iface, + template Network_Instance network_instance := *, + template Redirect_Information redirect_information := *, template Outer_Header_Creation ohc := *, - template Network_Instance network_instance := *) := { - elementIdentifier := 4, - lengthIndicator := ?, - grouped_ie := { + template DL_Transport_Level_Marking transport_level_marking := *, + template Forwarding_Policy forwarding_policy := *, + template Header_Enrichment header_enrichment := *, + template Traffic_Endpoint_ID traffic_endpoint_ID := *, + template ThreeGPP_Interface_Type destination_interface_type := *) := { + elementIdentifier := 4, + lengthIndicator := ?, + grouped_ie := { destination_interface := tr_PFCP_Destination_Interface(dest_iface), pdn_Instance := network_instance, - redirect_information := *, + redirect_information := redirect_information, outer_header_creation := ohc, - transport_level_marking := *, - forwarding_policy := *, - header_enrichment := *, - traffic_endpoint_ID := *, - destination_interface_type := * + transport_level_marking := transport_level_marking, + forwarding_policy := forwarding_policy, + header_enrichment := header_enrichment, + traffic_endpoint_ID := traffic_endpoint_ID, + destination_interface_type := destination_interface_type } } @@ -1299,7 +1412,8 @@ ts_PFCP_Session_Est_Req(template (value) Node_ID node_id, template (value) F_SEID cp_f_seid, template (value) Create_PDR_list create_pdr, - template (value) Create_FAR_list create_far) + template (value) Create_FAR_list create_far, + template (omit) PDN_Type pdn_type := omit) modifies ts_PDU_PFCP_ := { seid := '0000000000000000'O, /* shall be set to 0 as per 7.2.2.4.2 */ message_body := { @@ -1312,7 +1426,7 @@ create_QER_list := omit, create_BAR := omit, create_traffic_endpoint_list := omit, - pdn_type := omit, + pdn_type := pdn_type, node_list := omit, up_inactivity_timer := omit, user_id := omit, @@ -1325,7 +1439,8 @@ template (present) F_SEID cp_f_seid := ?, template (present) Create_PDR_list create_pdr := ?, template (present) Create_FAR_list create_far := ?, - template Create_URR_list create_urr := *) + template Create_URR_list create_urr := *, + template PDN_Type pdn_type := *) modifies tr_PDU_PFCP_ := { seid := '0000000000000000'O, /* shall be set to 0 as per 7.2.2.4.2 */ message_body := { @@ -1338,7 +1453,7 @@ create_QER_list := *, create_BAR := *, create_traffic_endpoint_list := *, - pdn_type := *, + pdn_type := pdn_type, node_list := *, up_inactivity_timer := *, user_id := *, diff --git a/s1gw/S1GW_ConnHdlr.ttcn b/s1gw/S1GW_ConnHdlr.ttcn index e02d6c6..423c05d 100644 --- a/s1gw/S1GW_ConnHdlr.ttcn +++ b/s1gw/S1GW_ConnHdlr.ttcn @@ -1110,7 +1110,7 @@ ohc2 := tr_PFCP_Outer_Header_Creation_GTP_ipv4(erab.u2c.teid, f_inet_addr(erab.u2c.tla)); - fpars2 := tr_PFCP_Forwarding_Parameters(CORE, ohc2); + fpars2 := tr_PFCP_Forwarding_Parameters(dest_iface := CORE, ohc := ohc2); far1 := tr_PFCP_Create_FAR(far_id := c_PFCP_FAR_ID_C2A, /* -- for Core -> Access */ aa := tr_PFCP_Apply_Action_DROP, diff --git a/upf/UPF_Tests.ttcn b/upf/UPF_Tests.ttcn index 3c85fae..59550a8 100644 --- a/upf/UPF_Tests.ttcn +++ b/upf/UPF_Tests.ttcn @@ -645,8 +645,8 @@ far_id, ts_PFCP_Apply_Action_FORW, valueof(ts_PFCP_Forwarding_Parameters( - ACCESS, - ts_PFCP_Outer_Header_Creation_GTP_ipv4( + dest_iface := ACCESS, + ohc := ts_PFCP_Outer_Header_Creation_GTP_ipv4( remote_teid, gtp_dest_addr_v4) )) @@ -681,9 +681,9 @@ ts_PFCP_Create_FAR( far_id, ts_PFCP_Apply_Action_FORW, - valueof(ts_PFCP_Forwarding_Parameters(dest_iface, - ts_PFCP_Outer_Header_Creation_GTP_ipv4(dest_remote_f_teid.teid, - dest_remote_f_teid.ipv4_address))) + valueof(ts_PFCP_Forwarding_Parameters(dest_iface := dest_iface, + ohc := ts_PFCP_Outer_Header_Creation_GTP_ipv4(dest_remote_f_teid.teid, + dest_remote_f_teid.ipv4_address))) ) ) }; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43731?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I6e6bc92d26e0b4041ef56f5c8d7eb23d4c302529 Gerrit-Change-Number: 43731 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTPv2_Emulation: Fix SeqTable entries never reused after unregister
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43733?usp=email ) Change subject: GTPv2_Emulation: Fix SeqTable entries never reused after unregister ...................................................................... GTPv2_Emulation: Fix SeqTable entries never reused after unregister Using the "seq := -" during unregister don't set back the values to "unbound" if already set; the values stay the same. As a result, entries being used couldn't be reused afterwards, which could end up in running out of free entries. Change-Id: I8d4d8f0de6fb3253d5876ebb9724750869ad5e06 --- M library/GTPv2_Emulation.ttcn 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/GTPv2_Emulation.ttcn b/library/GTPv2_Emulation.ttcn index 7ef5283..75e5cd5 100644 --- a/library/GTPv2_Emulation.ttcn +++ b/library/GTPv2_Emulation.ttcn @@ -178,10 +178,20 @@ testcase.stop("No Space in TidTable for ", teic); } +private function f_seq_tbl_init() runs on GTPv2_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(SeqTable); i := i+1) { + SeqTable[i] := { + seq := '000000'O, + vc_conn := null + } + } +} + private function f_seq_tbl_add(OCT3 seq, GTP2_ConnHdlr vc_conn) runs on GTPv2_Emulation_CT { var integer i; for (i := 0; i < sizeof(SeqTable); i := i+1) { - if (not isbound(SeqTable[i].seq)) { + if (SeqTable[i].vc_conn == null) { SeqTable[i].seq := seq; SeqTable[i].vc_conn := vc_conn; return; @@ -193,9 +203,9 @@ private function f_seq_tbl_del(OCT3 seq) runs on GTPv2_Emulation_CT { var integer i; for (i := 0; i < sizeof(SeqTable); i := i+1) { - if (isbound(SeqTable[i].seq) and SeqTable[i].seq == seq) { + if (SeqTable[i].vc_conn != null and SeqTable[i].seq == seq) { SeqTable[i] := { - seq := -, + seq := '000000'O, vc_conn := null } } @@ -414,6 +424,8 @@ private function f_init(Gtp2EmulationCfg cfg) runs on GTPv2_Emulation_CT { var Result res; + f_seq_tbl_init(); + map(self:GTP2C, system:GTP2C); res := GTPv2_CodecPort_CtrlFunct.f_IPL4_listen(GTP2C, cfg.gtpc_bind_ip, cfg.gtpc_bind_port, {udp:={}}); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43733?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I8d4d8f0de6fb3253d5876ebb9724750869ad5e06 Gerrit-Change-Number: 43733 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: smf: Test 4G IPv6/IPv4v6 sessions
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43732?usp=email ) Change subject: smf: Test 4G IPv6/IPv4v6 sessions ...................................................................... smf: Test 4G IPv6/IPv4v6 sessions * Use PFCP PDN Type to store the info in SMF_Session_CT, since PFCP is used in both 4G and 5G. * Verify the PDN Type and the IPv6 related PDR & FAR for IPv6 SLAAC are set by SMF during PFCP Session Establish Request. * Once the session is establish, emulate the UPF forwarding the ICMPv6 RS from the UE towards the SMF using GTPv1U, and verify a ICMPv6 RA is received as a result. * remove some (IPv4) ICMP dependencies which are not needed at all. Change-Id: Ic2fca0a7efad56ec9fc5e1bc2665f86626ead856 --- M smf/SMF_Session_CT.ttcn M smf/SMF_Session_CT_4G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml M smf/gen_links.sh M smf/regen_makefile.sh 6 files changed, 202 insertions(+), 47 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/smf/SMF_Session_CT.ttcn b/smf/SMF_Session_CT.ttcn index e581251..7b46f79 100644 --- a/smf/SMF_Session_CT.ttcn +++ b/smf/SMF_Session_CT.ttcn @@ -8,11 +8,17 @@ import from Native_Functions all; import from Misc_Helpers all; +import from GTPv1U_Templates all; +import from GTPv1U_CodecPort all; import from GTPv1U_Emulation all; import from GTPv2_Types all; import from GTPv2_Templates all; import from GTPv2_Emulation all; +import from IP_Types all; +import from ICMPv6_Types all; +import from ICMPv6_Templates all; + import from DIAMETER_Types all; import from DIAMETER_Templates all; import from DIAMETER_Emulation all; @@ -46,10 +52,6 @@ PFCP_ConnHdlr, MutexCT, HTTP2_CT, HTTP2_ConnHdlr { var SessionPars g_pars; - /* GTP-U IPv4 address remote sie */ - var OCT4 g_gtpu4_remote; - var OCT16 g_gtpu6_remote; - /* Address allocation */ var OCT4 g_ip4_addr; var OCT8 g_ip6_interface_id; @@ -87,7 +89,7 @@ } /* 'local' and 'remote' refer to the GTP information from the UPF's point of view: - * HNB UPF CN + * gNB/SWGU UPF SMF * access.remote <---> access.local | core.local <---> core.remote */ type record Gtp1uParameters { @@ -136,6 +138,7 @@ charstring pfcp_local_addr, Node_ID local_node_id, F_SEID local_f_seid, + INT3b pdn_type, /* c_PFCP_PDN_Type_* */ F_SEID remote_cp_f_seid optional, Session_URR_List urr_list optional, Gtp1uParameters gtp1u_pars @@ -144,13 +147,15 @@ function f_t_PfcpParams(uint32_t idx := 0, charstring pfcp_local_addr := mp_pfcp_ip_local, - template (value) Node_ID local_node_id := ts_PFCP_Node_ID_ipv4(f_inet_addr(mp_pfcp_ip_local))) + template (value) Node_ID local_node_id := ts_PFCP_Node_ID_ipv4(f_inet_addr(mp_pfcp_ip_local)), + INT3b pdn_type := c_PFCP_PDN_Type_IPv4) return PfcpParameters { var uint64_t local_f_seid := idx + 1; var template (value) PfcpParameters pfcp_pars := { pfcp_local_addr := pfcp_local_addr, local_node_id := local_node_id, local_f_seid := ts_PFCP_F_SEID_ipv4(f_inet_addr(pfcp_local_addr), int2oct(local_f_seid, 8)), + pdn_type := pdn_type, remote_cp_f_seid := omit, urr_list := omit, gtp1u_pars := t_Gtp1uParameters_default(idx, pfcp_local_addr) @@ -198,7 +203,7 @@ charstring apn, /* Apn subscribed or non-subscribed */ boolean selection_mode, - GTP2C_PDN_Type pdn_type, + INT3b pdn_type, /* c_PFCP_PDN_Type_* */ /* PAA */ /* Max APN Restriction */ /* APN-AMBR */ @@ -228,13 +233,13 @@ GTP2C_RAT_Type rat_type := GTP2C_RAT_EUTRAN, charstring apn := "internet", boolean selection_mode := false, - GTP2C_PDN_Type pdn_type := GTP2C_PDN_IPv4, + INT3b pdn_type := c_PFCP_PDN_Type_IPv4, template (omit) PfcpParameters pfcp_pars := omit) return SessionPars { var hexstring imsi := f_concat_pad(lengthof(mp_imsi), substr(mp_imsi, 0, lengthof(mp_imsi) - 6), idx); var charstring imsi_str := f_dec_TBCD(imsi_hex2oct(imsi)); if (not isvalue(pfcp_pars)) { - pfcp_pars := f_t_PfcpParams(idx := idx); + pfcp_pars := f_t_PfcpParams(idx := idx, pdn_type := pdn_type); } var template (value) SessionPars pars := { imsi := imsi, @@ -246,11 +251,11 @@ pdn_type := pdn_type, pco := omit, epco := omit, - teic_local := '00000000'O, + teic_local := int2oct(idx + 1, 4), teic_remote := omit, bearer := { ebi := 5, - teid_local := omit, + teid_local := int2oct(idx + 1, 4), teid_remote := omit }, gy := { @@ -292,6 +297,9 @@ runs on SMF_Session_CT { g_pars := valueof(pars); + /* No need to register g_pars.pfcp_pars.gtp1u_pars.access.local.teid since we don't expect any message on it */ + f_gtp1u_register_teid(g_pars.pfcp_pars.gtp1u_pars.core.local.teid); + f_handler_init_4G(); f_handler_init_5G(); @@ -377,8 +385,37 @@ function f_Session_tr_PFCP_Session_Est_Req() runs on SMF_Session_CT return template (present) PDU_PFCP { + var template (present) Create_PDR_list create_pdr := ?; + var template (present) Create_FAR_list create_far := ?; var template Create_URR_list create_urr := *; + if (g_pars.pfcp_pars.pdn_type == c_PFCP_PDN_Type_IPv6 or + g_pars.pfcp_pars.pdn_type == c_PFCP_PDN_Type_IPv4v6) { + /* On IPv6, validate a PDR and FAR to forward IPv6 SLAAC UPF->SMF is set up: */ + var template octetstring flow_description := '7065726D6974206F75742035382066726F6D20666630323A3A*2F31323820746F2061737369676E6564'O; // ("permit out 58 from ff02::*/128 to assigned"); + create_pdr := { + *, + tr_PFCP_Create_PDR(pdr_id := 4, + pdi := tr_PFCP_PDI(src_iface := ACCESS, + local_F_TEID := tr_PFCP_F_TEID(?, ?, '1'B, '1'B, omit, omit, omit, ?), + network_instance := tr_PFCP_Network_Instance(g_pars.apn), + sdf_filter_list := { tr_PFCP_SDF_Filter(fd := '1'B, + flow_description := flow_description) }, + source_interface_type := tr_PFCP_ThreeGPP_Interface_Type(11 /* N3 3GPP Access */)), + ohr := tr_PFCP_Outer_Header_Removal(GTP_U_UDP_IP), + far_id := 3) + , * + } + create_far := { + *, + tr_PFCP_Create_FAR(far_id := 3, + aa := tr_PFCP_Apply_Action(forw := '1'B), + fp := tr_PFCP_Forwarding_Parameters(dest_iface := CP_FUNCTION, + ohc := tr_PFCP_Outer_Header_Creation_GTP_ipv4(?, f_inet_addr(mp_smf_hostname)))) + , * + } + } + if (g_pars.gy.validity_time > 0) { create_urr := { tr_PFCP_Create_URR(urr_id := ?, @@ -389,7 +426,10 @@ }; } - return tr_PFCP_Session_Est_Req(create_urr := create_urr); + return tr_PFCP_Session_Est_Req(create_pdr := create_pdr, + create_far := create_far, + create_urr := create_urr, + pdn_type := tr_PFCP_PDN_Type(g_pars.pfcp_pars.pdn_type)); } altstep as_pfcp_sess_est_req() @@ -405,10 +445,15 @@ var template PDU_PFCP resp; var PFCP_Session_Establishment_Response.created_PDR_list pdrs := {}; var PFCP_Session_Establishment_Request serq := req.message_body.pfcp_session_establishment_request; + var Outer_Header_Creation ohc := serq.create_FAR_list[2].grouped_ie.forwarding_parameters.grouped_ie.outer_header_creation; /* Store peer's F-SEID for later: */ g_pars.pfcp_pars.remote_cp_f_seid := serq.CP_F_SEID; + /* TODO: store CP GTP1U endpoint IPaddr+TEID FAR, it will be used later to send a Router Solicitation UPF->SMF + * sand expect a Router Advertisement back. */ + g_pars.pfcp_pars.gtp1u_pars.core.remote := valueof(ts_PFCP_F_TEID_ipv4(ohc.teid, ohc.ipv4)); + var integer now := f_time(); for (var integer i := 0; i < lengthof(serq.create_URR_list); i := i + 1) { g_pars.pfcp_pars.urr_list[i] := valueof(ts_Session_URR(serq.create_URR_list[i].grouped_ie.urr_id, @@ -509,4 +554,90 @@ } } + +/********************************** + * GTP1U (UPF<->SMF), CP-FUNCTION + *********************************/ + +template (value) Gtp1uPeer ts_GtpPeerU(charstring ip) := { + connId := 1, + remName := ip, + remPort := GTP1U_PORT +} + +private function f_gtp1u_send(octetstring payload) runs on SMF_Session_CT { + var Gtp1uPeer peer := valueof(ts_GtpPeerU(f_inet_ntoa(g_pars.pfcp_pars.gtp1u_pars.core.remote.ipv4_address))); + GTP1U[0].send(ts_GTP1U_GPDU(peer, omit /*opt_part*/, g_pars.pfcp_pars.gtp1u_pars.core.remote.teid, payload)); +} + +/* Wait for ICMPv6 from GTP */ +private function f_gtp1u_wait_icmp6(template (present) PDU_ICMPv6 expected, + float t_timeout := 3.0) +runs on SMF_Session_CT { + var Gtp1uUnitdata ud; + timer T_default := t_timeout; + T_default.start; + alt { + [] GTP1U[0].receive(tr_GTPU_GPDU(ts_GtpPeerU(f_inet_ntoa(g_pars.pfcp_pars.gtp1u_pars.core.remote.ipv4_address)), ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, expected)) { + repeat; + } + /* We are waiting for RA */ + if (match(icmp6, tr_ICMPv6_RA(?))) { + for (var integer i := 0; i < lengthof(icmp6.routerAdvertisement.options); i := i + 1) { + var OptionField opt := icmp6.routerAdvertisement.options[i]; + if (ischosen(opt.prefixInformation)) { + log("SMF assigned IPv6 global prefix (len=", opt.prefixInformation.prefixLength, "): ", opt.prefixInformation.prefix, " -> ", + f_inet6_ntoa(opt.prefixInformation.prefix & '0000000000000000'O)); + /* Assume prefixLen will be multiple of 8, it's usually 64... */ + var OCT8 prefix := substr(opt.prefixInformation.prefix, 0, opt.prefixInformation.prefixLength / 8); + /* Pick second address in the prefix and use it as global IPv6 address: */ + g_ip6_addr := f_pad_oct(prefix, 16, '00'O); + g_ip6_addr[15] := '02'O; + log("Using IPv6 global address: ", g_ip6_addr, " -> ", f_inet6_ntoa(g_ip6_addr)); + setverdict(pass) + return; + } + } + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx ICMPv6 RA contain no Prefix Information option: ", icmp6)); + } + } + [] GTP1U[0].receive(tr_GTPU_GPDU(?, ?)) { repeat; } + [] GTP1U[0].receive { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Received unexpected GTPU while waiting for ICMPv6: ", expected)); + } + [] T_default.timeout { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Timeout waiting for ICMPv6: ", expected)); + } + } + T_default.stop; +} + +/* wait for GGSN to send us an ICMPv6 router advertisement */ +private function f_gtp1u_wait_rtr_adv(template integer mtu := *) runs on SMF_Session_CT { + var template (present) OptionField opt_prefix := tr_ICMP6_OptPrefix(?, 64); + var template (present) Options opts; + if (istemplatekind(mtu, "*")) { + opts := ( { opt_prefix }, { opt_prefix, tr_ICMP6_OptMTU(?) } ); + } else { + opts := { opt_prefix, tr_ICMP6_OptMTU(mtu) }; + } + f_gtp1u_wait_icmp6(tr_ICMPv6_RA(opts)); +} + +function f_gtp1u_perform_ipv6_slaac() runs on SMF_Session_CT +{ + f_gtp1u_send(f_gen_icmpv6_router_solicitation(g_ip6_addr)); + f_gtp1u_wait_rtr_adv(); +} + } diff --git a/smf/SMF_Session_CT_4G.ttcn b/smf/SMF_Session_CT_4G.ttcn index d041e19..8562db1 100644 --- a/smf/SMF_Session_CT_4G.ttcn +++ b/smf/SMF_Session_CT_4G.ttcn @@ -26,6 +26,7 @@ import from HTTP2_Adapter all; import from HTTP2_Server_Emulation all; +import from PFCP_Templates all; import from PFCP_Emulation all; import from Mutex all; @@ -51,9 +52,9 @@ f_diameter_expect_imsi(g_pars.imsi, idx := DIA_S6b); } - /* allocate + register TEI{C,D} on local side */ - g_pars.teic_local := f_gtp2_allocate_teic(); - g_pars.bearer.teid_local := f_gtp1u_allocate_teid(); + /* allocate + register TEIC on local side */ + f_gtp2_register_teic(g_pars.teic_local); + /* No need to register g_pars.bearer.teid_local since we don't expect to receive any GTP1U on it from IUT. */ } /* S6b emulation (AAA-Server) */ @@ -135,23 +136,6 @@ return (g_pars.rat_type == GTP2C_RAT_WLAN or g_pars.rat_type == GTP2C_RAT_Virtual); } -private function f_perform_ipv6_slaac() runs on SMF_Session_CT -{ - //var UECUPS_IPv6SLAACInd ipv6slaac_ind; - //var template (value) UECUPS_IPv6SLAAC ipv6slaac; - //ipv6slaac := ts_UECUPS_IPv6SLAAC( - // local_gtp_ep := ts_UECUPS_SockAddr(f_inet_addr(mp_local_hostname_u)), - // rx_teid := oct2int(g_pars.bearer.teid_local) - //); - //f_gtp1u_ipv6_slaac(ipv6slaac); - //GTP1U[0].receive(UECUPS_IPv6SLAACInd:?) -> value ipv6slaac_ind; - //log("5GC assigned IPv6 global prefix: ", ipv6slaac_ind.ipv6_prefix, " -> ", f_inet6_ntoa(ipv6slaac_ind.ipv6_prefix & '0000000000000000'O)); - - ///* Use the first global IPv6 address in the IPv6 prefix picked by osmo-uecups: */ - //g_ip6_addr := ipv6slaac_ind.ipv6_user_addr; - //log("Using IPv6 global address: ", g_ip6_addr); -} - /* process one to-be-created bearer context */ private function process_bctx_create(BearerContextGrouped bctx) runs on SMF_Session_CT { @@ -172,20 +156,40 @@ var FullyQualifiedTEID rx_fteid; rx_fteid := valueof(f_GTP2C_find_teid(bctx.bearerContextIEs.fullyQualifiedTEID, exp_fteid_if_type, exp_fteid_instance)); + if (not match(rx_fteid.tEID_GRE_Key, g_pars.pfcp_pars.gtp1u_pars.access.local.teid)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got IPv6 GTPv1U remote address ", rx_fteid.iPv4_Address, + " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)); + } g_pars.bearer.teid_remote := rx_fteid.tEID_GRE_Key; if (rx_fteid.v4_Flag == '1'B) { - g_gtpu4_remote := rx_fteid.iPv4_Address; + if (not match(rx_fteid.iPv4_Address, g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got IPv6 GTPv1U remote address ", rx_fteid.iPv4_Address, + " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)); + } } if (rx_fteid.v6_Flag == '1'B) { - g_gtpu6_remote := rx_fteid.iPv6_Address; + if (not match(rx_fteid.iPv6_Address, g_pars.pfcp_pars.gtp1u_pars.access.local.ipv6_address)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got IPv6 GTPv1U remote address ", rx_fteid.iPv6_Address, + " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.ipv6_address)); + } } - if (g_pars.pdn_type == GTP2C_PDN_IPv6 or - g_pars.pdn_type == GTP2C_PDN_IPv4v6) { - f_perform_ipv6_slaac(); + if (g_pars.pfcp_pars.pdn_type == c_PFCP_PDN_Type_IPv6 or + g_pars.pfcp_pars.pdn_type == c_PFCP_PDN_Type_IPv4v6) { + f_gtp1u_perform_ipv6_slaac(); } } +/* 3GPP TS 29.244 8.2.79 PDN Type -> 3GPP TS 29.274 8.34 PDN Type */ +private function f_pfcp_pdn_type_2_gtpv2c_pdn_type(INT3b pfcp_pdn_type) +return BIT3 { + /* Surprise surprise, they are the same, simply convert INT3b -> BIT3: */ + return int2bit(pfcp_pdn_type, 3); +} + /* create a session on the SMF */ private function f_create_session(template (value) FullyQualifiedTEID fteid_c_ie, template (value) FullyQualifiedTEID fteid_u_ie, @@ -209,7 +213,7 @@ rat_type := enum2int(g_pars.rat_type), sender_fteid := fteid_c_ie, apn := f_enc_dns_hostname(g_pars.apn), - pdn_type := int2bit(enum2int(g_pars.pdn_type), 3), + pdn_type := f_pfcp_pdn_type_2_gtpv2c_pdn_type(g_pars.pfcp_pars.pdn_type), teid_list := { fteid_u_ie }, chg_car := '0000'O, bearer_id := g_pars.bearer.ebi, diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index 1c9cf5a..cf68afc 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -202,8 +202,8 @@ private function f_init_gtp1u() runs on SMF_Test_CT { var Gtp1uEmulationCfg cfg := { - gtpu_bind_ip := omit, /* using gtpu daemon */ - gtpu_bind_port := omit, /* using gtpu daemon */ + gtpu_bind_ip := mp_pfcp_ip_local, + gtpu_bind_port := GTP1U_PORT, use_gtpu_daemon := false }; @@ -334,7 +334,7 @@ } } -/* create a session, then delete it again */ +/* create an IPv4 session, then delete it again */ private function f_TC_createSession_deleteSession() runs on SMF_Session_CT { f_s5s8_create_session(); f_delete_session(omit, Request_accepted); @@ -348,6 +348,26 @@ vc_conn.done; } +/* create an IPv6 session, then delete it again */ +testcase TC_createSession_deleteSession_ipv6() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(10, + pdn_type := c_PFCP_PDN_Type_IPv6); + f_init(); + vc_conn := f_start_handler(refers(f_TC_createSession_deleteSession), pars); + vc_conn.done; +} + +/* create an IPv4v6 session, then delete it again */ +testcase TC_createSession_deleteSession_ipv4v6() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(10, + pdn_type := c_PFCP_PDN_Type_IPv4v6); + f_init(); + vc_conn := f_start_handler(refers(f_TC_createSession_deleteSession), pars); + vc_conn.done; +} + /* send a DeleteSessionReq for an unknown/invalid TEID */ private function f_TC_deleteSession_unknown() runs on SMF_Session_CT { g_pars.teic_remote := f_rnd_octstring(4); @@ -520,6 +540,8 @@ control { execute( TC_tx_echo() ); execute( TC_createSession_deleteSession() ); + execute( TC_createSession_deleteSession_ipv6() ); + execute( TC_createSession_deleteSession_ipv4v6() ); execute( TC_deleteSession_unknown() ); execute( TC_gy_charging_cc_time() ); execute( TC_gy_ccr_update_rejected() ); diff --git a/smf/expected-results.xml b/smf/expected-results.xml index c8f6931..ed34c83 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -2,6 +2,8 @@ <testsuite name='Titan' tests='1' failures='0' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='SMF_Tests' name='TC_tx_echo' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_createSession_deleteSession' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_ipv6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_ipv4v6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_deleteSession_unknown' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_charging_cc_time' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_ccr_update_rejected' time='MASKED'/> diff --git a/smf/gen_links.sh b/smf/gen_links.sh index 8ab6063..061f69a 100755 --- a/smf/gen_links.sh +++ b/smf/gen_links.sh @@ -18,10 +18,6 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES -DIR=$BASEDIR/titan.ProtocolModules.ICMP/src -FILES="ICMP_EncDec.cc ICMP_Types.ttcn" -gen_links $DIR $FILES - DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES @@ -117,9 +113,10 @@ DIR=../library FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPCP_Types.ttcn IPCP_Templates.ttcn PAP_Types.ttcn " FILES+="GTPv1C_CodecPort.ttcn GTPv1C_CodecPort_CtrlFunct.ttcn GTPv1C_CodecPort_CtrlFunctDef.cc GTPv1C_Templates.ttcn Osmocom_Gb_Types.ttcn " -FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Emulation.ttcnpp " +FILES+="GTPv1U_CodecPort.ttcn GTPv1U_CodecPort_CtrlFunct.ttcn GTPv1U_CodecPort_CtrlFunctDef.cc GTPv1U_Templates.ttcn GTPv1U_Emulation.ttcnpp " FILES+="GTPv2_PrivateExtensions.ttcn GTPv2_Templates.ttcn " FILES+="GTPv2_CodecPort.ttcn GTPv2_CodecPort_CtrlFunctDef.cc GTPv2_CodecPort_CtrlFunct.ttcn GTPv2_Emulation.ttcn " +FILES+="ICMPv6_Templates.ttcn " FILES+="DNS_Helpers.ttcn " FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " FILES+="DIAMETER_Templates.ttcn DIAMETER_rfc4004_Templates.ttcn DIAMETER_rfc5447_Templates.ttcn DIAMETER_ts29_212_Templates.ttcn DIAMETER_ts29_212_Templates.ttcn DIAMETER_ts29_229_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn DIAMETER_ts29_273_Templates.ttcn DIAMETER_ts32_299_Templates.ttcn " diff --git a/smf/regen_makefile.sh b/smf/regen_makefile.sh index a648078..08a5b4a 100755 --- a/smf/regen_makefile.sh +++ b/smf/regen_makefile.sh @@ -16,7 +16,6 @@ GTPv2_CodecPort_CtrlFunctDef.cc HTTP2_EncDec.cc HTTP2_CodecPort_CtrlFunctDef.cc - ICMP_EncDec.cc ICMPv6_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43732?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic2fca0a7efad56ec9fc5e1bc2665f86626ead856 Gerrit-Change-Number: 43732 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: smf: Test concurrent 4G sessions
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43734?usp=email ) Change subject: smf: Test concurrent 4G sessions ...................................................................... smf: Test concurrent 4G sessions Mutex timeout needs to be increased because the mutual exclusion zone is really long (several transactions on Gx, Gy, etc.) and hence it takes a while for last sessions to be processed. Change-Id: I03c6d6ca5c20e004d6b259bf544df2ec357bf37e --- M smf/SMF_Session_CT_4G.ttcn M smf/SMF_Session_CT_5G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml 4 files changed, 36 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/smf/SMF_Session_CT_4G.ttcn b/smf/SMF_Session_CT_4G.ttcn index 8562db1..7789654 100644 --- a/smf/SMF_Session_CT_4G.ttcn +++ b/smf/SMF_Session_CT_4G.ttcn @@ -229,7 +229,7 @@ * so that the PFCPEM component cannot route them unambiguously. This is why we * need to ensure that only one ConnHdlr is triggering PFCP session establishment * at the given moment of time. */ - f_Mutex_lock(__BFILE__, __LINE__, Tval := 30.0); + f_Mutex_lock(__BFILE__, __LINE__, Tval := 60.0); /* Subscribe for PFCP Session Establishment Request PDU(s), which are * expected to have SEID set to 0, as per 3GPP TS 29.244, section 7.2.2.4.2. */ f_PFCPEM_subscribe_seid(c_SEID0); diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index 0f01549..0c47c1e 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -220,7 +220,7 @@ * so that the PFCPEM component cannot route them unambiguously. This is why we * need to ensure that only one ConnHdlr is triggering PFCP session establishment * at the given moment of time. */ - f_Mutex_lock(__BFILE__, __LINE__, Tval := 30.0); + f_Mutex_lock(__BFILE__, __LINE__, Tval := 60.0); /* Subscribe for PFCP Session Establishment Request PDU(s), which are * expected to have SEID set to 0, as per 3GPP TS 29.244, section 7.2.2.4.2. */ f_PFCPEM_subscribe_seid(c_SEID0); diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index cf68afc..5613abb 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -368,6 +368,34 @@ vc_conn.done; } +function f_TC_createSession_deleteSession_250(INT3b pdn_type) runs on SMF_Test_CT { + var SMF_Session_CT vc_conn[250]; + var integer i; + + f_init(guard_timeout := 90.0); + + for (i := 0; i < sizeof(vc_conn); i := i + 1) { + var SessionPars pars := f_SessionPars(idx := i, pdn_type := pdn_type); + vc_conn[i] := f_start_handler(refers(f_TC_createSession_deleteSession), pars); + } + + for (i := 0; i < sizeof(vc_conn); i := i + 1) { + vc_conn[i].done; + } +} + +testcase TC_createSession_deleteSession_250() runs on SMF_Test_CT { + f_TC_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4); +} + +testcase TC_createSession_deleteSession_250_ipv6() runs on SMF_Test_CT { + f_TC_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv6); +} + +testcase TC_createSession_deleteSession_250_ipv4v6() runs on SMF_Test_CT { + f_TC_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4v6); +} + /* send a DeleteSessionReq for an unknown/invalid TEID */ private function f_TC_deleteSession_unknown() runs on SMF_Session_CT { g_pars.teic_remote := f_rnd_octstring(4); @@ -542,6 +570,9 @@ execute( TC_createSession_deleteSession() ); execute( TC_createSession_deleteSession_ipv6() ); execute( TC_createSession_deleteSession_ipv4v6() ); + execute( TC_createSession_deleteSession_250() ); + execute( TC_createSession_deleteSession_250_ipv6() ); + execute( TC_createSession_deleteSession_250_ipv4v6() ); execute( TC_deleteSession_unknown() ); execute( TC_gy_charging_cc_time() ); execute( TC_gy_ccr_update_rejected() ); diff --git a/smf/expected-results.xml b/smf/expected-results.xml index ed34c83..a07c3a0 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -4,6 +4,9 @@ <testcase classname='SMF_Tests' name='TC_createSession_deleteSession' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_ipv6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_ipv4v6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250_ipv6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_createSession_deleteSession_250_ipv4v6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_deleteSession_unknown' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_charging_cc_time' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_gy_ccr_update_rejected' time='MASKED'/> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43734?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I03c6d6ca5c20e004d6b259bf544df2ec357bf37e Gerrit-Change-Number: 43734 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ngap: Introduce f_mw_PDUSessionResourceSetupRequestTransfer()
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43738?usp=email ) Change subject: ngap: Introduce f_mw_PDUSessionResourceSetupRequestTransfer() ...................................................................... ngap: Introduce f_mw_PDUSessionResourceSetupRequestTransfer() Similar to other functions already added to the file in the past. Change-Id: I1b21e873b3f0a377ad5064a5c32826e795a7dfe9 --- M library/ngap/NGAP_Templates.ttcn 1 file changed, 95 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/ngap/NGAP_Templates.ttcn b/library/ngap/NGAP_Templates.ttcn index 3fb0b6d..8a3e543 100644 --- a/library/ngap/NGAP_Templates.ttcn +++ b/library/ngap/NGAP_Templates.ttcn @@ -22743,6 +22743,101 @@ } } // End of template mw_pDUSessionResourceSetupRequestTransfer_id_MBSSessionSetupRequestList + + function f_mw_n2_PDUSessionResourceSetupRequestTransfer(template PDUSessionAggregateMaximumBitRate p_pDUSessionAggregateMaximumBitRate := omit, + template (present) UPTransportLayerInformation p_uPTransportLayerInformation := ?, + template UPTransportLayerInformationList p_uPTransportLayerInformationList := omit, + template DataForwardingNotPossible p_dataForwardingNotPossible := omit, + template (present) PDUSessionType p_pDUSessionType := ?, + template SecurityIndication p_securityIndication := omit, + template NetworkInstance p_networkInstance := omit, + template (present) QosFlowSetupRequestList p_qosFlowSetupRequestList := ?) + return template (present) PDUSessionResourceSetupRequestTransfer { + var template (present) PDUSessionResourceSetupRequestTransfer pdu := { + protocolIEs := {} + }; + var integer idx := lengthof(pdu.protocolIEs); + + /* PDUSessionAggregateMaximumBitRate */ + if (not istemplatekind(p_pDUSessionAggregateMaximumBitRate, "omit")) { + pdu.protocolIEs[idx] := { + id := id_PDUSessionAggregateMaximumBitRate, + criticality := reject, + value_ := { PDUSessionAggregateMaximumBitRate := p_pDUSessionAggregateMaximumBitRate } + }; + idx := idx + 1; + } + + /* UPTransportLayerInformation */ + pdu.protocolIEs[idx] := { + id := id_UL_NGU_UP_TNLInformation, + criticality := reject, + value_ := { UPTransportLayerInformation := p_uPTransportLayerInformation } + }; + idx := idx + 1; + + /* id-AdditionalUL-NGU-UP-TNLInformation */ + if (not istemplatekind(p_uPTransportLayerInformationList, "omit")) { + pdu.protocolIEs[idx] := { + id := id_AdditionalUL_NGU_UP_TNLInformation, + criticality := reject, + value_ := { UPTransportLayerInformationList := p_uPTransportLayerInformationList } + }; + idx := idx + 1; + } + + /* TODO: id-AdditionalUL-NGU-UP-TNLInformation */ + + /* DataForwardingNotPossible */ + if (not istemplatekind(p_dataForwardingNotPossible, "omit")) { + pdu.protocolIEs[idx] := { + id := id_DataForwardingNotPossible, + criticality := reject, + value_ := { DataForwardingNotPossible := p_dataForwardingNotPossible } + }; + idx := idx + 1; + } + + /* PDUSessionType */ + pdu.protocolIEs[idx] := { + id := id_PDUSessionType, + criticality := reject, + value_ := { PDUSessionType := p_pDUSessionType } + }; + idx := idx + 1; + + /* SecurityIndication */ + if (not istemplatekind(p_securityIndication, "omit")) { + pdu.protocolIEs[idx] := { + id := id_SecurityIndication, + criticality := reject, + value_ := { SecurityIndication := p_securityIndication } + }; + idx := idx + 1; + } + + /* NetworkInstance */ + if (not istemplatekind(p_networkInstance, "omit")) { + pdu.protocolIEs[idx] := { + id := id_NetworkInstance, + criticality := reject, + value_ := { NetworkInstance := p_networkInstance } + }; + idx := idx + 1; + } + + /* PDU Session Resource Setup Request List */ + pdu.protocolIEs[idx] := { + id := id_QosFlowSetupRequestList, + criticality := reject, + value_ := { QosFlowSetupRequestList := p_qosFlowSetupRequestList } + }; + idx := idx + 1; + + /* TODO: all IEs afterwards with criticality ignore. */ + return pdu; + } // End of function f_mw_PDUSessionResourceSetupRequestTransfer + template (present) PDUSessionResourceSetupResponseTransfer mw_pDUSessionResourceSetupResponseTransfer( template (present) QosFlowPerTNLInformation p_dLQosFlowPerTNLInformation := ?, template QosFlowPerTNLInformationList p_additionalDLQosFlowPerTNLInformation := *, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43738?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I1b21e873b3f0a377ad5064a5c32826e795a7dfe9 Gerrit-Change-Number: 43738 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: smf: Test 5GC IPv6 sessions
by pespin 30 Sep '26

30 Sep '26
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43739?usp=email ) Change subject: smf: Test 5GC IPv6 sessions ...................................................................... smf: Test 5GC IPv6 sessions Change-Id: If6a245870b03fda8979354aec1d9606c51141f4f --- M library/NG_NAS_Osmo_Templates.ttcn M smf/SMF_Session_CT.ttcn M smf/SMF_Session_CT_4G.ttcn M smf/SMF_Session_CT_5G.ttcn M smf/SMF_Tests.ttcn M smf/expected-results.xml 6 files changed, 212 insertions(+), 28 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/NG_NAS_Osmo_Templates.ttcn b/library/NG_NAS_Osmo_Templates.ttcn index 798fcfb..eabe221 100644 --- a/library/NG_NAS_Osmo_Templates.ttcn +++ b/library/NG_NAS_Osmo_Templates.ttcn @@ -166,6 +166,13 @@ }; /* 24.501 cl. 9.11.3.21 */ +template (present) DNN +cr_DNN_TLV(template (present) octetstring p_DNN) := +{ + iei := '25'O, + iel := ?, + dnnValue := p_DNN +}; template (value) DNN cs_DNN_TLV(template (value) octetstring p_DNN) := { @@ -236,6 +243,22 @@ maxDataRateDL := maxDataRateD }; +/* 24.501 cl. 9.11.4.10 */ +template (present) PDU_Address +cr_PDU_AddressTLV(template (present) B1_Type si16LLA := ?, + template (present) B3_Type typeValue := ?, + template octetstring adressInfo := *, + template octetstring ipv6Address := *) := +{ + iei := '29'O, + iel := ?, + spare := '0000'B, + si16LLA := si16LLA, + typeValue := typeValue, + adressInfo := adressInfo, + ipv6Address := ipv6Address +}; + /* 24.501 cl. 9.11.4.11 */ template (value) PDU_SessionType cs_PDU_SessionTypeTV(template (value) B3_Type p_Type) := @@ -245,6 +268,14 @@ typeValue := p_Type }; +template (value) PDU_SessionType +cs_PDU_SessionTypeV(template (value) B3_Type p_Type) := +{ + iei := omit, + spare := tsc_Spare1, + typeValue := p_Type +}; + /* 24.501 cl. 9.11.4.16 */ template (value) SSC_Mode cs_SSC_ModeTV(B3_Type p_SSCMode) := diff --git a/smf/SMF_Session_CT.ttcn b/smf/SMF_Session_CT.ttcn index 7b46f79..2eae5c8 100644 --- a/smf/SMF_Session_CT.ttcn +++ b/smf/SMF_Session_CT.ttcn @@ -184,7 +184,9 @@ }; type record SessionPars_Nudm { - charstring smf_subscription_id + charstring smf_subscription_id, + integer fiveqi, + integer prio_lvl }; type record SessionPars_NGNAS { @@ -280,7 +282,9 @@ smContextRef := omit }, nudm := { - smf_subscription_id := int2str(idx + 1) + smf_subscription_id := int2str(idx + 1), + fiveqi := 9, + prio_lvl := 8 }, nas := { pti := '00'O, diff --git a/smf/SMF_Session_CT_4G.ttcn b/smf/SMF_Session_CT_4G.ttcn index 7789654..9e84218 100644 --- a/smf/SMF_Session_CT_4G.ttcn +++ b/smf/SMF_Session_CT_4G.ttcn @@ -158,14 +158,14 @@ exp_fteid_if_type, exp_fteid_instance)); if (not match(rx_fteid.tEID_GRE_Key, g_pars.pfcp_pars.gtp1u_pars.access.local.teid)) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("Got IPv6 GTPv1U remote address ", rx_fteid.iPv4_Address, - " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)); + log2str("Got GTPv1U remote TEID ", rx_fteid.tEID_GRE_Key, + " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.teid)); } g_pars.bearer.teid_remote := rx_fteid.tEID_GRE_Key; if (rx_fteid.v4_Flag == '1'B) { if (not match(rx_fteid.iPv4_Address, g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)) { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("Got IPv6 GTPv1U remote address ", rx_fteid.iPv4_Address, + log2str("Got IPv4 GTPv1U remote address ", rx_fteid.iPv4_Address, " vs exp", g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address)); } } diff --git a/smf/SMF_Session_CT_5G.ttcn b/smf/SMF_Session_CT_5G.ttcn index 0c47c1e..0008235 100644 --- a/smf/SMF_Session_CT_5G.ttcn +++ b/smf/SMF_Session_CT_5G.ttcn @@ -4,6 +4,7 @@ import from Osmocom_Types all; import from Native_Functions all; import from Misc_Helpers all; +import from DNS_Helpers all; import from HTTP2_Types all; import from HTTP2_Templates all; @@ -30,11 +31,13 @@ import from NGAP_Templates all; import from NAS_CommonTypeDefs all; +import from NG_NAS_TypeDefs all; import from NG_NAS_MsgContainers all; import from NG_NAS_Osmo_Types all; import from NG_NAS_Osmo_Templates all; import from NG_NAS_Functions all; +import from PFCP_Templates all; import from PFCP_Emulation all; import from Mutex all; @@ -156,8 +159,6 @@ * 3GPP TS 29.502 6.1.3.2 */ function f_n11_create_session() runs on SMF_Session_CT { - var template (value) NG_NAS_UL_Message_Type nas_ul_msg; - var ProcedureTransactionIdentifier pti := f_next_pti(); var template (value) octetstring body; var integer http2_idx; var integer http2_stream_id := 3; @@ -184,11 +185,7 @@ var charstring boundary := "=-0EVVjxcWWFYNd1JXh1OQEg==" - nas_ul_msg := cs_NG_PDU_SESSION_ESTABLISHMENT_REQUEST(cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), pti, - p_IntegrityProtMaxDataRate := cs_IntegrityProtMaxDataRateV('FF'O, 'FF'O), - p_PDU_SessionType := cs_PDU_SessionTypeTV(c_PDU_SessionType_IPv4), - p_SSC_Mode := cs_SSC_ModeTV('001'B)); - var octetstring nas_enc := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); + var octetstring nas_enc := f_ng_nas_gen_session_establishment_request(); body := f_http2_encode_body_multipart_json_5gnas(sm_contexts_enc, nas_enc, boundary); http2_idx := f_http2_adapter_find_free_idx(); @@ -272,6 +269,11 @@ as_namf_comm_post_n1n2_messages(); f_n11_update_sm_context(); + + if (g_pars.pdn_type == c_PFCP_PDN_Type_IPv6 or + g_pars.pdn_type == c_PFCP_PDN_Type_IPv4v6) { + f_gtp1u_perform_ipv6_slaac(); + } setverdict(pass); } @@ -439,7 +441,6 @@ var N1N2MessageTransferReqData n1n2msg_req; var NGAP_IEs.PDUSessionResourceSetupRequestTransfer setup_req_transf; var template (value) N1N2MessageTransferRspData n1n2msg_rsp; - var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; var NG_NAS_DL_SM_Message_Type dl_nas; var template (value) HTTP2_Msg http2_tx; var octetstring body_enc; @@ -454,12 +455,7 @@ /* Decode 2nd part: NG-NAS: */ dl_nas := dec_NG_NAS_DL_SM_Message_Type(parts[1].data); - exp_rx_nas := cr_NG_PDU_SESSION_ESTABLISHMENT_ACCEPT(); - if (not match(dl_nas, exp_rx_nas)) { - Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("Rx unexpected DL NG-NAS: ", dl_nas, " vs exp ", exp_rx_nas)); - } - g_pars.nas.qos_rules := dl_nas.pdu_Session_Establishment_Accept.authorizedQoSRules.listofQoSRules; + f_ng_nas_handle_session_establishment_accept(dl_nas); /* Decode 3rd part: NGAP: */ setup_req_transf := dec_NGAP_PDUSessionResourceSetupRequestTransfer(parts[2].data); @@ -527,6 +523,15 @@ template (value) charstring subscr_id) := Nudm_uri_prefix & valueof(ts_Nudm_SDM_path_individual_subscription(imsi, subscr_id)); +/* 3GPP TS 29.244 8.2.79 PDN Type -> 3GPP TS 29.503 PduSessionType */ +private function f_pfcp_pdn_type_2_Nudm_SDM_pdu_session_type(INT3b pfcp_pdn_type) +return TS29503_Nudm_SDM.PduSessionType1_enum { + /* They are *mostly* the same, simply decrement one and convert INT3b -> PduSessionType1_enum: */ + var TS29503_Nudm_SDM.PduSessionType1_enum pe; + int2enum(pfcp_pdn_type - 1, pe); + return pe; +} + /* 3GPP TS 29.503 6.2.3.5.2.1 */ function f_tr_Nudm_UECM_put_IndividualSmfRegistration() runs on SMF_Session_CT return template (present) HTTP2_Msg { @@ -636,18 +641,19 @@ var template (value) DnnConfiguration1 dnn_cfg; var octetstring body_enc; var template (value) HTTP2_Msg http2_tx; + var TS29503_Nudm_SDM.PduSessionType1_enum pdu_sess_type := f_pfcp_pdn_type_2_Nudm_SDM_pdu_session_type(g_pars.pfcp_pars.pdn_type); - dnn_cfg := ts_DnnConfiguration1(pduSessionTypes := ts_PduSessionTypes1(defaultSessionType := ts_PduSessionType1(IPV4), - allowedSessionTypes := { ts_PduSessionType1(IPV4) }), + dnn_cfg := ts_DnnConfiguration1(pduSessionTypes := ts_PduSessionTypes1(defaultSessionType := ts_PduSessionType1(pdu_sess_type), + allowedSessionTypes := { ts_PduSessionType1(pdu_sess_type) }), sscModes := ts_SscModes1(defaultSscMode := ts_SscMode1(SSC_MODE_1), allowedSscModes := { ts_SscMode1(SSC_MODE_1), ts_SscMode1(SSC_MODE_2), ts_SscMode1(SSC_MODE_3)}), - fivegQosProfile := ts_SubscribedDefaultQos1(fiveqi := 9, - arp := ts_Arp(priorityLevel := ts_ArpPriorityLevel(8), + fivegQosProfile := ts_SubscribedDefaultQos1(fiveqi := g_pars.nudm.fiveqi, + arp := ts_Arp(priorityLevel := ts_ArpPriorityLevel(g_pars.nudm.prio_lvl), preemptCap := ts_PreemptionCapability(NOT_PREEMPT), preemptVuln := ts_PreemptionVulnerability(NOT_PREEMPTABLE)), - priorityLevel := 8), + priorityLevel := g_pars.nudm.prio_lvl), sessionAmbr := ts_Ambr1(uplink := "1000 Kbps", downlink := "1000 Kbps") ); @@ -873,9 +879,35 @@ * NGAP **************/ +/* 3GPP TS 29.244 8.2.79 PDN Type -> 3GPP TS 29.503 PduSessionType */ +private function f_pfcp_pdn_type_2_ngap_pdu_session_type(INT3b pfcp_pdn_type) +return NGAP_IEs.PDUSessionType { + /* They are *mostly* the same, simply decrement one and convert INT3b -> PduSessionType1_enum: */ + var NGAP_IEs.PDUSessionType pe; + int2enum(pfcp_pdn_type - 1, pe); + return pe; +} + /* Handle a PDUSessionResourceSetupRequestTransfer and return a Result */ private function f_ngap_pdu_handle_PDUSessionResourceSetupRequestTransfer(NGAP_IEs.PDUSessionResourceSetupRequestTransfer setup_req_transf) runs on SMF_Session_CT { + var template (present) QosFlowLevelQosParameters exp_qos; + var template (present) PDUSessionResourceSetupRequestTransfer exp; + + exp_qos := mw_qosFlowLevelQosParameters(p_qosCharacteristics := mw_qosCharacteristics_nonDynamic5QI(mw_nonDynamic5QIDescriptor(p_fiveQI := g_pars.nudm.fiveqi)), + p_allocationAndRetentionPriority := mw_allocationAndRetentionPriority(p_priorityLevelARP := g_pars.nudm.prio_lvl)); + + exp := f_mw_n2_PDUSessionResourceSetupRequestTransfer(p_pDUSessionAggregateMaximumBitRate := ?, + p_uPTransportLayerInformation := mw_uPTransportLayerInformation_gTPTunnel(mw_gTPTunnel(p_tla := oct2bit(g_pars.pfcp_pars.gtp1u_pars.access.local.ipv4_address), + p_gtp_teid := g_pars.pfcp_pars.gtp1u_pars.access.local.teid)), + p_pDUSessionType := f_pfcp_pdn_type_2_ngap_pdu_session_type(g_pars.pdn_type), + p_qosFlowSetupRequestList := { mw_qosFlowSetupRequestItem(p_qosFlowIdentifier := 1, + p_qosFlowLevelQosParameters := exp_qos) }) + if (not match(setup_req_transf, exp)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx unexpected DL NGAP: ", setup_req_transf, " vs exp ", exp)); + } + for (var integer i := 0; i < lengthof(setup_req_transf.protocolIEs); i := i + 1) { select (setup_req_transf.protocolIEs[i].id) { case (id_UL_NGU_UP_TNLInformation) { @@ -885,7 +917,6 @@ } case (id_QosFlowSetupRequestList) { var QosFlowSetupRequestList qos_req_li := setup_req_transf.protocolIEs[i].value_.QosFlowSetupRequestList; - /* TODO: validate received QoS */ } } } @@ -923,5 +954,79 @@ return g_pars.nas.pti; } +/* 3GPP TS 29.244 8.2.79 PDN Type -> 3GPP TS 24.501 9.11.4.11 PDU session type */ +private function f_pfcp_pdn_type_2_ng_nas_pdu_session_type(INT3b pfcp_pdn_type) +return BIT3 { + /* Surprise surprise, they are the same, simply convert INT3b -> BIT3: */ + return int2bit(pfcp_pdn_type, 3); +} + +private function f_ng_nas_gen_session_establishment_request() +runs on SMF_Session_CT return octetstring { + var BIT3 pdu_sess_type := f_pfcp_pdn_type_2_ng_nas_pdu_session_type(g_pars.pfcp_pars.pdn_type); + var ProcedureTransactionIdentifier pti := f_next_pti(); + var template (value) NG_NAS_UL_Message_Type nas_ul_msg; + var octetstring nas_enc; + + nas_ul_msg := cs_NG_PDU_SESSION_ESTABLISHMENT_REQUEST(cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), + pti, + p_IntegrityProtMaxDataRate := cs_IntegrityProtMaxDataRateV('FF'O, 'FF'O), + p_PDU_SessionType := cs_PDU_SessionTypeTV(pdu_sess_type), + p_SSC_Mode := cs_SSC_ModeTV('001'B)); + nas_enc := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); + return nas_enc; +} + +private function f_ng_nas_handle_session_establishment_accept(NG_NAS_DL_SM_Message_Type dl_nas) +runs on SMF_Session_CT { + var template (present) NG_NAS_DL_SM_Message_Type exp_rx_nas; + var BIT3 pdu_sess_type := f_pfcp_pdn_type_2_ng_nas_pdu_session_type(g_pars.pfcp_pars.pdn_type); + + exp_rx_nas := cr_NG_PDU_SESSION_ESTABLISHMENT_ACCEPT(p_PDU_SessionId := cs_NG_PDU_SessionIdV(int2oct(g_pars.namf.pdu_sess_id, 1)), + p_PDU_SessionType := cs_PDU_SessionTypeV(pdu_sess_type), + p_QoS_Rules := ?, + p_PDU_Address := cr_PDU_AddressTLV(typeValue := pdu_sess_type, + adressInfo := ?), + p_DNN := cr_DNN_TLV(f_enc_dns_hostname(g_pars.apn))); + if (not match(dl_nas, exp_rx_nas)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx unexpected DL NG-NAS: ", dl_nas, " vs exp ", exp_rx_nas)); + } + g_pars.nas.qos_rules := dl_nas.pdu_Session_Establishment_Accept.authorizedQoSRules.listofQoSRules; + + var PDU_Address paddr := dl_nas.pdu_Session_Establishment_Accept.pduAddress; + select (g_pars.pfcp_pars.pdn_type) { + case (c_PFCP_PDN_Type_IPv4) { + if (not match(paddr, cr_PDU_AddressTLV('0'B, pdu_sess_type, ? length (4), omit))) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got unexpected IPv4 UE addr", paddr)); + } + g_ip4_addr := paddr.adressInfo; + log("SMF assigned UE IPv4 address: ", f_inet_ntoa(g_ip4_addr)); + } + case (c_PFCP_PDN_Type_IPv6) { + if (not match(paddr, cr_PDU_AddressTLV(?, pdu_sess_type, ? length (8), *))) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got unexpected IPv6 UE addr", paddr)); + } + g_ip6_interface_id := paddr.adressInfo; + log("SMF assigned IPv6 Interface Id: ", g_ip6_interface_id); + g_ip6_addr := 'FE80000000000000'O & g_ip6_interface_id; + log("SMF assigned IPv6 link-local Address: ", f_inet6_ntoa(g_ip6_addr)); + } + case (c_PFCP_PDN_Type_IPv4v6) { + if (not match(paddr, cr_PDU_AddressTLV(?, pdu_sess_type, ? length (12), *))) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Got unexpected IPv4v6 UE addr", paddr)); + } + g_ip6_interface_id := substr(paddr.adressInfo, 0, 8); + log("SMF assigned IPv6 Interface Id: ", g_ip6_interface_id); + g_ip6_addr := 'FE80000000000000'O & g_ip6_interface_id; + log("SMF assigned IPv6 link-local Address: ", f_inet6_ntoa(g_ip6_addr)); + g_ip4_addr := substr(paddr.adressInfo, 8 , 4); + log("SMF assigned UE IPv4 address: ", f_inet_ntoa(g_ip4_addr)); + } + } +} } diff --git a/smf/SMF_Tests.ttcn b/smf/SMF_Tests.ttcn index 5613abb..609756a 100644 --- a/smf/SMF_Tests.ttcn +++ b/smf/SMF_Tests.ttcn @@ -535,6 +535,7 @@ vc_conn.done; } +/* create an IPv4 session from 5G AMF, then delete it again */ private function f_TC_n11_createSession_deleteSession() runs on SMF_Session_CT { f_n11_init(); f_n11_create_session(); @@ -543,20 +544,43 @@ } testcase TC_n11_createSession_deleteSession() runs on SMF_Test_CT { var SMF_Session_CT vc_conn; - var SessionPars pars := f_SessionPars(6, rat_type := GTP2C_RAT_NR); + var SessionPars pars := f_SessionPars(6, + rat_type := GTP2C_RAT_NR); f_init(); vc_conn := f_start_handler(refers(f_TC_n11_createSession_deleteSession), pars); vc_conn.done; } -testcase TC_n11_createSession_deleteSession_250() runs on SMF_Test_CT { +/* create an IPv6 session from 5G AMF, then delete it again */ +testcase TC_n11_createSession_deleteSession_ipv6() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(7, + rat_type := GTP2C_RAT_NR, + pdn_type := c_PFCP_PDN_Type_IPv6); + f_init(); + vc_conn := f_start_handler(refers(f_TC_n11_createSession_deleteSession), pars); + vc_conn.done; +} + +/* create an IPv4v6 session from 5G AMF, then delete it again */ +testcase TC_n11_createSession_deleteSession_ipv4v6() runs on SMF_Test_CT { + var SMF_Session_CT vc_conn; + var SessionPars pars := f_SessionPars(8, + rat_type := GTP2C_RAT_NR, + pdn_type := c_PFCP_PDN_Type_IPv4v6); + f_init(); + vc_conn := f_start_handler(refers(f_TC_n11_createSession_deleteSession), pars); + vc_conn.done; +} + +function f_TC_n11_createSession_deleteSession_250(INT3b pdn_type) runs on SMF_Test_CT { var SMF_Session_CT vc_conn[250]; var integer i; f_init(); for (i := 0; i < sizeof(vc_conn); i := i + 1) { - var SessionPars pars := f_SessionPars(idx := i); + var SessionPars pars := f_SessionPars(idx := i, pdn_type := pdn_type); vc_conn[i] := f_start_handler(refers(f_TC_n11_createSession_deleteSession), pars); } @@ -565,6 +589,18 @@ } } +testcase TC_n11_createSession_deleteSession_250() runs on SMF_Test_CT { + f_TC_n11_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4); +} + +testcase TC_n11_createSession_deleteSession_250_ipv6() runs on SMF_Test_CT { + f_TC_n11_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv6); +} + +testcase TC_n11_createSession_deleteSession_250_ipv4v6() runs on SMF_Test_CT { + f_TC_n11_createSession_deleteSession_250(c_PFCP_PDN_Type_IPv4v6); +} + control { execute( TC_tx_echo() ); execute( TC_createSession_deleteSession() ); @@ -580,8 +616,12 @@ execute( TC_s2b_createSession_v4_apco() ); execute( TC_n11_createSession_deleteSession() ); + execute( TC_n11_createSession_deleteSession_ipv6() ); + execute( TC_n11_createSession_deleteSession_ipv4v6() ); execute( TC_n11_createSession_deleteSession_250() ); + execute( TC_n11_createSession_deleteSession_250_ipv6() ); + execute( TC_n11_createSession_deleteSession_250_ipv4v6() ); } diff --git a/smf/expected-results.xml b/smf/expected-results.xml index a07c3a0..b610ee8 100644 --- a/smf/expected-results.xml +++ b/smf/expected-results.xml @@ -13,5 +13,9 @@ <testcase classname='SMF_Tests' name='TC_s2b_createSession_v4_noapco' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_s2b_createSession_v4_apco' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_ipv6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_ipv4v6' time='MASKED'/> <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv6' time='MASKED'/> + <testcase classname='SMF_Tests' name='TC_n11_createSession_deleteSession_250_ipv4v6' time='MASKED'/> </testsuite> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43739?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If6a245870b03fda8979354aec1d9606c51141f4f Gerrit-Change-Number: 43739 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: smf: Test 5GC IPv6 sessions
by pespin 30 Sep '26

30 Sep '26
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43739?usp=email ) Change subject: smf: Test 5GC IPv6 sessions ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43739?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If6a245870b03fda8979354aec1d9606c51141f4f Gerrit-Change-Number: 43739 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 30 Sep 2026 08:21:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ngap: Introduce f_mw_PDUSessionResourceSetupRequestTransfer()
by pespin 30 Sep '26

30 Sep '26
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43738?usp=email ) Change subject: ngap: Introduce f_mw_PDUSessionResourceSetupRequestTransfer() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43738?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I1b21e873b3f0a377ad5064a5c32826e795a7dfe9 Gerrit-Change-Number: 43738 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 30 Sep 2026 08:21:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: smf: Test concurrent 4G sessions
by pespin 30 Sep '26

30 Sep '26
Attention is currently required from: fixeria. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43734?usp=email ) Change subject: smf: Test concurrent 4G sessions ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43734?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I03c6d6ca5c20e004d6b259bf544df2ec357bf37e Gerrit-Change-Number: 43734 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 30 Sep 2026 08:21:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • ...
  • 190
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.