Skip to main content
. 2024 Feb 26;24(5):1515. doi: 10.3390/s24051515
Algorithm 1: Message Verification Process
Input: Lv, Le
Output: LC(IV), Rp, Tf
Process:
  1. Received EM from IV

  2. Extract Lv and Le

  3. If Lv! = Le then:

      Set Rp (IV)− = 1, Set flag = 0, Discard the message, Exit.

  4. Issue LC(IV)

  5. Create NBV_LIST

  6. Send EM to NBV_LIST for confirmation

  7. Set Rc, Cr, Fr, T = 0

  8. Start T

  9. Create two empty lists CRV_LIST FRV_LIST

  10. Repeat while (Rc < Tv or T < Dt)
    1. Received VM from VN, and set Rc ++
    2. If VM is True then:
      set Cr ++, and append VN to CRV_LIST
    3. else:
      set Fr ++, and append VN to FRV_LIST
  11. if T = Dt then:

      Set flag = 0, and Discard the message and Exit.

  12. if Cr > Fr then:
    1. set CEP (IV) = 1, set Cm (IV) ++ and set flag = 1
    2. for all VN in CRV_LIST
      set CEP (VN) = 0.25 and set Cm (VN) ++
    3. for all VN in FRV_LIST:
      set CEP (VN) = −0.25 and set Fm(VN) ++
  13. if Cr > Fr then:
    1. set CEP (IV) = −1, set Fm (IV) ++, and set flag = 0
    2. for all VN in CRV_LIST:
    3. set CEP (VN) = −0.25 and set Fm (VN) ++
    4. for all VN in FRV_LIST:
    5. set CEP (VN) = 0.25 and set Cm (VN) ++
  14. else:
    1. set T = 0 and repeat steps 10–13
  15. Update the value of Rp and Tf for IV and all VN.

  16. Return flag