The security threats in the Internet-of-Things (IoT) environment are increasing exponentially with the growth of its applications in diverse disciplines. Due to the inherent nature of resource constrained attributes, IoT networks are susceptible to enormous cyber attacks such as DDoS attack. Though there are many existing solutions to detect and mitigate its devastating impact, most of the solutions are neither suitable in the IoT environment not resilient against collaborative large-scale attacks. In addition, the existing mechanisms do not enable efficiently detecting novel attack vectors. Thus, it necessitates to design a robust and efficient alternative detection model such as based on deep learning applications. The hypothetical model should enable detecting unknown attack patterns that could be thwarted efficiently. In this paper, we analyze the major challenges that might incur in deploying existing solutions in the IoT environment. We also discuss some limitations of proposed techniques that are compatible within IoT networks. In this paper we demonstrate the use of an optimized pattern recognition algorithm to detect such attacks. Furthermore, we propose an Intrusion Detection System (IDS) methodology and design architecture for Internet of Things that makes the use of this search algorithm to thwart various security breaches. Numerical results are presented from tests conducted with the aid of NSL KDD cup dataset showing the efficacy the IDS.