Skip to content

Channel quality monitoring between CDN nodes

Overview

Since build 5.3.434 CDN inter-node media channels quality is automatically monitored. The CDN node receiving media streams from other node checks packet counters, computes packet loss and then detects the channel quality.

Warning

The channel quality is measuring for WebRTC UDP channels only

The quality metric and statistics are displayed in response to /rest-api/v3/cdn/show_nodes REST API query:

[
  {
    "id": "172.11.0.3",
    "version": "2.17",
    "role": "ORIGIN",
    "inboundConnected": false,
    "outboundConnected": true,
    "globalState": "ACTIVE",
    "processingState": "NEW_STREAMS_ALLOWED",
    "group": "group_A",
    ...,
    "monitorStats": {
      "mediaStats": {
        "packetLostPercent": 0,
        "incomingBitrate": 663328,
        "outgoingBitrate": 0
      },
      "signalingStats": {
        "rtt": 128
      },
      "connectionQuality": "PERFECT"
    }
  },
  ...
]

Where:

  • packetLostPercent - lost media packets percentage relative to the total packets received number
  • incomingBitrate - effective incoming media bitrate for streams received from this node
  • outgoingBitrate - effective outgoing bitrate, if this node sends something to the other node
  • rtt - signaling packets round trip delay with the node, in milliseconds
  • connectionQuality - connection quality metric

The connection quality metric may be one of the following values:

  • PASSIVE - there is no any communication with this node. It may be shut down.
  • UNKNOWN - no media streams receiving from this node. Channel quality can't be measured.
  • BAD - a media stream is receiving from this node with more than 10 % packets loss.
  • GOOD - a media stream is receiving from this node with less than 10 % packets loss (or equal to).
  • PERFECT - a media stream is receiving from this node with less than 5 % packets loss.

The connection quality metric is used to select a stream route in CDN. For example, if the Edge server detects the channel quality with a Transcoder node as BAD, it will request a route through another Transcoder (if available) for a new stream subscribers.

Pulling a special stream to test a channel between CDN nodes

A channel between two CDN nodes may be tested only if there is a media stream pulled from on node to another. In there are no any streams flow between two nodes, the channel may not be tested.

Since build 5.3.458, every node may pull a special test stream from uplink node. This allows to test inter-node channel periodically using the stream playback data. The feature may be enabled by the following parameter

cdn_route_test_enabled=true

In this case, the node tries to pull the stream named cdn-route-test from all its uplinks:

  • Edge and Recorder nodes will pull the test stream from any Transcoder and Origin in the group
  • Transcoder will pull the test stream from any Origin in the group

The stream name may be changed by the following parameter

cdn_route_test_stream_name=cdn-route-test

By default, the stream is pulling every minute for 30 seconds

cdn_route_test_active_duration=30000
cdn_route_test_idle_duration=60000

So CDN node tests all the uplinks channels every 90 seconds by default.

If some stream is already pulling by the node from some uplink, the test stream will not be pulled from this uplink because at least one stream should be pulled to test the channel

cdn_route_test_min_streams=1

All the settings above are applied to all the CDN nodes except Origins.

The source stream to pull must be published on the primary Origin in the group

cdn_route_test_publish_enabled=true

It may be a synthetic stream generated from black screen and silence. The regular file also may be used

cdn_route_test_file=/usr/local/FlashphonerWebCallServer/media/test-720p.mp4

The file should conform VOD source requirements.

The publishing parameters should be set on the primary Origin only.