Adaptive Mechanism for Discovering Internet Gateways in Wireless Networks Using Swarm Intelligence

One of the most critical and challenging processes is the provision of internet connectivity for nodes in Wireless Mesh Networks (WMN) or mobile ad hoc networks (MANET). A wide variety of “business and non-commercial” applications are implemented in MANET, most of them gaining Internet resources. Gateway (GW) or Mesh GWs are the key components of MANET’s Internet connectivity, and multiple GWs are implemented to improve MANET’s capabilities. Many of the current routing protocols are implemented and improved to work with MANET, either using traditional routing approaches or tree-based network approaches. But since MANET is a complex and transient network, it is very necessary to explore new or tack the GWs failure that adds more overhead on the network. Thus, in this paper a hybrid protocol inspired by the swarm intelligence technique that follows the non-root GWs discovery approach using Ant Colony Optimization (ACO) is suggested. The experimental results validate the processes of exploring new GWs, testing and maintaining existing paths to GWs, exploring different paths to existing GWs and detecting any connection failure in any route, and attempting to fix that failure.


I. INTRODUCTION
MANET is a group of wireless nodes that are dynamically self-organized and self-configured, creating a temporary network arranged in an ad-hoc manner without any fixed infrastructure services. Each node acts as a source and acts as a router as well as being able to forward packets (see Fig.1) [1]. MANET's distinctive characteristics have made it useful for a wide range of applications, including numerous types of commercial (smart agriculture, ad-hoc gaming, intelligent transport system) and non-commercial applications (wildlife tracking, disaster recovery, military application), etc. [2] and most applications and users in MANET consume internet resources. Typically, the GW is the most critical component of internet access, and Multiple-GWs should be deployed to provide high performance and efficient internet access [2], [3]. Due to the obvious design and attributes of the MANET and without any fixed infrastructure services [1], the process of discovering GWs connecting to or leaving The associate editor coordinating the review of this manuscript and approving it for publication was Tawfik Al-Hadhrami . the network, or even detecting failures or new connections to existing GWs, is complicated and higher overhead and loaded on the network. Several current routing protocols are attempting to provide and improve internet connectivity in MANET.
Routing protocols are divided into three approaches (See Fig. 2): Reactive (on-demand) routing protocols, proactive routing protocols (table-driven), and hybrid routing protocol. Firstly, reactive protocols are the on-demand method in which routes are defined only when the source node is The Swarm Intelligence-based Algorithmic Approaches (SI) like ''Ant Colony Optimization (ACO), Artificial Bee Colony Algorithm (ABC), and Particle Swarm Optimization (PSO)'' are more effective than early approaches in providing loop-free, energy-aware, and Multi-path routing in mobile Ad-hoc [12]- [14]. They are further promising in providing better routing overhead, average end-to-end delay, and packet delivery ratio [15], [16]. The ACO technique was developed to find an ideal solution for a certain optimization problem through the communication of a group of artificial ants that imitate the communication behavior of real ants. The pheromone concentration deposited by the ants across their traversal path determined the optimal path between the source and the destination. ACO is a heuristic approach that takes into account all the ants present in the network. ACO is providing better performance to discover the shortest route to the destination node compared to optimization techniques like Genetic Algorithm (GA) and Simulated Annealing (SA). The artificial ants used in ACO reflect control packets used to collect information between the source and the target nodes. There is a routing table with an entry for each of the neighboring nodes stored at each node in the network. Each of these entries refers to a pheromone value including a set of variables, and these values are used by the node to evaluate the quality of each path for multiple paths available between the source and destination nodes [17].
In this paper, we proposed a modified hybrid routing protocol based on Swarm Intelligence Ant colony optimization. The proposed protocol improves processes for exploring new GWs, testing and maintaining current GW routes, exploring new paths to current GWs, identifying any connection failure in any route, and attempting to fix that failure. It's a hybrid form, using ACO. It is a Multi-path Multi-GW solution that overcomes the drawbacks of current traditional protocols, minimizes the number of broadcasting in the network due to the ACO that will reduce overhead on the networks, and the time of discovery over tree-based routing protocols. This paper is a substantial extension of our conference paper [33]. Compared with this small version, further details of the suggested method are presented, and more extensive performance evaluation is conducted. We also give a more comprehensive literature review to introduce the background of the offered method and make the paper more selfcontained. Therefore, this version of the paper provides a more comprehensive and systematic report of the previous work.

