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

Updated balancing documentation #1226

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Apr 1, 2020

No description provided.

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [docs] Area: Improvements or additions to documentation Impact: Significant labels Apr 1, 2020
@ethouris ethouris added this to the v1.5.0 milestone Apr 1, 2020
@ethouris ethouris self-assigned this Apr 1, 2020
docs/API-functions.md Outdated Show resolved Hide resolved
docs/API-functions.md Outdated Show resolved Hide resolved
@@ -56,14 +56,19 @@ Every next link in this group gives then another 100% overhead.
## 2. Backup

This solution is more complicated and more challenging for the settings,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This solution is more complicated and more challenging for the settings,
The settings for this grout type are more complicated and more challenging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I actually meant is that it may be challenging to define proper settings by the user in accordance to network conditions and desired latency, and "complicated" is the overall solution of the backup groups. I rephrased it a little bit differently.

Copy link
Collaborator

@stevomatthews stevomatthews Apr 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The configuration of Backup groups is somewhat more complicated than with the other group types. In particular, it may be challenging to arrive at the optimal settings for a given set of network conditions and desired latency."

docs/socket-groups.md Outdated Show resolved Hide resolved
docs/socket-groups.md Outdated Show resolved Hide resolved
docs/socket-groups.md Outdated Show resolved Hide resolved
Co-Authored-By: stevomatthews <[email protected]>
docs/socket-groups.md Outdated Show resolved Hide resolved
Co-Authored-By: stevomatthews <[email protected]>
Comment on lines 115 to 122
This mode allows also to set link priorities, through the `weight`
parameter - the lower, the more preferred. This priority decides mainly, which
link is "best" and which is selected to take over transmission over a broken
link before others, as well as which links should remain active should multiple
links be stable at a time. If you don't specify priorities, the second
connected link need not take over sending, although as this is resolved through
sorting, then whichever link out of those with the same priority would take
over when all links are stable is undefined.
Copy link
Collaborator

@stevomatthews stevomatthews Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This mode allows also to set link priorities, through the `weight`
parameter - the lower, the more preferred. This priority decides mainly, which
link is "best" and which is selected to take over transmission over a broken
link before others, as well as which links should remain active should multiple
links be stable at a time. If you don't specify priorities, the second
connected link need not take over sending, although as this is resolved through
sorting, then whichever link out of those with the same priority would take
over when all links are stable is undefined.
This mode allows you to set link priorities using the `weight` parameter
(a lower value gives a higher ranking). The priority determines which link is "best" and
will be activated for transmission when the currently active link is found to be
"unstable". When there are multiple stable links, the priority also determines
which one(s) should remain active. If you don't specify priorities, then which
of the connected links will take over sending is undefined.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I misspelled something again. What I meant was that the lower values of the weight parameter gives the link higher priority rank - a link with weight=0 is more preferred than a link with weight=1.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on Line 245

Comment on lines 178 to 188
Please also keep in mind that there's a rule for all groups - one member
link established is enough for a group to be connection established. This
might be not always wanted in case of balancing groups, so your application
might need to do additional check and monitor how many links and which
ones are currently active. For example, if you need 3 links to balance
the load and having only 2 of them would be too little to withstand the
whole transmission, you should wait with connecting until all 3 links
are established. Important thing here is also that one of the links might
be at some moment not possible to be established, or one of the links
can get broken during transmission.

Copy link
Collaborator

@stevomatthews stevomatthews Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please also keep in mind that there's a rule for all groups - one member
link established is enough for a group to be connection established. This
might be not always wanted in case of balancing groups, so your application
might need to do additional check and monitor how many links and which
ones are currently active. For example, if you need 3 links to balance
the load and having only 2 of them would be too little to withstand the
whole transmission, you should wait with connecting until all 3 links
are established. Important thing here is also that one of the links might
be at some moment not possible to be established, or one of the links
can get broken during transmission.
Please also keep in mind the following:
- For all groups, establishing one member link is enough for a group connection
to be established.
- Only Backup groups distinguish between *active* and *idle* links. In Broadcast
and Balancing groups links can only be *active*.
The important thing here is that links in socket groups are never "defined" - they
can only be "established". When they get broken, they are simply removed from the
group. It's up to the application to re-establish them.
In the case of Balancing groups, the application should monitor how many of the
needed links have been established. If one or more links fails, but there are other links
still connected, the whole group is considered connected.
If the application wants to make sure that a transmission is balanced between links
(where only together can they maintain the bandwidth capacity required for a signal),
it must make sure that all "required" links are established by monitoring the group
data. For example, if you need a minimum of 3 links to balance the load, you should
delay connecting until all 3 links are established.
It is also important to take into consideration that it might not be possible to
establish one of the links, or that one of the links might get broken during
transmission.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially distributed in other parts; text to be kept copied from here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been distributed more in other places, so the text was mainly derived from this, but also changed.

Comment on lines 189 to 191
As there could be various ways as to how to implement balancing
algorithm, there's a framework provided to implement various methods,
and two algorithms are currently provided:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As there could be various ways as to how to implement balancing
algorithm, there's a framework provided to implement various methods,
and two algorithms are currently provided:
As there could be more than one way to implement a balancing
algorithm, there is a framework for to implementing various methods,
with two possible algorithms provided by default:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this "by default" - the situation is that the framework is prepared, but - unlike e.g. packetfilter - this is not exposed to the user. New algorithms can only be added as a part of the SRT source code; the framework just makes the future upgrades with new algorithms easier.

to the application to keep the minimum links allowed and break the
group link that is unable to withstand the load.

