Multi-Layer-Partial-Mesh-Based Fail Proof HAN With Decentralized Multi Gateway for Smart Home Monitoring and Control

This paper elaborates a unique development of decentralized ZigBee-enabled fail-proof home area network (ZFPHAN) with a multi-layer partial mesh (MLPM) topology using customized ZigBee control boards (ZCBs). The availability of alternate paths in MLPM under malfunctioning node(s) is extracted to enhance the operational robustness of consumers’ appliances. Any layer of the MLPM contains one active gateway (AG), one pseudo gateway (PG), and a number of ZCB nodes. A new layer of MLPM is formed with the rearrangement of PG and AG after the failure of AG in the previous layer. In its rearrangement procedure, the PG of the previous layer becomes new an AG node, and a new PG is formed from the remaining ZCBs, depending on their descending order schedule of degree distribution. The transmit power of any ZCB is minimized to maintain whispering distance with neighboring nodes for energy efficient and eco-friendly purposes. The proposed MLPM is simulated to estimate its working with propagation delay, its alternate path under malfunctioning nodes, and its robustness. For experimental verification, the performance of the proposed ZFPHAN with five ZCBs is tested under all possible conditions, and fail-proof networking is observed. The experimental result suggests the successful implementation of this ZFPHAN.

Multi-Layer-Partial-Mesh-Based Fail Proof HAN With Decentralized Multi Gateway for Smart Home Monitoring and Control Rakesh Das and Jitendra Nath Bera, Member, IEEE Abstract-This paper elaborates a unique development of decentralized ZigBee-enabled fail-proof home area network (ZFPHAN) with a multi-layer partial mesh (MLPM) topology using customized ZigBee control boards (ZCBs).The availability of alternate paths in MLPM under malfunctioning node(s) is extracted to enhance the operational robustness of consumers' appliances.Any layer of the MLPM contains one active gateway (AG), one pseudo gateway (PG), and a number of ZCB nodes.A new layer of MLPM is formed with the rearrangement of PG and AG after the failure of AG in the previous layer.In its rearrangement procedure, the PG of the previous layer becomes new an AG node, and a new PG is formed from the remaining ZCBs, depending on their descending order schedule of degree distribution.The transmit power of any ZCB is minimized to maintain whispering distance with neighboring nodes for energy efficient and eco-friendly purposes.The proposed MLPM is simulated to estimate its working with propagation delay, its alternate path under malfunctioning nodes, and its robustness.For experimental verification, the performance of the proposed ZFPHAN with five ZCBs is tested under all possible conditions, and fail-proof networking is observed.The experimental result suggests the successful implementation of this ZFPHAN.Index Terms-Gateway, home area network, multi-layer partial mesh, ZigBee communication, ZFPHAN.

