This research presents a novel approach for detecting the highly perilous RPL version number attack in IoT networks using deep learning models, specifically Long Short-Term Memory (LS TM) and Deep Neural Networks (DNN). The study employs the Cooja simulator to create a comprehensive dataset for simulating the attack. By training LS TM and DNN models on this dataset, intricate attack patterns are learned for effective detection. The urgency of this work is underscored by the critical need to bolster IoT network security. IoT networks have become increasingly integral in various domains, including healthcare, smart cities, and industrial automation. Any compromise in their security could result in severe consequences, including data breaches and potential harm. Traditional intrusion detection systems often struggle to counter advanced attacks like the RPL version number attack, which could lead to unauthorized access and disruption of essential services. Experimental results in this research showcase outstanding accuracy rates, surpassing traditional machine learning algorithms used in IoT network intrusion detection. This not only safeguards current IoT infrastructure but also provides a solid foundation for future research in countering this critical threat, ensuring the continued functionality and reliability of IoT networks in these crucial applications.