II. RELATED WORKS
In this section, we will present a brief of earlier studies that provided performance evaluation and comparison of existing MANET routing protocols and some of their limitations. We will also introduce some researches that focus on the advantages and benefits of integrating ACO in MANET's routing protocols.
Sureshkumar et al. [18] discussed the performance review of AODV that is a reactive routing protocol. It is one of VOLUME 9, 2021 MANET's most commonly used routing protocols and it discovers the destination route when the source node desires a route. It operates in two steps: one is route exploration and the other is route maintenance. However, AODV needs to enhance in terms of QoS (Quality of Service), packet delivery, and node energy [8]. Also, it is difficult to calculate the routing expiry time if no data is transferred [9], and it does not support finding new paths or exploring different gateways after discovering the initial paths to the existing gateway.
Kumar and Hans [19] presented an evaluation of the results of comparing the proactive routing protocols Destination-Sequenced Distance Vector (DSDV), Destination-Sequenced Distance Vector improvement (I-DSDV), and OLSR protocols. This research confirms that in terms of end-to-end delay and packet delivery fraction, OLSR is doing better. OLSR is a modification of the pure LSR protocol that was developed specifically for MANETs and achieves optimization over LSR using MPR (Multi-Point Relay) nodes. In OLSR, the Multi-point relay principle (MRP) eliminates control traffic overhead. Because of periodic routing table update intervals, bandwidth use is increased, and often finding MPR becomes difficult [5]. Patel and Srivastava [20] gives a performance evaluation of ZRP and other hybrid routing protocols introduced in the literature as enhancements to the basic version of ZRP such as Independent Zone Routing (IZRP), Two-Zone Routing (TZRP), and Fish-eye Zone Routing (FZRP). They use a hybrid framework composed of a proactive link-state routing protocol that handles the routing within the radius (zone) and a reactive routing protocol that demands routes for destinations outside the zone. They significantly decrease the quantity of communication overhead by allowing routes to be discovered faster by re-transmission and the drawbacks of them are they will function as pure proactive protocols for a large value of routing zone, while for the small value they behave like reactive protocols and they often create overlapping zones [21].
Yang et al. [22] presented a comprehensive analysis of hybrid wireless mesh protocol (HWMP), the default routing protocol for IEEE 802.11. HWMP is AODV-based and has a proactive routing configurable extension. It uses layer 2 routing MAC address and Radio-Aware as a routing metric. It uses tree-based routing with an on-demand routing protocol to address mobility. HWMP suffers from periodic route rebuilding due to unstable connection status in wireless environments, path diversity is not effectively utilized by single path routing [3] and as it is a tree-based proactive mode, it is fully centralized and restricted by the root node, which creates a root node bottleneck. The authors in [3] suggested multigateway multipath routing protocol (MGMP) to address the shortcomings of HWMP. It is developed to discover multiple routes in Multi-Gateway MANET. However, the layout of the tree-based architecture provided in HWMP is still used, so it also creates a bottleneck to the root node and more broadcast.
ACO is a well-known intelligent algorithm where complex collective behavior emerges from the behavior of ants. As one of the most successful swarm intelligence algorithms, it has also succeeded in some fields of the design of MANET [23].
Gupta et al. [24] provided a study that approved ACO as an efficient and comparatively better way to enhance the overall performance of a MANET routing protocol in terms of overhead and connectivity. This study emphasizes the importance of using ACO in the routing algorithm for MANETs. Many researchers tried to enhance the traditional MANET routing protocols by implemented them with ACO to overcome the limitations of them [22]. Ant-AODV is a hybrid protocol that is able to provide reduced end-to-end delay and high connectivity as compared to AODV, Ant Dynamic Source Routing (Ant-DSR) is a reactive protocol that implements a proactive route optimization meth-od through the constant verification of cached routes, This approach increases the probability of a given cached route express the network reality and The HOPNET algorithm also involves characteristics of Zone Routing Protocol, a hybrid protocol which combines benefits of proactive and reactive protocols [17], [23]- [25].
Habboush [17] summarized the research contributions available for addressing the problems of routing in MANET, he clarified the studies that using ACO algorithm to solve the routing problems in MANET and in particular, the phase of route discovery at the initiation of communication between two network nodes. He discussed routing solutions that took various parameters such as power consumption, QoS, and security aspects into account. He explained different ACO based routing protocol like Probabilistic Emergent Routing Algorithm (PERA), QoS Enabled Ant Colony Based Multipath Routing Protocol (QAMR), Position-Based Ant Colony Routing for MANET (POSANT), Energy-Aware Ant Based Routing (EAAR), and Secure Power-Aware Ant Routing Algorithm (SPA-ARA). This paper eventually concluded that the ACO technique is one of the most successful techniques for resolving issues related to route discovery during the connection between different nodes in MANET.
Taraka and Emani [26] provided a comparison study of AntHocNet routing protocol which is a hybrid routing protocol inspired by ACO and it supports Multi-path Multi-GW data transmissions. This protocol in its reactive phase discovering the distention path only when it needs to establish a communication session. And in the proactive phase, it maintains and updates the existing paths and searches for new paths. Its routing information stores in a pheromone table like other ACO algorithms and it deals with link failure using specific reactive mechanisms, like local route repair in addition to the use of warning messages. AntHocNet is suggested for large-scale, high data rate networks as it is a hybrid protocol and Multi-path Multi-GW and allows faster network discovery. But it is suffering from lopping in some scenarios [27] and it is a large consumer of energy [28].
The previous researches tried to hybridize between the traditional protocols and ACO to overcome the limitations of them by using the traditional approaches as the reactive phase and ACO as the proactive. Also, they're using the ACO to support multi-GWs for protocols that do not support or implementing ACO to reduce the overhead that is caused by the traditional protocols on the network. Our proposed protocol is built on ACO in all its phases, so, it will enhance the routing functionality in both discovery time and the network overhead.

