Overview
CDN 2.4 implements the following features in addition to CDN 2.1, 2.2 and 2.3:
- CDN signaling connections monitoring
- CDN signaling connections management
CDN signaling connections monitoring
CDN 2.4 allows to check current state of signaling connections with other CDN nodes using REST API or CLI. Thus, CDN coherence can be monitored from backend.
Using REST API
REST API query /cdn/show_nodes returns current state and statistics of signaling connection with other CDN nodes
[ { "version": "2.3", "role": "TRANSCODER", "inboundConnected": true, "outboundConnected": false, "globalState": "ACTIVE", "processingState": "NEW_STREAMS_ALLOWED", "id": "192.168.1.64" }, { "version": "2.4", "role": "EDGE", "inboundConnected": true, "outboundConnected": false, "globalState": "ACTIVE", "processingState": "NEW_STREAMS_ALLOWED", "connectionStats": { "lastRtt": 2, "lastSn": 24, "lastMessageSentMs": 1592359761801, "lastACKReceivedMs": 1592359761802, "maxRtt": 1224, "inFlightSize": 0 }, "id": "192.168.1.65" } ]
Parameters
Parameter | Description | Example |
---|---|---|
inboundConnected | Inbound connection is established from this node | true |
outboundConnected | Outbound connection is established to this node | false |
lastRtt | Last packet RTT, ms | 2 |
lastSn | Last packet sequence number | 24 |
lastMessageSentMs | Last message sent timestamp, ms | 1592359761801 |
lastACKReceivedMs | Last acknowlegement received timestamp, ms | 1592359761802 |
maxRtt | Maximum RTT, ms | 1224 |
inFlightSize | Current sending packet size, bytes | 0 |
Note that statistics is not available for previous CDN versions nodes, connection status only can be checked.
Using CLI
CLI v 2 command
cdn show-connections
shown CDN signaling connections statistics (for CDN 2.4 nodes only)
Ip State Inbound Outbound Last rtt Max rtt Last SN In flight ------------------------------------------------------------------------- 192.168.1.39 ACTIVE false true 1 2057 127 0
CDN signaling connections management
In some cases, certain CDN node coherence may be broken, for example, due to network issues between nodes. To restore the CDN coherence, singnaling connections reset and re-establishing may require. In previous CDN versions, this can be done by node restart only. In CDN 2.4, signaling connections can be reset using REST API. This operation does not affect media streams which already passing through this node.
Connection reset using REST API
HTTP: http://test.flashphoner.com:8081/rest-api/cdn/connection/reset_outbound
- HTTPS: https://test.flashphoner.com:8444/rest-api/cdn/connection/reset_outbound
Здесь:
- test.flashphoner.com -WCS server address
- 8081 - REST / HTTP port
- 8444 - HTTPS port
- rest-api - mandatory URL part
- /cdn/connection/reset_outbound - REST method used
REST queries should be sent to the node on which connections must be reset
REST queries and response states
REST query | Body example | Response states | Description |
---|---|---|---|
/cdn/connection/reset_inbound | { "nodeId":"192.168.1.65" } | 200 – OK 404 - Node not found | Reset inbound connection from this node |
/cdn/connection/reset_outbound | { "nodeId":"192.168.1.65" } | 200 – OK 404 - Node not found | Reset outbound connection to this node |
/cdn/connection/reset_all | 200 – OK | Reset all CDN connections on this node (since build 5.2.1222) |
Parameters
Parameter | Description | Example |
---|---|---|
nodeId | Node id (IP address) to reset connection with | 192.168.1.65 |
Signaling connections tuning
Inactive connections reset configuration
Signaling connection can be closed if server does not receive any packets during a certain timeout. The feature is enabled by the following parameters for incoming and outgoing signaling connections respectively
cdn_inbound_ws_read_socket_timeout=true cdn_outbound_ws_read_socket_timeout=true
By default, the read timeout is set to 60 seconds
cdn_inbound_ws_read_socket_timeout_sec=60 cdn_outbound_ws_read_socket_timeout_sec=60
Backward compatibility with CDN 2.0-2.3
1. Statistics is not displayed for connections with previous CDN versions nodes
2. Connection with previous CDN version node can be reset