I. INTRODUCTION
M ONITORING of the running conditions of the electrical appliances for a smart home or building from a centralized location or even from a smart phone is a topic of research since last few decades.The energy consumption pattern of each and individual load also needs to be controlled in order to achieve an optimum management of overall energy usage.The implementation of new services like automatic meter reading (AMR), demand response (DR) and demand side management (DSM) is the prime aspects [1], [2].The overall energy usage can thus be controlled on real-time tariff information basis.The smart home deployment or even conversion of an ordinary home to a smart one proposes for energy-efficient usage of various electrical appliances as discussed in [3].It also takes crucial role in reduction of footprint of greenhouse gases, as elaborated in [4].It is learnt from [5] that the display of real time information can result in energy reduction of up to 30%.
A protocol for harmonizing ZigBee and wireless local area network (WLAN) in a smart grid, utilizing cognitive techniques and energy-efficient methods, yields improved communication and power savings, as described by Lee et al. [6].The ZigBee at 2.4 GHz with IEEE 802.15.4 protocol is generally adopted due to its inherent low power consumption, high noise immunity, robustness, and reliability etc. features.
To enhance reliability and reduced inaccessibility, reactive and proactive fault-tolerance approaches are proposed by Attia et al. and Dymora et al. [7], [8].The energy-efficient cooperative routing scheme for heterogeneous wireless sensor networks to enhance network lifetime through shared relay paths is described in [9].An Informer homed routing (IHR)based energy-aware fault tolerance mechanism is proposed in [10] to address the node failure due to the energy depletion, hardware failure etc. reasons.
The spoofing attack also causes maloperation of the node(s) in home area network (HAN), the detection of which is mandatory for reliable and secured operation of the home appliances, as well as for preserving the privacy.Lu et al. [11] have proposed to detect spoofing attack of the node in a heterogeneous wireless networks between Wi-Fi and ZigBee nodes.Sun et al. [12] have proposed a supervised one-class support vector machine (OSVM) classifier to detect spoofing based on the RSS data.The idea of fingerprint of each and every ZigBee nodes is proposed in [13] as an approach to identify the spoofed node(s).The robustness issues of a network under the failure of links or spoofing attack, in particular for Internet of Things (IoT) network, have been studied critically in [14] based on the monitoring of different network parameters and switching topologies.Various research works are being performed to make the HAN fail proof under different abnormal conditions as well as under external attack conditions.Home automation utilizing IoT and cloud computing enables remote control and monitoring of household devices [15].The devices in smart homes are interconnected using IoT with the security aspects [16].Privacy and security aspects for IoT based interconnected devices are discussed in [17].
Besides, Multi-Layer-Mesh and a path switching algorithm based on software-defined networking (SDN) is proposed in [18] in order to enhance the network performance in a big data cluster.However, nothing is mentioned about the robustness aspects of this multi-layer mesh topology.Generally, home energy management systems (HEMSs) suffer from the adverse effects like rebound peaks, instabilities, and contingencies.In order to mitigate these adverse effects, coordination amongst the HANs is proposed in [19] based on the decomposition algorithm.Smart HEMS (SHEMS) with HAN deployment using ZigBee is proposed in [20], [21], [22] to provide intelligent services for users with their participation in DR and load management scheme.
The reliability of operation of different channels of ZigBee devices under different ambient conditions is studied in [23].It suggests for the use of dynamic channel hopping to fulfil the network management requirements.An enhanced self-configuration scheme for a robust ZigBee-based home automation is discussed in [24], [25].An automatic and effective architecture for dynamic integration of home appliances into ZigBee based home network is proposed by Ha [26].
But all of these works discussed so far use star topology to build the network.The major limitation of this star network is that the entire network becomes defunct if the coordinator or central node fails.In this context, the decentralized HAN is also being investigated in terms of effectiveness studies and performance analysis.They are also compared with the probability of detection and signal-to-noise ratio (SNR) of the centralized technique used [27].The complexity of the fully meshed network with a decentralized scheme is also analyzed in [28], [29], [30].However, in all of these cases, the required number of nodes are as many numbers of equipment and become vulnerable for any intermediate node failure.
The authors of this paper are thus motivated to resolve these limitations of centralized as well as decentralized monitoring and propose a fail proof decentralized HAN with multi-layer partial mesh topology.The novelty of the proposed ZFPHAN is that the partial mesh topology with multilayer concept is introduced in HAN utilizing customized ZCB.The developed systems has the following uniqueness: (i) the dimension of the ZCB is such that it can easily be inserted into the existing switchboards by providing sufficient safety issues like proper insulation and isolation to monitor and control all the connected load through that board; (ii) partial mesh topology for HAN is established to improve the network flexibility with reduced computational burden of each ZCB; (iii) whispering principle is proposed with very low transmit power of ZCB for safety and energy-efficient purposes; (iv) active gateway and pseudo gateway with multilayer working concept is introduced to make the system more robust and reliable than widely used existing star topology.
In its organization, Section II describes the customized development of four basic components of ZFPHAN.Section III describes about the basic problem formulation, hierarchical routing using Kruskal's algorithm, and multigateway coordination scheme.Section IV deals with the failure detection schemes of active gateway, ZCBs, and other nodes, robustness issues with multilayer coordination, and random walk topology.Section V represents the experimental results.Section VI concludes about the achievements.

