1
-
# Abstract
1
+
# SRT Socket Groups
2
+
3
+
## Introduction
2
4
3
5
The general concept of the socket groups means that a separate entity,
4
6
parallel to a socket, is provided, and the operation done on a group
@@ -9,34 +11,33 @@ The groups types generally split into two categories:
9
11
10
12
1. Bonding groups.
11
13
12
-
This group category is meant to utilize multiple connections in order
13
-
to have a group-wise connection. How particular links are then utilized
14
-
to make a group-wise sending, depends on the particular group type. Within
15
-
this category we have the following group types:
14
+
This group category is meant to utilize multiple connections in order
15
+
to have a group-wise connection. How particular links are then utilized
16
+
to make a group-wise sending, depends on the particular group type. Within
17
+
this category we have the following group types:
16
18
17
-
- Broadcast: send the stream over all links simultaneously
18
-
- Backup: use one link, but be prepared for a quick switch if broken
19
-
- Balancing: utilize all links, but one payload is sent only over one link
19
+
- Broadcast: send the stream over all links simultaneously,
20
+
- Main/Backup: use one link, but be prepared for a quick switch if broken,
21
+
- Balancing: utilize all links, but one payload is sent only over one link (**UNDER DEVELOPMENT!**).
20
22
21
-
Bonding category groups predict that a group is mirrored on the peer network
22
-
node, so all particular links connect to the endpoint that always resolves to
23
-
the same target application. Just possibly every link uses a different network
24
-
path.
23
+
Bonding category groups predict that a group is mirrored on the peer network
24
+
node, so all particular links connect to the endpoint that always resolves to
25
+
the same target application. Just possibly every link uses a different network
26
+
path.
25
27
26
28
2. Dispatch groups.
27
29
28
-
This category contains currently only one Multicast type (**CONCEPT!**).
29
-
30
-
Multicast group has a behavior dependent on the connection side and it is
31
-
predicted to be only used in case when the listener side is a stream sender
32
-
with possibly multiple callers being stream receivers. It utilizes the UDP
33
-
multicast feature in order to send payloads, while the control communication
34
-
is still sent over the unicast link.
30
+
This category contains currently only one Multicast type (**CONCEPT! NOT IMPLEMENTED!**).
35
31
36
-
Details for the group types:
32
+
Multicast group has a behavior dependent on the connection side and it is
33
+
predicted to be only used in case when the listener side is a stream sender
34
+
with possibly multiple callers being stream receivers. It utilizes the UDP
35
+
multicast feature in order to send payloads, while the control communication
36
+
is still sent over the unicast link.
37
37
38
+
## Details for the Group Types
38
39
39
-
## 1. Broadcast
40
+
### 1. Broadcast
40
41
41
42
This is the simplest bonding group type. The payload sent for a group will be
42
43
then sent over every single link in the group simultaneously. On the reception
@@ -52,8 +53,7 @@ A drawback of this method is that it always utilizes the full capacity of all
52
53
links in the group, whereas only one link at a time delivers any useful data.
53
54
Every next link in this group gives then another 100% overhead.
54
55
55
-
56
-
## 2. Backup
56
+
### 2. Main/Backup
57
57
58
58
This solution is more complicated and more challenging for the settings,
59
59
and in contradiction to Broadcast group, it costs some penalties.
@@ -139,8 +139,7 @@ withstand the initial high burst of packets, while then the bitrate will
139
139
become stable - but still, some extra latency might be needed to compensate
140
140
any quite probable packet loss that may occur during this process.
141
141
142
-
143
-
## 3. Balancing
142
+
### 3. Balancing (**UNDER DEVELOPMENT!**)
144
143
145
144
The idea of balancing means that there are multiple network links used for
146
145
carrying out the same transmission, however a single input signal should
@@ -185,8 +184,7 @@ the cost of sending by assigning so much of a share of the signal
185
184
bitrte as it is represented by the share of the link in the sum of
186
185
all maximum bandwidth values from every link.
187
186
188
-
189
-
## 4. Multicast (NOT IMPLEMENTED - a concept)
187
+
### 4. Multicast (**CONCEPT! NOT IMPLEMENTED!**)
190
188
191
189
This group - unlike all others - is not intended to send one signal
192
190
between two network nodes over multiple links, but rather a method of
@@ -303,8 +301,7 @@ The listener side will then send payload packets to the IGMP group,
303
301
however all control packets will be still sent the same way as before,
304
302
that is, over a direct connection.
305
303
306
-
307
-
# Socket groups in SRT
304
+
## Socket Groups in SRT
308
305
309
306
The general idea of groups is that there can be multiple sockets belonging
310
307
to a group, and various operations, normally done on single sockets, can
@@ -322,10 +319,10 @@ For groups you simply use the same operations as for single socket - it will
322
319
be internally dispatched appropriate way, depending on what kind of entity
323
320
was used. For example, when you send a payload, it will be effectively sent:
324
321
325
-
- For Broadcast group, over all sockets
326
-
- For Backup group, over all currently active links
327
-
- For Balancing group, over a currently selected link
328
-
- For Multicast group, over an extra socket to the multicast group
322
+
- For Broadcast group, over all sockets,
323
+
- For Main/Backup group, over all currently active links,
324
+
- For Balancing group, over a currently selected link,
325
+
- For Multicast group, over an extra socket to the multicast group.
329
326
330
327
Similarly, the reading operation will read over all links and due to
331
328
synchronized sequence numbers use them to decide the payload order: when
@@ -337,7 +334,7 @@ packet received over another link will be still earlier ready to play.
337
334
338
335
The difference in reading between groups is that:
339
336
340
-
- For Broadcast and Backup groups, sequence numbers are synchronized and
337
+
- For Broadcast and Main/Backup groups, sequence numbers are synchronized and
341
338
used to sort packets out
342
339
343
340
- For Balancing group, message numbers are used to sort packets out
@@ -352,8 +349,7 @@ multicast link must have the target defined as the group ID so that all data in
352
349
the header look exactly the same way depite being intended to be received by
353
350
various different network nodes.
354
351
355
-
356
-
# How to prepare connection for bonded links
352
+
## How to Prepare Connection for Bonded Links
357
353
358
354
In the listener-caller setup, you have to take care of the side separately.
359
355
@@ -364,7 +360,7 @@ handshake extension information concerning socket groups.
364
360
The listener socket must have `SRTO_GROUPCONNECT` flag set. There are two
365
361
reasons as to why it is required:
366
362
367
-
1. This flag **allows** the socket to accept bonded connections. Without this
363
+
1. This flag **allows** the socket to accept bonded connections. Without this
368
364
flag the connection that attempts to be bonded will be rejected.
369
365
370
366
2. When `srt_accept` function is being called on a listener socket that has
@@ -390,8 +386,7 @@ to you.
390
386
391
387
On the caller the matter is a little bit more complicated.
392
388
393
-
394
-
# Connect bonded
389
+
## Connect Bonded
395
390
396
391
At first, please remember that the official function to create a socket is now
397
392
`srt_create_socket` and it gets no arguments. All previous functions to create
@@ -472,8 +467,7 @@ procedure is done on the newly created socket for that connection (and that's
472
467
the only way how you can define the outgoing port for a socket that belongs
473
468
to a managed group).
474
469
475
-
476
-
# Maintaining link activity
470
+
## Maintaining Link Activity
477
471
478
472
A link can get broken, and the only thing that the library does about it is
479
473
make you aware of it. The bonding group, as managed, will simply delete the
@@ -515,9 +509,7 @@ result returned by `srt_group_data` - that is, sockets found broken during
515
509
the operation will be only present if you review the array that was filled
516
510
by `srt_sendmsg2` or `srt_recvmsg2`.
517
511
518
-
519
-
520
-
# Writing data to a bonded link
512
+
## Writing Data to a Bonded Link
521
513
522
514
This is very simple. Call the sending function (recommended is `srt_sendmsg2`)
523
515
to send the data, passing group ID in the place of socket ID. By recognizing
@@ -541,8 +533,7 @@ on particular link - and in this group type packets are distributed
541
533
throughout the link and never go in the order of scheduling on one link.
542
534
Therefore this group uses message numbers for ordering.
543
535
544
-
545
-
# Reading data from a bonded link
536
+
## Reading Data from a Bonded Link
546
537
547
538
This is also simple from the user's perspective. Simply call the reading
548
539
function, such as `srt_recvmsg2`, passing the group ID instead of socket
@@ -554,8 +545,7 @@ group reading facility will take care that you get your payload in the right
554
545
order and at the time to play, and the redundant payloads retrieved over
555
546
different links simultaneously will be discarded.
556
547
557
-
558
-
# Checking the status
548
+
## Checking the Status
559
549
560
550
If you call `srt_sendmsg2` or `srt_recvmsg2`, you'll get the status of every
561
551
socket in the group in a part of the `SRT_MSGCTRL` structure, where you should
@@ -588,7 +578,7 @@ on the socket group type:
588
578
1. Broadcast: the data are being sent over all links anyway, so it doesn't make
589
579
much difference except that the broken socket must be taken care of.
590
580
591
-
2. Backup: usually when a socket is broken, there has been a disturbance
581
+
2. Main/Backup: usually when a socket is broken, there has been a disturbance
592
582
notified much earlier and therefore another link already active. The bonding
593
583
group is allowed to keep as many active links as required for at least one
594
584
link to remain stable. A broken socket is then simply a possible resolution for
@@ -624,8 +614,7 @@ the state of "idle", and will be deleted before it could be used.
624
614
And finally, a group can be closed. In this case, it internally closes first
625
615
all sockets that are members of this group, then the group itself is deleted.
626
616
627
-
628
-
# Application support
617
+
## Application Support
629
618
630
619
Currently only the `srt-test-live` application is supporting a syntax for
631
620
socket groups.
@@ -723,5 +712,3 @@ when this link is back online.
723
712
The stability timeout can be configured through `groupstabtimeo` option.
724
713
Note that with increased stability timeout, the necessary latency penalty
725
714
grows as well.
726
-
727
-
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4