Commit 24f6321c authored by garciay's avatar garciay
Browse files

Terminate Packect Fragmentation for CPE role

parent 9d2eb8a8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -20,4 +20,6 @@ module Ats6RD_Pics {
     */
    modulepar boolean PICS_PORT_RANGE := false;
    
    modulepar boolean PICS_ICMP_ECHO_REQUEST := false;
    
} // End of module Ats6RD_Pics
 No newline at end of file
+14 −7
Original line number Diff line number Diff line
@@ -15,7 +15,10 @@ module Ats6RD_Pixits {
    // Ats6RD
    import from Ats6RD_TypesAndValues all;
    
    group equipmentsSettings {
    /**
     * @desc Define settings for 6RD equipments (CPE and BR)
     */
//    group equipmentsSettings {
        
        /**
         * @desc Indicates the IPv4 address of the CPE equipment
@@ -33,7 +36,12 @@ module Ats6RD_Pixits {
        modulepar Ipv4Address PX_IPv4_ANYCAST_ADDRESS := c_4ZeroBytes;
        
        /**
         * @desc The MSS value.
         * @desc The 6RD-MTU size.
         */
        modulepar UInt PX_6RD_MRD_MTU_SIZE := 1500;
        
        /**
         * @desc The MSS size.
         */
        modulepar UInt PX_6RD_MSS_SIZE := 1500;
        
@@ -57,12 +65,12 @@ module Ats6RD_Pixits {
         */
        modulepar UInt16 PX_IUT_PORT_RANGE := 3000;
        
    } // End of group equipmentsSettings
//    } // End of group equipmentsSettings
    
    /**
     * @desc Define settings for customers equipment behind the CPE
     */
    group customersEquipmentSettings {
//    group customersEquipmentSettings {
        
        /**
         * @desc Defines a list of IPv6 host services with a segment size greater than the IUT MSS value
@@ -137,8 +145,7 @@ module Ats6RD_Pixits {
        } // End of modulepar PX_MSSC_HOST_V6_LIST_CPE
        
        /**
         * @desc Defines a list of IPv6 in IPv4 host services
         * @see TC_6RD_CPE_MSSC_BV_001
         * @desc Defines a list of host services ti be used for IPv6 in IPv4
         */
        modulepar HostV6Descriptions PX_MULTIPLE_HOSTS_V6_IN_V4 := {
            {
@@ -153,6 +160,6 @@ module Ats6RD_Pixits {
            // TODO Could be extended 
        } // End of modulepar PX_MULTIPLE_HOSTS_V6_IN_V4
        
    } // End of group customersEquipmentSettings
//    } // End of group customersEquipmentSettings
    
} // End of module Ats6RD_Pixits
 No newline at end of file
+0 −11
Original line number Diff line number Diff line
@@ -39,17 +39,6 @@ module Ats6RD_Templates {
            }
        } // End of template mw_ipv4Packet_tcp
        
        // TODO To be removed
//        template (present) Ipv4Packet mw_ipv4Packet_http_fragment(
//            UInt8 p_protocol,
//            template (present) Ipv4Address p_src,
//            template (present) Ipv4Address p_dst
//        ) modifies mw_ipv4Hdr_protocol_fragment := {
//            ipv4Payload := {
//                rawPacket := ? // TODO To be refined
//            }
//        } // End of template mw_ipv4Packet_http
        
    } // End of group ipPackets 
    
} // End of module Ats6RD_Templates
 No newline at end of file