II. MATERIALS AND METHODS
The proposed decentralized fail proof HAN is built with four components, namely: (i) ZCB node; (ii) ZigBee gateway; (iii) in-home display (IHD); and (iv) Wi-Fi router.The ZigBee gateway is basically a ZCB node having some additional functionality over the network operation.There will be as many numbers of ZCBs as there are number of electrical switchboards in a particular home.In order to get access of each and every individual appliance within a home, a tetherless link between them and the active gateway (AG) is established using the ZigBee protocol.As a group of load is controlled through a switchboard within the house, this scheme helps in reduction in number of ZigBee nodes in comparison to the cases where ZigBee or any other communication module is used on per load basis.The ZCB is designed accordingly to reduce the number of ZigBee modules but still all the appliances can be monitored and controlled through the gateway.The four basic components are elaborated as follows.

A. Customized ZigBee Control Board
A switchboard in a home is generally utilized to operate manually a group of appliances connected to it.Inside space of each of the switchboards is utilized to mechanically mount the proposed ZCB, the basic schematic of which is shown in Fig. 1.This avoids the need of additional controller boards and the space required for their mounting within the home.As shown, a controller board, a ZigBee module, sensors (V s , C s ) with signal conditioning circuit, and relays on per load basis are embedded within a switchboard.Each load to a particular switch can be controlled either by usual manual operation or by remote operation of the relay.The relay can be replaced using phase-controlled device where phase control of the equipment is needed.The ZCB is made such that it can easily be filled inside ZCB with proper insulation and isolation level for the electronic part.

B. ZigBee Gateway: Active and Pseudo
In this proposed ZFPHAN, two gateways, namely (i) active gateway (AG), and (ii) pseudo gateway (PG), are proposed.As shown in Fig. 2, the AG is such a ZCB responsible to exchange information between other ZCB nodes besides its own appliances.The IHD, smart meter (SM), and Wi-Fi router  are used for remote monitoring and control.The running status of individual ZCB within the home, the overall power consumption as well as AMI service-related information from SM are sent to AG.The AG then forwards that information to the control station with the help of router as well as to the IHD.On the other hand, the respective control issues of individual appliances are generated in the control software and are sent back to the corresponding ZCB through the AG itself.Thus, AG plays the most important and pivotal role in HAN application.
The PG node, in general, behaves like a normal ZCB node.Additionally, PG tracks the working of the AG node to check about its healthy working by exchanging the coordination_link command between them.

C. ZigBee Enabled Wi-Fi Router
The remote monitoring and control software can be installed at any server or PC or even if in the form of a mobile 'App' for its operation from a smart phone.Since all these devices are connected through the Internet, a TCP/IP enabled Wi-Fi router is essential only to route the information from the ZigBee based gateway and vice-versa.
The router communicates with AG using the ZigBee protocol, and hence a ZigBee module is interfaced with the Wi-Fi router using a protocol converter processor.For economic reasons, only one Wi-Fi router is proposed, and the schematic diagram of this system is shown in Fig. 3(a).

D. In-Home Display
The in-home display, as shown in Fig. 3(b), is used to provide the consumption related information of each and every appliance corresponding to each ZCB and to control them as well.
It can also be able to display all the customer related information sent by the utility distribution center to the SM.The AG keeps track with SM for this kind of information and sends it to IHD.The IHD also communicates using ZCB protocol and can be treated as ZCB node.

III. HOME AREA NETWORKING ASPECTS
All the electrical appliances in a smart home are networked with proposed ZFPHAN to make controllable remotely with their dedicated in-built ZCB.The various aspects of this proposed fail proof HAN are described as follows:

A. Problem Definition
Each ZCB within a home is connected using a very low power, tetherless communication link with the ZigBee protocol.Considering the probable health hazard issues of high-power radio waves and as the physical distances between ZCBs are few feet only, the transmit power of the ZigBee module is intentionally made keep to a minimum (∼ −5 dBm to cover 35-40-foot distance).With this, the ZCBs whisper to establish communication among them.The ZCBs physically placed at a longer distance from the gateway and need multiple hops to exchange information between them.This suggests to adopt a mesh topology where the conventional star topology may fail to serve the purpose with ZCBs communicating with such low transmit power.Again, in the event of a failure of the star node, the entire network operation may get hampered.Hence, star topology is discarded in this proposed fail proof HAN.The fully mesh topology is not encouraged, as this also requires large transmit power to establish communication among the farthest nodes.
The partial mesh topology is chosen instead, where the advantage of having an alternate path in case of failure of one node is extracted.The complexity of having N(N − 1)/2 links for fully meshed network is also getting reduced in this way.The gateway has to serve the anchoring role for establishing the communication bridge between the intended ZCB node and the control software.The failure of gateway functioning creates the similar situation as like the situation of failure of star node in star topology.Accordingly, the concept of multigateway based partial mesh is introduced in this work.In order to increase the robustness of this proposed fail proof HAN, a multi-layer decentralized partial mesh model with a hierarchical routing topology is also introduced.Kruskal's algorithm is used for establishing the hierarchical routing, and all these are elaborated on in the subsequent sections.

