The Intelligent Transport System (ITS) includes VANET as an essential component. VANET is a system that enables vehicle nodes to exchange crucial and potentially life-saving information. It is important to rapidly identify any attacks on the VANET system. DDoS attacks are a type of cyber attack that can impact the availability of VANET systems. The exchange of valuable information between vehicle nodes is currently not possible due to a DDoS attack. The paper proposes a fog-based approach for detecting DDoS attacks in smart cities enabled by 5G technology. The approach aims to distinguish between normal traffic and attack traffic.