Stress testing for network streaming

From RidgeRun Developer Connection
Jump to: navigation, search

Overview

Stress testing is basically making a system work beyond its normal operation conditions to ensure its robustness and stability. Stress testing can be applied to various types of systems and the specifics of each test will depend on the nature of the system. Below you will find a guide on how to apply one kind of stress test for network streaming. Specifically the test will simulate bad network conditions by randomly dropping packets and optionally allowing you to add delay in packet delivery.

Example Stream

In this guide we are going to stress test a network video stream with the following characteristics:

Type RTSP
Resolution 1080p30
Encoder H.264
Processor TI DM368 SoC

Tools and utilities

NetStress

The network streaming stress test tool NetStress will simulate bad network conditions. NetStress is a utility that uses Linux traffic control (tc) in order to randomly drop a desired percentage of network packets and add a delay to them if desired.

RTSP Client

VLC is used on the host computer to receive the RTSP stream. In this specific example VLC 2.0.5 is used. Other applications that may be used as RTSP client are:

  • GStreamer
  • QuickTime

Test execution

Target device

In this example a RTSP server referred as multimediaServer is used. The following script configures multimediaServer with the desired encoder configuration, video input and starts the RTSP stream. The same concept applies for different servers.

#!/bin/sh

ENCODER_PROPS=encodingpreset=2 ratecontrol=2 targetbitrate=4000000 maxbitrate=4000000 bytestream=false single-nalu=true intraframeinterval=30 idrinterval=90

multimediaServer-client setVideoSource hd://1080p30
multimediaServer-client setVideoEncoder h264 "$ENCODER_PROPS"
multimediaServer-client setVideoStreamingUri "rtsp://0.0.0.0/test"
multimediaServer-client startVideoPipe
multimediaServer-client setVideoStreamingState rtsp true

Client PC

On the PC start receiving the stream

~# IP=<dm368.ip.address>
~# vlc rtsp://$IP/test


Once you are able to view the stream start the dropping simulation

~# LOSS=10
~# netstress -i eth0 -a $IP -l $LOSS  

In this specific example 10% of the packets are dropped. Immediately you should see the streaming on VLC displaying corrupted buffers due to the packet loss