Saving Energy Using the Modified Heuristic Algorithm for Energy Saving (MHAES) in Software-Defined Networks

Energy consumption is a significant concern in daily life, often neglected in terms of cost and environmental impact. Since IT networks play an essential role in our daily routines, energy-saving in this area is crucial. However, the implementation of energy efficiency solutions in this field have to ensure that the network performance is minimally affected. Traditional networks encounter difficulties in achieving this goal. Software-Defined Networks (SDN), which have gained popularity in the past decade, offer easy-to-use opportunities to increase energy efficiency. Features like central controllability and quick programmability can help to reduce energy consumption. In this article, a new algorithm named the Modified Heuristic Algorithm for Energy Saving (MHAES) is presented, which was compared to eight commonly used methods in different topologies for energy efficiency. The results indicate that by maintaining an appropriate load balance, one can save more energy than in case of using some other well-known procedures by applying a threshold value based on forecast, keeping only a minimal number of nodes in an active state, and ensuring that nodes not participating in packet transmission remain in sleep mode.


Introduction
Software-Defined Networks (SDN) [1,2] are regarded as valuable solutions in computer networks and are gaining increasing prominence in modern times.The idea of SDN originated from the fact that the optimal configuration of the network posed numerous difficulties and required substantial additional work in traditional networks.Moreover, legacy networks suffered from limited flexibility and lacked the capability for immediate, fast, and productive responses to network traffic demands.The main advantage of Software-Defined Networks lies in the centralized control and the separation of the data plane (transmission) and the control planes.The control plane ensures the management of programmable network devices, while the responsibility of forwarding packets according to the processing forwarding tables received from the controller lies solely with the switches.In recent years, SDN has witnessed widespread adoption, not only in large corporate and institutional networks but also in home networks.This is primarily due to the cost-saving opportunities provided by it, particularly in the energy domain, where costs have significantly surged.When examining network expenses, it becomes apparent that a considerable proportion is attributed to energy consumption.Consequently, numerous investigations have been carried out over the past few years and decades to reduce these expenses.
Several approaches exist for saving energy in SDN networks.They operate either on a hardware basis or with software solutions.From a physical point of view, energy savings are derived from optimizing the memory utilization of the switches.Managing the Ternary Content Addressable Memory (TCAM) [3] offers practical solutions.It is crucial to compress the contents and, if necessary, increase memory capacity to contribute to energy savings.However, it is important to note that memory capacity cannot be expanded infinitely.Software-based energy savings can be accomplished through the controller by leveraging central control.In this scenario, different algorithms can be utilized to influence the behavior of the network ensuring that energy savings do not come at the expense of network performance.SDN energy efficiency methods can primarily be categorized into four groups: Compression TCAM [3], End Host-Aware [4], Traffic-Aware [5], and Rule Placement [6].
This article introduces a novel algorithm called the Modified Heuristic Algorithm for Energy Saving (MHAES), which undergoes a comparative evaluation with eight commonly employed methods across various topologies to assess its energy efficiency.The results presented below stem from an investigation that primarily focused on three main categories of energy-saving methods: compressive TCAM, traffic monitoring, and the rule placement method.Although the endpoint-aware method was also examined, it was not considered relevant to our research as our primary focus revolved around campus level or smaller networks.Within the three selected categories, the options that greatly facilitated the operation of the heuristic algorithm being proposed in this article were thoroughly analyzed.Specifically, the Rectilinear [7] and CAM Razor [8] methods were examined for Compression TCAM, both prioritizing either rule or content compression.From the research perspective, both methods held significance, as the goal was to convey to the switches as many basic rules as possible while minimizing energy consumption.Traffic-aware options such as Green Abstraction Layer (GAL) [9], Exclusive Routing (EXR) [10], Strategic Greedy Heuristic (SGH) [11], or Routing for Minimization of Active Devices (RMAD, RMAD+) [12] were also analyzed.They proposed efficient solutions for the current investigation, enabling us to achieve energy savings with the implemented modifications.Additionally, rule placement methods such as Energy-Aware Routing (EAR) [13] and DevoFlow [14] were also considered and played a vital role in the research.These methods were modified resulting in the proposed heuristic algorithm.The primary objective of this paper is to present this algorithm and the achieved outcomes.
The rest of this paper is as follows.First, Software-Defined Networks (SDN) are introduced briefly in Section 2.Then, energy-saving solutions in SDNs are reviewed in Section 3. Section 4 presents the proposed new algorithm, while the simulation results are described in Section 5. Finally, the conclusions are drawn in Section 6.

Software Defined Networks
SDNs [15,16] completely separate controlling from the data transmission in contrast to the solution used in traditional networks.All decisions in the traditional network depend on the routers (e.g., packet forwarding), while in SDNs, the controller decides the best way for the packets using the centralization (Figure 1).Three main layers are distinguished in the SDN architecture (Figure 2), i.e., the data plane [17] (infrastructure layer), the control plane [18] and the application plane [19].Data plane: The data layer houses the network infrastructure, which consists of data transmission devices commonly referred to as switches.These devices ensure the delivery of packets from the source to the destination based on instructions received from the controller.In traditional networks, routers continuously exchange messages to determine the correct route.In SDN networks, switches inform the controller about the current topology status, enabling decision-making on appropriate traffic control in the upper layer.Data transmission information is then relayed to the relevant network devices through the southbound interface.Error-free communication with the control layer requires the use of the appropriate protocol, such as the open standard OpenFlow [20,21].This protocol provides a set of commands to modify the state of devices participating in an SDN.
Control Plane: The control layer encompasses the SDN controller(s) responsible for centralization in SDN.Controllers make decisions regarding rule placement and instructions for traffic control.However, centralization can pose challenges, including network security, scalability, and energy management, especially when controllers become overloaded.It is important to note that an SDN controller does not necessarily solve these tasks in larger networks.Attention should be given to the location of SDN controllers, as distributed control, error management, and energy consumption pose additional challenges.The network hypervisor and network operating system, located in this layer, aid in resolving these functions.
The control layer's third component is the northbound interface, facilitating communication between the controller and applications in the management layer.The northbound interface commonly employs open-source application programming interfaces (APIs) that can be easily utilized and modified according to specific requirements.
Application plane: The application layer comprises SDN network applications and programming languages.This layer provides a user interface to configure desired settings, including load distribution among potential routes, network security settings, rule system creation, and energy consumption modifications.
By employing SDN applications and proper monitoring, rapid responses to network changes can be achieved, such as addressing load balancing issues, lost routes leading to topological changes, or unexpected attacks.Centralization eliminates the need for local reconfiguration, allowing for quick and efficient changes through the controller [22].This capability is beneficial for network operation from all perspectives, and our article focuses on potential solutions for improving energy usage.

