## 4 Implementation of the Proposed Security Improvement Framework (SIF)  
The proposed Security Improvement Framework (SIF) using Zigbee protocol in the IoT platform is implemented in an office security system for intelligent monitoring. The office security system testbed is shown in Figure 6. The office area is separated into different locations and employees have restrictions for entering specific areas. All employees must use their RF identity card to enter any office area. When any employee wants to enter any office area, he/she will touch his card on the RF card reader. Readers include the Zigbee communication module which is called Router. Router sends reading information to central controller which is called Coordinator. If any employee wants to enter his/her permitted office area, the coordinator sends permission to unlock the door. On the other hand, if the employee wants to enter a prohibited office area for him/her, the coordinator sends denial of permission and notifies the administrator through email. Moreover, if a hacker tries to attack the system, then the framework detects and protects from such attempts effectively in the same way. The pseudocodes used for the proposed office security system is presented in Table 5.  
Figure 5: Sequence diagram of Router, Coordinator, Webserver, and Admin to detect Flooding Attack in the proposed Security Improvement Framework (SIF).  
Figure 6: (**a**) Block diagram of the office security system using proposed Security Improvement Framework (SIF); (**b**) photograph of the testbed for implementing the proposed SIF.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Algorithm: Office Security System (T\_data, R\_data, P, H, L)** \\ \hline
**Data:** Transmitting data=T\_data, Receiving data=R\_data, Pulse\_bit=P, Authorize bit=H, Unauthorized bit=L. \\
**Result:** Physical attack=P\_attack, Flooding\_attack=F\_attack, Access status=A\_status, Door state=D\_state. \\ \hline (1) & Start \\ \hline (2) & Connection==Serial Communication();/*Check serial communication between router and coordinator*/ \\ \hline (3) & If connection==Fail \\ \hline (4) & Return Start; /*Step 1*/ \\ \hline (5) & End \\ \hline (6) & If connection==True then \\ \hline (7) & T\_data==Encrypt(data); /*AES 128 bit encryption*/ \\ \hline (8) & If R\_data==’P’ OR 'H’ OR ‘L’ then /*128 bit decryption*/ \\ \hline (9) & P\_attack==No; \\ \hline (10) & Update Web(P\_attack);/*Update web page with no Physical attack data*/ \\ \hline (11) & Send Email(Admin); /*Send email to Admin notifying no Physical attack*/ \\ \hline (12) & Else \\ \hline (13) & P\_attack==Yes; \\ \hline (14) & Update Web(P\_attack);/*Update web page with Physical attack data*/ \\ \hline (15) & Send Email(Admin); /*Send email to Admin notifying Physical attack*/ \\ \hline (16) & End \\ \hline (17) & End \\ \hline (18) & If R\_data==’H’ OR ‘L’ \\ \hline (19) & Initialization i, data; \\ \hline (20) & Fori=1 to 20 do \\ \hline (21) & Data=data+1; \\ \hline (22) & Delay==200 ms; \\ \hline (23) & If Data=? \\ \hline (24) & F\_Attack==Yes; \\ \hline (25) & Update Web(F\_attack);/*Update web page with Flooding attack data*/ \\ \hline (26) & Send Email(Admin); /*Send email to Admin notifyingFlooding attack*/ \\ \hline (27) & End \\ \hline (28) & End \\ \hline (29) & End \\ \hline (30) & If R\_data==’H’ then \\ \hline (31) & A\_status==Authorized; \\ \hline (32) & D\_state==Open; \\ \hline (33) & UpdateWeb(D\_state);/*Update web page with Door state data*/ \\ \hline (34) & Send Email(Admin); /*Send email to Admin notifying authorized access*/ \\ \hline (35) & End \\ \hline (36) & If R\_data==’L’ then \\ \hline (37) & A\_status==Un-authorized; \\ \hline (38) & Door==Lock; \\ \hline (39) & Update Web(D\_state);/*Update web page with Door state data*/ \\ \hline \hline \end{tabular}
\end{table}
Table 5: Pseudocodes used in the proposed Security Improvement Framework (SIF) using Zigbee protocol implemented in an office security system.