The increasing Internet of Things (IoT) network complexity and sophisticated Distributed Denial of Service (DDoS) attacks at machine speeds make accurate and timely detection and mitigation of these attacks a challenging activity. This study presents a multi-agent-based system design (MAS-IoT) against DDoS attacks in the IoT network. The MAS-IoT consists of different types of agents which communicate using Advanced Encryption Standard (AES). In the context of the study, DDoS attacks were detected using a long-short-term memory (LSTM)-based model (LSTM-IoT) developed based on the CIC-IoT-2022 dataset with a 99.48% accuracy rate. The detection time of the LSTM-IoT and its time complexity were calculated and compared using similar methods mentioned in the literature. The results demonstrate the effectiveness of the LSTM-IoT in accurately detecting DDoS attacks. However, the ability to use it effectively and on time is vital to counter real-time attacks. The MAS-IoT system enables this with minimum human intervention.