A large array of objects is networked together under the sophisticated concept known as the Internet of Things (IoT). These connected devices collect crucial information that could have a big impact on society, business, and the entire planet. In hostile settings like the internet, the IoT is particularly susceptible to multiple threats. Standard high-end security solutions are insufficient for safeguarding an IoT system due to the low processing power and storage capacity of IoT devices. This emphasizes the demand for scalable, distributed, and long-lasting smart security solutions. Deep learning excels at handling heterogeneous data of varying sizes. In this study, the transport layer of IoT networks is secured using a multilayered security approach based on deep learning. The created architecture uses the intrusion detection datasets from CIC-IDS-2018, BoT-IoT, and ToN-IoT to evaluate the suggested multi-layered approach. Finally, the new design outperformed the existing methods and obtained an accuracy of 98% based on the examined criteria.