ItsGeoNetworking_TpFunctions.ttcn 718 KB
Newer Older
6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352
                    }
                }
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                
            } // end f_GEONW_PON_GNA_BV_02
            
        } // end geoGeoNetworkingAddress
        
        // 6.2.2.7
        group geoBeaconing {
            
            /**
             * @desc    TP Function for TC_GEONW_PON_BEA_TI_01
             */
            function f_GEONW_PON_BEA_TI_01() runs on ItsGeoNetworking {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                var boolean v_beaconReceived := false;
                timer t_minRetransTimer := f_getBsRetransmitTimer();
                timer t_maxRetransTimer := f_getBsRetransmitTimer() + f_getBsMaxJitter();
                
                // Test control
                if (not PICS_GN_BEACON_SRC) {
                    log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                 
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prDefault();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                
                t_maxRetransTimer.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(?)))) {
                        if (v_beaconReceived == false) {
                            v_beaconReceived := true;
                            t_minRetransTimer.start;
                            t_maxRetransTimer.start;
                            //after the first beacon received, check the retransmission
                            repeat;
                        }
                        if(t_minRetransTimer.running) {
                            log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too early) ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        else {
                            log("*** " & testcasename() & ": Beacon transmitted at prescribed periodicity ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    [] t_minRetransTimer.timeout {
                        log("*** " & testcasename() & ": Ready for retransmission ***");
                        repeat;
                    }
                    [] t_maxRetransTimer.timeout {
                        log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too late) ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                }
                f_acTriggerEvent(m_stopPassBeaconing);
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                
            } // end f_GEONW_PON_BEA_TI_01
            
            /**
             * @desc    TP Function for TC_GEONW_PON_BEA_TI_02
             */
            function f_GEONW_PON_BEA_TI_02() runs on ItsGeoNetworking {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                var boolean v_geoUnicastReceived := false;
                var boolean v_readyForRetransmission := false;
                timer t_minRetransTimer := f_getBsRetransmitTimer() - f_getDeltaTimer();
                timer t_maxRetransTimer := f_getBsRetransmitTimer() + f_getBsMaxJitter() + f_getDeltaTimer();
                
                // Test control
                if (not PICS_GN_BEACON_SRC) {
                    log("*** " & testcasename() & ": PICS_GN_BEACON_SRC required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateShbMessage) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwShbPacket))) {
                        tc_ac.stop;
                        t_minRetransTimer.start;
                        t_maxRetransTimer.start;
                        v_geoUnicastReceived := true;
                        repeat;
                    }
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket))) {
                        if(not(v_geoUnicastReceived)) {
                            repeat;
                        }
                        if(not(v_readyForRetransmission)) {
                            log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too early) ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        else {
                            log("*** " & testcasename() & ": Beacon transmitted at prescribed periodicity ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    [] t_minRetransTimer.timeout {
                        log("*** " & testcasename() & ": Ready for retransmission ***");
                        v_readyForRetransmission := true;
                        repeat;
                    }
                    [] t_maxRetransTimer.timeout {
                        log("*** " & testcasename() & ": Beacon not transmitted at prescribed periodicity (too late) ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": GUC not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                }
                f_acTriggerEvent(m_stopPassBeaconing);
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end f_GEONW_PON_BEA_TI_02
            
        } // end geoBeaconing
        
        // 6.2.2.8
        group geoGeoUnicast {
            
            /**
             * @desc    TP Function for TC_GEONW_PON_GUC_BV_01
             */
            function f_GEONW_PON_GUC_BV_01() runs on ItsGeoNetworking {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                
                // Test control
                if (not PICS_GN_GUC_SRC) {
                    log("*** " & testcasename() & ": PICS_GN_GUC_SRC required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                if ((f_getGeoUnicastForwardingAlgorithm() != e_greedy) and (f_getGeoUnicastForwardingAlgorithm() != e_unspecified)) {
                    log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == (e_greedy  or e_unspecified) required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)),
                                        ?
                                    )
                                )
                            )
                        ) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": DEPV of the received GUC message correctly set ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        ?,
                                        ?
                                    )
                                )
                            )
                        ) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": DEPV of the received GUC message incorrectly set ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end f_GEONW_PON_GUC_BV_01
            
            group GEONW_PON_GUC_BV_02 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_02
                 */
                function f_GEONW_PON_GUC_BV_02() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if ((f_getGeoUnicastForwardingAlgorithm() != e_greedy) and (f_getGeoUnicastForwardingAlgorithm() != e_unspecified)) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == (e_greedy  or e_unspecified) required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf04Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_02_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BV_02_nodeC());
                    v_nodeD.start(f_GEONW_PON_GUC_BV_02_nodeD());
                    
                    // Synchronization
                    f_serverSync3ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf04Down();
                    
                } // end f_GEONW_PON_GUC_BV_02
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_02)
                 */
                function f_GEONW_PON_GUC_BV_02_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_02_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_02)
                 */
                function f_GEONW_PON_GUC_BV_02_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(f_getPosition(c_compNodeA)),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_02_nodeC
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_GUC_BV_02)
                 */
                function f_GEONW_PON_GUC_BV_02_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_02_nodeD
                
            } // end GEONW_PON_GUC_BV_02
            
            group GEONW_PON_GUC_BV_03 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_03
                 */
                function f_GEONW_PON_GUC_BV_03() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_03_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BV_03_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_03
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_03)
                 */
                function f_GEONW_PON_GUC_BV_03_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    v_longPosVectorNodeA,
                                    f_longPosVector2ShortPosVector(f_getPosition(c_compIut)),
                                    vc_localSeqNumber
                                )
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithHl(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?,
                                        c_defaultHopLimit
                                    ),
                                    -,
                                    c_defaultHopLimit - 1
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        ?,
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: Fields not correctly updated ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_03_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_03)
                 */
                function f_GEONW_PON_GUC_BV_03_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_obsoleteLongPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    v_obsoleteLongPosVectorNodeA.timestamp_ := v_obsoleteLongPosVectorNodeA.timestamp_ - 1000;
                    v_obsoleteLongPosVectorNodeA.latitude := v_obsoleteLongPosVectorNodeA.latitude - 1;
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(v_obsoleteLongPosVectorNodeA),
                                    vc_localSeqNumber,
                                    c_defaultHopLimit
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_03_nodeC
                
            } // end GEONW_PON_GUC_BV_03
            
            group GEONW_PON_GUC_BO_04 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BO_04
                 */
                function f_GEONW_PON_GUC_BO_04() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BO_04_nodeB());
                    v_nodeC.start(f_GEONW_PON_GUC_BO_04_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BO_04
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BO_04)
                 */
                function f_GEONW_PON_GUC_BO_04_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    ),
                                    -,
                                    ?
                                )
                            )
                        ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Forwarded GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                         
                } // end f_GEONW_PON_GUC_BO_04_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BO_04)
                 */
                function f_GEONW_PON_GUC_BO_04_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(v_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                1
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BO_04_nodeC
                
            } // end GEONW_PON_GUC_BO_04
            
            /**
             * @desc    TP Function for TC_GEONW_PON_GUC_BV_05
             */
            function f_GEONW_PON_GUC_BV_05() runs on ItsGeoNetworking {
                
                // Local variables
                var template (value) GeoNetworkingPdu v_gnPacket;
                var integer i;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not PICS_GN_GUC_DST) {
                    log("*** " & testcasename() & ": PICS_GN_GUC_DST required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prDefault();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                v_gnPacket := m_geoNwPdu(
                                  m_geoNwUnicastPacket(
                                      f_getPosition(c_compNodeB),
                                      f_getIutShortPosVector(),
                                      vc_localSeqNumber
                                  )
                              );
                f_sendGeoNetMessage(m_geoNwReq_withLinkLayerDestination(v_gnPacket, -, f_getIutMacAddress()));
                
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
                for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                    // empty on purpose 
                }
                if(i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                }
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                
            } // end f_GEONW_PON_GUC_BV_05
            
            group GEONW_PON_GUC_BV_06 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_06
                 */
                function f_GEONW_PON_GUC_BV_06() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var float v_distance := int2float(f_getCbfMaxCommunicationRange() - 10);
                    var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoUnicastForwardingAlgorithm() != e_cbf) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    // re-compute NodeA's position.
                    v_longPosVectorIut := f_getIutLongPosVector();
                    v_longPosVectorNodeA := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 0);
                    v_longPosVectorNodeA.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_06_nodeB(v_distance, v_longPosVectorNodeA));
                    v_nodeC.start(f_GEONW_PON_GUC_BV_06_nodeC(v_longPosVectorNodeA));
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_06
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_06)
                 * @param   p_distanceToNodeA       Distance between IUT and NodeA
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_06_nodeB(in float p_distanceToNodeA, in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    timer t_toCbf := (int2float(f_getGeoUnicastCbfMaxTime())
                        + (
                            int2float(f_getGeoUnicastCbfMinTime() - f_getGeoUnicastCbfMaxTime())
                            / int2float(f_getCbfMaxCommunicationRange())
                        ) * p_distanceToNodeA) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    log("*** " & testcasename() & ": INFO: Message sent ***");
                    f_selfOrClientSyncAndVerdict(c_msgSent, e_success);
                    
                    tc_ac.start;
                    t_toCbf.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            if(t_toCbf.running) {
                                t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: Forwarded GUC received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_06_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_06)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_06_nodeC(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),
                                    f_longPosVector2ShortPosVector(p_longPosVectorNodeA),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    log("*** " & testcasename() & ": INFO: Message sent ***");
                    f_selfOrClientSyncAndVerdict(c_msgSent, e_success);
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Re-broadcasted GUC received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_06_nodeC
                
            } // end GEONW_PON_GUC_BV_06
            
            group GEONW_PON_GUC_BV_07 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GUC_BV_07
                 */
                function f_GEONW_PON_GUC_BV_07() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var float v_distance := int2float(f_getCbfMaxCommunicationRange() * 2);
                    var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA;
                    
                    // Test control
                    if (not PICS_GN_GUC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GUC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoUnicastForwardingAlgorithm() != e_cbf) {
                        log("*** " & testcasename() & ": PICS_GN_GEOUNICAST_FORWARDING_ALGORITHM == e_cbf required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf03Up();
                    // re-compute NodeA's position.
                    v_longPosVectorIut := f_getIutLongPosVector();
                    v_longPosVectorNodeA := f_computePositionUsingDistance(v_longPosVectorIut, v_distance, 0);
                    v_longPosVectorNodeA.gnAddr := f_getTsGnLocalAddress(c_compNodeA);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_GUC_BV_07_nodeB(v_longPosVectorNodeA));
                    v_nodeC.start(f_GEONW_PON_GUC_BV_07_nodeC(v_longPosVectorNodeA));
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_msgSent, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end f_GEONW_PON_GUC_BV_07
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GUC_BV_07)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_07_nodeB(in LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    timer t_toCbf := int2float(f_getGeoUnicastCbfMinTime()) / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    log("*** " & testcasename() & ": INFO: Message sent ***");
                    f_selfOrClientSyncAndVerdict(c_msgSent, e_success);
                    
                    tc_ac.start;
                    t_toCbf.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(p_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            )
                        ) {
                            tc_ac.stop;
                            if(t_toCbf.running) {
                            	t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: IUT re-broadcasted the packet too early ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: Forwarded GUC received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: Ready for receiving re-broadcasting ***");
                            repeat;
                        }
                        
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GUC was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GUC_BV_07_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_GUC_BV_07)
                 * @param   p_longPosVectorNodeA    Position vector of NodeA
                 */
                function f_GEONW_PON_GUC_BV_07_nodeC(LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    f_getPosition(c_compNodeC),