-
Notifications
You must be signed in to change notification settings - Fork 840
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
Added short doc about bonding #1117
Added short doc about bonding #1117
Conversation
@@ -0,0 +1,255 @@ | |||
What are groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are groups?
A Group is an entity that binds multiple sockets and it is required to | ||
establish a "bonded connection". Groups can be then used the same way as | ||
sockets for performing a transmission. It is then in general stated that a | ||
group is connected as long as at least one member-socket connection is alive, | ||
and as long as this state lasts, some member connections may get broken and | ||
new member connections can be established. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Group is an entity that binds multiple sockets, and is required to
establish a "bonded connection". Groups can be used in the same way as
sockets for performing a transmission. A group is connected as long as at
least one member-socket connection is alive. As long as a group is in the
connected state, some member connections may be broken and
new member connections can be established.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"may get broken" was written intentionally. The point is that they can transit from "connected" to "broken" (previously alive connections may break at some point).
Groups are fully flexible. There's no limitation how many single connections | ||
they can use as well as when you want to establish a new connection. On the | ||
other hand, broken connections are not automatically reestablished. The | ||
application should track the existing connections and reestablish broken ones | ||
if needed. But then, the application is also free to keep as many links as it | ||
wants, including adding new links to the group while it is being used for | ||
transmission, or removing links from the list if they are not to be further | ||
used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Groups are flexible. There's no limitation on how many single connections
they can use, or on establishing new connections. Broken connections,
however, are not automatically reestablished. The application should
track existing connections and reestablish broken ones if needed.
The application is free to keep as many links as it wants. It can
add new links to a group while it is being used for transmission, or
remove links from the list if they are no longer needed.
How the links are exactly utilized within the group, it depends on the group | ||
type. The simplest type, broadcast, utilizes all links at a time to send the | ||
same data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How links are utilized within a group depends on the group type.
The simplest type, broadcast, utilizes all links at once to send the
same data.
same data. | ||
|
||
|
||
Lay-ground: using sockets for establishing a connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder: Using sockets for establishing a connection
Important changes | ||
----------------- | ||
|
||
Note important changes SRT underwent since the first version from UDT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind these important changes to SRT:
1. Specifying family (`AF_INET/AF_INET6`) when creating a socket is no longer | ||
required. The existing `srt_socket` function redirects to a new | ||
`srt_create_socket` function that gets no arguments. The exact family is | ||
decided at the first call to `srt_bind` or `srt_connect` and it's extracted | ||
from the value of `sa_family` field of the `sockaddr` structure passed to | ||
this call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Specifying a family (
AF_INET/AF_INET6
) when creating a socket is no longer
required. The existingsrt_socket
function redirects to a new
srt_create_socket
function that takes no arguments. The family is
decided at the first call tosrt_bind
orsrt_connect
, and is extracted
from the value of thesa_family
field of thesockaddr
structure passed to
this call.
Socket connection | ||
----------------- | ||
|
||
Let's review quickly what you do to establish a socket connection in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's review quickly how to establish a socket connection in the
Except for several details, most of the API used for sockets can be used for | ||
groups. The groups also have the numeric identifiers, just like sockets, which | ||
are in the same domain as sockets, except that there's reserved one bit to | ||
mark that the identifier is for a group, bound to a `SRTGROUP_MASK` symbol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for several details, most of the API used for sockets can be used for
groups. Groups also have numeric identifiers, just like sockets, which
are in the same domain as sockets, except that there is one bit reserved to
indicate that the identifier is for a group, bound to a SRTGROUP_MASK
symbol.
IMPORTANT: Usually you'll be establishing multiple connections between two | ||
endpoints, just using a different network path - otherwise this simply doesn't | ||
make sense. The simplest method to achieve it is to have multiple network | ||
devices bound to different providers - but still, the listener must bind to | ||
one exactly port using 0.0.0.0 IP, that is, every device in the system. The | ||
goal is to reach this listening point through different target addresses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMPORTANT: Usually you'll be establishing multiple connections between two
endpoints, just using a different network path. The simplest method to is to
have multiple network devices bound to different providers. Still, the listener
must bind to exactly one port using the 0.0.0.0 IP (i.e. every device in the system). The
goal is to reach this listening point through different target addresses.
srt_connect(conngrp, &sa2, sizeof sa2); | ||
``` | ||
|
||
HOWEVER, this method can be so easily used in non-blocking mode, as here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMPORTANT: This method can be easily used in non-blocking mode, as you
``` | ||
|
||
HOWEVER, this method can be so easily used in non-blocking mode, as here | ||
you don't have to wait for the connection to be established. If you do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't have to wait for the connection to be established. If you do
No description provided.