Vehicular Ad Hoc Networks (VANETs) are becoming more commonplace as a means for cars to communicate and share data on things like traffic patterns, road conditions, and travel times and speeds. Therefore, one of the key issues facing academics now is ensuring data communication safety in VANET. There are several privacy-preserving verification techniques for VANETs. However, they do have complex calculations and safety issues. This research presented an operating platform for the 5G-based VANET architecture that combines Software-Defined Networking (SDN) with Self-Organizing Maps (SOM). The proposed system provides SOM and SDN-based network (SOM-SDN) solutions that will improve safety in two dimensions by spotting and stopping threats. First, this research examines the network's efficiency threats while considering Distributed Denial of Service (DDoS) threats. The suggested system's safety was then compared with current DDoS attacks. Additionally, the proposed method is strong enough to fend off typical assaults and maintain the communication information's secrecy, thanks to an examination of its security qualities. The efficiency comparisons' outcomes demonstrate the suggested procedure's light and effectiveness. Additionally, the suggested model using SUMO and NS-3 demonstrates how effective and useful the method is for VANETs. The proposed study shows a 92% improvement in performance, a 4% reduction in end-to-end latency, a 92% improvement in transmission outbound, a 98% improvement in packet transmission rate, and a 94% improvement in the enumeration of bounce compared to prior studies.