## 5 Modelling Rationale
### Modelling Strategy
#### 5.4.1 Link Model  
As we have mentioned, we use the link model to measure the probability of receiving a certain number of replicas \(n\) out of a total of \(k\) replicas transmitted through a single link with a specific frame size and BER. We must note that, currently, our link model only allows modelling the transmission of \(k\) replicas, where \(1\leq k\leq 4\). Figure 6 shows the state diagram of the complete link model. As we can see, the ellipses represent five different states which correspond to the number of replicas that can be transmitted through a link in the model. The transitions between states represent the probability of receiving \(n\) replicas out of \(k\), where \(n\leq k\), while they are transmitted through a single link. We must note that the model starts from one of the shown states, depending on the number of replicas we want to transmit. Furthermore, since we evaluate the model for a single link, the model can only reach one state, e.g., if we transmit two replicas, our model starts in the state \(k=2\) and can either stay in the state \(k=2\), move to state \(k=1\) or move to state \(k=0\). We use the same colour and type of line for the initial state and the transitions that the model can take for a single link.  
The probability of receiving a subset \(n\) from a set \(k\) of replicas depends on the number of replicas that are affected by a fault and can be expressed as follows:  
\[p=\binom{k}{k-n}\times(1-pe)^{n}\times pe^{(k-n)} \tag{1}\]  
where \(pe\) is the probability of a frame being affected by a fault. For further details on how we obtain this formula, the reader can refer to [10]. The probability \(pe\) of a frame being erroneous is calculated as follows:  
\[pe=1-e^{-\frac{BER*framesize}{bandwidth}}, \tag{2}\]  
where \(BER\) is the ratio between the number of erroneous bits and the total number of transmitted bits; \(framesize\) is the size of the frame in bits and \(bandwidth\) is the bandwidth of the link expressed in bits per second.  
As we have mentioned, we use the link model to feed our general models. Thus, in order to be able to model the transmission of any number of replicas (up to four) and the loss of any combination of replicas, we have to execute this model for every value of \(k\) and \(n\), where \(0\leq n\leq k\). On top of that, since we carry out a sensitivity analysis, we execute this model for each value of the BER and frame size that we have considered (Table 3). The input parameters of the link model are the following:  
* Number of replicas transmitted, \(k\). In our model, the minimum value for \(k\) is 1 and the maximum value for \(k\) is 4.
* Number of replicas received correctly, \(n\). The maximum value of \(n\) depends on the \(k\) we define, as we cannot receive more replicas than we transmit. Thus \(0\leq n\leq k\).
* Frame size. Necessary to calculate the probability of a frame being affected by a fault, as depicted in Equation (2). We use the frame size values set for our sensitivity analyses: 64, 782 and 1500 bytes.
* BER. Necessary to calculate the probability of a frame being affected by a fault, as depicted in Equation (2). We evaluate the BER values set for our sensitivity analyses: from \(1\times 10^{-4}\) to \(1\times 10^{-12}\). These experiments resulted in a total of 378 executions of the link model.  
Figure 6: State diagram for the model of a link.