Research Article
EEHRT: Energy Efficient Technique for Handling Redundant Traffic in Zone-Based Routing for Wireless Sensor Networks
Algorithm 1
Pseudocode for EEHRT routing strategy.
Begin | |
Set MsgSeqNo ← 0 | |
Set SzoneID ← -1 | |
Set SMsgType ← -1 | |
For each node’s Schedule MSG | |
Set MsgType ← 0 | |
If Msg ← OwnMsg then | |
Set MsgType ← 1 | |
Waits for a guard time // After the guard time expires or when the channel becomes free, then | |
Waits for a random listening time // Wait for time before the actual transmission | |
BroadCast Msg | |
Add zoneID, MsgSeqNo and MsgType into buffer | |
End if | |
If MsgType ← 1 or 2 and Node ← BS then | |
Set RecvPCKT ← RecvPCKT + 1 | |
Drop Msg | |
Else | |
If MsgScheduled == RcvMsgSeqNo then | |
If Recv_zoneID < SzoneID and MsgType > = SMsgtype //SMsgType is the buffered value of MsgType | |
and SzoneID is buffered/stored zoneID | |
Set SeqNo ← MsgRcvSeqNo | |
Set zoneID ← SzoneID | |
Set MsgType ← 3 | |
BroadCast Beacon//Broadcast Beacon message | |
CANCEL Event | |
Drop Msg | |
Reset buffer to initial value | |
Else | |
If RcvPCKT_ zoneID < = ZoneID then | |
Drop Msg | |
Else | |
Schedule Msg for relaying by adding its own zoneID | |
Set MsgType ← 2 | |
End if | |
End if | |
If zoneID==RecvZoneID and SeqNo==MsgRcvSeqNo and MsgType == 3 | |
Kill timer | |
Drop Msg | |
Reset the buffer | |
End if | |
End while | |
End |