B. Multi-Layer-Partial-Mesh Model of ZCBs
For better understanding of the workings of the nodes in this proposed ZFPHAN, the layered structure of the nodes is introduced.The nodes like AG, PG, inactive AG (IAG), ZCB, inactive ZCB (IZCB), IHD, and Wi-Fi router form a layer.Only on the failure or mal-functioning of AG, that is, when the node becomes IAG, PG immediately takes over the control of the network and forms a new layer.There may be several such layers containing all these nodes on successive failures of the AG node of the corresponding layer, but each layer differs with a new set of AG and PG.In general, a particular layer remains functional until its AG and PG remain active, but the failure of any ZCB of that layer is managed by providing some alternate path and isolating that IZCB.
The degree distribution pattern of all ZCB nodes is evaluated and arranged in a table in descending order.The AG and PG are selected on the basis of the degree distribution of ZCBs.The node with the highest degree distribution acts as AG, while the next one acts as PG.While this PG acts as AG, the next highest degree distribution node acts as PG in the new layer.This process of forming of new layers continues for subsequent failures of AG, and a multilayer structure is thus formed with a decentralized gateway.
In the proposed MLPM schematic for L y layer, shown in Fig. 4(a), all nodes, viz., AG, PG, and ZCBs, are in healthy condition.As shown in Fig. 4(b), a new layer L y+1 is created so that PG of L y layer becomes new AG, and the AG of L y layer becomes an IAG.In this case, a new set of links is created.While in Fig. 4(c), another set of new links is created when a ZCB becomes IZCB.However, in this case, the layer is not changed.

C. Algorithm for MLPM
The following algorithm is used for the MLPM.

Algorithm 1 Multilayer Partial Mesh Network
Step 1: Calculate the degree distribution (D d ) of each node and arrange them in descending order.
Step 2: For any layer L y , the node with maximum D d acts as AG and the next D d node acts as PG.
Step 3: For the layer L y , if AG becomes IAG, a new layer (L y+1 ) is created and the PG node acts as AG.The next D d node acts as PG in (L y+1 ) th layer.
Step 4: If any IAG becomes re-active, the (L y+1 ) th layer is reduced to (L y ) th layer and it becomes AG.The AG of (L y+1 ) th layer becomes PG.
The following mathematical model is used to represent the working of decentralized MLPM: If N i (t) is the number of nodes within the range of node i at t, PL i (t) is the attachment probability of the i th node at time t, and L i (t) is the set of responsive nodes within the range of node i at t. RSSI is the receive signal strength indication, and R th is the minimum threshold value of RSSI below which communication is not possible.Then it is satisfied by equation (1).
where P i tx is the transmit power of i th node and P i min is the minimum power to cover whispering [39], [40] distance between ZCBs, as expressed in equation (2).
The probability of responsive nodes is given as equation ( 3) The number of links k i for node i is arranged in descending order for determining the node activities as either AG or PG.The probability of becoming any node as AG and PG is expressed by equations ( 4) and (5).
The probability of any AG becomes IAG can be expressed in equation ( 6) In this case, PG becomes AG and forms L j+1 the probability is given by equation (7).
for L j+1 (7) where G Ai is the i th active gateway node, G Pi is the i th pseudo gateway node, G IAi is the i th inactive gateway node.

D. Hierarchical Routing
The schematic diagram containing the possible links for the partial mesh of a particular layer is shown in Fig. 4. As shown, multiple paths are possible in any layer from any normal ZCB to an AG node.Among all the possible paths, a hierarchy in route selection is maintained with the currently active nodes by introducing Kruskal's algorithm.For implementing Kruskal's, the links are evaluated based on the RSSI values.Fig. 4(a) and 4(b) show such typical routes determined by Kruskal's algorithm with an alternate path for a failure of node AG so that the communication remains fail proof.
The minimum spanning tree, for a connected weighted graph-based algorithm, is used to find the alternate paths in MLPM.The subsets of edges used to establish the weighted links are found using the following Kruskal's algorithm:

