## 5 The Proposed AFB-GPSR Strategy
### AFB-GPSR Architecture  
The following principal steps illustrate the criteria of the network model in the proposed strategy:  
1. Nodes are positioned randomly in an unimpeded area;
2. Each node is aware of its own geographical coordinates (position), IP address, speed, and direction;
3. Each node has the same transmission range and starts with an initial beacon interval for sharing information;
4. Once the node receives beacon packets from its neighbor nodes in the coverage area, it can obtain the neighbor information list and calculate one-hop neighbors' density and link reliability;
5. The fuzzy logic model is triggered to calculate a new _optimal beaconing interval time_ (OBIT) based on the three network parameters defined as NS, OHND, and LR;
6. Finally, the AFB-GPSR protocol can find the optimal next-hop route decision through the new beaconing interval time jointly with the original GPSR protocol to establish the routes using the GF (greedy forwarding) mode or perimeter mode.  
The routing information table for each node utilizing the proposed AFB-GPSR is defined in Figure 3. The information includes node IP, node position (X,Y), direction, speed, link reliability and neighbors' density. Each node manages this neighbor's table that holds the information obtained from a received beacon (Hello) message. The pseudocode of the AFB-GPSR algorithm is provided in Algorithm 1, and the flowchart of AFB-GPSR is also illustrated in Figure 4 to describe the two phases of beaconing and routing. Initially, each node starts broadcasting beacons with a fixed interval; once a node receives the neighbor's beacons, the routing information table is built including six parameters, node IP, node position (X,Y), direction, speed, link reliability and neighbors' density. Once the information is received, three parameters, node speed (NS), one-hop neighbors' density (OHND) and link reliability (RL) between the node and the neighbor node, are considered as input variables to fuzzy inference system (FIS) to dynamically update the new beacon for next broadcasting beacon. Later, the phase of next-hop selection for data forwarding starts either in greedy forwarding mode or in perimeter mode if there is a local max region (void region), as shown in Figure 4.  
```
Input: Destination IP, Source IP Output: BIT //BIT = Beacon Interval Time,  Initialize BIT = 1 //Start with initial value BIT = 1 s Phase: Beaconing Phase  For each node N do  1. Read self-address  2. Read self-position coordinates  3. Read self-speed  4. Read self-direction  5. End For  6. Broadcast Beacons  7. Update neighbors' tables information based on neighbor node (Nn) beacons' information  8. Estimate node speed (NS)  9. Estimate one-hop neighbors' density (OHND)  10.Estimate link reliability (LR)  11. Evaluate a new BIT based on FLC inputs (Self-Speed, OHND and LR) Phase2: Routing Phase  12. If Nn is the destination Then, Send the data packet  13. Elseif   Nn the closest node to the destination Then, Switch to Greedy mode  14. Else  Switch to Perimeter mode  15. Forward the data packet  16. Update Self Table information (Address, Location, Speed and Direction)  17. Broadcast Beacons based on new FLC output BIT  18. Repeat Phase 1 and Phase 2 until Data Packet reach the destination
```  
**Algorithm 1** AFB-GPSR Mechanism