Methodologies For Secure Networks In IoT And Countermeasures For Security Threats