E. Kruskal's Algorithm
At the termination of the algorithm, the forest forms a minimum spanning forest of the graph.This graph is used to provide an alternate path along with the hierarchy.

Algorithm 2 Working Principle of Kruskal
Step 1: A set of trees in forest of nodes F is created, with separate tree of each vertex in a graph G = (V, E).
Step 2: A set S containing all the edges in the graph is created.
Step 3: Remove an edge with minimum weight from S.
Step 4: If the removed edge connects two different trees, then add it to the forest F, combining two trees into a single tree Step 5: Continue step 3 till S is nonempty and F is not yet spanning.

F. AG and PG Coordination Topology
The functioning of AG for currently active layer is monitored at regular intervals by PG of that layer.In addition to its normal ZCB activities, PG transmits a coordination packet to AG at a regular interval.On reception of a specific reply packet, it gets confirmed about the normal activities of AG.The AG reply packet content will be any one or a combination of all these sub packet information, like AG id, dynamic header, packet id, layer no., home id, next interval, and RSSI value.The PG has to send a query packet to AG, requesting any of the sub packet or a combination of these.
The repeated failure of the reception of the proper response packet over a specific period of time, the AG is treated as suspicious or dead node with the help of customized AND-OR logic scheme.The AG is then treated as an IAG, while the PG starts acting as new AG and its network layer is increased to the next level.This new AG then broadcasts about its working as a gateway node, and the routing tables of each of the nodes are updated following Kruskal's algorithm.A new PG is created from the degree distribution table as shown in Table II.
The PG of any layer also looks after the restoration of the IAG.If IAG becomes active, the current layer AG, then instructs the PG to behave as normal ZCB, hands over the responsibility to IAG so that IAG can act as AG and reduces the layer level.It then behaves like a PG.The recovered AG broadcasts its presence, and the routing tables of each node get updated again.This kind of information exchange and gateway coordination remains active till the entire life duration of HAN to make the network fail-proof.

IV. FAULT TOLERANCE AND ROBUSTNESS ISSUES
The proposed decentralized MLPM HAN using ZCBs is so designed that communication among the appliances and central monitoring and control software remains unaffected under all abnormal conditions.There are several reasons like interference effects with other Wi-Fi or Bluetooth channels, hardware failure, battery or power supply failure, even if, malfunctioning of any ZCB or AG nodes of the proposed ZFPHAN under the influence of spoofing attacks.An alternate route will be activated under the failure of ZCB to make the system fault tolerance one.Similarly, the PG starts functioning in a new layer as AG of the previous layer fails to work.Thus, the detection of non or mal-functioning of the nodes is of prime importance, which can be realized from the following subsections.

A. Estimation of AG Failure Using Packet Analysis
For detection of failure or estimation of mal-operation of AG, PG scans regularly the activities of AG.The proposed system is so designed that AG communicates the data packets, as shown in Table I, during its normal operation.As indicated, packet P 1 is used to control ZCB operation, P 2 for ZCB and AG node discovery, P 3 for received packets from ZCB, P 4 for received packets from IHD, P 5 for received packets from Wi-Fi, P 6 for the last communication information request (info_request) received from PG, and P 7 for reply packets to PG.
Each packet is also associated with a packet ID for double checking purposes.In most cases, the packet structure is of fixed bytes, as indicated in this table.The packet (P 7 ) is of variable length as it will have to repeat the last packet received by AG for communication along with its RSS value.n = Number of RF payload bytes.

