Research Article
Fuzzy-Based Trust Prediction Model for Routing in WSNs
Algorithm 1
Algorithm for processing TREQ and TREP.
(a) Algorithm for transmitting TREQ message | Subject broadcasts the following TREQ message to its neighbors in its transmission range | | where S and T be the subject and target respectively. | Subject waits for recommendation messages until a predetermined time. | (b) Algorithm for processing the TREQ message | Neighbor receives the TREQ message broadcast by the subject | if (TReqId is new and not processed earlier) | checks its trust table for trust relationship with target | if ( is available in the transaction table) and (number of recent | transactions ≥) then | unicasts the TREP message to S | | else | discards the TREQ packet | end if | else | discards the TREQ packet | end if |
|