# MPResiSDN: Multipath Resilient Routing Scheme for SDN-Enabled Smart Cities Networks
## 4 MPResiSDN System
### System Components  
In this section, the MPResiSDN system components are described. As shown in Figure 5, the proposed system comprises six main components: Topology Discovery, Challenge Detector, Link Status, Nodes Manager, \(k\)-diverse Paths, and Rules Generator. The description of each component is outlined as follows:* Topology Discovery: This component is responsible for identifying the network topology and providing information about the available sensor nodes and links. It initiates as soon as the network connects to the SDN controller. It provides an ID list of all connected nodes and links. In addition, it determines the interfaces to which each link and node are connected. The component achieves these tasks by exploiting the built-in topology discovery algorithm provided in the RYU controller.
* Challenge Detector: This component detects challenges inside the sensing area. It also specifies the type of challenge. It uses sensors, such as temperature sensors, to detect the possibility of fire challenges. It also uses weather sensors, such as lightning and humidity sensors, to detect storms. Furthermore, this component is responsible for setting the \(k\) parameter, which represents the number of paths to be used by the system. The \(k\) parameter value depends on the results of the challenge detecting process. The \(k\) value increases relative to the severity of the challenge. The severity level is proposed to be determined based on the obtained sensory information. The implementation of this component is outside the scope of this research.
* Link Status: This component stores link parameters, such as link bandwidth and bit error ratio. It tracks link availability and reports disconnected links.
* Nodes Manager: The Nodes Manager stores node attributes and configurations. It maintains node types, such as a sensor or sink. It also gathers information about its power source, i.e., whether it is battery- or solar-powered. In addition, it keeps track of the status of nodes and reports node failures.
* \(\mathbf{k}\)-diverse-Paths: This is the key component of the system. It takes the output parameter \(k\) from the Challenge Detector component and then applies the Floyd-Warshall algorithm [57] to compute \(k\) diverse paths between nodes and available sinks. The  
Figure 5: MPResiSDN system architecture.  
computed paths are then used by the Rules Generator component to set the SDN rules for the system. Note, this component receives the reports about link and node failures sent by the Link Status and Nodes Manager components. It acts on the failure reports by eliminating any failed node or link, and then updates the network topology to avoid utilizing failed nodes and links when computing \(k\) diverse paths.
* Rules Generator: This component takes the list of computed \(k\) paths and generates the SDN rules associated with each path. Then, it uses the rules to fill the routing tables of all nodes in the used paths. Note, any SDN protocol can be used here. In our MPResiSDN system, we utilized the OpenFlow protocol. The rule is defined as an OpenFlow flow entry. Its abstract format is shown in Figure 6.