Energy Saving Solutions in SDN Networks
With the emergence of the energy crisis, the task of reducing energy consumption through centralization is becoming increasingly challenging for SDN networks as well.Moreover, accurately monitoring and tracking energy consumption is also crucial.Various techniques can be employed in SDN networks to achieve energy saving.It should be noted that in these networks, the decisions are made by the controller.SDN switches can be configured to operate in an active or sleeping state, bandwidth can be limited, and rules for Sensors 2023, 23, 9581 4 of 24 network operation can be defined and sent to the respective devices.This section presents an overview of these different energy saving methods.

Compression TCAM Solution
Switches utilize a specialized memory known as Content Addressable Memory (CAM) [23] to store and retrieve data.Unlike regular RAM, which relies on memory addresses, CAM allows direct content querying without the need for specifying addresses.CAM offers faster access compared to RAM and its tables yield either a true (0) or false (1) result.This type of memory is particularly useful for creating tables that require exact matches, such as MAC address tables.However, CAM's limitation lies in its ability to only check for complete matches of ones and zeros.To address this limitation, the solution lies in Ternary Content Addressable Memory (TCAM) [24,25].
TCAM serves as a specialized form of CAM, capable of storing and retrieving data based on three different input parameters: 0, 1, and X ("do not care").The inclusion of the "do not care" input parameter, acting as a wildcard, enables TCAM to perform more detailed searches as intended.TCAM proves valuable in finding longest matches and also stores additional information such as Access Control Lists (ACLs) [26] and other higher-level task-related data.While TCAM functions well in SDN switches for efficient routing, its drawbacks include high cost, significant power consumption, and excessive heat generation.These challenges pose a considerable obstacle for central controllers and other network devices.However, it is worth noting that the use of TCAM ensures that the application of ACLs does not impact the performance of the switch.Multiple TCAMs can be present in a switch, enabling the simultaneous or parallel evaluation of incoming and outgoing security ACLs, offering a substantial energy-saving advantage.
Considering the expense and energy consumption associated with TCAM usage, finding a solution to address these issues becomes imperative.One possible method is the compression of TCAM.Two potential compression approaches for TCAM are rule compression and content compression.
In SDN, switches make their decisions based on the forwarding rule identified in TCAM.Each entry in the process table defines a matching rule, specifying a predefined operation for each case.Upon packet arrival, the forwarding device identifies the highest priority matching rule and executes the requested action.Various solutions have been developed to compress these rules, ensuring a more efficient utilization of TCAM.
The Rectilinear [7] approach leverages the features provided by SDN, such as centrally programmable interfaces and the dynamic definition of actions for forwarding specific packets (content compression).In the case of compression, the bit size is reduced to store only vital information necessary for packet routing.Each flow is assigned a unique flow ID to ensure proper identification.Forwarding switches modify the packet headers to incorporate the flow ID, facilitating packet classification by switches.SDN switches employ a shorter label representation compared to the original bit number to identify flows, thereby conserving energy.
The rule compression method, known as the CAM Razor [8] method, defines a fourstep process.In the first step, a reduced decision diagram is created for the given rules.The second step involves considering rules associated with non-central nodes and minimizing them using dynamic programming techniques.Subsequently, rules are generated from the decision diagram in the third step.In the fourth and final step, unnecessary or redundant rules are eliminated from the process.
Compact TCAM [8,24,25] is a solution that reduces the size of TCAM process entries and uses shorter tags for process identification.This can be used to reduce the size of forwarding rules, so the TCAM space can be optimized.For the efficient use of TCAM, a scheme was created, which can be used to compress forwarding rule in overlapping switching nodes, thus reducing the occupied area in TCAM.

End Host-Aware Solution
The utilization of End Host-Aware solutions involves the common practice of shutting down less utilized servers and redirecting their tasks to other servers.This approach proves particularly advantageous for energy conservation in data centers.
ECODANE [27] serves as a valuable solution for energy saving in data centers.The implemented method consists of five logical modules: the data center network, optimizer, power control, forwarding module, and traffic generator.To create a data center network, the project creators utilized the Elastic-Tree network [28] and simulated it using Mininet [29].The task of the optimization module is to determine the minimum energy network segment, requiring the fewest switches and links, while maintaining traffic conditions corresponding to the requests and upholding quality of service (QoS) standards.A topology-aware heuristic [30] was developed to assist the optimizer in quickly determining the suitable subset for the power controller and forwarding module.
Leveraging OpenFlow, the power control module can modify the power supply status of ports or entire switches (i.e., turning them off, on, or enabling energy-saving mode) using the options provided by the Python API of Mininet.The function of the forwarding module is to optimize routes within the data center, employing a hierarchical load balancing routing algorithm [31].Although the optimizer and forwarding module are implemented separately, they closely collaborate.The forwarding module operates based on the data received from the optimizer, but in the absence of information, it sets all non-active network devices to the "on" state.The traffic generator contributes to the simulation process.
It is important to note that our research does not specifically focus on data center networks.Instead, we concentrate on optimizing energy consumption in institutional, local, and large company networks within the region.Therefore, this method did not play a prominent role in our study, and we did not compare it to our own algorithm.

