# VidBlock: A Web3.0-Enabled Decentralized Blockchain Architecture for Live Video Streaming
## 4 Experiment and Evaluation
### Performance Test
#### 4.2.3 Resilience and Recovery Latency Analysis for Relay Node Switching in VidBlock  
Figure 9 shows how VidBlock manages relay node failures and recovery times from the perspective of a consumer node located in Seoul. The creator node is also in Seoul, while the relay nodes are either in Seoul (same region) or in Frankfurt (cross-region). This setup highlights how VidBlock keeps latency manageable, even when recovery involves a relay node located far from the consumer.  
* **Content access request:** In both scenarios, the consumer node begins with a content access request, simultaneously attempting to connect with a relay node. This initial step sets the stage for how quickly the system can establish a connection and access content.
* **Relay connection and relay node failure:** Initially, the consumer node connects to a relay node located in Seoul. Both scenarios establish a stable connection with minimal latency. However, as the streaming session progresses, the primary Seoul-based relay node encounters a failure, disrupting the P2P connection between the consumer node and the relay. At the point of relay node failure, latency reaches 233 ms for one scenario and 257 ms for the other. This disruption requires the system to initiate recovery measures in the following stage.
* **Switch to a new relay node and reconnection with a ViB creator node:** After the initial relay node in Seoul fails, the consumer node transitions to a backup relay node to restore the streaming connection. In the same-region scenario, the consumer node connects to another relay node also located in Seoul. This close proximity allows for a rapid recovery, with a total latency of 468 ms from the initial connection to re-establishing a stable P2P link with the ViB creator node. The low latency highlights the benefit of having backup relay nodes within the same region, providing a smooth recovery with minimal disruption. In the cross-region scenario, the system switches to a backup relay node located in Frankfurt. The increased geographical distance introduces a higher latency, with the reconnection time reaching a total of 1414 ms. Despite the additional delay, VidBlock demonstrates resilience by seamlessly switching to a distant relay and re-establishing the connection with the ViB creator node.  
What Makes VidBlock Effective?  
* Fast local recovery: When both the consumer and relay nodes are in the same region, VidBlock achieves a quick recovery, keeping streaming smooth with low latency.
* Adaptability across regions: Even with a relay node in Frankfurt, VidBlock manages to reconnect without major delays, making it flexible for global setups.
* Consistent reliability: By switching relays swiftly, VidBlock ensures that the consumer Node does not lose connection, even if a relay fails.  
In summary, the analysis highlights the regional advantage of colocating client and relay nodes, allowing for faster recovery from relay node failures, especially in Seoul. However, VidBlock's resilience also extends to scenarios where client and relay nodes are located in different regions, thanks to efficient transition mechanisms to alternative relay nodes. This dual approach ensures uninterrupted streaming experiences for users, regardless of geographical challenges.  
Figure 9: Comparison of latency during relay node failure and recovery in same-region and cross-region scenarios.