2. `window` (default). This algorithm is performing cyclic measurement of the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. `window` (default). This algorithm is performing cyclic measurement of the
2. `window` (default). This algorithm performs cyclic measurement of the

Comment on lines 211 to 216
minimum flight window and this way determines the "cost of sending"
of a packet over particular link. The link is then "paid" for sending
a packet appropriate "price", which is collected in the link's "pocket".
To send the next packet the link with lowest state of the "pocket" is
selected. The "cost of sending" measurement is being repeated once per
a time with a distance of 16 packets on each link.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
minimum flight window and this way determines the "cost of sending"
of a packet over particular link. The link is then "paid" for sending
a packet appropriate "price", which is collected in the link's "pocket".
To send the next packet the link with lowest state of the "pocket" is
selected. The "cost of sending" measurement is being repeated once per
a time with a distance of 16 packets on each link.
minimum flight window and this way determines the "cost of sending"
of a packet over a particular link. The link is then "paid" for sending
a packet with an appropriate "price", which is collected in the link's "purse".
The link with lowest amount in its "purse" is selected to send the next packet.
The "cost of sending" measurement is being repeated once per
a time at an interval of 16 packets on each link.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased to be more "readable". My original idea was a little bit too "metaphoric".

case when a broken link caused that the others do not cover the required
capacity.

Please also keep in mind that there's a rule for all groups - one member
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This text should be removed. Statements are covered already.

Comment on lines 193 to 208
1. `fixed`. In this algorithm you specify the share that is given to
particular link manually through the `weight` parameter. The weight
value in case of this algorithm in balancing groups defines how much of
a share is given to this link. Important here is that you can easily
think of the weight values as a percentage of load burden for particular
link - however in reality the share of the load is calculated as a
percentage that particular link's weight comprises among the sum of all
weight values. Additionally, a value of 0 is special and is translated
into a weight that would make it equal to an average of all weights.
Be careful here with the non-established and broken links. For example,
if you have 3 links with weight 10, 20 and 30, it results in a load
balance of 16.6%, 33.3% and 50% respectively. However if the second link
gets broken, there are then 2 links with 10 and 30, which results in
load balance of 25% and 75% respectively. Keep in mind that it's up
to the application to keep the minimum links allowed and break the
group link that is unable to withstand the load.
Copy link
Collaborator

@stevomatthews stevomatthews Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. `fixed`. In this algorithm you specify the share that is given to
particular link manually through the `weight` parameter. The weight
value in case of this algorithm in balancing groups defines how much of
a share is given to this link. Important here is that you can easily
think of the weight values as a percentage of load burden for particular
link - however in reality the share of the load is calculated as a
percentage that particular link's weight comprises among the sum of all
weight values. Additionally, a value of 0 is special and is translated
into a weight that would make it equal to an average of all weights.
Be careful here with the non-established and broken links. For example,
if you have 3 links with weight 10, 20 and 30, it results in a load
balance of 16.6%, 33.3% and 50% respectively. However if the second link
gets broken, there are then 2 links with 10 and 30, which results in
load balance of 25% and 75% respectively. Keep in mind that it's up
to the application to keep the minimum links allowed and break the
group link that is unable to withstand the load.
1. `fixed`. In this algorithm you manually specify the share of a load that is given to
a particular link through the `weight` parameter. In Balancing groups, the weight
value defines how much of a share of the load is given to a link. That share is
calculated as a percentage of the sum of all weight values. For example, if you have
three links with weights of 10, 20 and 30, this results in a load balance of 16.6%, 33.3%
and 50% respectively.
Note that a value of 0 is translated into a weight that would make it equal to an average
of all non-zero weights. For example, if you have weights A, B and C of 0, 20, and 30
respectively, then A = (B+C)/2 = 25 (any other links in the group with weight = 0 would
also inherit the same calculated weight). If all weights are equal to zero, they all have
the same ranking.
Be careful here with non-established and broken links. In the example above, if the
second link gets broken, there are then two links with weights of 10 and 30, which
results in load balance values of 25% and 75% respectively. Keep in mind that it's up
to the application to monitor for the minimum number of active links needed, and to
break any group link that is unable to withstand the load.

the cost of sending by assigning so much of a share of the signal
bitrte as it is represented by the share of the link in the sum of
all maximum bandwidth values from every link.
There are possible also other methods and algorithms in the future.
Copy link
Collaborator

@stevomatthews stevomatthews Apr 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are possible also other methods and algorithms in the future.
This framework makes it easier to add new balancing algorithms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still keep "possible in future". What I meant here is that future changes in the SRT source code may be done to add new algorithms.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding temporal qualifiers like "currently" or "in the latest version" or "in the future" is usually not good practice. As time goes by, the context is lost. I don't think it's necessary to make promises here.

of all weight values from all member links. Note however that the sum is
calculated out of all links that have been successfully connected. The
default 0 is also a special value that defines an "equalized" load share
(its set to the arithmetic average of the weights from all links).
Copy link
Collaborator

@stevomatthews stevomatthews Apr 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(its set to the arithmetic average of the weights from all links).
(it is set to the arithmetic average of all non-zero weighted links).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original text has changed here again, so I reused your text with:

"weight values. Additionally, a value of 0 is special and it is translated
into the arithmetic average of all non-zero weighted links."

Copy link
Collaborator

@stevomatthews stevomatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor edits

@maxsharabayko maxsharabayko modified the milestones: v1.5.0, v1.5.1 Jul 27, 2020
@mbakholdina mbakholdina modified the milestones: v1.5.1, Backlog May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[docs] Area: Improvements or additions to documentation Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants