## 4 Delay Analysis  
### Delay Analysis without Bad Nodes  
Communication delay is an important measure of QoS, so it is necessary to calculate the communication delay of the artificial cobweb network accurately. In the tree topology, there is only one link connectivity between any two nodes, node communication failure due to channel noise and other uncertainties, which lead to the time of recovery communication cannot be accurately calculated, the delay time may be temporary or permanent. So the time of tree topology is not calculated in this paper. The transmission time of the packet \(t_{rx}\)is available from Equation (2):  
\[t_{rx}=p/\,\textit{Baud} \tag{2}\]  
where \(p\) is the packet size and _Baud_ is the communication rate. This paper sets the data processing delay \(t_{proc}=0.5\) s.  
After networking, the only factor that affects the communication delay is the subnet that the nodes come from. The communication delay is the same for different subnets that select the same central node as the relay node. Therefore, we select subnet 1, subnet 3, and subnet 4 from layer 1, layer 2, and layer 3, respectively, in Figure 4 to calculate the delay. First, we calculate the delay of peripheral node s, and all the nodes in subnets without bad nodes communicate with the BS.  
The steps of the transmission of data from a peripheral node in subnet 1 to the BS shown in Figure 8 are as follows:  
(a) The BS sends a data acquisition command to the central node \(h_{1}\) of subnet 1.  
(b) A peripheral node in subnet 1 sends its data to \(h_{1}\).  
(c) After the data processing time \(t_{proc}\), node \(h_{1}\) sends the data of a peripheral node to the BS.  
The delay \(t_{d1}\) in the transmission of data from a peripheral node in subnet 1 to the BS is shown in (3):  
\[t_{d1}=3t_{rx}+t_{proc} \tag{3}\]  
The steps of the transmission of data from a peripheral node in subnet 3 to the BS are as follows:  
(a) The central node \(h_{1}\)sends a data acquisition command to the central node \(h_{3}\) of subnet 3, and a peripheral node in subnet 3 sends its data to \(h_{3}\).  
(b) After the data processing time \(t_{proc}\), node \(h_{3}\)sends the data of a peripheral node to \(h_{1}\).  
(c) After the data processing time \(t_{proc}\), node \(h_{1}\)sends the data to the BS.  
Figure 7: Timing of the algorithms. (**a**) Timing of the ACRA; (**b**) Timing of CSP.  
\[T_{dAll}^{\cdot} = \sum_{i=1}^{n}T_{di}^{\cdot}\] \[= \left(2\,p_{1}+3\,p_{2}+4\,p_{3}+\cdots+\left(n+1\right)p_{n}+3n \right)\!\!t_{xx}+\left(4+5+6+\cdots+\left(n+3\right)\right)\!\!t_{proc}\] \[= \left(2\,p_{1}+3\,p_{2}+4\,p_{3}+\cdots+\left(n+1\right)p_{n}+3n \right)\!\!t_{xx}+\left(\sum_{m=1}^{n}\left(m+3\right)\right)\!\!t_{proc}\! \left(n>=1\right)\]  
Figure 10 shows the calculated results based on the Equations proposed above, where each subnet contains seven nodes and the subnet layer \(n\) is from 1 to 10. It shows that when \(n=10\) and each subnet contains 1 bad node, \(T_{dAll}\) is about 68 s. With an automatic meter reading system, which is less demanding on the timing, the delay can fully guarantee the QoS of system. Though this method costs some time, it guarantees the data collection success rate of the BS, and has the desirable practicability. These results demonstrate that even though the method is time consuming, the ACRA is effective for guaranteeing QoS in PLC.