We designed a fuzzy system to detect and predict the DDoS attacks in IEEE 802.15.4 MAC layer. The attack detection is done by the base station on the input values of detection metrics received by it from the respective node. The base station uses the value of BPR and SNR as input to the fuzzy systems to get the Level Of Attack (LOA) as the output of the system. The attack prediction is done in cluster-based wireless network. Prediction of DDoS attacks is done based on energy consumption rate. The nodes with abnormal energy consumptions are identified as malicious attacker. Furthermore, the fuzzy system is designed to distinguish the types of DDoS attack according to the energy consumption rate of the malicious nodes. We tested the effectiveness of the proposed system with the results obtained from the simulation experiments. The performance was analyzed based Detection of attacks, energy consumption rate of DDoS attacks, attack detection rate, prediction of attacks, and speed of attack detection. The results were compared with the existing approaches. From the results we found a significant improvement in the detection and prediction of DDoS attacks IEEE 802.15.4 MAC layer.