Skip to main content
. 2021 Sep 11;21(18):6092. doi: 10.3390/s21186092
Algorithm 2: MBPCA
1: Node Vx receives an Emergency message from Vs;
2: if ForwarderAddress == ID(x)      //preferred forwarder
3:       if duplicate (MsgID)
4:           if CurTransHop < MsgHop;
5:               if wait to retransmission
6:                   Cancel retransmission procedure;
7:               end if
8:               if wait Ack || wait to forward
9:                   Cancel Ack timeout timer or forwarding;
10:             end if
11:         end if
12:     else if within the region of interest
13:         CurTransHop = MsgHop;
14:         Calculate the forwarding CW according to Equation (11);
15:         Choose preferred forwarder according to Equation (10);
16:         Start the MAC layer forwarding procedure and start the Ack timeout timer after send successfully;
17:     end if
18: else                //candidate forwarder
19:     if duplicate (MsgID)
20:          Follow the procedures in lines 4–11;
21:     else if within the region of interest
22:          CurTransHop = MsgHop;
23:          Calculate the forwarding CW according to Equations (12) and (13);
24:          Follow the procedures in lines 15–16;
25:     end if
26: end if
27: procedure AckTimeout()
28:     if enable retransmission && less than the limit of retransmission times
29:          Start the retransmission procedure;
30:     else
31:          Drop the packet;
32: end procedure