## 4 Descriptions of Different Topologies of WSNs
### Flat/Unstructured Topology  
This is actually the case of no topology or the absence of any defined topology. In flat topology, each sensor plays equal role in network formation. Different protocols have been proposed based on flat/unstructured topology. For example, this flat topology has been used in data aggregation protocols [53], data gathering protocols [30], node scheduling protocols [66], and routing protocols [67]. Figure 2 shows the flat topology architecture where the nodes are the sensors and the edges are available communication links between two sensors. All the protocols, while using flat topology, attempt to find good-quality routes from source nodes to sink nodes by some form of flooding. Flooding is a technique in which a given node broadcasts data and control packets that it has received to the rest of the nodes in the network. This process repeats until the destination node is reached. Note that, this technique does not take into account the energy constraints imposed by the WSNs. As a result, when used for data routing in WSNs, it leads to the following two problems, namely, implosion and overlap [44]. Given that flooding is a blind technique, duplicate packets may keep circulate in the network, and hence sensors will receive those duplicate packets, causing an implosion problem. Also when two sensors sense the same region and broadcast their sensed data at the same time, their neighbours will receive duplicated packets. In a flat network, data aggregation is accomplished by data-centric routing where the base station usually transmits a query message to the sensor nodes via flooding, and the sensor nodes that have data matching in the query will send response messages back to the base station. The sensor nodes communicate with the base station via multi-hop routes by using peer nodes as relays. The choice of particular communication protocol depends on the specific application. Since flooding is a very costly operation in resource starved networks, smart routing algorithms restrict the flooding to localized regions. Some algorithms use probabilistic techniques based on certain heuristics to establish routing paths. Some examples of routing protocol based on flat topology are Sensor Protocols for Information via negotiation (SPIN) [44; 68], Directed-Diffusion [69], Rumor-Routing [70], _etc_. Figure 2: Flat topology architecture. SPIN's meta-data negotiation solves the classic problems of flooding to some extent. SPIN is a three-stage protocol as sensor nodes use three types of messages, such as ADV, REQ, and DATA to communicate sensors with each other. ADV is used to advertise new data, REQ is used to request data, and DATA is the actual message itself. The protocol starts when a SPIN node obtains new data it is willing to share. It does so by broadcasting an ADV message containing metadata. If a neighbour is interested in the data, it sends a REQ message for the DATA and the DATA is sent to this neighbour node. The neighbour sensor node then repeats this process with its neighnours. As a result, the entire sensor area will receive a copy of the data. One of the advantages of SPIN is that topological changes are localized since each node need know only its single-hop neighnours. SPIN provides more energy savings than flooding, and metadata negotiation almost halves the redundant data. However, SPIN's data advertisement mechanism cannot guarantee delivery of data. To see this, consider the application of intrusion detection where data should be reliably reported over periodic intervals, and assume that nodes interested in the data are located far away from the source node, and the nodes between source and destination nodes are not interested in that data; such data will not be delivered to the destination at all. Directed diffusion differs from SPIN in two aspects. First, directed diffusion issues data queries on demand as the BS sends queries to the sensor nodes by flooding some tasks. In SPIN, however, sensors advertise the availability of data, allowing interested nodes to query that data.