Click here to Skip to main content
12,701,314 members (34,058 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked

ARA - Simulation

, 10 May 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Ant-Colony Based Routing Algorithm (ARA) C# Simulation


I'm providing a simulation for the (ARA) Ant-Colony Based Routing Algorithm in A mobile ad-hoc network (MANET).

MANET is a set of mobile nodes which communicate over radio and do not need any infrastructure. These kind of networks are very flexible and suitable for several situations and applications, thus they allow the establishing of temporary communication without pre installed infrastructure. Due to the limited transmission range of wireless interfaces, the communication traffic has to be relayed over several intermediate nodes to enable the communication between two nodes.

Nodes have to work as hosts, and also each node has to be a router, forwarding packets for other nodes.
The main problem in mobile ad-hoc networks is still, the finding of a route between the communication end-points, which is aggravated through the node mobility.
The ARA is a new approach for an on demand ad-hoc routing algorithm, which is based on swarm intelligence.
The ant colony is an Optimization Meta heuristic used to solve different problems, e.g. optimization problems.


Ant colony algorithms are a subset of swarm intelligence and consider the ability of simple ants to solve complex problems by cooperation. The interesting point is, that the ants do not need any direct communication for the solution process, instead they communicate by stigmergy.

The notion of stigmergy means the indirect communication of individuals through modifying their environment. Several algorithms which are based on ant colony problems were introduced in recent years to solve different problems, e.g. optimization problems. To show that the approach has the potential to become an appropriate algorithm for mobile multi-hop ad-hoc networks we present some results, which are based on our simulations.

The basic idea of the ant colony optimization meta heuristic is taken from the food searching behavior of real ants. When ants are on they way to search for food, they start from their nest and walk toward the food. When an ant reaches an intersection, it has to decide which branch to take next.
While walking, ants deposit pheromone, which marks the route taken. The concentration of pheromone on a certain path is an indication of its usage. With time, the concentration of pheromone decreases due to diffusion effects.
This property is important because it is integrating dynamic into the path searching process.

Using the Code

The method that runs on every node in the network.

public void run()
    Console.WriteLine("Thread run for Node";
    Message message;
        if (messagesToSend.Count > 0)
            //Source and Dest must be define
            message = messagesToSend.Peek();
            int nextID = routingTable.getNextHop(message.dest);
            System.Windows.Forms.MessageBox.Show("I'm Node [""] Routing table result :" + nextID);
            if (nextID != -1)
                message = messagesToSend.Dequeue();
                string seqNo = new SequenceFormat().createSequance(message);
                message.sequnceNumber = seqNo;
                message.messageType = MessageType.DATA;
                message.publinNod = Form1.getNodeById(nextID);
                message = messagesToSend.Dequeue();
                string seqNo = new SequenceFormat().createSequance(message);
                message.sequnceNumber = seqNo;
                System.Windows.Forms.MessageBox.Show("I'm Node [" + + "] and i create a Fant." );
                Message fantMessage = new Message();
                fantMessage.source = this;
                fantMessage.dest = message.dest;
                fantMessage.messageType = MessageType.FANT;
                string fantseq = new SequenceFormat().createSequance(fantMessage);
                fantMessage.sequnceNumber = fantseq;

To download the code:


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170118.1 | Last Updated 10 May 2014
Article Copyright 2014 by yazanjaradat
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid