tencent cloud

All product documents
Multi-Path Network Transmission
Last updated: 2025-02-11 16:46:31
Multi-Path Network Transmission
Last updated: 2025-02-11 16:46:31
Note:
Multi-path network transmission can support the transmission of audio and video streaming and control data flow using multiple network paths. When using it, ensure that the device's network environment meets the requirements, and configure the SDK to bind multiple network cards.

SDK Multi-network Configuration

During SDK initialization, use multiple network binding configuration. By binding multiple network card IPs, it can enable the multi-path network transmission feature
Network Card IP Binding Configuration
"network_bind":["IP1","IP2"]
If using the web tool to generate the device configuration, in advanced settings, check the specified IP binding network card configuration, enter multiple network card IPs separated by semicolons.
Video Multi-network Transmission Mode (Optional)
"media_trans_mode":1
1 suitable for multiple networks with acceptable bandwidth; 2 for Balanced Mode; 3 for multiple networks with very low bandwidth.
Note:
When running the application with the SDK in multi-network mode, sudo permissions are required to ensure successful network card binding. If granting sudo permissions is inconvenient, you can grant network card binding permissions to the application separately by executing the following in the application directory: sudo setcap cap_net_raw,cap_net_bind_service+ep ./application_name

Multi-network Environment Verification

Before using the SDK for multi-network transmission, it is necessary to verify if the device's multi-network environment meets the SDK requirements. For verification, you can use the curl command on the device to access a website URL that returns the client's public IP address (using http://cip.cc as an example below), to verify whether the public IP addresses of the multiple network card are different or not.
curl http://43.130.151.72:5100/ip --interface local_network_card_IP1
curl http://43.130.151.72:5100/ip --interface local_network_card_IP2
If curl requests from different network card IPs can stably return different public IPs and match the corresponding network ISP circuits, the verification is successful.

Device Routing and IP Configuration (for reference)

The following is an example of the network deployment scheme that meets the requirements of multi-network environment. Note that it is not a mandatory recommendation. Any deployment scheme that can pass the verification is OK.

CPE Configuration Requirements

Single Multi-Network CPE

The same CPE accesses different ISP WAN networks. It creates multiple different IP range LAN gateways pointing to different WAN networks through VLAN+route configuration. For example, the gateway for the 192.168.67.1 IP range points to the WAN1 network (A ISP), and the gateway for the 192.168.8.1 IP range points to the WAN2 network (B ISP).

Multiple Single-Network CPE

Different CPEs access different ISP WAN networks. Set the LAN IP ranges of multiple CPEs to distinct IP ranges. For example, CPE1 uses the 192.168.8.1/24 IP range, and CPE2 uses the 192.168.67.1/24 IP range.

Device IP and Route Configuration

Single Network Card Connecting to CPE

The device uses 1 network port and network cable to connect to multiple LAN ports of the CPE through the ethernet switch.
IP Settings
Set multiple IP ranges and corresponding gateways for the network card. Below is an example of the Ubuntu system `/etc/network/interfaces.d` settings. For the eth0 network card, create eth0:0, assign IP 192.168.8.96 and gateway 192.168.8.1, and create eth0:1 assign IP 192.168.67.96 and gateway 192.168.67.1.
auto eth0
iface eth0 inet static

auto eth0:0
iface eth0:0 inet static
address 192.168.8.96
netmask 255.255.255.0
gateway 192.168.8.1
 
auto eth0:1
iface eth0:1 inet static
address 192.168.67.96
netmask 255.255.255.0
gateway 192.168.67.1
Route Table Settings
Create separate route tables for each network IP and specify the gateway for the route. Below is an example of different IP route settings for the eth0 network card:
ip rule add from 192.168.8.96 table 10
ip rule add from 192.168.67.96 table 20
ip route add default via 192.168.8.1 dev eth0 proto static metric 0 table 10
ip route add default via 192.168.67.1 dev eth0 proto static metric 0 table 20

Multiple Network Cards Connecting to CPE

The equipment uses multiple network ports and network cables to connect to multiple LAN IP range gateways of the CPE (can be through a switch).
IP Settings
Set the corresponding IP and gateway for each network card. The following is an example of settings for Ubuntu system /etc/network/interfaces.d, where IP 192.168.8.96 and gateway 192.168.8.1 are assigned to network card eth0, and IP 192.168.67.96 and gateway 192.168.67.1 are assigned to network card eth1.
auto eth0
iface eth0 inet static
address 192.168.8.96
netmask 255.255.255.0
gateway 192.168.8.1
 
auto eth1
iface eth1 inet static
address 192.168.67.96
netmask 255.255.255.0
gateway 192.168.67.1
Route Table Settings
Create an independent route table for each network IP and specify the gateway for the routes. The following is an example of different IP route settings for network cards eth0 and eth1:
ip rule add from 192.168.8.96 table 10
ip rule add from 192.168.67.96 table 20
ip route add default via 192.168.8.1 dev eth0 proto static metric 0 table 10
ip route add default via 192.168.67.1 dev eth1 proto static metric 0 table 20
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support