Pervasive growth of Internet of Things (IoT) is visible across the globe. The 2016 Dyn cyberattack exposed the critical fault-lines among smart networks. Security of Internet of Things (IoT) has become a critical concern. The danger exposed by infested Internet-connected things not only affects the security of IoT, but also threatens the complete Internet ecosystem which can possibly exploit the vulnerable Things (smart devices) deployed as botnets. Mirai malware compromised the video surveillance devices and paralyzed Internet via distributed denial of service (DDoS) attacks. In the recent past, security attack vectors have evolved bothways, in terms of complexity and diversity. Hence, to identify and prevent or detect novel attacks, it is important to analyze techniques in IoT context. This survey classifies the IoT security threats and challenges for IoT networks by evaluating existing defense techniques. Our main focus is on Network Intrusion Detection Systems (NIDS); hence, this paper reviews existing NIDS implementation tools and datasets as well as free & open-source network sniffing software. Then, it surveys, analyzes and compares state-of-the-art NIDS proposals in the IoT context in terms of architecture, detection methodologies, validation strategies, treated threats and algorithm deployments. The review deals with both traditional and machine learning (ML) NIDS techniques and discusses future directions.