With the exponential growth of IoT devices, there comes an increasing demand for security. The threats to IoT devices vary from eavesdropping to flooding (DoS or DDoS) attacks. To detect network-based anomalies, various machine learning algorithms can be used. The focus of this research is to evaluate the performance of machine learning clustering to distinguish between DDoS attacks and normal network traffic using an IoT-specific dataset. Optimizing the performance of the clustering algorithm with appropriate feature selection is considered in this thesis. The algorithm used in this research is K-Means clustering which is applied for an IoT dataset containing Mirai botnet – Distributed Denial-of-Service (DDoS) attack. The average accuracy achieved to differentiate DDoS attacks from normal network traffic entries using K-means clustering is 88.5% with an average precision of 85.5%.