(i) PG activity for authentication of AG:
In order to scan, PG transmits the P_Com_Info packet (P 8 ) to AG at a regular interval.PG analyzes the received packet from AG to check the authenticity of the content of the packet along with its RSSI value.The AG transmit power is also scanned by PG by monitoring the energy level associated with the last transmitted packet.This energy scan is performed using packet P 9 to observe the band of the energy level of AG for its normal operation.It is assumed that the energy level of the AG transmit packet will be higher than this band if it wishes to communicate with other external nodes outside the HAN area.After receiving a reply from the AG and its detected energy level and layer ID, PG analyzes about the authenticity of the AG activity with the AND-OR logic algorithm.
(ii) The AND-OR logic: This customized AND-OR logic, which is very less complex in implementation, is shown in Fig. 5.The 'Analysis block' first analyzes the length for each of the packets (P 1 to P 8 ).It then extracts the information of layer ID, physical position of the communicated node.The outputs of these blocks are logically ORed considering only one type of packet can be communicated at a time.The output of OR logic and the extracted RSSI and ZCB position, detection of PG's own energy level band, and layer ID (iii) PG activity for during malfunctioning AG: If the AG of the current layer (L y ) is found to be a suspicious node on the basis of this AND-OR logic algorithm, the AG of this layer will be blacklisted by the PG.The packet P 10 is basically a broadcast message to all the ZCBs/ IHD and Wi-Fi AP for intimating them about the black listed AG of layer (L y ) as well as recent change over of PG to a new AG with increased layer number (L y+1 ).
This broadcast message contains the ID of the new AG, the latest layer number, so that all other nodes can update their routing table.This new AG then behaves as the normal AG of layer (L y+1 ).For better realization, a state diagram of packet transmissions is shown in Fig. 6.

B. Activation of Alternate Route for ZCB Failure
During data transmission from any node to the gateway or vice-versa using multiple hopping, the malfunctioning of any intermediate node is identified when it remains non-responsive for a specified duration of time or if the desired response is not received by its previous node.In this case, an alternate route is chosen to transmit the data packet so that the communication is not interrupted.
The total number of possible paths or links (P N ), varies depending on the clustering coefficient of the fully meshed or partial or lattice random network, as expressed by equations ( 8) and ( 9), one having range from 0.9 to 0.5 with N p number of nodes: The clustering coefficient for this partial meshed HAN is intentionally made low by reducing the transmit power of the ZigBee module.Thus, the alternate (P a ) can be anyone of the remaining (N p −1) paths, as expressed by equation (10).P a = P N where (P N ) min < P N < (P N ) max (10) The logic for detection of malfunctioning node is determined by equation (11).(11) where N act i and N ina i are the active and inactive nodes, L Ai (t) is link attachment probability depending of the minimum value of RSSI for the i th node.If RSSI value is < R th due to non-or mal-response, the corresponding node is treated as malfunctioning one at time instant t.

C. Robustness of Proposed ZFPHAN
The ability of any network to forward the data packet to the destination from its source under the failure of its intermediate node(s) is quantified with its robustness.Providing an alternate path under node or link failure condition for uninterrupted flow of data traffic is the property of any robust network.For robustness quantification, the random walk principle is adopted from [31], [32], a mathematical relationship of which is realized from graph theory.For every graph G = (V, E) with vertex set V and edge set E, if an element p ij has a probability to go from vertex i to vertex j, for i, j ∈V for matrix P and h ij is the number of hops in between, then for random walk the edge is expressed by equation (12).
Let T(j) be the vector with i th coordinate equal to E(h ij ), and let P(j) be the matrix equal to P but with row j and column j removed, for j∈V, then T(j) can be expressed with the equation (13).
where I is the identity matrix: Or it can be expressed as T(j) = ∞ n=0 P(j) So, the effective graph resistance with random walks is calculated as given by equation (14).

V. EXPERIMENTAL RESULTS
The performance of the proposed ZFPHAN is tested with some case studies using (i) simulation and (ii) hardware prototype developments, as described below.The all-possible conditions of failure of any intermediate node(s) or even active gateway node of any layer as well as the corresponding switchover to the new path or a new layer has been elaborated in these case studies.
All these case studies along with the critical analysis of the result are made to justify all the fail-proof properties of the proposed network.

