Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRT-bonding send data via 2 network interface #2550

Closed
yyaya opened this issue Nov 24, 2022 · 5 comments
Closed

SRT-bonding send data via 2 network interface #2550

yyaya opened this issue Nov 24, 2022 · 5 comments
Labels
Type: Question Questions or things that require clarification

Comments

@yyaya
Copy link

yyaya commented Nov 24, 2022

Hello, I recently tried the function of SRT bonding on AWS EC2.

I now have two instances, where the sender acts as a caller and has two network interfaces(say caller's ip1:1.2.1.2 and ip2:1.2.3.4); the receiver acts as a listener and has a network interface(say ip:1.2.1.5). I want to establish bonding connections between them.

I don't quite understand how to use srt-test-live to specify the caller to send data from two network interfaces at the same time. Shoule I change the routing thing or modify some parametars?

One more questions: should I open 2 port in the receiver side? (the listener is using same port in the document for bonding)

@yyaya yyaya added the Type: Question Questions or things that require clarification label Nov 24, 2022
@yyaya
Copy link
Author

yyaya commented Nov 24, 2022

now I am using the following command:

sender/caller:
./srt-test-live udp://:5555 -g srt://*?type=broadcast receiver_ip:5000?DEVICE=eth0 receiver_ip:5000?DEVICE=eth1 -v

receiver/listener:
.ive srt://:5000?groupconnect=1 udp://127.0.0.1:6000 -v

Logging looks like:

NOTE: OUTPUT specification set as: srt:////group?type=broadcast&nodes=RECEIVER_IP:5000?DEVICE=eth0,RECEIVER_IP:5000?DEVICE=eth1,
SRT parameters specified:
nodes = 'RECEIVER_IP:5000?DEVICE=eth0,RECEIVER_IP:5000?DEVICE=eth1,'
type = 'broadcast'
Opening SRT target caller(blocking, backlog=1) on :0
REDUNDANT connections with 2 nodes:
Connecting to nodes:
[1] RECEIVER_IP:5000
[2] RECEIVER_IP:5000
Waiting for group connection... [ASYNC] will wait...SUCCESSFUL
Setting SND blocking mode: true timeout=0
Setting SND blocking mode: true timeout=0
Group connection report:
@389026640 (=0) PEER:RECEIVER_IP:5000
@389026639 (=0) PEER:RECEIVER_IP:5000
ENCRYPTION status: UNSECURED (SND:UNSECURED RCV:UNSECURED) PBKEYLEN=0
OPTIONS: maxbw=-1 rcvlatency=120 blocking{rcv=true snd=true} snddropdelay=0 packetfilter=
STARTING TRANSMISSION: 'udp://:5555' --> 'srt:////group?type=broadcast&nodes=RECEIVER_IP:5000?DEVICE=eth0,RECEIVER_IP:5000?DEVICE=eth1,'
[. << ... << 1316 -> G@389026640<RUNNING> G@389026639<RUNNING> (#1 %1648274030 34C38247) .] sent
[. << ... << 1316 -> G@389026640<RUNNING> G@389026639<RUNNING> (#2 %1648274031 97E7BA7C) .] sent
[. << ... << 564 -> G@389026640<RUNNING> G@389026639<RUNNING> (#3 %1648274032 436BBF04) .] sent
[. << ... << 1316 -> G@389026640<RUNNING> G@389026639<RUNNING> (#4 %1648274033 330FC1C9) .] sent

In the case of broadcast, only eth0 is seen to be sending data through iftop. Is this normal?

@maxsharabayko
Copy link
Collaborator

As an alternative, you could try srt-xtransmit.

@ethouris
Copy link
Collaborator

I don't remember to have added any DEVICE option for the single connection URI.

The member connection specification URI (following the srt://* statement) supports two options: weight (unused for broadcast type) and source, which expects a local IP address that the socket should bind (plus single socket options with srto. prefix). If you are looking for something like SO_BINDTODEVICE, note that this is a Linux-specific option and it's only available as a socket option, and AFAIR it only matters if you are going to read packets from the socket (so, might be useful only for a listener).

In order to establish a bonded connection (which isn't checked by SRT at all - you can just as well make two member connections with exactly the same address, it just makes little sense), there are two methods you can use:

  1. Use a wildcard-bound listener (specify 0.0.0.0 as binding IP address) on a machine that features two network devices, each one being set its own IP address. The caller side then establishes two connections, each one specifying the target IP address of a particular device on the listener side.
  2. Use multiple listener sockets, each one bound to a separate local IP address. The srt-test-live application doesn't support it, but for that there's a separate application to demonstrate, srt-test-mpbond.

Note that in order to unleash the power of bonding you need to already have two bidirectional UDP links available that are at least for most of the network path completely separate - otherwise you'll just double the bandwidth usage with no advantage. It is then unavoidable that your listener machine feature at least two separate IP addresses through which it can be reached, and there are appropriate routing rules that will drive the traffic through a specific route with no common parts. This is possible also if you have only one network device on the listener side, but you have to set it up two IP addresses, and the routing rules are defined so that each one is reachable over a different network route.

@yyaya
Copy link
Author

yyaya commented Nov 25, 2022

As an alternative, you could try srt-xtransmit.

Thanks maxsharabayko for the advice. However,I have build with -DENABLE_BONDING=ON and -DENABLE_EXPERIMENTAL_BONDING=ON and seems there is no srt-xtransmit(got srt-test-live/srt-test-mpbond,etc).

Also thanks ethouris for the answear, and this answered some questions for me. Anyway I have comfirmed the PULL type (listener acts as sender) with srt-test-live on AWS EC2. Now I am trying the PUSH type(listener acts as receiver) . But I don't know much about routing yet. Still need time to learn.

@ethouris
Copy link
Collaborator

The question seems to have been answered and no activity observed since more than one month - closing the ticket. Please reopen if anything new appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Questions or things that require clarification
Projects
None yet
Development

No branches or pull requests

3 participants