III. THE PROPOSAL ALGORITHM
The proposed protocol was implemented to provide MANET network nodes with an automated and effective way to discover internet gateways (GWs) connected to the network. It is a hybrid protocol was developed in 3 phases as illustrated in Fig. 3. The GW offloading phase, which is a new technique that will highly reduce the GWs' overhead caused by the control packets generated by the GW to respond to nodes either to discover new paths or maintain existing paths, the reactive phase which used to discover connected or new GWs, and the proactive phase that used to maintain existing paths, explorer new paths, and detect any outage or failure in connected GWs. Each node will create a data structure that will be saved in an array called a pheromone table (PH-TABLE ). This data structure will contain a list of all N ID s, GW ID s, NN ID , PHQ GW for and EV for each path as described in Table 1 The PHQ GN will be calculated for each GW's path from the minimum bandwidth link among the path (BW MIN ) as where BW i and BW i−1 are the bandwidth link of the current and previous nodes, the queue length of maximum node's queue among the path (Q MAX ) as where Q i and Q i−1 are the queue length of the current and previous nodes, and the number of nodes among the path (N PATH ). The EV will be represented as the following: EV ∈ (0, 0.5, 1) The path is verified 0.5 The path needs to check 1 The path is expired where 1 means the path is verified, and available for data transmission and exchange with neighbors to update their PH-TABLE , 0.5 means the path needs to check and a proactive process should be initiated to update that path, and 0 means the path is expired or no longer available. The proposed protocol is a non-tree-based routing protocol or non-root discovery technique that means the discovery of the GWs will be initiated from each node instead of initiated by broadcasting announcements from the GW. And to achieve that, we used SI and especially the ACO. In ACO an electronic packet will represent the ant, it is called an ant agent. There are two types of Ants agent, an ant agent called Forward Ant (FW-ANT ) which is used to find and explorer all available GW's paths and the Backward Ant (BW-ANT ) which will collect the necessary data required to build the PH-TABLE . In the next sections, we will explain in detail each phase