Traffic-Aware Solution
The energy efficiency solution, focusing on traffic awareness, highlights the fact that network switches are not always fully utilized.By optimizing the on and off state of these devices, energy savings of up to 40% can be achieved.The key idea is to switch on these transmission devices only when necessary and switch them off otherwise, thereby conserving energy [32].While energy saving is crucial, it is equally important to consider the quality of service (QoS) [33] since a significant reduction in QoS can have a more detrimental impact on our optimized network than the energy saved.
The Green Abstraction Layer (GAL) [9,10] method represents a traffic-aware solution that capitalizes on the communication capabilities between network devices, with the querying of this communication playing a pivotal role in energy saving.The GAL abstraction encompasses two main models: the Energy-Aware State (EAS) [12] and the Energy Optimizer module.EAS defines logically independent units of the network, such as switches or traffic management operations.Data collected from these units are transmitted to the controller, which, considering the actual requirements, applies the most effective strategies across the network devices.The Energy Optimizer module calculates the optimal state to minimize energy consumption based on information received from EAS.The GAL operation consists of three distinct stages: discovery, provisioning, and monitoring.In the discovery phase, information is collected, and network devices inform the controller about their energy usage.This process can be time-consuming and energy-intensive due to the varying number of devices depending on the network size.The provisioning stage, on the other hand, is faster and more efficient as it leverages basic settings and rules whenever possible to set the network nodes to their optimal energy states.Following the provisioning stage, the monitoring phase ensures continuous optimal network operation.The controller receives real-time information about the current state of each entity through monitoring, and if necessary for network operation, the triple process restarts.
Exclusive Routing (EXR) [30] represents a method to enhance fair-sharing routing (FSR) [34], a general routing approach for efficient distribution.FSR evenly distributes flows over a subset of links, ensuring fairness without delay.However, this method operates with reduced capacity, failing to utilize the full capacity available.By implementing EXR, energy can be saved by utilizing the full capacity of active links and putting additional switches to sleep.The primary aspect of this solution lies in eliminating low link and switch utilization.If all routes are used, but a route has temporarily suspended flows with lower priority than the current flow, the flow becomes active, and the package is forwarded via a lower priority route.Otherwise, the flow remains suspended.If multiple options are available, the switch with the fewest idle states is selected.Upon the successful completion of a process, the controller resets the necessary flows.
Tests conducted using the OpenFlow protocol have revealed that EXR enables energy savings regardless of whether the network is idle or busy, achieving effective utilization through connection structure application or capacity utilization modifications.Prioritizing flows can enhance the network's flexibility in utilization, but careful attention must be paid to avoid delays.It is essential to note that network flexibility in this solution assumes the presence of backup routes and swift response, as failing to meet these conditions may result in an unacceptable level of service.
The Strategic Greedy Heuristic (SGH) [11] algorithm serves as an effective means to optimize the energy consumption of Software-Defined Networks (SDNs).In SGH, participating access nodes in a flow share their load information with other nodes, and the controller optimizes traffic flow accordingly, putting idle devices to sleep whenever possible.SGH considers three aspects: capacity limitation to ensure efficient connections without underutilization or overload [35][36][37], assigning flows to paths with adequate capacity for each traffic demand, and shutting down nodes where necessary.
Routing for Minimization of Active Devices (RMAD, RMAD+) [12] presents a highly beneficial energy-saving solution for SDN networks.This method takes into account the energy savings achievable by turning devices on and off.The outlined method primarily utilizes the Open Shortest Path First (OSPF) [38] protocol for route determination, which proved to be an effective and swift solution.RMAD identifies the most active links using the shortest path, extending the sleeping time of already inactive units to achieve greater energy savings.The improved RMAD+ further limits the number of hops on a given path and selects the path with the fewest active nodes.It is important to note that the selection of a path with fewer active nodes does not necessarily equate to the shortest path determination.

