Loading ttcn/Ats464XLat/Ats464XLat_Pixits.ttcn3 +5 −0 Original line number Diff line number Diff line Loading @@ -66,4 +66,9 @@ module Ats464XLat_Pixits { */ modulepar UInt PX_464XLAT_MSS_SIZE := 1500; /** * @desc The NAT64-Tunnel-MTU value. */ modulepar UInt PX_464XLAT_PLAT_MTU := 1500; } // End of module Ats464XLat_Pixits No newline at end of file ttcn/Ats464XLat/Ats464XLat_TestCases.ttcn3 +186 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,192 @@ module Ats464XLat_TestCases { group validBehaviour { /** * @desc Check that the IUT fragments an HTML IPv4 packet downstream * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT is properly provisioned * the interfaces are connected & functional * the physical MTU (Phy-MTU) size being equal or greater than the IPv4 or IPv6 packet between all devices * and the PLAT MTU being higher than the IPv4 packet * } * Expected behaviour: * ensure that { * when { * the IUT receives an HTML IPv4 packet from the internet * containing source address * indicating a private IPv4 address * containing the DF bit * indicating the value 0 * with a packet size greater than the PLAT-MTU * } * then { * the IUT fragments that packet before it encapsulates it in IPv6 during translation * and the IUT forwards correctly formatted fragmented packets to the LSN * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.6 464XLAT Technology Summary * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/464XLAT/PLAT-LSN/PF/VB/01 */ testcase TC_464XLAT_PLATLSN_PF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var integer v_index := 0; // Test control // Test component configuration vc_lsnComponents[v_index] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_index] := HostComponent.create(c_COMP_HOST); f_cf01Up_PLAT(); // Test adapter configuration // Test Body // Start all components f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_464XLAT_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_464XLAT_PLAT_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_464XLAT_PLATLSN_PF_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_464XLAT_PLATLSN_PF_BV_001_host(v_ipv4Packet, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].ip6Address)); f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_464XLAT_PLATLSN_PF_BV_001 group f_TC_464XLAT_PLATLSN_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_PLATLSN_PF_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables // Preamble // Clause 'Initial conditions' f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body ipv4Port.send(p_ipv4Packet); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_PLATLSN_PF_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_PLATLSN_PF_BV_001_host(Ipv4Packet p_ipv4Packet, Ipv6Address p_ipv6Address) runs on HostComponent { // Local variables var boolean v_firstReceived := false; var boolean v_lastReceived := false; var template(present) Ipv4Packet v_firstFragment; var template(present) Ipv4Packet v_lastFragment; // Preamble // Clause 'Initial conditions' f_preamble_host(); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': //construct encapsulated fragments v_firstFragment := p_ipv4Packet; v_firstFragment.ipv4Hdr.totalLength := PX_464XLAT_PLAT_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength); v_lastFragment := p_ipv4Packet; v_lastFragment.ipv4Hdr.totalLength := p_ipv4Packet.ipv4Hdr.headerLength + p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag0; v_lastFragment.ipv4Hdr.fragmentOffset := PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, v_lastFragment.ipv4Hdr.fragmentOffset, p_ipv4Packet.ipv4Hdr.headerLength); //receive encapsulated fragments tc_ac.start; alt { [v_firstReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); tc_ac.stop; v_firstReceived := true; if (v_lastReceived == false) { tc_ac.start; repeat; } } [v_lastReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); tc_ac.stop; v_lastReceived := true; if (v_firstReceived == false) { tc_ac.start; repeat; } } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***"); } } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); log("*** " & __SCOPE__ & ": PASS: IUT correctly forwarded fragmented packets. ***"); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_PLATLSN_PF_BV_001_host } // End of group f_TC_464XLAT_PLATLSN_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading Loading
ttcn/Ats464XLat/Ats464XLat_Pixits.ttcn3 +5 −0 Original line number Diff line number Diff line Loading @@ -66,4 +66,9 @@ module Ats464XLat_Pixits { */ modulepar UInt PX_464XLAT_MSS_SIZE := 1500; /** * @desc The NAT64-Tunnel-MTU value. */ modulepar UInt PX_464XLAT_PLAT_MTU := 1500; } // End of module Ats464XLat_Pixits No newline at end of file
ttcn/Ats464XLat/Ats464XLat_TestCases.ttcn3 +186 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,192 @@ module Ats464XLat_TestCases { group validBehaviour { /** * @desc Check that the IUT fragments an HTML IPv4 packet downstream * @verdict pass on success, inconc on timeout, fail otherwise * <pre> * PICS Selection: none * Initial conditions: * with { * the IUT is properly provisioned * the interfaces are connected & functional * the physical MTU (Phy-MTU) size being equal or greater than the IPv4 or IPv6 packet between all devices * and the PLAT MTU being higher than the IPv4 packet * } * Expected behaviour: * ensure that { * when { * the IUT receives an HTML IPv4 packet from the internet * containing source address * indicating a private IPv4 address * containing the DF bit * indicating the value 0 * with a packet size greater than the PLAT-MTU * } * then { * the IUT fragments that packet before it encapsulates it in IPv6 during translation * and the IUT forwards correctly formatted fragmented packets to the LSN * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.6 464XLAT Technology Summary * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/464XLAT/PLAT-LSN/PF/VB/01 */ testcase TC_464XLAT_PLATLSN_PF_BV_001() runs on FourSixFourXLatComponent system TestAdapter { // Local variables var Ipv4Packet v_ipv4Packet; /** IPv4 packets */ var integer v_index := 0; // Test control // Test component configuration vc_lsnComponents[v_index] := LSNComponent.create(c_COMP_LSN); vc_hostComponents[v_index] := HostComponent.create(c_COMP_HOST); f_cf01Up_PLAT(); // Test adapter configuration // Test Body // Start all components f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_464XLAT_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_464XLAT_PLAT_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_464XLAT_PLATLSN_PF_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_464XLAT_PLATLSN_PF_BV_001_host(v_ipv4Packet, PX_464XLAT_MAPPING_TABLE_1_TO_N.portInfos[v_index].ip6Address)); f_serverSyncNClientsAndStop(2, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); } // End of testcase TC_464XLAT_PLATLSN_PF_BV_001 group f_TC_464XLAT_PLATLSN_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_PLATLSN_PF_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent { // Local variables // Preamble // Clause 'Initial conditions' f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body ipv4Port.send(p_ipv4Packet); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); // Postamble f_postamble_lsn(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_PLATLSN_PF_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_464XLAT_PLATLSN_PF_BV_001_host(Ipv4Packet p_ipv4Packet, Ipv6Address p_ipv6Address) runs on HostComponent { // Local variables var boolean v_firstReceived := false; var boolean v_lastReceived := false; var template(present) Ipv4Packet v_firstFragment; var template(present) Ipv4Packet v_lastFragment; // Preamble // Clause 'Initial conditions' f_preamble_host(); f_selfOrClientSyncAndVerdict(c_prDone, e_success); log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': //construct encapsulated fragments v_firstFragment := p_ipv4Packet; v_firstFragment.ipv4Hdr.totalLength := PX_464XLAT_PLAT_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength); v_lastFragment := p_ipv4Packet; v_lastFragment.ipv4Hdr.totalLength := p_ipv4Packet.ipv4Hdr.headerLength + p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag0; v_lastFragment.ipv4Hdr.fragmentOffset := PX_464XLAT_PLAT_MTU - p_ipv4Packet.ipv4Hdr.headerLength; v_lastFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, v_lastFragment.ipv4Hdr.fragmentOffset, p_ipv4Packet.ipv4Hdr.headerLength); //receive encapsulated fragments tc_ac.start; alt { [v_firstReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, v_firstFragment // containing first fragment )) { log("*** " & __SCOPE__ & ": First fragmented packet received. ***"); tc_ac.stop; v_firstReceived := true; if (v_lastReceived == false) { tc_ac.start; repeat; } } [v_lastReceived==false] ipPort.receive( mdw_generalIpv6_extHdr_dst_ipv4Payload( c_ipv4Hdr, p_ipv6Address, ?, v_lastFragment // containing last fragment )) { log("*** " & __SCOPE__ & ": Last fragmented packet received. ***"); tc_ac.stop; v_lastReceived := true; if (v_firstReceived == false) { tc_ac.start; repeat; } } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in time. ***"); } } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); log("*** " & __SCOPE__ & ": PASS: IUT correctly forwarded fragmented packets. ***"); // Postamble f_postamble_host(); f_selfOrClientSyncAndVerdict(c_poDone, e_success); log("*** " & __SCOPE__ & ": INFO: Postamble done. ***"); } // End of function f_TC_464XLAT_PLATLSN_PF_BV_001_host } // End of group f_TC_464XLAT_PLATLSN_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading