The Internet of things is no longer a concept; it is a reality already changing our lives. It aims to interconnect almost all daily used devices to help them exchange contextualized data in order to offer services adequately. Based on the existing Internet, IoT suffers indisputably from security issues that could threaten its evolution and its users' interests. Starting from this fact, we try to define the main security threats for the IoT perimeter and propose some pertinent solutions. To do so, we first establish a state of the art concerning the IoT definition, protocols, environment, architecture and security. Then, we expose a case study of a standard IoT platform to illustrate the impact of security on all IoT layers. Furthermore, the paper presents the results of a security audit on our implemented platform. Finally, based on our evaluation, we highlight many solutions as well as possible directions for future research.