Rule Placement Solution
The Rule Placement method [6, 13,39] necessitates the placement of information in switches to ensure proper packet forwarding from the source to the destination address.The crucial aspect of these techniques lies in the reception of accurate, fast, and easy-toimplement rules by the processing devices.The ideal solution is centralized control, where the controller provides the most optimal transmission paths.The downloading of rules to the switches is a significant aspect of this technology.Although heuristic-based algorithms are not foolproof, they contribute to finding the optimal solution for network enhancement.It should be noted that switches have finite memory capacity, but this can be optimized by defining basic traffic control rules and preloading them onto the switches.
The Energy-Aware Routing (EAR) [13] solution assumes an infinite number of rule spaces, which is not accurate due to the limited size of the TCAM, as mentioned previously.Giroire et al. [13] developed a method to overcome the rule space limitations in energyaware routing.The initial step involved creating a default rule, which is selected when no predefined rule is available for packet forwarding, indicating that the forwarding device lacks the necessary information to determine the possible route.Deploying these default rules to devices is time-consuming and energy-intensive, but it can yield longterm benefits if properly implemented.A crucial aspect is that these basic rules are only sent to one default port from the controller, resulting in energy savings throughout the network.The developers of the method considered the determination of the default port as a key element of their solution.It is important to note that each switch has only one default port.To address this, a heuristic algorithm was created, aiming to find the best possible forwarding route for received requests while considering storage capacity and rule limitations.The routing table is continuously populated with appropriate routes until the TCAM reaches its capacity.The default port is determined based on the port involved in the most management tasks.Taking this into account, the number of active links is reduced, switches with lower loads are put into sleep mode, and their responsibilities are assumed by other active devices, resulting in energy savings.This solution not only conserves energy but also reduces the rule area size, decreases delay time, and minimizes communication with the controller, which is crucial in a corporate environment.
Another viable and beneficial solution is DevoFlow [40], which essentially modifies an OpenFlow controller.The solution involves breaking the connection with the controller to offload certain tasks to the switches, thereby reducing the workload on the controller and leading to significant energy savings.The controller continuously gathers network information, consuming substantial energy and hindering the fast transmission of large packets.To expedite switch control, rule cloning was introduced.When a flow matches another flow, the switch clones the rule, reducing the usage of TCAM and minimizing communication with the controller.The authors also proposed a local mechanism, enabling switches to make decisions without consulting the controller for certain packet transmissions, leveraging the use of basic rules.
In terms of the research (Table 1 shows the examined solutions), the Traffic-Aware solution, combined with rule placement options (and the utilization of Compression TCAM), proved to be highly beneficial.The reason is the Traffic-Aware and the Rule Placement solutions have a very useful relationship.Important feature of Traffic-Aware is elasticity and topology awareness.Talking about the Rule Placement solution, the knowledge of the entire topology is closely related to these two properties, which is essential for choosing the best route.Knowing the full network topology means having a global view.It is the ability to decide which rules have to be placed on which switch, which depends on the total network information, end-point policies, and routing policies.The set of these rules is the rule space.Rule spaces can be reduced by reducing the number of active switches and links.It is important to note that attention must be paid to which rule is defined for proactive operation (before the packet arrives) and which is for reactive operation (reaction to new packets).The insights gained from all these methods played a pivotal role in shaping the development of the Modified Heuristic Algorithm for Energy Saving (MHAES), as detailed in the previous section (refer to Table 1 for the analyzed solutions).Notably, the Traffic-Aware solution, coupled with strategic rule placement and the adoption of Compression TCAM, demonstrated significant advantages.These methodologies collectively influenced the refinement and formulation of the Modified Heuristic Algorithm for Energy Saving (MHAES), which will be elaborated upon in the following section.

Energy-Aware Approach-Modified Heuristic Algorithm for Energy Saving (MHAES)
In the preceding section, several methods were presented that can effectively contribute to energy savings in SDNs.The mathematical models of the Traffic-Aware solution and the Rule Placement solution [41][42][43][44][45], which will also be shown in this section, had a significant impact on the design of the new algorithm presented here.Moreover, the mathematical background of the proposed algorithm will be detailed as well, along with the algorithm itself.

