The Internet of Vesicles ( IoV) is an open and integrated network system with high reliability and security control capabilities. The system consists of vehicles, users, infrastructure, and related networks. Despite the many advantages of IoV, it is also vulnerable to various types of attacks due to the continuous and increasing growth of cyber security attacks. One of the most significant attacks is a Distributed Denial of Service (DDoS) attack, where an intruder or a group of attackers attempts to deny legitimate users access to the service. This attack is performed by many systems, and the attacker uses highperformance processing units. The most common DDoS attacks are User Datagram Protocol (UDP) Lag and, SYN Flood. There are many solutions to deal with these attacks, but DDoS attacks require high-quality solutions. In this research, we explore how these attacks can be addressed through Machine Learning (ML) models. We proposed a method for identifying DDoS attacks using ML models, which we integrate with the CICDDoS2019 dataset that contains instances of such attacks. This approach also provides a good estimate of the model's performance based on feature extraction strategic, while still being computationally efficient algorithms to divide the dataset into training and testing sets. The best ML models tested in the UDP Lag attack, Decision Tree (DT) and Random Forest (RF) had the best results with a precision, recall, and F1 score of 99.9%. In the SYN Flood attack, the best-tested ML models, including K-Nearest Neighbor (KNN), DT, and RF, demonstrated superior results with 99.9% precision, recall, and F1-score.