A. GW OFFLOADING PHASE
In all previous and current routing protocols, in reactive and proactive phases, each node in the network sends a periodic control packet either to explore the GW or to verify its existence, and the GW will replay to all the packets, which leads to overhead on the GW just to serve the exploration of the network. So, we're offloading this operation from the GW to its neighbors' nodes, and we're dedicating the GW to serve its main job which is providing internet access. In this phase, every GW announces its neighbors' nodes about its existence by sending a broadcast packet periodically, and to ensure the broadcast ends at the next neighbors, it makes the TTL=1. This packet will contain information about the GW so each neighbor will estimate the quality and status of that GW each time the packet is received and consider the GW down if no packet is received. Every neighbor receives a GW broadcast announcement, tags itself as a GW neighbor (GW N ) and replays back to any node that attempts to check the availability of the GW on behalf of it.

B. REACTIVE PHASE
The reactive phase is the process of exploring new undiscovered GWs connected to the network, and it is used in two different situations. Firstly, in the initial discovery process when the node has no GW at its PH-TABLE , it will send FW-ANT to all neighbors' nodes asking for information about available GWs. Secondly, in the continuous discovery process when it has GWs but attempts to explorer new others. In this phase, it will send a FW-ANT to every neighbor which does not appear as the next node in any GW's path in the PH-TABLE .
Each neighbor receives a FW-ANT , will search its PH-TABLE and if it knows any GWs, it will check the PHO GN and the EV of each. For each PHQ GN , if the EV = 1 so, the path is verified and updated, and the tour of the FW-ANT will end and the FW-ANT will be converted to a BW-ANT . And if the EV = 0.5 so, the path is valid but not updated, and the node will start the proactive process for that path to update it ''which will be explained in detail in the next part''. Then after the proactive process is completed for that path, the FW-ANT will be converted to a BW-ANT and forward back to the source node. And for paths with EV = 0, they will be considered not available and skipped. But if the received node' PH-TABLE does not have any GW; it will repeat the same process and send a FW-ANT to its all neighbors except the one that it just received from to prevent any loops. This process will continue until the FW-ANT received by node has GW in its PH-TABLE or received by a GW N , then the FW-ANT will be converted to be a BW-ANT and return to the source node among the same path. The BW-ANT will update the PH-TABLE of each node with the GW ID , the NN ID , and its PHQ GN depending on the BW MIN , Q MAX , and the N PATH of the path from the GW to the current node. Also, it will update the path's EV = 1.

