Keywords

1 Introduction

Since the start of the 1970s, the use of wireless networks has increased. Presently, two alternatives exists for mobile wireless networks. One of the alternative is infrastructured networks, i.e., networks that have fixed and wired gateways. The router which helps to perform the routing is called a base station [1]. A mobile node in such networks joins to the nearest base station in its transmission range for communication to other nodes. Another category of wireless network is the infrastructure-less network which is also known as an ad hoc network. There is no fixed route in ad hoc network; all the participating nodes can be connected dynamically in any topological manner [2]. All the moving nodes in such networks act as routers that search and sustain the paths to other moving nodes. Such temporary networks can be used in meetings, search-and-rescue operations in crises or situations where persons need to transmit the information quickly, and data acquisition operations in inhospitable terrains [3].

Because the nodes establish a temporary way of communication without having any pre-installed infrastructure. Almost all the intermediate nodes involve in relaying traffic generated as a result of communication. So, such types of network are sometimes also known as mobile multi-hop ad hoc networks [4].

Exchanging data packets between the two nodes is called the process of routing. As there is no fixed path due to moving nodes, therefore the routing possesses a challenge to the MANET. It means it is difficult to identify the stable path between the source and the destination [5]. The frequent breakup and establishing the new path make routing a difficult task in MANETs. Therefore, it always requires choosing an efficient routing protocol.

There are three categories of routing protocol in MANET, i.e., proactive routing, reactive routing, and hybrid routing. All the nodes in proactive routing always maintain a routing table which contains the path to every other node in network. In reactive routing, there is not pre-existing routing table but the routes are established when there is requirement of communication between two nodes. The hybrid routing is the mixture of the two routing techniques [6].

The traditional process of routing requires the whole network route information for path selection process. The algorithm in such protocols places huge overheads on updating of routing information when there is change in network system. This is because the routes are established and break frequently due to moving nodes. Congestion also presents challenge in routing [7].

To astound the presented drawback as stated above, adaptive and distributive routing algorithms are needed to be proposed. There are many optimization techniques like genetic algorithms, cuckoo search, and particle swarm optimization [8, 9]. One of the techniques with such a property is centered on ant colony optimization (ACO) algorithm. The ACO routing which is the result of the nature of swarm intelligence is a distributive multi-agent system. Intelligent swarms such as honey bees or ants can adapt their deeds smoothly in the environment where they are living. By the application of the distributive routing scheme, the problems presented previously can be avoided and the overall performance will be improved.

Biologically distributed ant colonies while having the simplicity of their components exhibit highly structured social organization. As an effect of this, colonies of ants can achieve astonishing results in complicated responsibilities that could not be achieved by a single ant. The fundamental principle followed by the ant routing algorithm is that the ants lay pheromone (a chemical) while roaming in search of food. While searching food, ants travel on path which have high pheromone concentration leading to high probability [10]. It was also revealed experimentally which shows the pheromone trail behavior, and this ultimately laid the foundation for the emergence of the shortest path [11].

For illustrating the ant behavior, the experiment of the double bridge was also conducted where ants require to select from the two different paths of different lengths. As can be seen in Fig. 1 (a) that in the beginning, the different ants explore all possible routes to their destination [12]. After passing a few times, it can also be seen in Fig. 1 (b) that now most of the ants take the shortest path to the food location, while some remaining ants still explore other non-optimal routes. Marco Dorigo presented this double-bridge experiment, and this is also the copyright for his work [4, 5, 13]. We have only referred to this experiment for showing the behavior of ants when there is the availability of multiple paths between the nest source and destination food source [14].

Fig. 1
Two double bridge diagrams of foraging areas, up to the nest. The path includes 2 bridges part from the straight paths.

Double-bridge experiment

2 Ant Algorithm for Solving Routing Problem

The ant colony optimization algorithm can be categorized into the following steps for solving the routing problem:

  • Probability of a move:

When multiple links may lead toward the destination, the link that has the highest value of probability \(p_{i\Psi }^{k}\) is selected as the next node on which the ant/data/control packet can move to reach the destination. The value of probability \(p_{i\Psi }^{k}\) ranges from 0 to 1. The probability value is equal to 0 for all moves which are infeasible [15,16,17]. The probability is calculated as shown in Eq. (1)

