# Topology control

Topology control is a technique used in distributed computing to alter the underlying network (modeled as a graph) to reduce the cost of distributed algorithms if run over the resulting graphs. It is a basic technique in distributed algorithms. For instance, a (minimum) spanning tree is used as a backbone to reduce the cost of broadcast from O(m) to O(n), where m and n are the number of edges and vertices in the graph, respectively.
The term "topology control" is used mostly by the wireless ad hoc and sensor networks research community. The main aim of topology control in this domain is to save energy, reduce interference between nodes and extend lifetime of the network. However, recently the term has also been gaining traction with regards to control of the network structure of electric power systems.

## Topology construction and maintenance

Lately, topology control algorithms have been divided into two subproblems: topology construction, in charge of the initial reduction, and topology maintenance, in charge of the maintenance of the reduced topology so that characteristics like connectivity and coverage are preserved.
This is the first stage of a topology control protocol. Once the initial topology is deployed, specially when the location of the nodes is random, the administrator has no control over the design of the network; for example, some areas may be very dense, showing a high number of redundant nodes, which will increase the number of message collisions and will provide several copies of the same information from similarly located nodes. However, the administrator has control over some parameters of the network: transmission power of the nodes, state of the nodes (active or sleeping), role of the nodes (Clusterhead, gateway, regular), etc. By modifying these parameters, the topology of the network can change.
Upon the same time a topology is reduced and the network starts serving its purpose, the selected nodes start spending energy: Reduced topology starts losing its "optimality as soon as full network activity evolves. After some time being active, some nodes will start to run out of energy. Especially in wireless sensor networks with multihopping, intensive packet forwarding causes nodes that are closer to the sink to spend higher amounts of energy than nodes that are farther away. Topology control has to be executed periodically in order to preserve the desired properties such as connectivity, coverage, density.

## Topology construction algorithms

There are many ways to perform topology construction:
* Optimizing the node locations during the deployment phase
* Change the transmission range of the nodes
* Turn off nodes from the network
* Create a communication backbone
* Clustering
* Adding new nodes to the network to preserve connectivity (Federated Wireless sensor networks)
Some examples of topology construction algorithms are:

### Tx range-based

* Geometry-based: Gabriel graph (GG), Relative neighborhood graph (RNG), Voronoi diagram
* Spanning Tree Based: LMST, iMST
* Direction Based: Yao graph and Nearest neighbor graph, Cone Based Topology Control (CBTC), Distributed RNG
* Neighbor based: KNeigh, XTC
* Routing based: COMPOW

### Hierarchical

* CDS-based: A3, EECDS, CDS-Rule K
* Cluster-based: Low Energy Adaptive Clustering Hierarchy (LEACH), HEED

## Graphical examples

* Full power network topology
* Reduced network topology via Minimal Spanning Tree (Change in Tx Range)
* Reduced network topology via Connected Dominating Set (Select a subset of nodes that cover all the network and turn off non-selected nodes)

## Topology maintenance algorithms

In the same manner as topology construction, there are many ways to perform topology maintenance:
* Global Vs. Local
* Dynamic Vs. Static Vs. Hybrid
* Triggered by time, energy, density, random, etc.
Some examples of topology maintenance algorithms are:

### Global

* DGTRec (Dynamic Global Topology Recreation):
Periodically, wake up all inactive nodes, reset the existing reduced topology in the network and apply a topology construction protocol.
* SGTRot (Static Global Topology Rotation):
Initially, the topology construction protocol must create more than one reduced topology (hopefully as disjoint as possible). Then, periodically, wake up all inactive nodes, and change the current active reduced topology to the next, like in a Christmas tree.
* HGTRotRec (Hybrid Global Topology Rotation and Recreation)
Work as the SGTRot, but when the current active reduced topology detects a certain level of disconnection, reset the reduced topology and invoke the topology construction protocol to recreate that particular reduced topology.

### Local

* DL-DSR (Dynamic Local DSR-based TM)
This protocol, based on the Dynamic Source Routing (DSR) routing algorithm, recreates the paths of disconnected nodes when a node fails.
In all of the above protocols can be found in. In Atarraya, two version of each of these protocols are implemented with different triggers: one by time, and the other one by energy. In addition, Atarraya allows the pairing of all the topology construction and topology maintenance protocols in order to test the optimal maintenance policy for a particular construction protocol; it is important to mention that many papers on topology construction have not performed any study on this regard.