A. Simulation of Proposed ZFPHAN
The proposed HAN with 15 number of ZCB nodes is simulated first in order to study the performance of the developed algorithms for its working with multi-mesh conditions under failure of ZCB nodes.The working of multi-layer algorithm Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.  is also tested when the AG becomes an IAG in a particular layer.
The performance of the proposed ZFPHAN is tested with the following case studies: Case I (A typical node distribution pattern of HAN): A typical HAN with partial mesh of 15 ZCB nodes is simulated.A typical distribution of nodes along with all possible partial links is shown in Fig. 7.The active links are shown with bold lines for such a HAN communication.
The degree distribution of the nodes, organized in descending order, is shown in Table II.
This organization helps in selecting AG and PG nodes for subsequent layers.For example, it can be said that for layer 1, node 2 acts as AG and node 5 acts as PG.If node 2 fails, it becomes IAG; layer 2 is formed where node 5 behaves as AG and node 8 behaves as PG.If node 2 becomes active again, node 5 hands over its AG activity to node 2 and becomes PG, while node 8 becomes a normal ZCB.In this way, this table is extremely helpful in determining the AG, PG, IAG, and IZCB nodes of the current layer.
For the cases of nodes having same degree, their average RSSI values are considered for arranging them in descending order.Besides, it is observed that the total number of links is seen much less than N(N − 1)/2 to confirm its behavior as partial mesh.
Case II (Multi-layer Partial Mesh): The presence of AG, PG, ZCB, IZCB, and IAG nodes in different layers for this typical HAN is summarized in Table III.The variations in data transmission path from node 12 (i) to AG 5 without IAG/IZCB in layer L 1 ; (ii) to AG 5 with IZCB node 4 in layer L 1 ; and (iii) to AG 2 with IAG node 5 in layer L 2 are indicated in rows 1, 2, and 3 respectively.The layer is changed for the last case as AG becomes inactive while the PG becomes new AG and node 8 becomes new PG following Table II.This shows that the data transmission remains unaffected under the failure of any node(s) or even AG.For this transmission, the average end-to-end delay ( ) in i th hop is calculated as = d i /T n with total number of trials (T n ) and delay in each trial (d i ).Average data throughput (D) is thus calculated using D=(D p P s )/ where D p and P s is the number of bits per packet and the size of a packet respectively.It is observed that for 100 times transmission of 20 bytes of data packets, the average data throughput for this partial HAN is well within 2-15 sec [36].
Case III (Robustness of Proposed ZFPHAN): The random walk robustness of the proposed ZFPHAN is evaluated by following equation ( 14) on the basis of calculating total effective graph resistance.The robustness values for different link failure conditions with different layers are shown in Table IV.It is seen from the robustness values that the link failure or even AG failure conditions are well managed by the proposed ZFPHAN, as these values are less than the limiting values of 1.The average robustness value for the proposed partial mesh is 0.4254.
For comparison, the fully mesh and star networks exhibit maximum and minimum robustness with values of 1 and 0, respectively.This indicates that the proposed ZFPHAN is highly robust.

B. Hardware Experiments
Case I (Placement of Developed ZCB): A laboratory prototype setup with five number ZCBs, one IHD, and one AG is developed in order to build the proposed ZFPHAN.Fig. 8 shows a hardware assembly to be fitted inside the switchboard.
As shown in Fig. 8, the hardware assembly of a ZCB controller unit is made up with the help of a processor, sensors (V s and C s ), relay module along with its driver, an XBEE module, and SMPS.The XBEE module communicates using ZigBee protocol, where the relay module controls the ON-OFF operation of the electrical appliances, sensors V s and C s are used for voltage and current sensing.The controller unit performs all the coordination among these modules based on the information received in the ZigBee data packet.
Five ZCBs, as shown in Fig. 9, are placed at 5 different places within a laboratory with the distances of 5, 7, 8, 10, and 12 meters away from the AG.The IHD is placed at the central position of 6 meters.The following test parameters   are measured, and the links and communication path for the partial mesh are summarized in Table V.
Case II (Measurement of RSSI of ZCBs): The variations in RSSI value of the receiver node (sensitivity of −100 dBm), placed at different locations for transmit power of −5 dBm of the sender node are shown in Fig. 10.At this lowest transmit power level of the XBEE module, the maximum coverage distance between the transmitter and receiver nodes is approximately 15 meters for a typical laboratory structure.
However, this coverage distance may vary from one room to another, depending on their structural layout and the presence of other materials.

