# Wireless Sensor Network Energy Model and Its Use in the Optimization of Routing Protocols
## 1 Introduction
### Scope of Routing Protocols in Sensor Networks
AODV can transmit in unicast or multicast mode, uses bandwidth efficiently, and quickly responds to network changes avoiding network loops [5]. Each node in the network has a sequence number and a unique identifier in the network. This guarantees the absence of loops and avoids counting packets to infinity. To maintain and track routes to the neighbors, nodes periodically send _HELLO_ messages. The nodes have a lifetime each time a node receives a packet from a neighbor. At this time, the neighbor's entry is updated in the routing table. If no entry has been defined for this neighbor, the node creates a new entry in the routing table. Therefore, information from the _HELLO_ packet is used by neighbors to notify other nodes that the node itself is still active. This information is used by the neighbors to update the timers associated with that node or, alternatively, to disable the entries that are not responding. In fact, AODV maintains time-based states in each node's routing tables. A routing table entry expires if it has not been used recently. The timer function prevents using links which status has been marked as unknown for a long time. Some advantages of AODV are high reliability and low bandwidth costs. However, there are some disadvantages such as high complexity, additional calculations required, extra memory costs, and the fact that this protocol was designed to work in a network where there are no malicious nodes. In sum, it is not a secure protocol. The DSR protocol is also a reactive protocol. This protocol routes from the source node including a header in the packets. This header indicates which nodes may need to be crossed to arrive at a destination since the originating node is responsible for calculating the complete route to the destination node. This process is called **Source Routing**. DSR does not require any periodic message. In this way, it reduces message overload. For this, when the origin node moves or the topology of the network changes, the algorithm perceives the modifications and adapts accordingly. In addition, DSR handles unidirectional links and asymmetric routes. Each node in the network has a cache memory that storesall the routes obtained through the discovery processes from the node itself, which may consume slightly additional processing. If there is no current route to a specific destination, the node starts a reactive route discovery just like AODV. The route table or route cache is constantly monitored to detect invalid routes and repairs them as the network topology changes. This process is called **Route Maintenance**. DSR features some advantages such as that nodes can obtain multiple routes to a specific destination but requesting only one route. DSR allows the network to be completely self-configurable, without a specific architecture or topology. In addition, it is a good choice in scenarios where the number of mobility nodes is reduced. This protocol adapts quickly to routing changes when a node is frequently moving and decreases network overload. Next, we study a hybrid (proactive and reactive) routing protocol previously proposed, called MPH, which creates a hierarchical network logical topology where node hierarchy is proactively given by its location in the tree. Basically, the root hierarchy (sink or collector node) has the highest hierarchy. When a node has a hierarchy level, it can only have links from parents or children, directly connected. The hierarchical topology minimizes the number of hops and optimizes the routes to the coordinating node. The advantage of this protocol is that it combines features of both proactive and reactive nature and presents redundancy without losing simplicity in the algorithm. The coordinator can also send packets to the network nodes. An origin routing approach is adopted so that traffic is sent from the collector to any node, because the coordinator node has more resources and capacity than the rest.