CMCD-enabled dash.js prototype for paper titled: "Use of CMCD in HTTP Adaptive Streaming: Initial Findings" to appear in ACM NOSSDAV 2021. Here is an early version presented in the DASH-IF special session on April 9th, 2021.
Run the NGINX server:
- Navigate to the
cmcd-server/folder - Install the NJS module in NGINX using
sudo apt install nginx-module-njs - Open
nginx/config/nginx.confand edit<PATH_TO_CMCD-DASH>(under "location /media/vod") to indicate the absolute path to this repository - Launch NGINX using
sudo nginx -c <PATH_TO_CMCD-DASH>/cmcd-server/nginx/config/nginx.conf(note that the absolute path must be used) - Reload NGINX using
sudo nginx -c <PATH_TO_CMCD-DASH>/cmcd-server/nginx/config/nginx.conf -s reload, if the configuration has changed - Test the NJS application
cmcd_njs.jswith CMCD usinghttp://⟨MachineIP_ADDRESS⟩:8080/cmcd-njs/testProcessQuery?CMCD=bl%3D21300and verify that it returns a value of 21300 for buffer length (bl)
Run the dash.js client:
- Navigate to the
dash.js/folder - Install the dependencies using
npm install - Build, watch file changes and launch samples page using
grunt dev - Test the dash.js application by navigating to
http://⟨MachineIP_ADDRESS⟩:3000/samples/cmcd-dash/index.htmlto view the CMCD-enabled player
Run the experiment:
- Navigate to the
dash-test/folder - Install the dependencies using
npm install - Edit
network_profileindash-test/package.jsonto specify the desired bandwidth profile for the test. The list of available bandwidth profiles are given indash-test/tc-network-profiles/ - Edit
maxCapacityBitsPerSincmcd-server/nginx/cmcd_njs.jsaccording to the selected bandwidth profile. Reload the NGINX config since we made a configuration change - Edit
client_profileindash-test/package.jsonto specify the desired client profile (with CMCD or NO CMCD). There are two client profiles:- client_profile_join_test_with_cmcd.js
- client_profile_join_test_no_cmcd.js
- Update the setup parameters in the two client profile files based on the target scenario, such as the numberof clients (
numClient), minimum buffer (minBufferGlobal), maximum buffer (maxBufferGlobal), video location (url) and segment duration (segmentDuration). The set of video datasets are located incmcd-server/nginx/media/vod/ - Start a test using
npm run test-multiple-clients. Note that testing is done in Chrome headless mode by default - Alternatively, to do a batch test with consecutive repeated runs for CMCD and NO CMCD (e.g., a batch test of five CMCD and five NO CMCD runs), update the parameters in the two client profile files and
batch_test.shand then run the batch test script withsudo bash batch_test.sh- Note that the parameter values in
batch_test.shwill overwrite those inpackage.json, hence there is no need to edit the latter for this batch test run - Note that the
jqtool must be installed to use the batch test script:sudo apt-get install jq - If the batch test script is terminated prematurely, the background Chrome processes need to be killed
- Note that the parameter values in
- Once the runs are finished, clear any previous tc setup using
sudo bash tc-network-profiles/kill.sh(this must be run before starting any new run) - On completing the test run, results are generated in the
results/<timestamp>_multiple_clients/folder ordered by the test run’s timestamp - To generate summary results across all clients in a test run, first navigate to the
results/folder and then runpython generate_summary.py
There are three main components in this setup and they correspond to the three main sub-folders:
cmcd-server: NGINX serverdash.js: dash.js clientdash-test: Automated testing with Puppeteer and scripts
- NGINX JS (NJS) webserver and middleware (NGINX v1.18)
- See
nginx/cmcd_njs.jsfor more details on the NJS application logic and implementation- Note that request URLs that are prefixed with
/cmcd-njs/bufferBasedRateControlrefer to CMCD requests and will trigger the NJS rate control mechanism - Example request with CMCD:
http://localhost:8080/cmcd-njs/bufferBasedRateControl/media/vod/bbb_30fps_akamai/bbb_30fps.mpd - Example request with NO CMCD:
http://localhost:8080/media/vod/bbb_30fps_akamai/bbb_30fps.mpd
- Note that request URLs that are prefixed with
Other useful commands:
- Check if NGINX is running:
curl http://127.0.0.1:8080- Or
ps -ef | grep nginx - Or
systemctl status nginxfor webserver status
- Log files location:
/var/log/nginx/- To inspect logs:
tail -f error.logandtail -f access.log - To capture the custom logs in
cmcd_njs.js:- Create the log file:
sudo touch /var/log/nginx/cmcd.log - Update write permission for the log file:
sudo chmod 666 /var/log/nginx/cmcd.log - To inspect logs:
tail -f cmcd.log
- Create the log file:
- To inspect logs:
- Official dash.js reference player integrated with CMCD support (dash.js v3.1.3)
- Refer to
dash.js/samples/advanced/cmcd.htmlfor the offical CMCD-enabled sample player (basic sample) - Refer to
dash.js/samples/cmcd-dash/index.htmlfor our setup's dash.js client (we added metrics collection and other supplementary features for our setup)
- Puppeteer is used for automated headless Chrome-based testing
- Headless mode can also be turned off in
dash-test/run-multiple-clients.js(search for parameterheadless)
Other useful commands:
- Use
iperf3tool between server and client to measure network speed and verify if shaping works as intended
- When running
sudo apt install nginx-module-njs, error occursE: Unable to locate package nginx-module-njs: It is likely that your version of NGINX is not compatible. Purge your current NGINX and reinstall the latest from:http://nginx.org/en/linux_packages.html#Ubuntu. Alternatively, ensure that your machine's/etc/apt/sources.listcontains the correct sources foraptto find the required module
- If the batch test script is terminated prematurely, checks must be done to ensure that all background processes are cleared:
- Chrome:
sudo ps aux | grep chromeand kill if any is present - tc:
sudo bash tc-network-profiles/kill.sh
- Chrome:
- The network shaping script uses
sudo tc <...>. To avoid/rectify password prompting issues, you may wish to add this to yourvisudofile:ALL ALL=NOPASSWD: /usr/sbin/tc