+121 −26
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ module Ats6RD_TestCases {
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_VerdictControl all;
    import from LibCommon_Sync all;
    import from LibCommon_Time all;
    
    // LibIPv6
    import from LibIpv6_Interface_TypesAndValues all;
@@ -79,6 +80,10 @@ module Ats6RD_TestCases {
                    // Local variables
                    
                    // Test control
                    if (not(PICS_ROLE_IS_CPE)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_ROLE_IS_CPE' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    vc_dhcpv4Component := DHCPv4Component.create(c_COMP_DHCPv4);
@@ -623,7 +628,7 @@ module Ats6RD_TestCases {
                 * @desc Check that the IUT reassembles an HTML IPv6 payload from the IPv4 packet downstream
                 * @verdict pass on success, inconc on timeout, fail otherwise
                 * <pre>        
                 * PICS Selection: PICS_HOST_IS_CPE_DEVICES 
                 * PICS Selection: PICS_ROLE_IS_CPE and PICS_ICMP_ECHO_REQUEST
                 * Initial conditions:
                 *  with {
                 *      the physical MTU (Phy-MTU) size being equal or greater than the 6RD IPv4 packet between all devices and, 
@@ -661,31 +666,55 @@ module Ats6RD_TestCases {
                testcase TC_6RD_CPE_PF_BV_002() runs on SixRDComponent system TestAdapter {
                    
                    // Local variables
                    var UInt v_noOfDataRequests := 3;
                    var integer v_hostNum := lengthof(PX_MULTIPLE_HOSTS_V6_IN_V4);  /** Expected number of IPv6 packets to be forwarded */
                    var HostBrDataMsgs v_hostBrDataMsgs;                            /** Expected of IPv6 packets to be forwarded */
                    var Ipv6Packet v_ipv6Packet;                                    /** IPv6 packets to be sent */
                    var integer v_host;                                             /** 'for' statement counter */
                    
                    // Test control
                    if (not(PICS_ROLE_IS_CPE)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_ROLE_IS_CPE' required for executing the TC ***");
                    if (not(PICS_ROLE_IS_CPE) or not(PICS_ICMP_ECHO_REQUEST)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_ROLE_IS_CPE and PICS_ICMP_ECHO_REQUEST' required for executing the TC ***");
                        stop;
                    }
                    
                    // Test component configuration
                    vc_brComponent := BRComponent.create(c_COMP_AFTR);
                    vc_hostHttpComponents[0] := HostHTTPComponent.create(c_COMP_HTTP);
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_hostComponents[v_host] := HostComponent.create(c_COMP_HOST & int2str(v_host));
                    } // End of 'for' statement 
                    f_cf01Up_cpe();
                    
                    // Test adapter configuration
                    
                    // Start all components
                    vc_brComponent.start(f_TC_6RD_CPE_PF_BV_002_br());
                    
                    // TODO Use ICMP with a PIC_ICMP_ECHO_REQUEST
                    // Build the list of the IPv6packet to be sent
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        v_ipv6Packet := m_echoRequest_extHdr_data(
                            c_icmpHdr,
                            omit, 
                            PX_MULTIPLE_HOSTS_V6_IN_V4[v_host].srcAddress,
                            PX_MULTIPLE_HOSTS_V6_IN_V4[v_host].dstAddress,
                            c_defId,
                            c_defSeqNo,
                            bit2oct(
                                encvalue(
                                    m_tcp_packet(
                                        PX_MULTIPLE_HOSTS_V6_IN_V4[v_host].srcPort,
                                        PX_MULTIPLE_HOSTS_V6_IN_V4[v_host].dstPort,
                                        m_tcpRawPayload(int2oct(0, PX_6RD_MRD_MTU_SIZE))
                                    )
                                )
                            )
                        );
                        f_setExtensionHeaders(v_ipv6Packet);
                        v_hostBrDataMsgs[v_host].hostId := v_host;
                        v_hostBrDataMsgs[v_host].payload.ipv6Packet := v_ipv6Packet;
                    } // End of 'for' statement 
                    
//                    vc_hostHttpComponents[0].start(f_TC_6RD_CPE_PF_BV_002_host_http(
//                        PX_WEB_SERVER_IPv6,
//                        PX_HTTP_CLIENT_IPV6_ADDRESS,
//                        v_noOfDataRequests
//                    ));
                    // Start all components
                    vc_brComponent.start(f_TC_6RD_CPE_PF_BV_002_br(v_hostBrDataMsgs));
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_hostComponents[v_host].start(f_TC_6RD_CPE_MSSC_BV_001_host(v_hostBrDataMsgs[v_host]));
                    } // End of 'for' statement 
                    
                    // Test Body
                    // Clause 'when': Nothing to do 
@@ -701,9 +730,57 @@ module Ats6RD_TestCases {
                
                group f_TC_6RD_CPE_PF_BV_002 {
                    
                    function f_TC_6RD_CPE_PF_BV_002_br() runs on BRComponent {
                    function f_TC_6RD_CPE_PF_BV_002_br(in HostBrDataMsgs p_hostBrDataMsgs) runs on BRComponent {
                        
                        // Local variables
                        var integer v_hostNum := lengthof(p_hostBrDataMsgs);
                        var integer v_host;
                        var template(value) Ipv4Packet v_firstFragment;
                        var template(value) Ipv4Packet v_lastFragment;
                        
                        // Construct IPv4 fragments
                        f_finalyzeIpv4Packet(
                            m_ipv4Packet_df(
                                c_doNotFragFlag0,
                                PX_BR_GW_IPv4_ADDRESS,
                                PX_CPE_IPv4_ADDRESS,
                                m_tcp_packet(
                                    PX_ETS_PORT,
                                    PX_IUT_PORT,
                                    m_tcpHttpPayload(
                                        substr(
                                            p_hostBrDataMsgs.payload.ipv6Packet, 
                                            0, 
                                            PX_6RD_MRD_MTU_SIZE - 20 /* IP header length */
                                        )
                                    ),
                                    m_tcp_flags_syn
                                )
                            ),
                            v_firstFragment
                        );
                        v_firstFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag1;
                        f_finalyzeIpv4Packet(
                            m_ipv4Packet_df(
                                c_doNotFragFlag1,
                                PX_BR_GW_IPv4_ADDRESS,
                                PX_CPE_IPv4_ADDRESS,
                                m_tcp_packet(
                                    PX_ETS_PORT,
                                    PX_IUT_PORT,
                                    m_tcpHttpPayload(
                                        substr(
                                            p_hostBrDataMsgs.payload.ipv6Packet, 
                                            v_firstFragment.ipv4Hdr.fragmentOffset, 
                                            20 /* IP header length */
                                        )
                                    ),
                                    m_tcp_flags_syn
                                )
                            ),
                            v_lastFragment
                        );
                        v_lastFragment.ipv4Hdr.moreFragsFlag := c_moreFragsFlag0;
                        
                        // Preamble
                        // Clause 'Initial conditions'
@@ -712,8 +789,11 @@ module Ats6RD_TestCases {
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        // Clause when:
                        // TODO ipv4Port.send();
                        // Clause 'when': the IUT receives multiple HTML IPv4 packets...
                        ipv4Port.send(v_firstFragment); // First fragment
                        f_sleep(0.5);
                        ipv4Port.send(v_lastFragment); // Second fragment
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        
                        // Postamble
                        f_postamble_br();
@@ -722,7 +802,7 @@ module Ats6RD_TestCases {
                            
                    } // End of function f_TC_6RD_CPE_PF_BV_002_br
                    
                    function f_TC_6RD_CPE_PF_BV_002_host() runs on HostComponent {
                    function f_TC_6RD_CPE_PF_BV_002_host(in HostBrDataMsg p_host) runs on HostComponent {
                        
                        // Local variables
                        var Ipv6Packet v_ipv6Packet;
@@ -736,9 +816,24 @@ module Ats6RD_TestCases {
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        
                        // Test Body
                        // Clause 'when': the IUT receives multiple HTML IPv6 packets 
                        // TODO Use ICMP with a PIC_ICMP_ECHO_REQUEST
                        // Clause 'then': the IUT forwards correctly formatted IPv6
                        tc_ac.start;
                        alt {
                            [] ipPort.receive(                            // the IUT forwards correctly formatted IPv6
                                p_host.payload.ipv6Packet
                            ) {
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": PASS: The IUT forwards correctly formatted IPv6. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                            [] tc_ac.timeout {
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                                log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***");
                            }
                        } // End of 'altstep' statement
                        
                        
                        // Postamble
                        f_postamble_host();
@@ -828,7 +923,7 @@ module Ats6RD_TestCases {
                            c_tcpHdr,
                            PX_MSSC_HOST_V6_LIST_CPE[v_host].srcAddress,
                            PX_MSSC_HOST_V6_LIST_CPE[v_host].dstAddress,
                            omit, // TODO To be checked, perhaps an EctHdr is required
                            omit, 
                            bit2oct(
                                encvalue(
                                    m_tcp_packet(
@@ -1733,7 +1828,7 @@ module Ats6RD_TestCases {
                 * @desc Check that the IUT fragments an HTML IPv6 packet upstream
                 * @verdict pass on success, inconc on timeout, fail otherwise
                 * <pre>        
                 * PICS Selection: PICS_ROLE_IS_CPE 
                 * PICS Selection: PICS_ROLE_IS_BR and PICS_ICMP_ECHO_REQUEST
                 * Initial conditions:
                 *  with {
                 *      the physical MTU (Phy-MTU) size being equal or greater than the 6RD IPv4 packet between all devices and, 
@@ -1774,8 +1869,8 @@ module Ats6RD_TestCases {
                    var UInt v_noOfDataRequests := 1; // Only one HTTP request per host
                    
                    // Test control
                    if (not(PICS_ROLE_IS_CPE)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_ROLE_IS_CPE' required for executing the TC ***");
                    if (not(PICS_ROLE_IS_BR) or not(PICS_ICMP_ECHO_REQUEST)) {
                        log("*** " & __SCOPE__ & ": ERROR: 'PICS_ROLE_IS_CPE and PICS_ICMP_ECHO_REQUEST' required for executing the TC ***");
                        stop;
                    }
                    
@@ -1788,7 +1883,7 @@ module Ats6RD_TestCases {
                    
                    // Start all components
                    vc_brComponent.start(f_TC_6RD_BR_PF_BV_002_br(v_noOfDataRequests));
                    // TODO Use ICMP with a PIC_ICMP_ECHO_REQUEST
                    // TODO Use ICMP with a PICS_ICMP_ECHO_REQUEST
                    
                    // Test Body
                    // Clause 'when': Nothing to do 
@@ -1851,7 +1946,7 @@ module Ats6RD_TestCases {
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
                        // Test Body
                        // TODO Use ICMP with a PIC_ICMP_ECHO_REQUEST
                        // TODO Use ICMP with a PICS_ICMP_ECHO_REQUEST
                        
                        // Postamble
                        f_postamble_host();