Loading ttcn/AtsCommon/AtsCommon_Templates.ttcn3 +26 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,28 @@ module AtsCommon_Templates { } // End of group ipv4MessageTemplates group ipv6MessageTemplates { /** * @param p_nextHeader Next header identifier value to be used. * @param p_dst Binary IPv6 address associated with NUT. * @param p_extHdrList List of extension header in the packet. * * */ template (present) Ipv6Packet mdw_generalIpv6_extHdr_dst_ipv4Payload( in UInt8 p_nextHeader, in template (present) Ipv6Address p_dst, in template (present) ExtensionHeaderList p_extHdrList, in template (present) Ipv4Packet p_ipv4Payload ) modifies mw_generalIpv6_extHdr_dst := { ipv6Payload := { ipv4Packet := p_ipv4Payload } } // End of template mdw_generalIpv6_extHdr_dst_ipv4Payload } // End of group ipv6MessageTemplates group tcpMessageTemplates { group tcpDummySendTemplates { Loading Loading @@ -140,6 +162,10 @@ module AtsCommon_Templates { rawPayload := p_rawPayload } template (value) TcpPayload m_tcpHttpPayload(in template (value) octetstring p_httpPayload) := { httpPayload := p_httpPayload } } // End of group tcpDummySendTemplates group tcpMessagesDummyRecvTemplates { Loading ttcn/AtsDSlite/AtsDSLite_Templates.ttcn3 +0 −18 Original line number Diff line number Diff line Loading @@ -92,24 +92,6 @@ module AtsDSLite_Templates { group ipv6RecvMessages { /** * @param p_nextHeader Next header identifier value to be used. * @param p_dst Binary IPv6 address associated with NUT. * @param p_extHdrList List of extension header in the packet. * * */ template (present) Ipv6Packet mdw_generalIpv6_extHdr_dst_ipv4Payload( in UInt8 p_nextHeader, in template (present) Ipv6Address p_dst, in template (present) ExtensionHeaderList p_extHdrList, in template (present) Ipv4Packet p_ipv4Payload ) modifies mw_generalIpv6_extHdr_dst := { ipv6Payload := { ipv4Packet := p_ipv4Payload } } // End of template mdw_generalIpv6_extHdr_dst_ipv4Payload /** * @param p_nextHeader Next header identifier value to be used. * @param p_extHdrList List of extension header in the packet. Loading ttcn/AtsNAT64/AtsNat64_Pixits.ttcn3 +5 −0 Original line number Diff line number Diff line Loading @@ -109,4 +109,9 @@ module AtsNat64_Pixits { */ modulepar UInt PX_NAT64_MSS_SIZE := 1500; /** * @desc The NAT64-Tunnel-MTU value. */ modulepar UInt PX_NAT64_TUNNEL_MTU := 1500; } // End of module AtsNat64_Pixits No newline at end of file ttcn/AtsNAT64/AtsNat64_TestCases.ttcn3 +189 −3 Original line number Diff line number Diff line Loading @@ -1039,6 +1039,192 @@ module AtsNat64_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 NAT64 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 NAT64-Tunnel-MTU * } * then { * the IUT fragments the IPv4 packet before it encapsulates it in IPv6 * and the IUT forwards correctly formatted fragmented packets * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.4.6.20 LSN Fragmentation and Buffering * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/NAT64/LSN/PF/VB/01 */ testcase TC_NAT64_LSN_PF_BV_001() runs on Nat64Component 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(); // Test adapter configuration // Test Body // Start all components f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_NAT64_TUNNEL_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_NAT64_LSN_PF_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_NAT64_LSN_PF_BV_001_host(v_ipv4Packet, PX_NAT64_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_NAT64_LSN_PF_BV_001 group f_TC_NAT64_LSN_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_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_NAT64_LSN_PF_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_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_NAT64_TUNNEL_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_NAT64_TUNNEL_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_NAT64_TUNNEL_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] ipv6Port.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] ipv6Port.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_NAT64_LSN_PF_BV_001_host } // End of group f_TC_NAT64_LSN_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading Loading @@ -1096,11 +1282,11 @@ module AtsNat64_TestCases { m_ipv4Packet_df( 1, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_NAT64_MAPPING_TABLE_1_TO_1.mapInfos[0].ip4Address, PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_NAT64_MAPPING_TABLE_1_TO_1.etsPort, m_tcpRawPayload(int2oct(42, PX_NAT64_MSS_SIZE + 10)), PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[0].srcPort, m_tcpRawPayload(int2oct(42, PX_NAT64_MSS_SIZE)), m_tcp_flags_syn ) ), Loading Loading
ttcn/AtsCommon/AtsCommon_Templates.ttcn3 +26 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,28 @@ module AtsCommon_Templates { } // End of group ipv4MessageTemplates group ipv6MessageTemplates { /** * @param p_nextHeader Next header identifier value to be used. * @param p_dst Binary IPv6 address associated with NUT. * @param p_extHdrList List of extension header in the packet. * * */ template (present) Ipv6Packet mdw_generalIpv6_extHdr_dst_ipv4Payload( in UInt8 p_nextHeader, in template (present) Ipv6Address p_dst, in template (present) ExtensionHeaderList p_extHdrList, in template (present) Ipv4Packet p_ipv4Payload ) modifies mw_generalIpv6_extHdr_dst := { ipv6Payload := { ipv4Packet := p_ipv4Payload } } // End of template mdw_generalIpv6_extHdr_dst_ipv4Payload } // End of group ipv6MessageTemplates group tcpMessageTemplates { group tcpDummySendTemplates { Loading Loading @@ -140,6 +162,10 @@ module AtsCommon_Templates { rawPayload := p_rawPayload } template (value) TcpPayload m_tcpHttpPayload(in template (value) octetstring p_httpPayload) := { httpPayload := p_httpPayload } } // End of group tcpDummySendTemplates group tcpMessagesDummyRecvTemplates { Loading
ttcn/AtsDSlite/AtsDSLite_Templates.ttcn3 +0 −18 Original line number Diff line number Diff line Loading @@ -92,24 +92,6 @@ module AtsDSLite_Templates { group ipv6RecvMessages { /** * @param p_nextHeader Next header identifier value to be used. * @param p_dst Binary IPv6 address associated with NUT. * @param p_extHdrList List of extension header in the packet. * * */ template (present) Ipv6Packet mdw_generalIpv6_extHdr_dst_ipv4Payload( in UInt8 p_nextHeader, in template (present) Ipv6Address p_dst, in template (present) ExtensionHeaderList p_extHdrList, in template (present) Ipv4Packet p_ipv4Payload ) modifies mw_generalIpv6_extHdr_dst := { ipv6Payload := { ipv4Packet := p_ipv4Payload } } // End of template mdw_generalIpv6_extHdr_dst_ipv4Payload /** * @param p_nextHeader Next header identifier value to be used. * @param p_extHdrList List of extension header in the packet. Loading
ttcn/AtsNAT64/AtsNat64_Pixits.ttcn3 +5 −0 Original line number Diff line number Diff line Loading @@ -109,4 +109,9 @@ module AtsNat64_Pixits { */ modulepar UInt PX_NAT64_MSS_SIZE := 1500; /** * @desc The NAT64-Tunnel-MTU value. */ modulepar UInt PX_NAT64_TUNNEL_MTU := 1500; } // End of module AtsNat64_Pixits No newline at end of file
ttcn/AtsNAT64/AtsNat64_TestCases.ttcn3 +189 −3 Original line number Diff line number Diff line Loading @@ -1039,6 +1039,192 @@ module AtsNat64_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 NAT64 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 NAT64-Tunnel-MTU * } * then { * the IUT fragments the IPv4 packet before it encapsulates it in IPv6 * and the IUT forwards correctly formatted fragmented packets * } * } * </pre> * * @version 0.0.1 * @reference ETSI TS 101 569-1 Clause 6.4.6.20 LSN Fragmentation and Buffering * @see ETSI TS xxx xxx-x V0.0.1.5a-draft (2013-07) TP/NAT64/LSN/PF/VB/01 */ testcase TC_NAT64_LSN_PF_BV_001() runs on Nat64Component 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(); // Test adapter configuration // Test Body // Start all components f_finalyzeIpv4Packet( m_ipv4Packet_df( 0, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[v_index].srcPort, m_tcpHttpPayload(int2oct(42, PX_NAT64_TUNNEL_MTU)), m_tcp_flags_syn ) ), v_ipv4Packet ); vc_lsnComponents[v_index].start(f_TC_NAT64_LSN_PF_BV_001_lsn(v_ipv4Packet)); vc_hostComponents[v_index].start(f_TC_NAT64_LSN_PF_BV_001_host(v_ipv4Packet, PX_NAT64_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_NAT64_LSN_PF_BV_001 group f_TC_NAT64_LSN_PF_BV_001 { /** * @desc Simulates LSN side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_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_NAT64_LSN_PF_BV_001_lsn /** * @desc Simulates client side * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise */ function f_TC_NAT64_LSN_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_NAT64_TUNNEL_MTU; v_firstFragment.ipv4Hdr.hcs := ?; v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1; v_firstFragment.ipv4Payload.rawPacket := substr(p_ipv4Packet.ipv4Payload.rawPacket, 0, PX_NAT64_TUNNEL_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_NAT64_TUNNEL_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] ipv6Port.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] ipv6Port.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_NAT64_LSN_PF_BV_001_host } // End of group f_TC_NAT64_LSN_PF_BV_001 } // End of group validBehaviour } // End of group packetFragmentation Loading Loading @@ -1096,11 +1282,11 @@ module AtsNat64_TestCases { m_ipv4Packet_df( 1, PX_IPV4_DESTINATION_INFORMATION.iutAddress, PX_NAT64_MAPPING_TABLE_1_TO_1.mapInfos[0].ip4Address, PX_NAT64_MAPPING_TABLE_1_TO_N.ip4Address, m_tcp_packet( PX_IPV4_DESTINATION_INFORMATION.iutPort, PX_NAT64_MAPPING_TABLE_1_TO_1.etsPort, m_tcpRawPayload(int2oct(42, PX_NAT64_MSS_SIZE + 10)), PX_NAT64_MAPPING_TABLE_1_TO_N.portInfos[0].srcPort, m_tcpRawPayload(int2oct(42, PX_NAT64_MSS_SIZE)), m_tcp_flags_syn ) ), Loading