With the advancing trends in the field of information technology, the data users were subjected to face differernt of attacks. Hence effective and prompt detection of malicious attacks must be optimized in terms of confidentiality, privacy, availability and integrity. Accordingly this research paper provides an effective mechanism for detecting and classifying DDoS attacks such as TCP-SYN, UDP flood, ICMP echo, HTTP flood, Slowloris Slow Post and Brute Force attack, by utilizing machine learning methods within SNMP-MIB dataset. MIB (Management Information Base) is meant for attack classification database linked to the SNMP (Simple Network Management protocol). Three classifiers are considered such as MLP, Random forest, Adaboost to construct the detection model. Significantly, Gated Recurrent Unit Neural Network based on Bidirectional Weighted Feature Averaging (GRU-BWFA) classifier is utilizing as a proposed classifier for high detection rate and accuracy in distinguishing the mentioned DDoS attacks. Feature selection is performed using the Enhanced Salp Swarm Optimization technique to select the optimal features for identify the attacks. The application of various classifier provides a detailed study on the effectiveness of SNMP-MIB dataset in detecting DDoS attacks. Empirical findings indicate that machine learning methods are highly effective at detecting and classifying the attacks with a higher accuracy rate.