C. THE PROACTIVE PHASE
The proactive phase is the process where the GW path or paths that exist in the PH-TABLE need to be maintained and maintain here means to check the path availability and collect its quality. In normal circumstances, each node might have multiple GWs in its PH-TABLE and even for each GW, there will be multiple paths. So, the proactive process will update these paths and the EV value will determine which path is valid and updated, which is valid but required to check, and which is expired. Also, the proactive phase will be used to explore better new connected GWs among existing GWs' paths, ''if there are multiple GWs and their paths pass through the same neighbor node, only the GW ID with the best PHQ GN will be saved in the PH-TABLE ''.
Each discovered GW's path will be saved in the PH-TABLE with EV = 1 which means it is valid and updated, but if this path is not used for a while, the node will change its EV value to be 0.5 which mean it is not updated and need to be checked. In this case, the proactive process will start by sending a FW-ANT to the node with the NN ID in that path to ask for an update about that GW ID . The next node will check its PH-TABLE and if it found EV of that path = 1, then it is updated and will convert the FW-ANT to be BW-ANT and return it to the source node with the PHQ WN of that path, if the EV = 0 that means it is not valid and will send BW-ANT to inform the source node to expire that path and if the EV = 0.5 that means this node also needs to check and update for that GW's path and it will repeat the same operation with NN ID from its PH-TABLE until the FW-ANT converted to BW-ANT either by a node among the path that has EV = 1 or reaching the GW N and there, it will be the end of any FW-ANT and no FW-ANT reaches the GW because of the offloading process. The BW-ANT will return using the same FW-ANT path and update the PH-TABLE of each node among the path as described previously. Finally, in some cases the received node will have better new connected GW than that source node asked for and here it will send a BW-Ant to the source node with EV = 0 for the old GW ID path and the new GW ID with its quality. The source node will expire the old GW ID ' path and create a new record to the new GW ID in the PH-TABLE . The following formula will explain the action will take for the FW-ANT at each node as (5), shown at the bottom of the page.
The proposed protocol is a Multi-GWs Multi-paths which means the node could transmit data to the internet through multiple GWs and even multiple paths of the same GW depend on the quality of the available paths in the PH-TABLE . Choosing path meaning choosing its NN ID to forward the data and the node will choose the best paths or the next NN ID with the probability as: where P NIDG is the probability of the NN ID to reach the GW, NN I ID is the set of the NN ID of all GWs' paths, PHQ GN is the pheromone quality of the GW's path through the NN ID , and β1 is a parameter value that can control the exploratory behavior of the ants [29]. In most ACO routing protocol, β1 = 1 to choose the best path [29], but since our proposed protocol is a Multiple-paths Multiple-GWs and from the experimental result we gave it a big number ''20'', which will lead the data to be distributed across multiple paths if their quality is closer. However, if one path is obviously better than the others, it will almost be chosen.

D. THE DIFFERENT BETWEEN THE REACTIVE AND PROACTIVE PHASE.
The reactive phase is used in the initial discovery process where the node has no GW in its PH-TABLE and needs to discover the current connected GWs to the network and in the contentious discovery process where the node tries to explorer new connected GWs through the neighbor nodes not listed in the PH-TABLE as NN ID . However, the proactive phase is used to check the availability and the quality of the existing GWs' paths. Also, it used to explorer new connected GWs but through the existing NN ID s listed in the PH-TABLE .