Case III (Measurement of Transmission Latency):
The transmission latency to evaluate data throughput with variation in hop count is estimated by measuring the traffic delay from any one of the source nodes (1, 2, 3, 4) to AG (5).The  corresponding delay value for each of the hop counts is shown in Table V.It is to be mentioned that the ZCB processor communicates at a baud rate of 115200, and the payload is 20 bytes.
For comparison purposes, the transmission delays of the works described in [33], [34], [35], [36] are also listed in Table V.It is observed from this comparison that the latency generated from the proposed work is well within the acceptable limit and less than that of these referred works.
Case IV (Packet delivery ratio): Performance metrics like packet delivery ratio and loss ratio are measured for the assessment of network reliability.For this study, different types of packets like monitoring (MT), control traffic (CT), network management traffic (NMT), and node discovery (ND) are transmitted by placing two ZigBee nodes at a 10-meter distance.The packet loss ratio (PLR) is evaluated using PLR = 100(P s − P l )/P s where P s and P l is the number of packets sent and lost during transmission.Packet delivery ratio (PDR) is evaluated with PDR = 98.5%.
A PLR of 1.5% is observed from Table VI for a trial of 200 times of 20 bytes of NMT packet.For the other packet types, the PLRs are lower than this one, and hence, all these are within the acceptable limit.An improvement in PDR is observed in this proposed method in comparison to a PDR of 95%, as mentioned in the work published by Lu et al. [37].
It can be mentioned here that, considering the average number of switch boards among various homes, particularly in the Indian scenario, the number 15 is chosen.However, the actual number of ZCBs will vary from one home to another.It is observed from Table III and Table V that the data throughput and latency depend on the number of hops.Thus, considering the allowable bandwidth of 10-100 kbps within the allowable latency of 2 to 15 sec, the maximum number of hops can be much more than 15, subject to the latency constraint as well as the payload size [38].
Accordingly, depending on the configuration of the home, the number of hops as well as the number of ZCB are to be decided, which is definitely greater than 15.On the other side, a reduction in ZCB number than 15 will reduce the number of hops and thereby the latency will be reduced.

VI. CONCLUSION
This paper describes the developments of ZFPHAN along with its constituent components like customized ZCBs, IHD, and Wi-Fi routers, in order to provide the consumer a robust, reliable, and economic network of appliances.The mounting of one ZCB within a switchboard is proposed to control all the loads on that board in order to save the physical space of mounting and extra wiring as required in conventional HAN.Thereby, the requirement of number of ZCB is reduced to a great extent in comparison to the conventional HAN, where one controller per load basis is utilized.This indirectly reduces the radio mesh as well as overall power consumption of ZCBs.The consumer thus gets two-fold benefits with the reduction in (i) the cost of total number of controllers as well as their installation cost to build the HAN and (ii) the running cost since the transmit power is kept intentionally very low.Additionally, the low transmit power for whispering coverage becomes beneficial to the consumer [39], [40] from their radio wave related health hazard issues.The internal working of the proposed decentralized ZFPHAN utilizing IHD, AG, PG, IAG, ZCB, and IZCBs is elaborated through various sections, and is verified through simulations as well as hard prototype deployment.The fail-proof properties are also critically analyzed and established through various experiments.Thus, this development helps a consumer to establish a fail-proof, lowcost partial mesh HAN to monitor and control home appliances with the help of IHD and/or any smartphone using remote control application software.

Fig. 5 .
Fig. 5. AND-OR logic block for detection of AG failure.

Fig. 6 .
Fig. 6.State diagram of various packets for HAN operation.

Fig. 7 .
Fig. 7. Typical Node distribution pattern of 15 nodes.(a) a typical path with all active nodes (b) an alternate path with one IZCB.

Fig. 9 .
Fig. 9. Physical position of ZCB, PG, AG, and IHD along with a snapshot of IHD.

TABLE I AG
AND PG COMMUNICATION PACKETS IN BYTES

TABLE II DISTRIBUTION
OF DEGREE IN ASCENDING ORDER

TABLE III MULTIPLE
PATHS WITH ACTIVE/INACTIVE NODES

TABLE IV TOPOLOGY
-BASED ROBUSTNESS FOR15 NODES

TABLE V PRACTICAL
DELAY FROM ONE NODE TO ANOTHER NODE

TABLE VI PACKET
DELIVERY AND LOSS RATIO