Abstract Vehicle ad hoc network (VANET) has gradually become a prominent research topic in the fields of wireless networks and intelligent vehicles. VANETs are unique mobile ad hoc networks with vehicles as their mobile nodes, presenting distinctive performance characteristics compared to traditional wireless self-organizing networks. In recent years, VANETs have gained significant attention in the wireless network and intelligent transportation domain. As an integral aspect of autonomous driving technology, vehicle-to-everything (V2X) communication spans multiple disciplines and is closely related to intelligent transportation, assisted driving, active safety, and smart vehicles. Evaluating VANET protocols and applications in real-world settings can be challenging. Therefore, utilizing simulation tools for VANET research is an effective approach. In this paper, we have designed and developed an optimized platform that uses IEEE 802.11a and IEEE 802.11p protocols for communication within a simulated urban traffic environment created with NS-2. The simulation results confirm the feasibility and rationale of applying the IEEE 802.11p protocol to wireless vehicular ad hoc networks. Within a distance of 300 m, at 0.0000 s, 14 key packets have not arrived in IEEE 802.11a, and 8 packets have not arrived in IEEE 802.11p; at 8.0000 s, 38 key packets have not arrived in IEEE802.11a, and 6 packets have not arrived in IEEE802.11p. Comparing the performance of IEEE 802.11a and IEEE 802.11p, the study concluded that the use of the 802.11p protocol in urban mobile environments can improve reliability and reduce average packet latency.