{B.Tatomir, J.Boehle, L.J.M.Rothkrantz}@ewi.tudelft.nl. Abstract. A driver travelling from point A to B in a city constantly gathers valuable information about the ...
Dynamic routing in traffic networks and MANETs using Ant Based algorithms Bogdan Tatomir1,2 , Joost Boehle1 , Leon Rothkrantz1,2 1
Delft University of Tehnology, Mekelweg 4, 2628 CD Delft, The Netherlands 2 DECIS Lab, Delftechpark 24, 2628 XH Delft, The Netherlands {B.Tatomir, J.Boehle, L.J.M.Rothkrantz}@ewi.tudelft.nl
Abstract. A driver travelling from point A to B in a city constantly gathers valuable information about the environment and traffic conditions. This information remains with the driver and therefore precious information that in theory could be useful to other drivers is lost. By equipping automobiles with a PDA, drivers are able, with the use of those PDA’s, to form mobile ad-hoc communication networks. This enables them to exchange information and connect them with the Routing system via wireless access points available along the roads. This paper addresses the problems related to creating and maintaining a hybrid network composed of both wired and wireless ad hoc networks. The system should allow the users to exchange messages and files between one or multiple nodes present in the city street network and provide them with routing information in order to avoid traffic jams or evade from hazardous situations.
1
Introduction
Nowadays in many countries the car traffic is a very big problem. One of the reasons for congestions is that the road capacity is not optimally used. This leads to the development of Routing systems which use dynamic information about the current state of the road network. By avoiding congested roads and using alternative ways instead the network capacity is exploited in a more optimal way. Another cause for congestions are the accidents. If an accident occurs emergency services need to be notified as soon as possible with up-to-date information concerning the current situation. Any automobiles travelling through that area need to be diverted by the police to prevent a major traffic jam. The drivers constantly gather valuable information about the environment and traffic conditions. But usually this information remains with the driver and therefore precious information that in theory could be useful to other drivers is lost. One way to make use of this information is to equip automobiles with a PDA [10]. These PDA’s will form a mobile ad-hoc communication networks, which enables the drivers to exchange the information. Wireless access points available along the roads will collect the data. These base stations are wired connected with each
2
Fig. 1. Routing system
other and wireless with the cars. They form a distributed routing system (Figure 1). Traffic is always on the move and mobile ad-hoc communication technology is only able to cover relatively small distances (550 meters/601.49 yards maximum). Dynamic self-organizing networks have to be formed in order to maintain communication with nodes even if they are out of the sending nodes transmission range. Nodes can enter and leave the network at any time; a node that leaves the network can do so without prior notice. This paper addresses the problems related to creating and maintaining a dynamic wireless ad hoc network in a city street network. It discusses a simulation environment that simulates the creation, operation and maintenance of a dynamic wireless ad hoc network. Two different Ant-colony-based routing algorithms, one for fixed networks and one for MANETs, were implemented. They will be described in the next section.
2
Ant-colony-based routing algorithms
Using Ant-colony-based algorithms [6, 12], the routing is determined through complex interactions of network exploration agents. The behavior of these agents is modeled on the trail-laying abilities of natural ants. 2.1
Routing in wired networks: AntNet
In AntNet described in [3, 4], each node in the network has a probability table for every possible final destination. The tables have entries for each neighbouring node that can be reached via one connecting link (Table 1). Table 1. AntNet routing table Destination address Next hop Probability d n Pd,n
3
The agents are divided into two classes, the forward ants and the backward ants. The idea behind this subdivision of agents is to allow the backward ants to utilize the useful information gathered by the forward ants on their trip from source to destination. As the forward ants move, pheromone is deposited as a function of the time of their journey. They select their path (’Next hop’) at each intermediate node according to the distribution of the simulated pheromone at each node. This process is repeated until the agent reaches its destination. Once the destination is reached, a backward ant inherits the data collected by the forward ant. It follows the reverse path and updates the probabilities for the destination entry d, with a reinforcement value. This is a function of the time T , the ant computed and its mean value µ. T T cµ ; cµ < 1, c > 1 r= (1) r = 1 otherwhise 0 Pd,j = Pd,j + (1 − r)(1 − Pd,j ) j = n the next node chosen by the ant
0 Pd,j = Pd,j − (1 − r)Pd,j , for j 6= n
2.2
(2) (3)
Routing in MANETs: ARA
Ant Colony Optimization was successfully applied also for Mobile ad-hoc Networks [2, 5, 9, 11, 13]. ARA algorithm [7, 8] maintains an entry in the routing table for each individual communication device in the network (Table 2). ’destination address’ represents the address of the sending node, ’Next hop’ represents the address of the previous node, which relayed the packet to the current node, and ’Pheromone’ represents the strength of the trail. Table 2. ARA routing table Destination address Next hop Pheromone i j ϕi,j
Each time a packet (ant) is received by a communication device (node) the routing tables are updated. The amount of pheromone ϕi,j for the route taken is increased with a constant value ∆ϕ. ϕi,j := ϕi,j + ∆ϕ
(4)
When operating in a dynamic network some routes may become invalid or are simply not used. In order to distinguish between optimal routes and sub
4
optimal routes the amount of pheromone is decreased periodically for all routes. Pheromone values are decreased as below: ϕi,j := (1 − q) · ϕi,j , q ∈ (0, 1]
(5)
The ARA routing algorithm consists of three distinct phases namely the route discovery phase, route maintenance and route failure handling. Discovery phase In order to communicate with other nodes the ARA protocol sends out a uniquely identifiable forward ant (FANT) that tries to establish a route to node somewhere in the network. At each node (hop) that it encounters on the way to the destination node it updates the route tables. If there is no address entry for the route taken by the FANT, the FANT senders address is noted is the ’destination address’ field, the hop that relayed the packet is noted in the ’Next hop’ field and the pheromone value is set to default. Otherwise only the pheromone value is updated using formula 4. As soon as the FANT finds/arrives at the destination node a uniquely identifiable backward ant is launched (BANT). The BANT traces back the route to originating FANT node by making use of the routing table entries previously made by the FANT. While tracing back the route to the BANT updates the routing tables at each hop in the same fashion the FANT did. Once the FANT originator node is reached communication between the nodes can be established. Route maintenance The individual nodes do the route maintenance by analyzing received packets and by use of pheromone formula 5. Each packet received by the node either for processing or relaying is used to update the routing table and the pheromone value by use of formula 4. A timer determines the when formula 5 is executed in order to decrease the pheromone value. Once the pheromone value for a certain route has reached zero the route can safely be discarded. Route failure The MAC (Media Access Layer) layer implemented on the NIC (Network Interface Card) of the communication device notifies the ARA protocol in case of route failure by returning a ROUTE ERROR message. Once notified by the MAC layer the ARA protocol searches the routing table for an alternative route. If no alternative route is found the packet is relayed to all the neighbours of the node who will check their routing tables for a route to the destination. If the packet cannot be relayed to the destination node the packet is send back to the destination node, each receiving hop tries to find an alternative route as described above before sending the packet back.
3
Routing system
As stated in the introduction we suppose that wireless access points with computational power are available along the roads. They form a wired network with
5
the same topology as the street network. This network is communicating with the local wireless Ad-Hoc networks formed by the PDAs carried on the cars. The result is a hybrid network as in Figure 2, which besides communication will provide the drivers with dynamic routing.
Fig. 2. Hybrid network
The wired network plays the role of a distributed routing system for the vehicles. Periodically the cars transmit via the PDAs their current speed. These messages, if possible, are routed wireless to the last access point the car passed. Here, this information is used to approximate the average speed on the road the car is running, and respectively the time necessary to cover it. This will be used as input for the AntNet algorithm running on the network, as a virtual propagation delay for the links. The ants are collecting these virtual delays, which will correspond with the time necessary for a car to follow the same path as the ant. Each time they get closer to such a wireless access point on the road, the vehicles request from the system which direction to follow next and give their destination. The system returns the direction corresponding to the higher entry in the local probability table for the selected destination. In the same time new ants are generated locally and sent over the network to the same destination. In this way the optimal routes are trained in advance for each car in the traffic.
6
Fig. 3. Routing example for a mobile user
4
Communication layer
The Communication layer encompasses the functionality of an entire PDA, although only a sub set of features have been implemented. The PDA provides the files or messages that have to be transmitted, they travel through the protocol layer that fragments the data in the correct packet sizes and discovers and maintains routes to nodes. The MAC layer then handles the IEEE 802.11B compliant packet forwarding and transmission of data to other nodes. The next sub-paragraphs will describe the design of the MAC and Protocol layers in detail. 4.1
Media access communications layer
The IEEE 802.11B MAC Layer (see [1], [15]) consists of a series of agreements concerning the sending and receiving of data. In this chapter the agreements that are implemented in the simulation environment are discussed. Probing Before nodes, operating in an ad hoc wireless environment, can start to transmit data to each other they must first find each other. In order for a node to discover its neighbour nodes, which are within its communication range, the node sends out a probe (Figure 4). Setting the type field of an IEEE 802.11B frame control structure to ’Management’ and its subtype field to ’Probe’ creates the probe message packet. Once created the message is broadcasted at 1Mbps in order to have the maximum transmission range. After transmission the node waits for a specified amount of time in order to receive all probe response messages. The probing node confirms each received probe response message with an ACK (Acknowledgement)
7
Fig. 4. Station probing
message. A node that receives the probe message formulates a probe response message by setting the type field of an IEEE 802.11B frame control structure to ’Management’ and its subtype field to ’Probe response’. After transmitting the packet to the probing nodes it waits a specified amount of time for the ACK message confirming the reception of the probe response packet. If no ACK message is received within the time period the probe message is retransmitted. This sequence is repeated up to four times. Basic access method In order to realize communication between two wireless IEEE 802.11B compatible nodes a complicated set of delay timers and packets is needed. Nodes operating in the wireless ad hoc mode cannot start sending data immediately. First the nodes must determine if the receiving node is currently idle before transmission can start. Data transmission The transmission of a data packet to a node starts when the sending has found the receiver to be idle. The sending node broadcasts an RTS (Ready To Send) packet to the intended destination then waits a certain amount of time for a CTS (Clear To Send) packet. If the CTS packet is not received within the waiting time the RTS packet is transmitted again, if the destination node is still idle. The CTS packet is send back using the broadcast method to notify other nodes of the pending transmission (Figure 5). Nodes that receive either the broadcasted RTS or CTS message set an NAV (Network Allocation Vector) timer specifying the length time in which the sending and receiving nodes are not available for transmissions. The time period for the NAV timer is taken form the duration field of the RTS or CTS packet. If no transmission is detected after the exchange of RTS or CTS a node may reset its NAV timer after a period specified by the formula below. N AV reset = (2 ∗ aSIF ST ime) + (CT ST ime) + (2 ∗ aSlotT ime)
(6)
After receiving the CTS packet and waiting for a SIFS (Short Inter Frame Space) amount of time the node can transmit the data packet to the destination.
8
Fig. 5. Data transmission communication
Once transmitted the node waits a specified time for the ACK packet to arrive confirming a good transmission. Multi fragment An 802.11B data packet can have a maximum payload of 2312 bytes. Data that exceeds this size needs to be fragmented by the sender before transmission can take place. The 802.11B specification has limited the payload to 2312 bytes in order to minimize the bit error rate. 4.2
ARA Protocol
The information required for the ARA protocol like source address, destination address and previous transmitter is obtained from the MAC layer. Since the MAC layer described before will handle the main bulk of the information exchange, the protocol should only worry about data fragmentation, data buffering and Ant based route discovery and maintenance and duplicate Ant detection. The routing table needed for the ARA algorithm controls the build up and flow of data over the network. In order to find and to communicate over the best possible data link the signal strength that is calculated by the MAC layer is incorporated into the pheromone update formula. The signal strength is calculated by the MAC layer as a percentage in relation to the distance between transmitter and receiver. ϕi,j := ϕi,j + (signal/100) + ∆ϕ
(7)
The filtering of duplicate packets is an important feature in ARA since ants are broadcasted onto the network and propagated by other nodes using broadcasting. A packet list is maintained in order to filter out duplicate data packets and ants. The routing table that functions as small database in order to register, mutate and remove routes found by the host. The protocol buffer provides a means to store fragmented data transmissions received from one or multiple hosts and concatenates this stream to the final end result being a file or text message. The pictures 6 and 7 present the way in which packets are send to other hosts and received by the protocol.
9
Fig. 6. Outgoing data packet
5
Fig. 7. Incoming data packet
Conclusions and results
When design a simulation environment for wireless communication a number of requirements almost immediately arise. Wireless communication is limited by data transfer rates, transmission ranges and signal interference. PDA’s are limited in resources like battery power, memory and processor speed. Our focus lied upon the communication layer and not on implemented features like signal interference and PDA limitations. Table 3 lists the transmission speeds in relation to transmission range used in the simulator. Note that the transmission ranges in table seven are only possible in an ideal environment, signal interference will cause these transmission ranges to decrease drastically in a real life situation. For the various parameters that influence the MAC layer, we used the default values as defined by the IEEE 802.11B specification. Table 4 specifies the default parameters set for the transmission timing calculations. With the use of traffic lights, precedence rules, roundabouts, one lane, multi lane and one-way roads a ’realistic’ simulation environment for the traffic was created [14].
10 Table 3. MAC layer ideal transmission ranges Transmission 1 2 5.5 11
speed Mbps Mbps Mbps Mbps
Communication range 550 meter (601.49 yards) 400 meter (437.45 yards) 270 meter (295.28 yards) 160 meter (174.98 yards)
Table 4. MAC layer default parameters Parameter Tslot τ Tp Tdifs Tsifs Tpifs CWmin CWmax Tphy
Value 20 µs 1 µs 144 µs 50 µs 10 µs 30 µs 31 µs 1023 µs 48 µs
Description Slot time Propagation delay Transmission time of the physical preamble DIFS time SIFS time PIFS time Minimum back off window size Maximum back off window size Transmission time of physical header
A simple experiment, on a network with 10 intersections, is displayed in figure 8. The white circles represent the base stations located at each intersection. The colored dots represent the cars with PDA’s. For each node in the wireless network the transmission range and the connectivity links are drawn. The white dots are the cars which are not connected to the Routing system. The vehicles going from the roads between intersection 1 and 10, and backwards, can take the northern path via intersections 3, 4 and 8, or they can take the southern path via intersection 6. The southern is shorter and more attractive from this point of view. Nevertheless intersection 6 of the southern route is a point where many vehicles from different roads join and cross each others path. Therefore it is controlled by traffic lights. These traffic lights make the crossing safer and the priority for vehicles from different roads is distributed more fairly. On the other hand the traffic might perceive a considerable delay at this intersection because of the heavy load and the traffic lights. This will cause the northern path to be more attractive for vehicles. As expected the vehicles that follow the advice of the Routing system, drove via the northern roads, where there are no delaying intersections. This resulted in faster routes for these vehicles (80 s) as opposed to the vehicles that do not used the Routing system (87 s). In conclusion, because of the small difference between the two results, all the cars benefit from the Routing system, directly or indirectly.
11
Fig. 8. Traffic symulator
Besides simple traffic networks we used to test the system with big networks of whole cities like Delft (42 intersections), the centrum of Rotterdam (110 intersections) with hundred of cars running around. The system described in the paper, proved to be reliable for dynamic routing of vehicles. We found that 40% of the cars should poses a PDA, in order to have a fluid traffic in the rush hours. At DECIS Lab Delft, we are involved in a project concerning Multi-agent based intelligent network decision support systems in a chaotic open world (COMBINED). We are planing to expand the system to a simulation environment for a crisis situation in a city. Routing the ambulances according with the number, position and the state of the victims will also be solved using ACO.
References 1. P. Brenner. A technical tutorial on the ieee 802.11 protocol. Breeze COM, 1997. 2. D. Camara and A.A.F. Loureiro. Gps/ant-like routing in ad hoc networks. Telecommunication Systems, 18(1-3):85–100, 2001. 3. G. Di Caro and M. Dorigo. Antnet: A mobile agents approach to adaptive routing. Technical Report IRIDIA, Universit Libre de Bruxelles, (12), 1997. 4. G. Di Caro and M. Dorigo. Antnet: distributed stigmergetic control for communication networks. Journal of Artificial Intelligence Research (JAIR), 9:317–365, 1998.
12 5. G. Di Caro, F. Ducatelle, and L.M. Gambardella. Anthocnet: An ant-based hybrid routing algorithm for mobile ad hoc networks. In PPSN, pages 461–470, 2004. 6. M. Dorigo and T. Stutzle. Ant colony optimization. MIT Press, Cambridge, MA, 2004. 7. M. Gunes, U. Sorges, and I. Bouazizi. Ara - the ant-colony based routing algorithm for manets. In ICPPW ’02: Proceedings of the 2002 International Conference on Parallel Processing Workshops, 2002. 8. M. Gunes and O. Spaniol. Ant-routing-algorithm for mobile multi-hop ad-hoc networks. Network control and engineering for Qos, security and mobility II, pages 120–138, 2003. 9. M. Heissenbuttel and T. Braun. Ants-based routing in large-scale mobile ad-hoc networks. In Proceedings of Kommunikation in verteilten Systemen (KiVS ’03), pages 91–99, Leipzig, Germany, Feb. 2003. 10. R. Morris, J.Jannotti, F. Kaashoek, J. Li, and D. Decouto. Carnet: a scalable ad hoc wireless network system. In EW 9: Proceedings of the 9th workshop on ACM SIGOPS European workshop, pages 61–65, 2000. 11. M. Roth and S. Wicker. Termite: Emergent ad-hoc networking. In Proceedings of the Second Mediterranean Workshop on Ad-Hoc Networks, 2003. 12. R. Schoonderwoerd, O.E. Holland, J.L. Bruten, and L.J.M. Rothkrantz. Ant-based load balancing in telecommunications networks. Adaptive Behavior, (2):169–207, 1996. 13. K.M. Sim and W.H. Sun. Ant colony optimization for routing and loadbalancing:survey and new directions. IEEE Transactions on Systems, Man, and Cybernetics, PartA, 33(5):560–572, 2003. 14. B. Tatomir and L.J.M. Rothkrantz. Dynamic traffic routing using ant based control. In International Conference on Systems, Man and Cybernetics, 2004. 15. IEEE 802.11 working group. Ansi/ieee std. 802.11, 1999 edition: Wireless lan medium access control (mac) and physical layer (phy) specifications. Technical report, ANSI/IEEE, 1999.