Research Article

Vehicle Density Based Forwarding Protocol for Safety Message Broadcast in VANET

Pseudocode 1

Pseudocode of VDF.
Parameters:
 {
   : The transmission range;
   : The maximum contention window;
   : The minimum contention window;
   : The vehicle set in the transmission range;
   : The vehicle number in ;
   : The forwarder vehicle;
   : The distance from to the current vehicle;
 }
Initialization:
 {
   ;
   ;
   ;
   = ;
 }
On receiving a beacon from vehicle   :
 if    is not  in   then
  {
    ;
   add into ;
   update the vehicle density ;
 }
 if    is the forwarder   then
  update as the distance from to the current vehicle;
  }
On receiving a message from the forwarder   :
if     then
  {
   calculate with (11);
   start the waiting timer;
  
else
  stop the waiting timer;
  }
On the waiting time expire:
 {
  broadcast the received message;
  the current vehicle becomes the forwarder ;
  }