In the Internet of Things (IoT), the routing makes the security over several network attacks as any attacker intrudes routing method for establishing the destructive methods over a network that persist essentiality of security protocols in IoT. Hence, this work develops a secure protocol based on an optimization method, Salp and Particle Swarm Optimization algorithm (S-PSO) that is the hybridization of the Salp-Particle Swarm Optimization approach to provide effectual network security. At first, the effectual nodes are chosen by exploiting the multilayer-Feed Forward Neural Network (FNN) classifier based on factors, like the trust and energy of nodes. The secure nodes engross in routing for that secure multipath is selected optimally exploiting developed S-PSO method that selects secure multipath based on the factors such as energy, and trust. The study of the proposed algorithm in attendance of attacks, like message replicate, black-hole, and DDOS, discloses that the developed algorithm outperforms the conventional algorithms. The developed Salp-PSO protocol obtained the high throughput, energy, and the rate of detection, correspondingly with the least delay.