WebRTC_Stress_Testing

WebRTC stress testing

Go Networking Linux

Project

As part of my Master's thesis research on utilizing WebRTC for streaming of content at Sophia university (上智大学) I created a stress test system in order to analyze the maximum number of peers a streamer client can connect to before encountering connection issues due to performance and networking limitations.

Full paper available

Although traditional streaming systems can support millions of clients as they distribute the stream through many servers, the proposed alternative model is a more cost efficient solution as the streamer's device is responsible for transmitting data to subscribers of the stream and uses the WebRTC peer to peer technology to bypass the use of servers, reducing infrastructure costs. This, however, represents a huge load for the client streaming device, limiting the number of peers capable to establinsh a reliable connection. For this purpose I created a sort of testing suite that can test and determine the maximum number of peers that can connect simultaneously without experiencing networking issues.

Setup

First the streamer client connects to the server and requests to connect and then waits for subscribers that wish to connect to the stream. Either a real subscriber client can connect to a stream, or the cummy client system can connect which creates a new dummy client every second until reaching the desired number of dummy clients (maximum 100). The dummy client system also monitors the packets being received by all of the active clients, as well as when a new peer connects until the desired number and then notifies about each second that passes after that. This way we can (also using timestamps taken of when each packet arrived), calculate the average number of packets received per second for each peer and determine the average, minimum and maximum.


Demo

The demo works by first selecting the stream resolution and starting a "streamer". Then it is possible to create a "subscriber" client that can observe the stream (from the same device or a separate one). To run the test the number of peers should be selected and the test run.