-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
4668 lines (4375 loc) · 170 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head> <title>P2PSP (Peer-to-Peer Straightforward Protocol)</title>
<meta charset="UTF-8" />
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" />
<link rel="stylesheet" type="text/css" href="index.css" />
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
></script>
<style type="text/css">
.MathJax_MathML {text-indent: 0;}
</style>
</head><body
>
<div class="maketitle">
<h2 class="titleHead">P2PSP (Peer-to-Peer Straightforward Protocol)</h2>
<div class="author" ><span
class="ecrm-1200">The P2PSP team</span></div><br />
<div class="date" ><span
class="ecrm-1200">December 1, 2019</span></div>
</div>
<div
class="abstract"
>
<div class="center"
>
<!--l. 26--><p class="noindent" >
</p><!--l. 26--><p class="noindent" ><span
class="ecbx-0900">Abstract</span></p></div>
<!--l. 6--><p class="indent" > <a
href="https://p2psp.github.io" ><span
class="ecrm-0900">P2PSP (Peer-to-Peer Straighforward Protocol)</span></a> <span
class="ecrm-0900">is an application-layer</span>
<span
class="ecrm-0900">multicast protocol that provides real-time broadcasting of media streams</span>
<span
class="ecrm-0900">in the Internet. The peers relay the stream split into chunks, using an</span>
<span
class="ecrm-0900">UDP push communication model. The data flow is controlled by the</span>
<span
class="ecrm-0900">source(s) of the stream, and the peers use a congestion control method</span>
<span
class="ecrm-0900">based on the relaying of chunks, only when chunks are received. The</span>
<span
class="ecrm-0900">topology of the overlay is dynamic and adapts to the requirements of</span>
<span
class="ecrm-0900">the physical topology and startup latency required, which is proportional</span>
<span
class="ecrm-0900">to the maximum number of peers in the P2P overlay. In absence of</span>
<span
class="ecrm-0900">connectivity restrictions (such as the imposed by NATs) and selfish peers,</span>
<span
class="ecrm-0900">all peers have an input/output ratio close to 1. P2PSP can use IP</span>
<span
class="ecrm-0900">Multicast communications, when available.</span>
</p>
</div>
<h3 class="likesectionHead"><a
id="x1-1000"></a>Notation</h3>
<!--l. 31--><p class="noindent" ><span
class="ecti-1000">Cursive is used the first time a P2PSP-related term/concept is introduced, and for</span>
<span
class="ecti-1000">key concepts or ideas.</span>
</p><!--l. 33--><p class="noindent" >
</p>
<h3 class="likesectionHead"><a
id="x1-2000"></a>Introduction</h3>
<!--l. 34--><p class="noindent" >P2PSP has a modular design organized in <span
class="ecti-1000">sets of rules</span>, where each module is
especialized in implementing different functionalities.
</p><!--l. 37--><p class="noindent" >
</p>
<h3 class="likesectionHead"><a
id="x1-3000"></a>Contents</h3>
<div class="tableofcontents">
<span class="sectionToc" >1 <a
href="#x1-40001" id="QQ2-1-4">LBS (Load Balancing Set)</a></span>
<br /> <span class="sectionToc" >2 <a
href="#x1-50002" id="QQ2-1-6">DBS (Data Broadcasting Set)</a></span>
<br /> <span class="subsectionToc" >2.1 <a
href="#x1-60002.1" id="QQ2-1-7">Team definition and types of peers</a></span>
<br /> <span class="subsectionToc" >2.2 <a
href="#x1-70002.2" id="QQ2-1-9">Feeding the team</a></span>
<br /> <span class="subsectionToc" >2.3 <a
href="#x1-80002.3" id="QQ2-1-10">Joining a team</a></span>
<br /> <span class="subsectionToc" >2.4 <a
href="#x1-90002.4" id="QQ2-1-12">Buffering chunks</a></span>
<br /> <span class="subsectionToc" >2.5 <a
href="#x1-100002.5" id="QQ2-1-13">Buffering time estimation</a></span>
<br /> <span class="subsectionToc" >2.6 <a
href="#x1-110002.6" id="QQ2-1-14">Chunk flooding</a></span>
<br /> <span class="subsectionToc" >2.7 <a
href="#x1-120002.7" id="QQ2-1-20">Routes discovery and topology optimization</a></span>
<br /> <span class="subsectionToc" >2.8 <a
href="#x1-130002.8" id="QQ2-1-21">Leaving a team</a></span>
<br /> <span class="subsectionToc" >2.9 <a
href="#x1-140002.9" id="QQ2-1-22">Free-riding control at the splitter</a></span>
<br /> <span class="subsectionToc" >2.10 <a
href="#x1-150002.10" id="QQ2-1-23">Free-riding control at peers</a></span>
<br /> <span class="sectionToc" >3 <a
href="#x1-160003" id="QQ2-1-24">ACS (Adaptive Capacity Set)</a></span>
<br /> <span class="sectionToc" >4 <a
href="#x1-170004" id="QQ2-1-25">FCS (Free-riding Control Set)</a></span>
<br /> <span class="sectionToc" >5 <a
href="#x1-180005" id="QQ2-1-26">IMS (Ip Multicast Set)</a></span>
<br /> <span class="sectionToc" >6 <a
href="#x1-190006" id="QQ2-1-27">TAS (Topology Adaptation Set)</a></span>
<br /> <span class="sectionToc" >7 <a
href="#x1-200007" id="QQ2-1-28">MRS (Massively-lost chunk Recovery Set)</a></span>
<br /> <span class="sectionToc" >8 <a
href="#x1-210008" id="QQ2-1-29">NTS (NAT Traversal Set)</a></span>
<br /> <span class="subsectionToc" >8.1 <a
href="#x1-220008.1" id="QQ2-1-30">Traffic filtering</a></span>
<br /> <span class="subsectionToc" >8.2 <a
href="#x1-230008.2" id="QQ2-1-33">Cone VS symmetric</a></span>
<br /> <span class="subsectionToc" >8.3 <a
href="#x1-240008.3" id="QQ2-1-34">Port allocation</a></span>
<br /> <span class="subsectionToc" >8.4 <a
href="#x1-250008.4" id="QQ2-1-35">NAT type analysis</a></span>
<br /> <span class="subsectionToc" >8.5 <a
href="#x1-260008.5" id="QQ2-1-36">(Theoretical) NAT traversal performance of DBS</a></span>
<br /> <span class="subsectionToc" >8.6 <a
href="#x1-270008.6" id="QQ2-1-41">A port prediction algorithm (Max’s proposal)</a></span>
<br /> <span class="sectionToc" >9 <a
href="#x1-280009" id="QQ2-1-42">MCS (Multi-Channel Set)</a></span>
<br /> <span class="sectionToc" >10 <a
href="#x1-2900010" id="QQ2-1-43">CIS (Content Integrity Set)</a></span>
</div>
<!--l. 39--><p class="noindent" >
</p>
<h3 class="sectionHead"><span class="titlemark">1 </span> <a
id="x1-40001"></a>LBS (Load Balancing Set)</h3>
<!--l. 7--><p class="noindent" ><span
class="ecbx-1000">Note: </span>Finished but not implemented.
</p><!--l. 11--><p class="noindent" >LBS describes the bootstrap procedure that peers must follow in order to join the
overlay. LBS is an standalone set of rules, and it is compatible with any other
set.
</p>
<hr class="figure" /><div class="figure"
>
<a
id="x1-40011"></a>
<!--l. 16--><p class="noindent" ><div style="text-align:center;"> <img width=800 src="graphics/icecast-P2PSP.svg" /> </div>
<br /> </p><div class="caption"
><span class="id">Figure 1: </span><span
class="content">A possible data-flow in an hybrid CDN/P2PSP network.
<!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>S</mi></math>
represents a splitter and <!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></math>
the <!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>i</mi></math>-th
peer.</span></div><!--tex4ht:label?: x1-40011 -->
</div><hr class="endfigure" />
<!--l. 24--><p class="indent" > P2PSP supposes that there is a collection of <a
href="#glo:stream">streams</a> (usually, video) that are broadcasted in
parallel.<span class="footnote-mark"><a
href="index2.html#fn1x0"><sup class="textsuperscript">1</sup></a></span><a
id="x1-4002f1"></a> The <a
href="#glo:stream">streams</a> are
available at one or more<span class="footnote-mark"><a
href="index3.html#fn2x0"><sup class="textsuperscript">2</sup></a></span><a
id="x1-4003f2"></a>
streaming <a
href="#glo:server">servers</a>, and each stream has a different <a
href="#glo:URL">Universal Resource Locator</a>,
usually expressed as a Web address with the structure:
</p>
<div class="verbatim" id="verbatim-1">
http://server/mount_point
</div>
<!--l. 35--><p class="nopar" > Notice that a server can be serving several channels.
</p><!--l. 39--><p class="indent" > P2PSP does not perform data-flow control over the stream. The transmission
bit-rate between P2PSP entities is controlled by the servers (Icecast servers, for
example), which provides the stream to the P2PSP <span
class="ecti-1000">teams</span>. Fig. <a
href="#x1-40011">1<!--tex4ht:ref: fig:icecast-P2PSP --></a> shows an example
of a streaming overlay where several servers relay a set of channels generated by a set
of source-clients, directly or through other servers. As can be seen, a listener
(which usually plays the stream) can be replaced by a <span
class="ecti-1000">splitter</span>, a P2PSP
entity that sends the received stream (a single channel) to a set of P2PSP
<span
class="ecti-1000">peers</span>.
</p><!--l. 64--><p class="indent" > In a pure CDN system, users request the channels directly to the servers.
Unfortunately, this simple procedure has a drawback: normally, users do not know
the load nor the distance to the servers. This problem can be solved by using a <span
class="ecti-1000">load</span>
<span
class="ecti-1000">balancer</span>. The listeners, which know the URL of the required channel, connects first
to a load balancer which redirects them (with an HTTP 302 code) to a suitable
server.
</p><!--l. 73--><p class="indent" > This idea can be extended to minimize the response time of hybrid CDN/P2PSP
structures. When a user (who knows an URL of the channel) runs a local peer, it
provides to his peer the URL of the channel (the URL pointing to a server and a
mount point). Then, the peer (as any other listener does) contacts a load
balancer which in this case sends a list of splitters which are broadcasting the
channel.<span class="footnote-mark"><a
href="index4.html#fn3x0"><sup class="textsuperscript">3</sup></a></span><a
id="x1-4004f3"></a>
Then, the peer tries to connect with all the splitters in parallel, and the first
establised connection determines the selected splitter (the rest of connections are
closed). If only those splitters with space in their teams answer to the peer, this
procedure should select the “nearest” splitter for the peer in terms of response
time.
</p><!--l. 90--><p class="indent" > For the case of the incorporation of new splitters to the network, the
procedure is similar. A new splitter (which is instantiated knowing an URL of
a channel) contacts the load balancer which returns a list of servers and
peers, which are serving the channel. Then, the splitter tries to connect
with all of them in parallel, and the first successfull connection is finally
selected.<span class="footnote-mark"><a
href="index5.html#fn4x0"><sup class="textsuperscript">4</sup></a></span><a
id="x1-4005f4"></a>
</p><!--l. 100--><p class="indent" > Using the idea of the extended load balancer, when a <span
class="ecti-1000">player </span>(listener) connects
to it, if there is a local peer running in the same host or the same private
network that the player, the balancer will redirect the player to the local
peer.
</p><!--l. 105--><p class="indent" > Finally, it is compulsory that all the splitters associated to the same channel to
generate exactly the same chunks (content and header).
</p>
<h3 class="sectionHead"><span class="titlemark">2 </span> <a
id="x1-50002"></a>DBS (Data Broadcasting Set)</h3>
<!--l. 5--><p class="noindent" ><span
class="ecbx-1000">Note: </span>Finished and implemented.
</p><!--l. 9--><p class="noindent" ><span
class="ecbx-1000">Note: </span>DBS is the most basic set of rules. The rest of sets extends or modify its
functionality.
</p><!--l. 14--><p class="noindent" ><a
href="#glo:DBS">DBS</a> provides <a
href="#glo:ALM">ALM</a> of a <a
href="#glo:media">media</a> <a
href="#glo:stream">stream</a> in <a
href="#glo:unicast">unicat</a> environments. The media is sent by
a streaming <a
href="#glo:server">server</a> (which is not related to P2PSP), and it is received by a
<a
href="#glo:splitter">splitter</a>. (see Sec. <a
href="#x1-40001">1<!--tex4ht:ref: sec:LBS --></a>) The splitter divides the stream into a sequence of <a
href="#glo:chunk">chunk</a>s of
data, and relays them to a <a
href="#glo:team">team</a> of peers, following a round-robing schema. Each peer
of a team gathers the chunks from the splitter and the rest of peers of the team, and
sends them to at least one <a
href="#glo:player">player</a>.Peer should run even if no player(s) are connected
to it. Peers are organized in a unstructured topology (all peers perform the same
tasks).
</p><!--l. 8--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">2.1 </span> <a
id="x1-60002.1"></a>Team definition and types of peers</h4>
<!--l. 7--><p class="noindent" >A team is a set of one or more peers (referenced by their end-points) that share the
same stream. By definition, in a team at least one peer is a <a
href="#glo:monitor">monitor</a>. Monitors are
deployed by the overlay administrator to check different aspects of the broadcasting,
such as, the expected quality of the rendered video at the peers or the estimated
latency.
</p><!--l. 13--><p class="indent" > The number of peers (normal peers and monitors) in a team has a maximum
<!--l. 14--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>N</mi></mrow><mrow
><mo
class="MathClass-bin">∗</mo></mrow></msup
></math> (see
Tab. <a
href="#x1-60011">1<!--tex4ht:ref: tab:DBS_nomenclature --></a>). This parameter has an significative impact on the maximum latency of the
protocol (see Sec. <a
href="#x1-90002.4">2.4<!--tex4ht:ref: sec:buffering_chunks --></a>), and is usually defined by the administrator of the
overlay.
</p>
<div class="table">
<!--l. 1--><p class="indent" > <a
id="x1-60011"></a></p><hr class="float" /><div class="float"
>
<div class="tabular"> <table id="TBL-2" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-2-1g"><col
id="TBL-2-1" /><col
id="TBL-2-2" /></colgroup><tr
style="vertical-align:baseline;" id="TBL-2-1-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-1-1"
class="td11"> Parameter </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-1-2"
class="td11"> Meaning </td>
</tr><tr
class="hline"><td><hr /></td><td><hr /></td></tr><tr
style="vertical-align:baseline;" id="TBL-2-2-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-2-1"
class="td11"> <!--l. 6--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>N</mi></mrow><mrow
><mo
class="MathClass-bin">∗</mo></mrow></msup
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-2-2"
class="td11"> Maximum number of peers in a team </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-3-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-3-1"
class="td11"> <!--l. 7--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>T</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-3-2"
class="td11"> Average round-time </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-4-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-4-1"
class="td11"> <!--l. 8--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>l</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-4-2"
class="td11"> Chunk length </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-5-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-5-1"
class="td11"> <!--l. 9--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-5-2"
class="td11"> Buffer size, in chunks, used by the peers </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-6-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-6-1"
class="td11"> <!--l. 10--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>B</mi></mrow><mrow
><mi
>′</mi></mrow></msup
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-6-2"
class="td11"> Length of the list of the last <!--l. 10--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>B</mi></mrow><mrow
><mi
>′</mi></mrow></msup
></math> peers served by the splitter </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-7-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-7-1"
class="td11"> <!--l. 11--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>D</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-7-2"
class="td11"> Diameter of the flooding tree </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-8-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-8-1"
class="td11"> <!--l. 12--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>L</mi></mrow><mrow
><mo
class="MathClass-bin">∗</mo></mrow></msup
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-8-2"
class="td11"> Maximum allowed number of lost chunks </td></tr><tr
style="vertical-align:baseline;" id="TBL-2-9-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-9-1"
class="td11"> <!--l. 13--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>M</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-9-2"
class="td11"> Number of monitors</td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-10-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-10-1"
class="td11"> <!--l. 14--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>R</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-10-2"
class="td11"> Average bit-rate of the media </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-11-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-11-1"
class="td11"> <!--l. 15--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>H</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-11-2"
class="td11"> Pre-fetching horizon </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-12-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-12-1"
class="td11"> <!--l. 16--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>P</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-12-2"
class="td11"> The list of peers in the team </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-13-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-13-1"
class="td11"> Variable </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-13-2"
class="td11"> </td>
</tr><tr
class="hline"><td><hr /></td><td><hr /></td></tr><tr
style="vertical-align:baseline;" id="TBL-2-14-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-14-1"
class="td11"> <!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>N</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-14-2"
class="td11"> Number of peers in the team </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-15-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-15-1"
class="td11"> <!--l. 20--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>L</mi></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-15-2"
class="td11"> Number of lost chunks </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-16-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-16-1"
class="td11"> <!--l. 21--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>c</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-16-2"
class="td11"> Chunk time </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-17-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-17-1"
class="td11"> <!--l. 22--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>r</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-17-2"
class="td11"> Round time </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-18-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-18-1"
class="td11"> <!--l. 23--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-18-2"
class="td11"> Buffering time </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-19-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-19-1"
class="td11"> <!--l. 24--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>Δ</mi><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-19-2"
class="td11"> Protocol (buffering) jitter </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-20-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-20-1"
class="td11"> <!--l. 25--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>p</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-20-2"
class="td11"> Physical (network) latency </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-21-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-21-1"
class="td11"> <!--l. 26--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>Δ</mi><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>p</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-21-2"
class="td11"> Physical jitter </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-22-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-22-1"
class="td11"> <!--l. 27--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>s</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-22-2"
class="td11"> Start-up time </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-2-23-"><td style="text-align:right; white-space:nowrap;" id="TBL-2-23-1"
class="td11"> <!--l. 28--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>i</mi></mrow><mrow
><mi
>p</mi></mrow></msub
></math> : </td><td style="text-align:left; white-space:nowrap;" id="TBL-2-23-2"
class="td11"> The played chunk index </td></tr></table>
</div>
<br /> <div class="caption"
><span class="id">Table 1: </span><span
class="content">Nomenclature used in DBS.</span></div><!--tex4ht:label?: x1-60011 -->
</div><hr class="endfloat" />
</div>
<h4 class="subsectionHead"><span class="titlemark">2.2 </span> <a
id="x1-70002.2"></a>Feeding the team</h4>
<!--l. 7--><p class="noindent" >The splitter divides the stream into chunks of constant length
<!--l. 7--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>C</mi></math>, and sends exclusively each
chunk to a different <a
href="#glo:origin">origin</a><span class="footnote-mark"><a
href="index6.html#fn5x0"><sup class="textsuperscript">5</sup></a></span><a
id="x1-7001f5"></a>
peer, using a round-robin schema. Chunks are enumerated to distinguish them, and
this information is transmitted as a part of a chunk header.
</p><!--l. 32--><p class="indent" > A <a
href="#glo:round">round</a> is defined as the process of transmitting
<!--l. 32--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>N</mi></math> different chunks from
the splitter to a team of <!--l. 33--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>N</mi> <mo
class="MathClass-rel">≤</mo> <msup><mrow
><mi
>N</mi></mrow><mrow
><mo
class="MathClass-bin">∗</mo></mrow></msup
></math>
peers (therefore, all the peers of the team are origin of a different chunk, in each round). For
a team of size <!--l. 35--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>N</mi></math>,
the average <a
href="#glo:round-time">round-time</a> can be estimated as </p><table class="equation"><tr><td> <a
id="x1-7002r1"></a>
<!--l. 37--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="block" class="equation">
<mi
>T</mi> <mo
class="MathClass-rel">=</mo> <mi
>N</mi><msup><mrow
><mi
>t</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
><mo
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(1)</td></tr></table>
<!--l. 40--><p class="indent" > where <!--l. 40--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>t</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
></math>
is the <a
href="#glo:chunk-time">chunk time</a>, defined as </p><table class="equation"><tr><td> <a
id="x1-7003r2"></a>
<!--l. 41--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="block" class="equation">
<msup><mrow
><mi
>t</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
> <mo
class="MathClass-rel">=</mo> <mfrac><mrow
><msup><mrow
><mi
>l</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
></mrow>
<mrow
><mi
>R</mi></mrow></mfrac> <mo
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(2)</td></tr></table>
<!--l. 45--><p class="indent" > where <!--l. 45--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>l</mi></mrow><mrow
><mi mathvariant="normal">chunk</mi></mrow></msup
></math>
is the length of the chunks (all the chunks are split with the same length) and
<!--l. 46--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>R</mi></math> is the
average transmission bit-rate, that should match the average bit-rate of the stream in
order to achieve a seamsless playing.
</p>
<h4 class="subsectionHead"><span class="titlemark">2.3 </span> <a
id="x1-80002.3"></a>Joining a team</h4>
<!--l. 7--><p class="noindent" >After connecting with a splitter<span class="footnote-mark"><a
href="index7.html#fn6x0"><sup class="textsuperscript">6</sup></a></span><a
id="x1-8001f6"></a> ,
incoming peers request (using a reliable communication) to the splitter the current list of peers in the team
<!--l. 12--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>T</mi></math>. To minimize the <a
href="#glo:joining-time">joining
time</a>, the peer sends a <!--l. 13--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mrow ><mo
class="MathClass-open">[</mo><mrow><mi mathvariant="monospace">hello</mi></mrow><mo
class="MathClass-close">]</mo></mrow></math>
message to each other peer of the team, in parallel with the reception of the list. When a peer of the
team receives a <!--l. 15--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mrow ><mo
class="MathClass-open">[</mo><mrow><mi mathvariant="monospace">hello</mi></mrow><mo
class="MathClass-close">]</mo></mrow></math>,
it adds the sender of the message to the team
list<span class="footnote-mark"><a
href="index8.html#fn7x0"><sup class="textsuperscript">7</sup></a></span><a
id="x1-8002f7"></a> and to a jagged
array of peers called <!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi mathvariant="monospace">f</mi><mrow ><mo
class="MathClass-open">[</mo><mrow></mrow><mo
class="MathClass-close">]</mo></mrow></math>
(see <a
href="https://github.com/P2PSP/simulator/blob/f0c73be1817e7d3b816cc61cd2c8e59b17f9a0e6/src/core/peer_dbs.py#L491" ><!--l. 21--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mstyle
class="text"><mtext >f[]</mtext></mstyle></math> in <span
class="ectt-1000">peer.py</span></a>). If
a peer <!--l. 21--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></math> has an entry
<!--l. 22--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi mathvariant="monospace">f</mi><mrow ><mo
class="MathClass-open">[</mo><mrow><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>j</mi></mrow></msub
></mrow><mo
class="MathClass-close">]</mo></mrow> <mo
class="MathClass-rel">=</mo> <mrow ><mo
class="MathClass-open">{</mo><mrow><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>k</mi></mrow></msub
></mrow><mo
class="MathClass-close">}</mo></mrow></math>, then each chunk
received by <!--l. 22--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></math> and
originated at <!--l. 23--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>j</mi></mrow></msub
></math> will be
forwarded to <!--l. 23--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>k</mi></mrow></msub
></math>. When
an incoming peer <!--l. 24--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></math>
has received the list of peers, its forwarding table has been initialized to
<!--l. 25--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi mathvariant="monospace">f</mi><mrow ><mo
class="MathClass-open">[</mo><mrow><msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></mrow><mo
class="MathClass-close">]</mo></mrow> <mo
class="MathClass-rel">=</mo> <mrow ><mo
class="MathClass-open">{</mo><mrow><mi
>T</mi> <mo
class="MathClass-bin">∖</mo> <msub><mrow
><mi
>P</mi></mrow><mrow
><mi
>i</mi></mrow></msub
></mrow><mo
class="MathClass-close">}</mo></mrow></math>.
Notice that, as long as the forwarding table contains this information, all the chunks
received from the splitter will be forwarded to the rest of the team, directly (in one
single hop/chunk). So, in absence of communication constraints, the team will be
organized as a full-connected overlay (see Fig. <span
class="ecbx-1000">??</span>).
</p>
<hr class="figure" /><div class="figure"
>
<a
id="x1-80032"></a>
<!--l. 34--><p class="noindent" ><div style="text-align:center;"> <img width=800 src="graphics/topologies.svg" /> </div>
<br /> </p><div class="caption"
><span class="id">Figure 2: </span><span
class="content">Different overlay (team) topologies.</span></div><!--tex4ht:label?: x1-80032 -->
</div><hr class="endfigure" />
<!--l. 73--><p class="indent" > The splitter, in an infinite loop: (1) listens to the incoming peers, (2) sends to
them the list of peers of the team, (3) includes the incoming peer to the list, and (4)
send a copy of the stream to the team using a round-robing, as a sequence of chunks.
Notice that only those peers that are in the list of peers of the splitter are considered
to be in the team served by such splitter.
</p><!--l. 91--><p class="indent" > <span
class="ecbx-1000">Note: </span>See <a
href="https://github.com/P2PSP/simulator/blob/f0c73be1817e7d3b816cc61cd2c8e59b17f9a0e6/src/core/splitter_dbs.py#L296" ><!--l. 92--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mstyle
class="text"><mtext >destination_of_chunk</mtext></mstyle><mrow ><mo
class="MathClass-open">[</mo><mrow></mrow><mo
class="MathClass-close">]</mo></mrow></math>
in <span
class="ectt-1000">peer_dbs.py</span></a>.
</p>
<h4 class="subsectionHead"><span class="titlemark">2.4 </span> <a
id="x1-90002.4"></a>Buffering chunks</h4>
<!--l. 7--><p class="noindent" >In order to hide the jitter generated by the physical network and the
protocol itself, peers need to store the received chunks in a buffer during
a period of time, before sending them to a player. A chunk with number
<!--l. 10--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>x</mi></math> is inserted in the
position <!--l. 10--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mrow ><mo
class="MathClass-open">(</mo><mrow><mi
>x</mi><mspace width="0.33em" class="nbsp" /><mi mathvariant="italic">mod</mi><mspace width="0.33em" class="nbsp" /><mn>2</mn><mi
>B</mi></mrow><mo
class="MathClass-close">)</mo></mrow></math> of the
buffer, where <!--l. 11--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math> is
the maximum number of chunks that the buffer stores before start playing the first chunk. In
a peer’s life, <!--l. 12--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math>
is a constant specified by the user, but it is not compulsory that all peers of a team
use the same buffer size.
</p><!--l. 16--><p class="indent" > The buffer is implemented as a circular array of
<!--l. 16--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mn>2</mn><mi
>B</mi></math> chunks, that is filled
with up to <!--l. 17--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math> chunks during
the <a
href="#glo:buffering-time">buffering time</a> <!--l. 18--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>t</mi></mrow><mrow
><mi mathvariant="normal">buffer</mi></mrow></msup
></math>.
Such time is the main component of the <a
href="#glo:start-up-time">start-up time</a>
<!--l. 19--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msup><mrow
><mi
>t</mi></mrow><mrow
><mi mathvariant="normal">start−up</mi></mrow></msup
></math>
experienced by users. The oldest chunk in the buffer is sent to the player each time a
new chunk is received.
</p><!--l. 20--><p class="noindent" >
</p>
<h4 class="subsectionHead"><span class="titlemark">2.5 </span> <a
id="x1-100002.5"></a>Buffering time estimation</h4>
<!--l. 14--><p class="noindent" >The start-up time <!--l. 14--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>l</mi></mrow></msub
></math>
is the latency that the end-user experiments during the redering of the media.
<!--l. 15--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>l</mi></mrow></msub
></math>,
defined as </p><table class="equation"><tr><td> <a
id="x1-10001r3"></a>
<!--l. 16--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="block" class="equation">
<msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>l</mi></mrow></msub
> <mo
class="MathClass-rel">=</mo> <msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>p</mi></mrow></msub
> <mo
class="MathClass-bin">+</mo> <msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
><mo
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(3)</td></tr></table>
<!--l. 20--><p class="indent" > is the sum of the physical delay <!--l. 21--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>p</mi></mrow></msub
></math>
and the buffering time <!--l. 21--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
></math>,
where </p><table class="equation"><tr><td> <a
id="x1-10002r4"></a>
<!--l. 22--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="block" class="equation">
<msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
> <mo
class="MathClass-rel">=</mo> <mi
>B</mi><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>c</mi></mrow></msub
><mo
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(4)</td></tr></table>
<!--l. 26--><p class="indent" > is the time that has elapsed since the peer receives two chunks distanced
<!--l. 27--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math> positions in the buffer,
being <!--l. 27--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><mi
>B</mi></math> the buffer size
(in chunks), and <!--l. 28--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>c</mi></mrow></msub
></math> the
chunk time (considering <!--l. 28--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>c</mi></mrow></msub
></math>
a constant<span class="footnote-mark"><a
href="index9.html#fn8x0"><sup class="textsuperscript">8</sup></a></span><a
id="x1-10003f8"></a> ).
In other words, the buffering time is the delay in the rendering of the media required
to expect a seamless playing. Notice that Eq. <a
href="#x1-10002r4">4<!--tex4ht:ref: eq:t_b --></a> does not assume that the chunks
completely fill the buffer during the buffering time.
</p><!--l. 35--><p class="indent" > To minimize <!--l. 35--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>l</mi></mrow></msub
></math>,
<!--l. 35--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>p</mi></mrow></msub
></math> and
<!--l. 35--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi
>b</mi></mrow></msub
></math> should be as small as
possible. How to minimize <!--l. 36--><math
xmlns="http://www.w3.org/1998/Math/MathML"
display="inline" ><msub><mrow
><mi
>t</mi></mrow><mrow
><mi