| Algorithm 2. the algorithm of a trust-based secure routing (TBSR) scheme |
|
INPUT: receive a packet // is the th hour of the th day; is the available energy at , // is the probability of marking at , is the probability of logging at , and 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 Do aggregate its member nodes’ data into a data packet using ID-based aggregate signature technology as Reference [58]; aggregate its member nodes’ abstract into an abstract using ID-based aggregate signature technology as Reference [58]; End for (2) Adopt the variable probability marking and logging stage 4: For each receive packet in node and is not sink Do Mark all received packets P with . // using Equation (41). End for 5: For each receive packet generated by last node Do Log the amount of notification in packet with . // using Equation (50); End for 6: Forward New packets to next hop node. |