Overview

The Eyevinn Chaos Stream Proxy is a versatile open-source tool designed to simulate various network conditions and streaming errors, enabling developers and QA engineers to test the resilience and performance of video streaming services. By acting as an intermediary between the client and the streaming server, it enables the introduction of controlled impairments, such as latency, timeouts, and HTTP errors.

Key Use Cases of Eyevinn Chaos Stream Proxy

  • Simulating Network Impairments: Introduce artificial delays, throttling, or timeouts to mimic poor network conditions. This helps in assessing the robustness of streaming applications under varying network environments.
  • Continuous Integration and Deployment (CI/CD) Testing: Incorporate the Chaos Stream Proxy into CI/CD pipelines to automatically test streaming applications against predefined error scenarios, ensuring consistent quality and reliability before deployment.
  • Live Stream Resilience Assessment: Evaluate how live streaming setups respond to real-time issues by simulating segment failures or network disruptions, ensuring minimal impact on the viewer experience.
  • Analytics and Monitoring Validation: Test the accuracy and responsiveness of analytics systems by generating specific errors and verifying that these incidents are correctly logged and reported.

Getting Started with Chaos Stream Proxy in Open Source Cloud

Prerequisites

  • If you have not already done so, sign up for an OSC account or sign in

Create a Chaos Stream Proxy instance

Navigate to the Chaos Stream Proxy service in Eyevinn Open Source Cloud and activate the service if you have not already.

Enter a name for your chaos stream proxy instance.

Decide if you wish to enable stateful mode (disabled by default). Stateful mode is a configuration option in the Chaos Stream Proxy that allows the system to store and track state information about streaming media requests. When enabled, the proxy maintains an in-memory cache to track information such as the initial sequence number of media segments.

When ready, press "Create". You will then shortly have an instance of the Chaos Stream Proxy running.

Once your instance is created, you can find your chaos proxy URL in the OSC dashboard. The URL will be displayed in the instance details and typically follows the format: https://<instance-name>.eyevinn-chaos-stream-proxy.auto.prod.osaas.io

Simulate errors

To simulate different errors, append a stringified JSON as a query parameter to the proxy URL. Each corruption type uses its own format and targets specific segments:

https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&some_corruption=[{i:0},{i:1},...]

Each {i:N} targets the Nth segment for corruption.

Note: Replace <chaos-proxy> with your actual instance URL from the OSC dashboard and <stream_url> with your target stream URL.

Available query parameters:

PARAMETER DESCRIPTION
url Url path to the original HLS/MPEG-DASH stream (REQUIRED)
delay Delay the response, in milliseconds, for a specific segment request
statusCode Replace the response for a specific segment request with a specified status code response
timeout Force a timeout for the response of a specific segment request
throttle Send back the segment at a specified speed of bytes per second

To see what corruptions are available, see the list of supported corruptions.

Test Use Cases and Examples

Network Resilience Testing

Test how your streaming service handles various network conditions and failures:

Segment delay of 3000ms on first and second segment of a HLS VOD stream: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8&delay=[{i:0,ms:3000},{i:1,ms:3000}]

MPEG-DASH live stream with a segment download speed limited to 10kB/s on all segments: https://<chaos-proxy>/api/v2/manifests/dash/proxy-master.mpd?url=<dash_stream_url>&throttle=[{i:*,rate:10000}]

Error Handling Validation

Test how your player responds to various HTTP error codes:

Return 404 status code on sixth segment: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&statusCode=[{i:5,code:404}]

Return 500 server error on all segments for specific bitrate: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&statusCode=[{i:*,code:500}]

Timeout Scenarios

Simulate network timeouts to test player buffering and recovery:

Force timeout on third segment: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&timeout=[{i:2}]

Bandwidth Limitation Testing

Test adaptive bitrate behavior under various bandwidth constraints:

Throttle segment download to 50kB/s for segments 10-15: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&throttle=[{i:9,rate:50000},{i:10,rate:50000},{i:11,rate:50000},{i:12,rate:50000},{i:13,rate:50000},{i:14,rate:50000}]

Live Stream Robustness Testing

For live streams, test segment availability and real-time error handling:

Introduce 2-second delay every 10 segments in live stream: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<live_stream_url>&delay=[{i:9,ms:2000},{i:19,ms:2000},{i:29,ms:2000}]

Monitoring and Analytics Validation

Test if your monitoring systems correctly detect and report streaming issues:

Mix multiple corruptions to create realistic failure scenarios: https://<chaos-proxy>/api/v2/manifests/hls/proxy-master.m3u8?url=<stream_url>&delay=[{i:0,ms:1000}]&statusCode=[{i:3,code:404}]&throttle=[{i:5,rate:5000}]

Additional documentation

See the GitHub repository for the Eyevinn Chaos Stream Proxy.