Mathematical Model for Traffic-Aware Solutions
Network traffic, which refers to the number of packets transmitted on the network at a given time, can be managed to avoid congestion, promote proper load distribution, and save energy.For optimal route selection, the status information of the devices used in the network is periodically collected by the SDN controller.This data assist in determining the network rule system, enabling quick reactions in case of possible failures.The Traffic-Aware model [12,32,[35][36][37], which is a solution aimed at minimizing power consumption by deciding when each device should be put to sleep under low traffic conditions, can be utilized through SDN-centralized management.Table 2 shows the list of notations used.In terms of energy consumption, links and switches are the main participants in SDN networks.The reduction in the number of switches and connections required for network traffic transfer is crucial for achieving more favorable energy savings.
Network traffic can be illustrated by an undirected weighted graph G = <Z, E>.Here Z and E represent the number of switches and connections, where z i ∈ Z and e i j ∈ E. The Sensors 2023, 23, 9581 9 of 24 connection, or link, between switches z i and z j is denoted by e ij .The current state of the switch is determined by the following equation.
Equation ( 2) aims to minimize the total energy consumption of the network through the utilization of switches and connections.The energy consumption of the links and switches is represented by the first and second terms, respectively.
The energy consumption of the connection e ij and the switch z i is denoted as PC ij and PCS i , respectively.The network traffic flow, represented by f, belongs to the set F, where f can be defined as f = (s r d s f r ).The flow rate is denoted as f r , while s r and d s , both belonging to the set Z, represent the source and destination switches, respectively, subject to: The flow rate between the switches is specified by Equation (3), which ensures that it does not exceed the maximum capacity of the available connection.The inflow and outflow values are given by Equation (4).Equation ( 5) governs the flow from the source to the destination.Equations ( 6) and (7) ensure that the flow cannot be directed towards any sleeping switches.Assistance in deactivating idle switches is provided by Equation (8).

Mathematical Model for Rule Placement Solutions
Another energy saving method, as already mentioned, is Rule Placement solution [6, 13,39,[41][42][43][44][45].An important aspect of this method is TCAM, in which significant energy savings can be achieved by controlling the number of flow rules.TCAM memory is finite, and an important aspect is that this memory is also expensive.The energy consumption of the SDN network can be influenced by the number of entries stored in the TCAM.By using the rule placement method, the number of rules placed in the TCAM can be influenced, for example with the default rules, or possibly with other replacement methods.
The goal of this solution is to minimize flow inputs, thus increasing energy efficiency.To represent the network traffic, we use an undirected weighted graph G = <Z, E> where Z and E represent the number of switches and links, such that z i ∈ Z and e ij ∈ E. The e ij is a connection between switches z i and z j .The bandwidth of the given link is presented by w ij .The state of the switch is given by the following Equation (9).
Considering the free capacity of resources, the matrix of rules can be described as follows (10).Rules represent flows associated with switches: The size of the matrix is determined by the number of switches in the matrix.The edge is e ij , and whether it is asleep or not is decided by the binary variable L ij .
The status of the flow through the edge e ij is refreshed by the variable K ij , which gives back a binary result.
The number of rules present in switches is given by Equation ( 13).The capacity of the connection fixedly determines the number of flows that can pass through the given link, and this can be seen in Equation ( 14).Of course, the number of rules built into the switch cannot exceed the switch capacity, Equation (15).Equation (16) shows the state of the flow passing through edge e ij .Equation ( 17) puts the unused connection to sleep.If this reference is used in any process, it must become active.It can be seen in Equation (18).Equation ( 19) contains the rule of flow retention.

Mathematical Model and Algorithm of MHAES
As the starting point of the development of the Modified Heuristic Algorithm for Energy Saving, an analysis was carried out to determine the components upon which the energy consumption of switches depends.For this purpose, the following formula was utilized.
where E basic denotes the basic performance of the switch, E configuration is configuration speed, E openflow refers to the energy consumption of the processed OpenFlow traffic (operations), while E control pertains to the energy consumption of the control traffic (which depends on the speed of outgoing and incoming packets).
During the investigation, focus was placed on determining which components' energy consumption could be influenced to achieve greater energy saving.E basic and E openflow offered limited opportunities for reducing energy usage but modifying the variables E configuration and E control showed promise in solving the problem.
In this investigation an undirected weighted graph G = <K, E> was used to represent the network traffic.Here, K includes both hosts and SDN switches (K = H U Z), and E represents the number of connections, such that z i ∈ Z and e ij ∈ E. The connection between switches z i and z j is denoted by e ij .The basic rule B applied between hosts was taken into account.For each R, H r represents the default traffic control rule set.
The premise underlying the approach was to minimize communication between transmission devices and the controller, thereby achieving significant savings in delay time, capacity utilization, and energy consumption.To enable reduced communication, an algorithm was conceived that detects active and sleeping SDN-compatible switches and seeks to avoid activating switches already in a sleeping state.Whenever possible, as many default and local rules as possible were applied to determine the proper forwarding of packets between the source and destination addresses without relying on central communication.The primary goal was to minimize energy consumption in the SDN network.
When developing the mathematical model, the well-established solutions developed in the aforementioned Traffic-Aware and Rule Placement approaches were taken into account, supplemented by the defined expectations aimed at reducing network energy consumption.Table 3 shows the designations of basic and special input data, while Table 4 contains the decision parameters.The total energy consumption of SDN switches participating in the network is minimized by the task of function (21).Flow constraints are contained in Equation (22).Equation (23) indicates that the traffic forwarded on each connection's link is either less than or equal to the available capacity.Constraint (24) ensures that if a connection is in a sleep state, CA e = 0, indicating it has no capacity.However, if the link is active, its capacity is limited by CA, which represents the maximum capacity of the link.
Constraint (25) guarantees that when a switch z is in the off state, the capacity of both the incoming and outgoing links must be 0, i.e., CA e = 0. Equation (26) ensures that if a request r does not impact the link e, the traffic associated with the request will be 0 (Y re = 0).Equation ( 27) determines the number of processes belonging to the OpenFlow protocol that should be set on the z switch.X = min(E basic ∑ z y z + E con f iguration_po ∑ e z e + E con f iguration_sp∑ e CA e + E openlow∑ z r z ) (21)   is subject to: CA e ≤ CA Z e , ∀e ∈ E ∑ e∈k out (z) The modified heuristic algorithm (Algorithm 1) has been developed using the abovepresented model.In the algorithm, R represents the list of traffic requests, and CuRe represents the current request that needs to be examined.TCA is the threshold value of the link capacity defined manually [46].ASW represents the list of active SDN switches, while SSW contains the set of switches in a sleeping state.AL is the list of active links, while CA represents the capacity of the link.F represents the active flows in each SDN switch.CPo denotes the power consumption of the current request, and SP includes the list of selected paths and their corresponding CPo.
The main goal was to determine a route that would minimize the energy consumption of the network.The algorithm treats the first request separately from subsequent requests.For the first incoming request, the algorithm considers it as the shortest and most efficient path in terms of energy consumption and updates the required values accordingly.In the case of requests following the first request, the first task is to define the set of all available routes that can be assigned to the given request.Next, the method selects the set of paths with a capacity greater than the specified capacity threshold (20%) and determines their energy consumption.Next, it chooses the path that results in the smallest energy increase in the network.After determining the path with the minimum value, the necessary values are updated accordingly.
In the Power_Value function, as depicted in Algorithm 2, the algorithm determines whether certain actions need to be taken based on the threshold number of active switches.These actions include activating a new switch if necessary, modifying link settings (e.g., increasing speed with Active_Links_Update (CL, CuRe)), or adding a new flow entry to the existing ones as requested (Basic_Flow_Update (CuRe)).
A switch in a sleeping state can only be awakened under the condition that the switch intended for use by the link is not active, meaning there is no active connection between the source and target, and the number of active SDN switches does not exceed the specified threshold number.

Simulation and Results
The algorithm was tested in Net2Plan [47-49] using several different environments.For this purpose, two network topologies, i.e., Simmons and eon, built into the software, were employed with different numbers of nodes.The tests were conducted on fixed wired networks with 15, 30, 45, and 60 nodes.In each case, six different solutions were compared to the newly created algorithm five times starting from different nodes.The power consumption was analyzed when all switches and links were active.Additionally, the Rectilinear, DevoFlow, EXR, RMAD, RMAD+, and Giroire et al.'s heuristic algorithm solutions were tested and compared against the new MHAES solution.
The initial tests utilized the built-in networks Simmons_N30_E72 and Simmons_N60_E154 E154.To broaden the scope of testing, selected solutions were also tested with 15 nodes.For the 15-node solution (Figure 3), the network topology Simmons_N30_E72 was modified by removing several links and nodes (resulting in 43 links).With 30 nodes we use the original Simmons_N30_E72 (with 72 links) topology (Figure 4.).The topology with 45 nodes (Figure 5) was created by deleting nodes and links from the Simmons_N60_E154 network (resulting in 122 links).In Figure 6. can see the original topology Simmons_N60_E154 (with 154 links).

Simulation and Results
The algorithm was tested in Net2Plan [47][48][49] using several different environments.For this purpose, two network topologies, i.e., Simmons and eon, built into the software, were employed with different numbers of nodes.The tests were conducted on fixed wired networks with 15, 30, 45, and 60 nodes.In each case, six different solutions were compared to the newly created algorithm five times starting from different nodes.The power consumption was analyzed when all switches and links were active.Additionally, the Rectilinear, DevoFlow, EXR, RMAD, RMAD+, and Giroire et al.'s heuristic algorithm solutions were tested and compared against the new MHAES solution.
The initial tests utilized the built-in networks Simmons_N30_E72 and Sim-mons_N60_E154 E154.To broaden the scope of testing, selected solutions were also tested with 15 nodes.For the 15-node solution (Figure 3), the network topology Sim-mons_N30_E72 was modified by removing several links and nodes (resulting in 43 links).With 30 nodes we use the original Simmons_N30_E72 (with 72 links) topology (Figure 4.).The topology with 45 nodes (Figure 5) was created by deleting nodes and links from the Simmons_N60_E154 network (resulting in 122 links).In Figure 6. can see the original topology Simmons_N60_E154 (with 154 links).

Simulation and Results
The algorithm was tested in Net2Plan [47][48][49] using several different environments.For this purpose, two network topologies, i.e., Simmons and eon, built into the software, were employed with different numbers of nodes.The tests were conducted on fixed wired networks with 15, 30, 45, and 60 nodes.In each case, six different solutions were compared to the newly created algorithm five times starting from different nodes.The power consumption was analyzed when all switches and links were active.Additionally, the Rectilinear, DevoFlow, EXR, RMAD, RMAD+, and Giroire et al.'s heuristic algorithm solutions were tested and compared against the new MHAES solution.
The initial tests utilized the built-in networks Simmons_N30_E72 and Sim-mons_N60_E154 E154.To broaden the scope of testing, selected solutions were also tested with 15 nodes.For the 15-node solution (Figure 3), the network topology Sim-mons_N30_E72 was modified by removing several links and nodes (resulting in 43 links).With 30 nodes we use the original Simmons_N30_E72 (with 72 links) topology (Figure 4.).The topology with 45 nodes (Figure 5) was created by deleting nodes and links from the Simmons_N60_E154 network (resulting in 122 links).In Figure 6. can see the original topology Simmons_N60_E154 (with 154 links).The simulation average results are depicted in the diagrams presented in Figures 7-10, representing networks with 15, 30, 45, and 60 nodes, respectively.The y-axis indicates the energy consumption relative to the expected amount, where 100% corresponds to the scenario with all links and nodes active.All tested methods consistently consumed less energy compared to this scenario.In the case of 15 nodes (Figure 7), the Rectilinear, DevoFlow, EXR, RMAD, and RMAD+ solutions exhibited energy savings of average 10-15% for a small number of requests and up to 15-20% for a larger number of requests on average.Giroire et al.'s heuristic algorithm and the MHAES consistently outperformed the other methods, achieving energy savings of around 25% for 80 requests.The MHAES demonstrated the best performance, surpassing Giroire et al.'s heuristic algorithm by an additional 2% in energy savings on average.This was mainly due to the fact that more information reaches the nodes in the initial stage, which, although it requires more energy in the case of continuous increases in requests, due to less frequent contact with the controller, it uses its own local information and can save energy.It is important that the capacity and the number of sleeping nodes decisively influence the amount of energy savings.In this case, these numbers are constant values given through experience, which will be determined in the future, taking into account the actual needs.Notably, this study served as a starting point and focused on network topologies typically found in smaller companies.The simulation average results are depicted in the diagrams presented in Figures 7-10, representing networks with 15, 30, 45, and 60 nodes, respectively.The y-axis indicates the energy consumption relative to the expected amount, where 100% corresponds to the scenario with all links and nodes active.All tested methods consistently consumed less energy compared to this scenario.In the case of 15 nodes (Figure 7), the Rectilinear, DevoFlow, EXR, RMAD, and RMAD+ solutions exhibited energy savings of average 10-15% for a small number of requests and up to 15-20% for a larger number of requests on average.Giroire et al.'s heuristic algorithm and the MHAES consistently outperformed the other methods, achieving energy savings of around 25% for 80 requests.The MHAES demonstrated the best performance, surpassing Giroire et al.'s heuristic algorithm by an additional 2% in energy savings on average.This was mainly due to the fact that more information reaches the nodes in the initial stage, which, although it requires more energy in the case of continuous increases in requests, due to less frequent contact with the controller, it uses its own local information and can save energy.It is important that the capacity and the number of sleeping nodes decisively influence the amount of energy savings.In this case, these numbers are constant values given through experience, which will be determined in the future, taking into account the actual needs.Notably, this study served as a starting point and focused on network topologies typically found in smaller companies.The simulation average results are depicted in the diagrams presented in Figures 7-10, representing networks with 15, 30, 45, and 60 nodes, respectively.The y-axis indicates the energy consumption relative to the expected amount, where 100% corresponds to the scenario with all links and nodes active.All tested methods consistently consumed less energy compared to this scenario.In the case of 15 nodes (Figure 7), the Rectilinear, DevoFlow, EXR, RMAD, and RMAD+ solutions exhibited energy savings of average 10-15% for a small number of requests and up to 15-20% for a larger number of requests on average.Giroire et al.'s heuristic algorithm and the MHAES consistently outperformed the other methods, achieving energy savings of around 25% for 80 requests.The MHAES demonstrated the best performance, surpassing Giroire et al.'s heuristic algorithm by an additional 2% in energy savings on average.This was mainly due to the fact that more information reaches the nodes in the initial stage, which, although it requires more energy in the case of continuous increases in requests, due to less frequent contact with the controller, it uses its own local information and can save energy.It is important that the capacity and the number of sleeping nodes decisively influence the amount of energy savings.In this case, these numbers are constant values given through experience, which will be determined in the future, taking into account the actual needs.Notably, this study served as a starting point and focused on network topologies typically found in smaller companies.Moving on to networks with 30 nodes (Figure 8), the initial average energy savings with the MHAES and Giroire et al.'s heuristic algorithm were slightly lower compared to the 15-node scenario.However, they still outperformed the other examined methods, demonstrating only minimal loss.The MHAES began performing noticeably better after 25 requests, achieving significant energy savings.Similar energy savings to the 15-node test were attained for 80 requests in this network.
Figures 9 and 10 display the results for networks with 45 and 60 nodes, respectively.Once again, the MHAES and Giroire et al.'s heuristic algorithm outperformed the other solutions.The Rectilinear, DevoFlow, EXR, and RMAD methods achieved average energy savings of 20-25% for almost 80 requests in the case of 45 nodes and 25-30% for 60 nodes.However, the MHAES and Giroire et al.'s heuristic algorithm, after the initial rule placement load, consistently achieved substantial energy savings compared to the aforementioned methods.With 40-45 requests, the MHAES consistently outperformed its competitors, achieving nearly 40% energy savings compared to the scenario where all switches and links are active.In the network with 60 nodes, the MHAES maintained a 2% average energy savings advantage over Giroire et al.'s heuristic algorithm after 45 requests, which persisted even after 80 requests.It is worth noting that due to the larger number of links, all tested methods exhibited smaller savings compared to the first series of tests.The deviation from the average value in the negative direction was not greater than 1.2% in all cases, while the maximum value in the positive direction was 2.5%.The network performance performed similarly in all cases examined, and no significant differences were observed.
For the second series of tests, the starting point was the built-in network eon_N15_E66 (with 66 links), as depicted in Figure 11.The network was also tested with 30, 45, and 60 nodes five times each, starting from different nodes.Additional nodes and links were randomly added to the basic network.Consequently, the 30-node network (Figure 12) had 108 links, the 45-node network (Figure 13) had 152 links, and the 60-node network (Figure 14) had 214 links.The aim was to significantly increase the number of connections compared to the previous test and evaluate the selected SDN-based energysaving solutions.Moving on to networks with 30 nodes (Figure 8), the initial average energy savings with the MHAES and Giroire et al.'s heuristic algorithm were slightly lower compared to the 15-node scenario.However, they still outperformed the other examined methods, demonstrating only minimal loss.The MHAES began performing noticeably better after 25 requests, achieving significant energy savings.Similar energy savings to the 15-node test were attained for 80 requests in this network.
Figures 9 and 10 display the results for networks with 45 and 60 nodes, respectively.Once again, the MHAES and Giroire et al.'s heuristic algorithm outperformed the other solutions.The Rectilinear, DevoFlow, EXR, and RMAD methods achieved average energy savings of 20-25% for almost 80 requests in the case of 45 nodes and 25-30% for 60 nodes.However, the MHAES and Giroire et al.'s heuristic algorithm, after the initial rule placement load, consistently achieved substantial energy savings compared to the aforementioned methods.With 40-45 requests, the MHAES consistently outperformed its competitors, achieving nearly 40% energy savings compared to the scenario where all switches and links are active.In the network with 60 nodes, the MHAES maintained a 2% average energy savings advantage over Giroire et al.'s heuristic algorithm after 45 requests, which persisted even after 80 requests.It is worth noting that due to the larger number of links, all tested methods exhibited smaller savings compared to the first series of tests.The deviation from the average value in the negative direction was not greater than 1.2% in all cases, while the maximum value in the positive direction was 2.5%.The network performance performed similarly in all cases examined, and no significant differences were observed.
For the second series of tests, the starting point was the built-in network eon_N15_E66 (with 66 links), as depicted in Figure 11.The network was also tested with 30, 45, and 60 nodes five times each, starting from different nodes.Additional nodes and links were randomly added to the basic network.Consequently, the 30-node network (Figure 12) had 108 links, the 45-node network (Figure 13) had 152 links, and the 60-node network (Figure 14) had 214 links.The aim was to significantly increase the number of connections compared to the previous test and evaluate the selected SDN-based energy-saving solutions.The simulation results are presented in Figures 15-18.Similarly to the previous test, the y-axis represents the percentage of energy consumption relative to the expected level, while the x-axis indicates the number of requests.As observed, the network consumed the most energy when all switches and links were active.The average energy savings achieved through the tested methods yielded similar results to the previous topology, although higher link numbers naturally led to increased energy consumption.In the case of 15 nodes (Figure 15), Giroire et al.'s heuristic algorithm and the MHAES yielded the best results.The MHAES achieved the best performance with 25% average savings for 80 requests, surpassing Giroire et al.'s heuristic algorithm by 2%.
The simulation results are presented in Figures 15-18.Similarly to the previous test, the y-axis represents the percentage of energy consumption relative to the expected level, while the x-axis indicates the number of requests.As observed, the network consumed the most energy when all switches and links were active.The average energy savings achieved through the tested methods yielded similar results to the previous topology, although higher link numbers naturally led to increased energy consumption.In the case of 15 nodes (Figure 15), Giroire et al.'s heuristic algorithm and the MHAES yielded the best results.The MHAES achieved the best performance with 25% average savings for 80 requests, surpassing Giroire et al.'s heuristic algorithm by 2%.The simulation results are presented in Figures 15-18.Similarly to the previous test, the y-axis represents the percentage of energy consumption relative to the expected level, while the x-axis indicates the number of requests.As observed, the network consumed the most energy when all switches and links were active.The average energy savings achieved through the tested methods yielded similar results to the previous topology, although higher link numbers naturally led to increased energy consumption.In the case of 15 nodes (Figure 15), Giroire et al.'s heuristic algorithm and the MHAES yielded the best results.The MHAES achieved the best performance with 25% average savings for 80 requests, surpassing Giroire et al.'s heuristic algorithm by 2%.For 30 nodes (Figure 16), similarly to the previous topology, the MHAES and Giroire et al.'s heuristic algorithm demonstrated initial energy savings compared to networks with fewer nodes.The MHAES already outperformed the other methods after 35 requests.The energy savings achieved with 80 requests were similar to those obtained with the first topology.
In the case of networks with 45 or 60 nodes (Figures 17 and 18), the MHAES and Giroire et al.'s heuristic algorithm once again outperformed the other tested solutions.For 45 nodes, the MHAES surpassed Giroire et al.'s heuristic algorithm after the 30th request.With 80 requests, these two algorithms still consumed the least energy, but their advantage was not as significant as with a smaller number of nodes.Compared to the RMAD, RMAD+, and Giroire et al.'s heuristic algorithm, the MHAES achieved 7% and 9% less average energy consumption, respectively (compared to all switches and links, the savings were 30%).In the case of 60 nodes, the MHAES outperformed the heuristic algorithm by 2% after 45 requests, maintaining the advantage even after 80 requests.It is important to note that due to the larger number of links, all tested methods exhibited smaller For 30 nodes (Figure 16), similarly to the previous topology, the MHAES and Giroire et al.'s heuristic algorithm demonstrated initial energy savings compared to networks with fewer nodes.The MHAES already outperformed the other methods after 35 requests.The energy savings achieved with 80 requests were similar to those obtained with the first topology.
In the case of networks with 45 or 60 nodes (Figures 17 and 18), the MHAES and Giroire et al.'s heuristic algorithm once again outperformed the other tested solutions.For 45 nodes, the MHAES surpassed Giroire et al.'s heuristic algorithm after the 30th request.With 80 requests, these two algorithms still consumed the least energy, but their advantage was not as significant as with a smaller number of nodes.Compared to the RMAD, RMAD+, and Giroire et al.'s heuristic algorithm, the MHAES achieved 7% and 9% less average energy consumption, respectively (compared to all switches and links, the savings were 30%).In the case of 60 nodes, the MHAES outperformed the heuristic algorithm by 2% after 45 requests, maintaining the advantage even after 80 requests.It is important to note that due to the larger number of links, all tested methods exhibited smaller savings compared to the first test series.The deviation from the average value within these topologies in the negative direction was not greater than 1.7% in all cases, while the maximum value in the positive direction was 2.8%.The network performance performed similarly in all cases examined, and no significant differences were observed.
Regarding the MHAES, it is crucial to emphasize that the capacity threshold number and the threshold number of active switches were determined empirically.Further research will focus on predicting these values accurately based on collected samples using fuzzy logic and other artificial intelligence techniques [50][51][52][53].The development of an effective method to predict the power demand of the network, enabling precise determination of the necessary threshold numbers, is of utmost importance.

Conclusions
All of the SDN-based energy-saving solutions examined in this study are highly valuable; however, they vary in their energy-saving capabilities.Several studies have been conducted on this topic, producing many relevant findings.Difficulties arose during the investigation due to variations among researchers in terms of the tested methods, network topologies, and software utilized.Therefore, this study conducted two sets of tests, each employing different built-in topologies and four different node numbers per topology.Within these environments, seven different methods were compared.The baseline case involved all switches and links being active, which was then compared to the Rectilinear, DevoFlow, EXR, RMAD, RMAD+, Giroire et al.'s heuristic algorithm solutions, and the MHAES proposed in this article.
Based on the results, it can be concluded that both the proposed MHAES and Giroire et al.'s heuristic algorithm achieved similar performances and provided significantly higher energy savings compared to the other examined solutions.It is worth noting that in all the tested environments, MHAES outperformed Giroire et al.'s heuristic algorithm after 40-45 requests.
To better anticipate future requirements, fuzzy logic can play a crucial role.Leveraging the capabilities of fuzzy logic, it would be advantageous to predict the threshold number for capacity and the number of active switches to be applied in the MHAES, based on network needs and load.
Another aspect that deserves attention in future research is the development and placement of rules on switches.Transferring decision making from the controller to the switches increases the energy consumption of the MHAES for initial requests.Therefore, a suitable solution must be devised to ensure more efficient operation.
Attention must also be paid to the fact that the algorithm has to take into account the diversity of traffic control devices, which can also affect the degree of energy savings.
It would be important to create a fast-intervention SDN application that, based on the queried data, could change the messages sent by the controller with the help of a mobile device of any platform in terms of energy saving [54,55].

Figure 7 .
Figure 7.The average energy consumption with 15 nodes depending on the number of requests.

Figure 8 .
Figure 8.The average energy consumption with 30 nodes depending on the number of requests.

Figure 9 .Figure 7 . 24 Figure 7 .
Figure 9.The average energy consumption with 45 nodes depending on the number of requests.

Figure 8 .
Figure 8.The average energy consumption with 30 nodes depending on the number of requests.

Figure 9 .Figure 8 . 24 Figure 7 .
Figure 9.The average energy consumption with 45 nodes depending on the number of requests.

Figure 8 .
Figure 8.The average energy consumption with 30 nodes depending on the number of requests.

Figure 9 .Figure 9 .
Figure 9.The average energy consumption with 45 nodes depending on the number of requests.

Figure 10 .
Figure 10.The average energy consumption with 60 nodes depending on the number of requests.

Figure 10 .
Figure 10.The average energy consumption with 60 nodes depending on the number of requests.

Figure 15 .
Figure 15.The average energy consumption using 15 nodes depending on the number of requests.

Figure 16 .Figure 15 .
Figure 16.The average energy consumption using 30 nodes depending on the number of requests.

Figure 15 .
Figure 15.The average energy consumption using 15 nodes depending on the number of requests.

Figure 18 .
Figure 18.The average energy consumption using 60 nodes depending on the number of requests.

Figure 18 .
Figure 18.The average energy consumption using 60 nodes depending on the number of requests.
r , r ∈ R Offered route rule for r.From this information, s(r) denotes the source host of a demand r, and t(r) is the target host