Detecting Black Hole Attacks in Ad Hoc Networks: Security, Algorithm and Simulation in Vanet