# Experimenting with Routing Protocols in the Data Center: An ns-3 Simulation Approach
## 4 Validation and Experimental Results
### Theoretical Analysis of BGP Behavior over Selected Scenarios
#### 4.3.1 Case Spine Node Failure  
To analyze the behavior of BGP when a spine node fails, we divided the problem into three sub-problems: (1) the PoD of the failure, (2) the PoD with no failures and (3) the spine-core links. Since the goal is to find an expression that models the total number of packets exchanged after the failure, dividing the problem into sub-problems is equivalent to dividing the expression into sums. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Scenario** & **Number** & **PDUs** & **PDUs** & **PDUs** \\  & **of Nodes** & **ns-3** & **ns-3** & **Sibyl** \\  & & **w/o Zebra** & **w Zebra** & \\ \hline
2\_2\_1\_node-failure-leaf & 20 & 60 & 60 & 60 \\
2\_2\_2\_node-failure-leaf & 10 & 28 & 28 & 28 \\
4\_4\_1\_node-failure-leaf & 80 & 504 & 504 & 504 \\
4\_4\_2\_node-failure-leaf & 40 & 248 & 248 & 248 \\
4\_4\_4\_node-failure-leaf & 20 & 120 & 120 & 120 \\
6\_6\_1\_link-failure-leaf-spine & 180 & 996 & 996 & 996 \\
6\_6\_1\_link-recovery-spine-tof & 180 & 1796 & 1796 & 1657, 1796 \\
10\_10\_1\_node-failure-spine & 500 & 37,480 & 37,480 & 18,390 \\
12\_12\_1\_node-failure-leaf & 720 & 17,244 & - & 13,800 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Representative results for comparison against Sibyl. First note that each leaf needs connectivity information for \(k^{2}/2\) prefixes; while \(k^{2}/2-1\) prefixes are \"foreign\", the remaining one is directly connected. When the fails occurs, in the PoD of the fail there are \(k/2\) leaf nodes aware of the failure. The BGP process of each leaf node will recalculate the routes and will notice that for every known prefix, one possible next-hop is missing. Consequently, it will send, for each known prefix, a BGP update with the next-hop attribute updated. Thus, we have \(k/2\) leafs sending \(k^{2}/2-1\) packets (the total number of prefixes in the fabric which have lost a next-hop) through their \(k/2-1\) links. Consequently, the total amount of BGP packets in the PoD of the failure equals \(k/2\times(k/2-1)\times(k^{2}/2-1)\). 2. The rest of the PoDs learn about the failure through the spine connected to the same plane as the faulty spine, through the corresponding core switch. This spine sends a BGP withdraw containing all the prefixes no longer reachable through the corresponding core switch (all the prefixes inside the PoD with the failure) to all its neighbors (\(k/2\) leaves in this PoD). After that, each leaf recalculate its routes and notice that each prefix received in the withdraw are no longer reachable through one of its next hops. Consequently, it will send, for each of these \(k/2\) prefixes, a BGP update to all its neighbors (\(k/2\) spines). Consequently, the total amount of BGP packets in each PoD without a failure equals \((k/2)+(k/2)\times(k/2)\times(k/2)\). 3. The faulty spine was connected to \(k/2\) core switches. Because the topology considered is multi-plane with \(R=1\), these core nodes have exactly one link with each PoD. After the failure, each core connected with the faulty spine have no longer reachability to the prefixes of the corresponding PoD, and it must send a BGP withdraw for the prefixes of such PoD to all its neighbors (\(k-1\) spines). After that, when a spine connected to these cores receives the withdraw from all of them, it will notice that it no longer has reachability to the prefixes of the given PoD, and it will send the correspondent withdraw upstream to the cores; therefore, a total of two BGP packets traverse every core-spine link. In effect, we have \(k/2\) cores, which send and receive one BGP withdraw through all their \"live\" interfaces (\(k-1\)). Consequently, the total amount of BGP packets in the core-spine links equals \(2\times(k-1)\times k/2=(k-1)\times k\) packets. Put together, and multiplying the expression for the PoDs without a failure times the amount of such PoDs (\(k-1\)), we arrive at a total BGP packets of \(k/2\times(k/2-1)\times(k^{2}/2-1)+(k-1)\times((k/2)+(k/2)\times(k/2)\times(k/ 2))+(k-1)\times k\).