the number of IoT devices, estimated to be 26 billion connected IoT devices by the end of 2020 [@evans2011internet].

Although IoT devices provide a more efficient, automated, and smart life, from security/privacy perspective, many threats and vulnerabilities have been raised in IoT devices. Many investigations on cyber-based threats demonstrate that there are 176 new cyber-threats every minute, and over 2.5 million within only four months [@frustaci2017evaluating]. Several incidents have highlighted the massive influence of counterfeit/cloned/tampered devices into the supply chain [@guin2014counterfeit; @rostami2014primer]. As an instance, influencing and controlling every connected device within a ZigBee network, which is one of the most prevalent wireless communications in IoT, has been illustrated in [@zillner2015zigbee; @ronen2017iot]. Another recent evaluation by HP demonstrates that 70% of the devices in IoT are vulnerable to different types of threats, including physical attacks [@kumar2016security].

In current IoT applications, almost all proposed IoT devices are working (and communicating) based on a very well known 3-layer hierarchical architecture that is illustrated in Fig. \[IoTarch\]. These three layers, i.e. ***“devices”***, ***“gateways”*** and ***“servers”*** are the main layers in IoT architecture [@atzori2010internet; @da2014internet]. The devices that are responsible for interacting between the physical environment and computer-based systems, called *edge*, can connect with 