# Energy-Aware Wireless Sensor Networks for Smart Buildings: A Review
## 6 Networking Layer
### The Network Layer Protocols
Since it is a hybrid protocol, it can emulate a proactive network or a reactive network depending on the count time and threshold value. The disadvantage of this protocol is that additional complexity is needed to implement the threshold and count time. Power-Efficient Gathering in Sensor Information Systems (PEGASIS)  
It is a near-optimal, chain-based, power-efficient protocol based on LEACH. In this protocol [61], each node has information about all other nodes. Additionally, each node can transmit data to the gateway directly. PEGASIS assumes that all WSN nodes have the same energy level and they will consume their power at the same time. Since all WSN nodes have information about the network status, the protocol can construct a chain using a greedy algorithm. The creation of the chain starts at a node that is away from the gateway. Each node sends and receives data from the closest node of its neighbors. The sensor node uses signal strength to measure the distance; it only adjusts the signal strength to reach the nearest node. When constructing the chain, each node merges received data with its data. In each round of chain construction, the protocol randomly selects a node to be a leader from the chain that will transmit the aggregated data to the gateway. PEGASIS outperforms LEACH as it eliminates the overhead of dynamic cluster information. In this protocol, each node requires global information about the network. Such a requirement is a drawback of this protocol because the network might change when a node goes down. As a result, nodes should be updated each time, introducing more overhead, thus more energy consumption. Sensor Protocols for Information via Negotiation (SPIN)It is a set of adaptive protocols that uses data negotiation and resource-adaptive algorithms [62]. SPIN is data-centric, and it assumes that all WSN nodes in the network are gateways and that nodes close to each other have similar data. SPIN names sensor data using meta-data. Since all nodes are considered gateways, all information is sent to all nodes in the WSN. As a result, the user can query any node and get the data immediately. Nodes in this network use a high-level name to describe their collected data called meta-data. Therefore, before transmission, nodes exchange meta-data, hence avoiding the retransmission of redundant data sets. When receiving the data, the sensor node advertises it to its neighbors. Meta-data is used for negotiation to solve the flooding problem, hence improving energy efficiency of the WSN. SPIN uses three types of messages: ADV, REQ, and DATA for communication within the WSN. The ADV message is used for advertising new data, while the REQ message is used to request data. The DATA message transmits data sets. For example, when a node gets some new data and wants to distribute it throughout the network, it broadcasts an ADV message containing the meta-data. Only the interested nodes request that data by sending a REQ message. Then the node replies by a DATA message to the requesting sensor node. The neighboring node keeps repeating this process until WSN nodes get the new data. SPIN has two main protocols, which are SPIN-1 and SPIN-2, which incorporate negotiations before transmitting data. Hence, only useful information will be sent. Each node in the WSN has its resource manager that keeps track of resource consumption. SPIN-1 incorporates negotiation, while SPIN-2 includes a threshold-based resource awareness mechanism. SPIN provides energy savings using meta-data negotiation, which reduces redundant data by 50%. However, the SPINs do not guarantee the delivery of data to the interested sensor nodes. For example, if nodes interested in the data are away from the source node and the intermediate nodes between the source and the destination are not interested in that data, such data will not be delivered to the destination. Rumor Routing (RR)  
Rumor Routing combines query flooding and event flooding protocols.