$$ p_{i\Psi }^{k} = \left\{ {\begin{array}{*{20}c} {\frac{{\alpha . \tau_{i\Psi } + \left( {1 - \alpha } \right). \eta_{i\Psi } }}{{\mathop \sum \nolimits_{{\left( {iv} \right) \notin {\text{tab}}u_{k} }} \left( {\alpha . \tau_{iv} + \left( {1 - \alpha } \right). \eta_{iv} } \right) }} + {\text{ if }} \left( {i\Psi } \right) \notin {\text{tab}}u_{k} } \\ {0 {\text{ Otherwise}}} \\ \end{array} } \right. $$
(1)

Parameter α is used to define the comparative importance of the attractiveness of the pheromone trail. α is a user-defined parameter and normally ranges from (0 ≤ α ≤ 1):

  • Trail update:

At each iteration, the pheromone trail is increased on the favorable paths as shown in Eq. (2) which means the paths which are selected by the ants for traversal. It is because of the ant’s property to lay down pheromone while moving [18, 19]. The trail on other paths is decreased (which are not selected).

$$ \tau_{i\Psi } \left( t \right) = \rho \tau_{i\Psi } \left( {t - 1} \right) + \Delta \tau_{i\Psi } $$
(2)

where ρ is the coefficient defined by the user for pheromone and Δτιψ is the summation of the contributions of the trail by all the ants that make use of move τιψ for constructing the solution.

  • Attractiveness and Trail

For any ant k, the probability \(p_{i\Psi }^{k}\) is calculated while traversing from node i toward state ψ and depends on the combination of two values [20, 21]:

  1. 1.

    As computed by approximately heuristic indicating the a priori desirability of the ant movement, the attractiveness η is calculated.

  2. 2.

    The value of pheromone trail level τ of the move that indicates competently it has been present in the past to make that particular move.

3 ACO Pseudocode

The pseudocode for the ant algorithm which is stated above [22] can be written as follows. It is already illustrated parameter-wise in the above section.

1. (Initialization)

           Assign the initial value to parameters \(\tau_{i\Psi }\) , \(\Delta \tau_{i\Psi }\) for all i and Ψ

2. (Construction)

for every ant k do

               repeat

                                 Compute \(\Delta \tau_{i\Psi }\), \(\tau_{i\Psi }\).

                           choose the next move based on path with high probability add the selected path to the path of k-th ant till the k-th ant has finished with ıts solution

               end do

3. (Updating the Pheromone Trail)

                     For every ant on the path move ( \(i\Psi\) ) do

                    compute Δ \(\tau_{i\Psi }\) and apprise the pheromone on selected paths

4. (Condition of the Termination)

                 If end of the condition is not achieved then move to step 2.

4 Flowchart for ACO Routing

When a source has data to be sent to the destination, a proper procedure is applied to calculate the path to the destination [23]. The following algorithm illustrates the steps for calculating the optimizing path between the source and the destination. The population of ants is created according to the required number of necessary iterations. Every any is launched in a new iteration to find the optimal path. That ant evaluates the better solution according to the present parameter. Each checks whether the termination criteria are reached or not. If it is reached, then we can say that solution has been found. If the condition is not met, then the ant moves on the path depending on the pheromone with a higher probability. The ant deposits the pheromone while moving on the path selected as part of the algorithm. The path is selected from the available paths with the least value of distance and a higher value of pheromone. The pheromone is evaporated on the unfavorable paths, and it is deposited on the favorable paths by the ants passing from this path [24]. When the termination condition is achieved, then the algorithm gives the required solution; otherwise, it moves toward following the same steps as stated above (Fig. 2).

Fig. 2
A flowchart of ant-based algorithm. It starts with the launch of a new iteration, followed by finding new solutions and evaluating them. It ends when the termination criteria is met and a solution is found.

Flowchart for ant-based algorithm

5 Running Simulations

For executing a specific scenario

Run the script:

                                      ./Run Scenario.bat scenario

                                      ./Run Directory seed < -cache > 

In the above command, the script is executing with the scenario stored in the file “Scenarioo.bat”. The sample is stored in Run Directory. The value of the seed can be practiced to set the seed value of the random number generators. The value in the cache option can be used to assign the modified version of the program for ACO-MANET. It also facilitates the extended caching value in place of the original ACO-MANET value. This procedure can be used to initiate/call the other procedural scripts for setting up the directory structures and for generating the new movement files (if that is not existing previously) and executing the simulation scenario for the given simulation.

As an example, for the sake of running the conf scenario in the environment of ACO-MANET, we need to run the following command:

                                     ./ RunScenario.Bat Conf Run0 2 -Cache

Similarly, the file of movement will be stored in:

                                    ACOtools/ACOMotion/run0/conf.motion

The file in which trace information is to be stored in:

                                    ACOtools/ACOTraces/run0/original/conf.tr

For examining the output from the generated trace file can be run as:

                                    Awk-fACO-tools/eval.awkACO-tools/ACO-traces/run0/original/conf.tr

In the above algorithm, the agents based on the ants constantly go on updating the routing tables after iteration from each ant and according to the states of the network. Two improvements are proposed by using the term blocking probability in the above-stated algorithm which was not present in the traditional routing algorithms. The first advantage of ant-based algorithm is that the availability of the path can be searched within no times by using the routing tables. This will reduce the delay in the network setup considerably. The second advantage of this algorithm is that it is flexible because it can adjust the number of ants while calculating the probability on each node by ants to achieve a better result in terms of performance. Therefore, it can be said that the new ant-based algorithm is highly adaptive and robust.

6 Results Received After Simulations

The proposed ant-based algorithm is executed along with other traditional algorithms of MANETs like AODV, DSR, and DSDV.

The results after the simulation have shown that the ant-based algorithm performs better than AODV, DSR, and DSDV. More packets were sent when packets are sent using an ant algorithm which is also shown in Fig. 3. Figure 4 shows that a lesser number of packets are dropped while using the ant algorithm as compared to other traditional algorithms.

Fig. 3
A bar graph of the number of T C P packets sent versus bars A D D V, A N T algo, and D S D V. The highest value is 12931 of A N T algo.

Number of TCP packets sent

Fig. 4
A bar graph of the number of T C P packets dropped versus bars A D D V, A N T algo, and D S D V. The highest value is 43 of D S R.

Number of packets dropped

7 Conclusion and Future Work

Because of the absence of a centralized installed infrastructure, mobile ad hoc networks are flexible. Nowadays, highly sophisticated devices are used for getting an increased level of applications using which can be seen as the future of wireless transmission technologies. However, routing is one of the main challenges in MANETs which is happening due to the movement of nodes. In this paper, an ant-based routing algorithm for mobile ad hoc networks has been proposed. We are also planning to focus our future studies on reducing the overheads caused due to the maintenance of routes. Many techniques that are proposed using an ant-based routing algorithm are emerging better to find the globally best solution in terms of routing. It is found that due to the movement of nodes, the links become unstable, and also due to limited resources, it becomes difficult to manage the routes leading to link failure in traditional routing algorithms, whereas ant-based algorithms can easily handle such types of issues in a better way. Ant-based algorithms are found to produce better results which can also be seen in the figures shown in the result section.