Text this: Mitigating malicious nodes using trust and reputation based model in wireless sensor networks