# An Internet of Things Access Control Scheme Based on Permissioned Blockchain and Edge Computing
## 6 Security and Performance Analysis
### Performance Analysis  
In order to test the performance of the access control mechanism proposed in this paper, an experimental environment of the alliance chain is built in this section. The experimental environment is shown in Table 3.  
The proposed system architecture is built using Ethereum as a platform for testing and evaluation. In the experiment, Ethereum nodes are divided into full nodes and light nodes. High-performance devices become full nodes, such as edge servers and gateways. The devices with ordinary performance become light nodes, such as sensors. The gateway is implemented by running the SDN controller in an independent virtual machine hosted on a Linux server. Raspberry Pi is configured as Raspbian 2019-09-26 as an edge server. Smart contracts are written in a stable format using Solidity v.0.4.20 which was proposed by [PERSON] in August 2014. Distributed applications are deployed and compiled using the Truffle development suite. In the access control mechanism based on the blockchain, access logging and access control policy deployment belong to the right blockchain. The access control policy is evaluated as executing the Smart contract on the blockchain and writing the log to the blockchain. The log is viewed as reading the data of the blockchain. The Ethereum Smart contract does not run directly on the node, but runs in the Ethereum virtual machine. The contract is stored on the blockchain of the Ethereum, and it is compiled into the bytecode of the Ethereum virtual machine, which runs through the virtual machine. The performance of the access control mechanism based on the blockchain is evaluated by testing the speed of the reading/writing blockchain. The read-write speed of the blockchain is not only related to the hardware environment, but also to the number of nodes in the blockchain network. In this paper, we configure a sort node, with 5 and 10 peer nodes. Through simulation, we continuously send transactions to the blockchain at different speeds, including the reading blockchain and the writing blockchain. We test the speed of the read-write blockchain under different conditions. (1) The speed of the reading/writing blockchain when five peer nodes are configured (as shown in Figure 7). Figure 7: Read/write blockchain speed for 5 peer nodes. \begin{table}
\begin{tabular}{c c} \hline \hline
**Software/Hardware** & **Parameter** \\ \hline Operating system & Ubuntu Linux 18.04 LTS \\ CPU & AMD Ryzen5 3600X 3.6 GHz \\ Writing language & Solidity \\ Internal storage & 8 GB \\ Raspberry Pi & 3B+ \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Experimental environment. 2. The speed of the reading/writing blockchain when ten peer nodes are configured (as shown in Figure 8). As can be seen from Figures 7 and 8, whether there are 5 or 10 peer nodes, the speed of reading into the blockchain is faster than that of writing into the blockchain. The consensus mechanism of the blockchain determines the writing and the verification speed of permission transactions on the chain. Because the KRaft consensus algorithm used in this paper can provide high throughput and low latency, the speed of the reading/writing blockchain is faster than the general one. The total time from sending the access request to the final response can be used as a measure of the system computing overhead. The access control model in cloud computing is based on the traditional access control model. It is improved on the traditional access control model to make it more suitable for the environment of cloud computing. The experiment compares this scheme with the cloud-based access control scheme. By changing the size of user data requests, we can observe the request processing time of the cloud-based scheme and this scheme. Processing time includes all the time from sending the access request to obtaining the final result. The request processing time for both schemes is shown in Figure 9 (the coordinate value is obtained by taking the logarithms of the bottom 10 as the actual value).