CDN 2.4¶
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
shows 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¶
REST query should be HTTP/HTTPS POST request as follows:
- HTTP:
http://test.flashphoner.com:8081/rest-api/cdn/connection/reset_outbound
- HTTPS:
https://test.flashphoner.com:8444/rest-api/cdn/connection/reset_outbound
Where:
test.flashphoner.com
- WCS server address8081
- REST / HTTP port8444
- HTTPS portrest-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
/cdn/connection/reset_inbound¶
Reset inbound connection from this node
Request example¶
POST /rest-api/cdn/connection/reset_inbound HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"nodeId":"192.168.1.65"
}
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
404 | Not found |
/cdn/connection/reset_outbound¶
Reset outbound connection to this node
Request example¶
POST /rest-api/cdn/connection/reset_outbound HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"nodeId":"192.168.1.65"
}
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
404 | Not found |
/cdn/connection/reset_all¶
Reset all CDN connections on this node (since build 5.2.1222)
Request example¶
POST /rest-api/cdn/connection/reset_all HTTP/1.1
Host: localhost:8081
Content-Type: application/json
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
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
By default, the read timeout is set to 60 seconds
Backward compatibility with CDN 2.0-2.3¶
-
Statistics is not displayed for connections with previous CDN versions nodes
-
Connection with previous CDN version node can be reset