# Implementation of a Lossless Moving Target Defense Mechanism
## 7 Performance Evaluation  
### Convergence Time  
To conduct the optimization process and assess the effectiveness of the solution, it is necessary to determine the system's convergence time, meaning the time required for all switches to exclusively use addresses from the current generation (this also includes the IP addresses of packets in the network interface buffers and packet memories). Two scenarios should be considered. Scenario I: All modification are introduced simultaneously by \(C^{\text{SDN}}\) in all border switches. In this scenario, the convergence time is determined by two components:  
* The time to update the flow tables in all border switches (\(T^{Controler}\));
* The longest packet transfer time between two border switches (\(T^{Transfer}\)). For formal notation, let us introduce designations for the active elements (such as core and border switches, hosts, and the SDN controller) and passive elements, namely, links. Let \(S_{i}^{C}\) denote the \(i\)th core switch. Similarly, let us denote the \(j\)th border switch as \(S_{j}^{B}\). Host number \(k\), connected to \(S_{j}^{B}\), is denoted as \(H_{k}^{j}\). The SDN controller, having only one instance, is simply denoted as \(C^{\text{SDN}}\). The link between \(S_{i_{1}}^{C}\) and \(S_{i_{2}}^{C}\) (i.e., the link between the \(i_{1}\)th and \(i_{2}\)th core switches) is denoted as \(L_{i_{1},i_{2}}^{C-C}\), the link between \(S_{j_{1}}^{B}\) and \(S_{j_{2}}^{B}\) (i.e., the link between the \(j_{1}\)th and \(j_{2}\)th border switches) is denoted as \(L_{j_{1},j_{2}}^{B-B}\), while the link between \(H_{k}^{j}\) and \(S_{j}^{B}\) is denoted as \(L_{i,j}^{C-B}\). The link between the controller and \(S_{i_{1}}^{C}\) or \(S_{i_{2}}^{B}\) is denoted as \(L^{S_{i_{1}}^{C}}\) or \(L^{S_{i_{2}}^{B}}\), respectively. Figure 7 illustrates these network elements along with their designations. Additionally, let us introduce the notation of the function \(T(x)\), which returns the time value in which an IP packet is in element (which can be either an active and a passive element) \(x\). The first component of convergence time is defined by the following equation:  
\[T^{Controler}=\max\biggl{(}T\biggl{(}I^{\text{CDN}}_{i}\biggr{)}+T\biggl{(} I^{\text{CDN}}_{j}\biggr{)}+T\biggl{(}L^{S_{i}^{C}}\biggr{)}+T\biggl{(}I^{S_{j}^{ B}}\biggr{)}\biggr{)}, \tag{1}\]  
where \(T\biggl{(}I^{\text{CDN}}_{i}\biggr{)}\) (\(T\biggl{(}I^{\text{CDN}}_{j}\biggr{)}\)) is the time of generation, buffering, and sending a message in the SDN controller on the interface to \(S_{i}^{C}\) (\(S_{j}^{B}\)); \(T\biggl{(}I^{S_{j}^{B}}\biggr{)}\) is the time of receiving, verifying correctness, buffering, and updating the flow table in switch \(S_{j}^{B}\); and \(T\Bigl{(}L^{S_{i_{1}}^{C}}\Bigr{)}\) is the propagation time between \(C^{\text{SDN}}\) and \(S_{j}^{B}\). Assuming that \(C^{\text{SDN}}\) sends almost identical messages to all \(S_{j}^{B}\) (only differing in IP and MAC addresses), that all interfaces of \(C^{\text{SDN}}\) are identical, and that all \(S_{j}^{B}\) switches are identical, Equation (1) can be simplified to  
\[T^{Controler}=T\biggl{(}I^{\text{CDN}}_{j}\biggr{)}+T\biggl{(}I^{S_{j}^{B}} \biggr{)}+\max\Bigl{(}T\Bigl{(}L^{S_{j}^{B}}\Bigr{)}\Bigr{)}. \tag{2}\]  
This means that the time of the first component is equal to the time of updating the flow table in the border switch most distant from \(C^{\text{SDN}}\). The second component of the convergence time is equal to the longest duration for an IP packet to pass between two edge switches. Excluding situations where a packet may be buffered in switches (due to temporary disconnection/switching of the network link), unusually long packet handling in the switch, etc., this time can be calculated from  
\[ \begin{split} T^{Transfer}&=\text{max}\bigg{(}T \bigg{(}I^{S^{B}_{1}}\bigg{)}+T\bigg{(}I^{S^{B}_{2}}\bigg{)}+T\bigg{(}L^{C-B}_{ i_{1}j_{1}}\bigg{)}+T\Big{(}L^{C-B}_{i_{2}j_{2}}\Big{)}+\\ &+\sum T\bigg{(}S^{C}_{i}\bigg{)}+\sum T\bigg{(}L^{C-C}_{i_{1}j_ {2}}\bigg{)}\bigg{)}\end{split}