# Blockchain Solutions for Enhancing Security and Privacy in Industrial IoT
## 5 Experiment and Results
### Experiment Setup  
The experimental environment was designed to mimic a smart factory equipped with IoT sensors, local processors, and blockchain technology. This setup allowed us to evaluate the system's performance in a realistic industrial context, where real-time monitoring and secure data processing are paramount. A network of 20 Raspberry Pi IoT devices (Cambridge, UK) was deployed in a controlled laboratory setup at the AT@Lab of KMU University in Daegu, South Korea. Each Raspberry Pi was equipped with a suite of environmental sensors, including temperature sensors (DS18B20), humidity sensors (DHT22), and pressure sensors (BMP280). Functioning as digital \"noses,\" these devices continuously monitored environmental parameters, providing real-time data collection and analysis for various research applications. For example, a temperature sensor in factory A recorded 25.4 \({}^{\circ}\)C every 10 s, highlighting the importance of real-time monitoring in detecting anomalies such as overheating motors or abnormal humidity levels, which could lead to equipment failures or production delays. Table 2 consolidates sensor readings from multiple factories, including temperature and humidity data.  
Five Raspberry Pi mini computers served as edge nodes to preprocess and secure data before transmitting it to central servers, acting as \"local traffic cops.\" These edge nodes generated unique digital fingerprints (SHA256) for each data packet, akin to barcodes that uniquely identify products, and secured data using AES-256 (Advanced Encryption Standard with 256-bit key length) encryption, providing bank-grade security to prevent unauthorized access. By performing localized computations, edge nodes reduce latency and alleviate the computational burden on central servers, ensuring efficient data flow.  
Figure 6 illustrates a decentralized IIoT architecture, where factory A and factory B utilize IoT sensors and dedicated edge nodes to collect and secure data locally. Processed data is sent to a central controller and recorded on an Ethereum blockchain with 100 validating nodes, ensuring data integrity and traceability. The system supports miners, transaction nodes, and light nodes, with data stored in a centralized database for end user access and analysis.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Factory** & **Sensor Type** & **Value** & **Timestamp** & **Normal Range** &
\begin{tabular}{c} **Anomaly** \\ **Detected** \\ \end{tabular} \\ \hline \multirow{2}{*}{Factory A} & Temperature & 25.4 \({}^{\circ}\)C & 2023-04-08T12:00:00 & 23–27 \({}^{\circ}\)C & No \\ \cline{2-6}  & Temperature & 28.0 \({}^{\circ}\)C & 2023-04-09T03:00:00 & 23–27 \({}^{\circ}\)C & Yes (Z \(>\) 3) * \\ \hline \multirow{2}{*}{Factory B} & Humidity & 65\% & 2023-04-08T12:00:05 & 50–70\% & No \\ \hline \hline \end{tabular}  
* Z-Score was used to measure unusual data points. Threshold: Z \(>\) 3 flagged as abnormal.  
\end{table}
Table 2: Sensor readings from factory A and B.  
The system utilized Ethereum's energy-efficient Proof-of-Stake (PoS) consensus mechanism, which contrasts sharply with the computationally intensive and energy-heavy Proof-of-Work (PoW) method. Validators in the PoS model are selected based on their \"stake\", which is akin to a security deposit, resulting in a 76% reduction in energy consumption compared with the PoW model. This adoption of PoS ensured faster transaction processing while aligning with sustainability goals. An HTTP flood attack was simulated to evaluate the system's resilience, generating 50,000 requests per second over a 10 min period. Under normal conditions, the system handled 1200 transactions per second, like a busy highway with manageable traffic flow. However, during the attack, traffic surged to 50,000 requests per second, representing a 40-fold increase that caused significant congestion.