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))) ) ) };