How to Use Energy Efficient Routing Algorithm in NS2


Energy based routing is the important routing functionality required by MANET. Energy of the node is considered while selecting the router to balance the energy consumption of the network.


residualenergy = Nodeaddr->energy_model()->energy();
If (residualenergy > Threshold) {
// send reply via the energy efficient router