Skip to main content
. 2018 Mar 1;18(3):751. doi: 10.3390/s18030751
Algorithm 2. the algorithm of a trust-based secure routing (TBSR) scheme
INPUT: receive a packet
// ti,j(0j23) is the j th hour of the i th day; Ui,j is the available energy at ti,j,
// αi,j is the probability of marking at ti,j, βi,j is the probability of logging at ti,j, and h is the hop from the sink.
OUTPUT: Forward a new packet to next hop node
(1) aggregate signature stage
1: For each node Do
    running aggregator determining algorithm which is similar to cluster-head selection algorithm in Reference [59];
End for
 // now, nodes either belong to aggregators or belong to member nodes
2: For each member node Do
   send its data and node ID, data time to its aggregator
End for
3: For each aggregator node s0 Do
    s0 aggregate its member nodes’ data into a data packet D0
  using ID-based aggregate signature technology as Reference [58];
    s0 aggregate its member nodes’ abstract into an abstract A0
  using ID-based aggregate signature technology as Reference [58];
End for
(2) Adopt the variable probability marking and logging (αi,j,βi,j) stage
4: For each receive packet P in node nh and nh is not sink Do
    Mark all received packets P with αi,j.
   // αi,j using Equation (41).
End for
5: For each receive packet P1 generated by last node nh+1 Do
    Log the amount of notification in packet P1 with βi,j.
   // βi,j using Equation (50);
End for
6: Forward New packets P to next hop node.