IV. EXPERIMENTAL RESULTS
In this experiment, we implemented our routing approach using the MATLAB 9.1 (R2016B) simulation also, implemented AODV and HWMP, and then compared our approach to each of them. We chose AOVD because it's commonly used in MANET and HWMP as it's the default IEEE routing protocol in MANET. We implemented AntHocNet protocol and compared our approach with it because AntHocNet is the closest routing protocol to our approach as it is a hybrid protocol, Multi-path Multi-GWs, and built-in ACO. Also, it widely used and one of the most effective routing protocols in MANET. Equations used for implementing all methods used in comparisons that include AODV, HWMP, and AntHocNet are discussed briefly in [29]- [32].
The simulation was carried out in several iterations and stages, in each cycle we modified the number of nodes, the number of GWs, and used several simulation times, as shown in Table 2, to validate our approach and to confirm its stability under various circumstances and situations. After    applied each protocol, we addressed three iterations of our simulation and described the intent and the experimental outcome of each one. In the first iteration, we measured the reactive phase outcome for each protocol and estimated the time for all nodes to discover all GWs with all possible paths.We also measured the following in each iteration. The routing overhead, which is the ratio of the routing control packets to the total network packets. The GWs overhead, which is the ratio of the GW routing control packets to the total packets that the GW handle both to and from internet.
In the experimental result, we used two protocols HTTP and video streaming. HTTP is the main protocol of Internet traffics. Video streaming is highly used on the internet nowadays and it will evaluate our protocol in a high traffic network. It is consuming bandwidth higher than voice and almost like FTP traffic.
We noticed in Figure 4 that using the proposed protocol, nodes can discover faster all available Network GWs and each route towards the same GW than AODV, HWMP, and AntHocNet, since even all protocols initiate the exploration phase with broadcasting, but all other protocols needed the discovery package to reach the GW, however, the proposed protocol would stop forwarding the discovery packet at any node among the path that already discovered the GW. So, it's slightly faster than them. The next iteration was introduced to evaluate the discovery time of all new connected GWs at all nodes and to do so, we performed the simulation three times, adding different numbers of new GWs ''1 GW, 3 GWs and 5 GWs'' and evaluating the discovery time for each protocol.  From Figure 5 we found that it took a long time for AODV to explore new GW connected to the network because it is a reactive or on-demand protocol that does not provide any mechanism to discover new GWs if it already has one. For HWMP, AntHocNet, and the proposed protocol, they are faster since they're hybrid protocols, meaning they'll quickly explore the GWs in the proactive phase. HWMP is faster than AntHocNet since HWMP will receive an announcement from the new GW and the time of the discovery will depend on the number of the nodes in the path between the source node the GW but AntHocNet has to reach the GW among the whole path forward then back which case longer discovery time. But in the case of the proposed protocol, it will get the GW information from any neighbor node among the path which already previously discovered the GW without the need to reach the GW itself. So, the proposed protocol performs faster than the other protocols. In the last iteration, as new node was connected to the existing network, we evaluated the time it took to discover all the GWs Figure 6 shows that for every new node connected to the network, the proposed protocol supported excellent discovery  time for the discovery of all available GWs. The explanation, is that for AODV and AntHocNet, the new node will start the whole initial discovery process starting from the source node to the GWs then back to the source, and for HWMP, the new node will wait until receiving all GWs' announcements. But for the proposed protocol, when the new node starts the discovery, all neighbors will immediately respond with all accessible GW and no need to reach each GW in the network.
In Figure 7 we find that, in the initial process, the routing overhead is nearly similar for all protocols that's because they all start with broadcast and HWMP is considerably higher routing overhead because it uses two broadcast packets, one from the node to discover the network and another from the GW to announce about itself. But after the initial process, the overhead for the AODV and the proposed protocol significantly lowered as HWMP continues to use the broadcast in the reactive phase which raises the overhead and AntHocNet keep checking the GWs availability by forwarding ants the whole path forward and back which increase the number of routing control packets over the network. But the proposed protocol will update its routing table ''the pheromone table'' by negotiating neighbors for any changes using the FW-ANT not the Whole path. The overhead AODV decreased as it does not have proactive technique, which is one of its drawbacks.
Finally, Figure 8 reveals one of the advantages of the proposed protocol, GW offloading. The overhead for GW is approximately varying between 20%-28% in AODV, 16%-21% in HWMP, and 20%-26% in AntHoc-Net depend on the internet traffic load in the network. But for the proposed protocol, it is around 7% because the GWN will respond on behalf of the GW where it significantly decreased the GW overhead to the minimum.

V. CONCLUSION AND FUTURE WORK
In this paper, we presented a new routing discovery protocol that is ACO non-root-base routing approach. It is a Multi-gateways Multi-paths protocol that provides path diversity with simultaneous transmission to increase network bandwidth, initiates reactive and proactive phases from the source node using ACO, uses minimal network broadcasts, and outperforms the two common traditional protocols, AODV and HWMP, according to the excremental result in terms of GW discovery time, either the initial exploration phase and proactive path. Also, the result confirmed it is a promising GW discovering protocol compared to the existing bio-inspired routing protocol like AntHocNet which is one of the most effective routing protocols. The most efficient enhancements provided by the proposed protocol over other bio-inspired protocols are that it gets the GWs' existence and quality from the neighbor nodes if available instead of forward the Ant among the whole path. And it introduces a new GW offloading mechanism which significantly decreases the routing control overhead on the GW. The proposed protocol covers the discovery of GWs and their different paths and the reliability, quality, and efficiency of each one and in the future, we intend to support the discovery of the internal network which means discovering destinations within the network and their paths to construct a full routing table to be a complete MANET routing protocol.