forked from robin-raymond/ortc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-raymond-rtcweb-webrtc-js-obj-api-rationale-02.txt
1848 lines (1262 loc) · 76.5 KB
/
draft-raymond-rtcweb-webrtc-js-obj-api-rationale-02.txt
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
Network Working Group R. Raymond
Internet-Draft E. Lagerway
Intended status: Informational Hookflash
Expires: February 13, 2014 I. Baz Castillo
Versatica
R. Shpount
TurboBridge
August 12, 2013
WebRTC JavaScript Object API Rationale
draft-raymond-rtcweb-webrtc-js-obj-api-rationale-01
Abstract
This document describes the reasons why a JavaScript Object Model
approach is a far better solution than using SDP [RFC4566] as a
surface API for interfacing with WebRTC. The document outlines the
issues and pitfalls as well as use cases that are difficult (or
impossible) with SDP with offer / answer [RFC3264], and explains the
benefits and goals of an alternative JavaScript object model
approach.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 13, 2014.
Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
Raymond, et al. Expires February 13, 2014 [Page 1]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
2. Issues with a Universal Session Description Format (and Offer
/ Answer) . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Goal of Minimized Requirements . . . . . . . . . . . . . 6
2.2. Offer / Answer State Machine . . . . . . . . . . . . . . 7
2.2.1. Offer / Answer Violations . . . . . . . . . . . . . . 8
2.3. Browser to Browser Format Compatibility Issue . . . . . . 8
2.4. Browser to JavaScript Compatibility Issues . . . . . . . 9
2.5. SDP as a surface API for JavaScript developers . . . . . 9
2.6. Is SDP allowed to be mangled? . . . . . . . . . . . . . . 10
2.7. SDP errata and bugs compatibility issues . . . . . . . . 11
2.7.1. SDP Bugs Become Enshrined . . . . . . . . . . . . . . 11
2.8. SIP/SDP compatibility worsened . . . . . . . . . . . . . 12
2.9. Increased surface API . . . . . . . . . . . . . . . . . . 12
2.10. Impossible API to implement to achieve browser
compatibility . . . . . . . . . . . . . . . . . . . . . . 13
2.10.1. Example Oddities That Need Definition . . . . . . . 13
2.11. Plan A, Plan B vs NoPlan . . . . . . . . . . . . . . . . 14
2.12. SIP Forking Issue . . . . . . . . . . . . . . . . . . . . 15
3. Alternatives to Fixing these Issues Now . . . . . . . . . . . 15
3.1. Waiting for WebRTC 2.0 . . . . . . . . . . . . . . . . . 15
3.1.1. Cost now to fix versus fixing later . . . . . . . . . 16
3.1.2. If starting over, would even SIP people want SDP as a
surface API? . . . . . . . . . . . . . . . . . . . . 16
3.1.3. Incremental Approach may make Compatibility Worse . . 16
3.2. Session Description Format Construction API . . . . . . . 17
4. Example Difficult Usage Cases with Current Model . . . . . . 19
4.1. On / off hold example usage case . . . . . . . . . . . . 19
4.2. One-Sided Constraints Negotiation use Case Scenario . . . 20
4.3. Meet-me Negotiation Use Case Scenario . . . . . . . . . . 22
4.4. Browser to Browser Compatibility Extension Compatibility
Issue Scenario . . . . . . . . . . . . . . . . . . . . . 22
4.5. Building Interoperability between WebRTC and a SIP
Service Scenario . . . . . . . . . . . . . . . . . . . . 23
4.6. Bit-rate Change Scenario . . . . . . . . . . . . . . . . 24
4.7. Video Codec Option Change Scenario . . . . . . . . . . . 25
4.8. Video Upgrade Scenario . . . . . . . . . . . . . . . . . 25
5. Proposal: WebRTC JavaScript Object Model . . . . . . . . . . 26
Raymond, et al. Expires February 13, 2014 [Page 2]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2. Benefits . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2.1. Greater compatibility . . . . . . . . . . . . . . . . 26
5.2.2. Easier to extend . . . . . . . . . . . . . . . . . . 26
5.2.3. Faster Reaction Time To Issues . . . . . . . . . . . 27
5.2.4. Decreased surface API . . . . . . . . . . . . . . . . 27
5.2.5. Greater compatibility for SIP . . . . . . . . . . . . 27
5.2.6. Alternative formats . . . . . . . . . . . . . . . . . 28
5.3. Design Goals and Considerations . . . . . . . . . . . . . 28
5.3.1. Objects Model Kept Simple . . . . . . . . . . . . . . 28
5.3.2. Simple to Gather Negotiation Information . . . . . . 28
5.3.3. Offer / Answer . . . . . . . . . . . . . . . . . . . 28
5.3.4. Extensions . . . . . . . . . . . . . . . . . . . . . 28
5.3.5. Well Defined Behaviors . . . . . . . . . . . . . . . 29
5.3.6. Data Channel . . . . . . . . . . . . . . . . . . . . 29
5.3.7. Satisfy the expectations of the RTCWEB charter . . . 29
5.3.8. SIP/SDP and current WebRTC API shim compatibility
statement . . . . . . . . . . . . . . . . . . . . . . 29
5.3.9. Greater Separation of RTCWEB Working Group and Other
Working Groups . . . . . . . . . . . . . . . . . . . 30
6. Security Considerations . . . . . . . . . . . . . . . . . . . 30
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1. Normative References . . . . . . . . . . . . . . . . . . 30
8.2. Informative References . . . . . . . . . . . . . . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32
1. Introduction
While the IETF RTCWEB WG is not specifically tasked with providing an
API by the W3C, the group has effectively defined a surface API with
the mandate to use SDP [RFC4566] with offer / answer [RFC3264].
SDP is a condensed text based format that typically describes all of
the real-time media streams, networking properties, codecs, media
state and media attributes. SDP is completely extensible and can be
used to describe absolutely anything so long as it is formatted
correctly within its minimally defined limitations.
The points for mandating SDP with an offer / answer API typically
boils down to:
1. It's really easy to establish communication, especially with SIP
[RFC3261].
2. The decision was already made.
3. SDP yields greater compatibility (especially with SIP networks).
Raymond, et al. Expires February 13, 2014 [Page 3]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
4. We must have some kind of universal exchange format.
5. There is no alternative to this approach except destroying
everything created and starting from scratch.
This document will explain why these reasons are insufficient to
continue with an SDP with offer / answer mandate approach given
strong logical arguments and reasons with real world scenarios where
this approach fails and due in no small part to its lasting
consequences (including negative consequences for SIP).
The document highlights the benefits and goals for a different
"JavaScript Object Model" approach, which satisfies the RTCWEB WG
charter's requirements, yields greater compatibility and offers a
road-map where future potential extensions can be readily added
without breaking existing implementations.
A "JavaScript shim" is described including details on how it can
offer a wrapped API around a core WebRTC JavaScript Object Model.
This Shim will provide the same level of "ease of use" as experienced
with the current SDP WebRTC API. However, this JavaScript shim is
not mandatory to use for those who do not require an "SDP with offer
/ answer" model.
1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119].
2. Issues with a Universal Session Description Format (and Offer /
Answer)
The issue with SDP is not the expressiveness of the format but its
usage as an arbitrary universal format and an API surface instead of
providing JavaScript developers an object model they can readily
understand. JavaScript could be used to control the plumbing of
media objects using familiar JavaScript expressive concepts enshrined
with methods, properties and events. Today, in many real-world use
cases, controlling WebRTC requires modifying SDP directly.
Requiring JavaScript developers to serialize their API control
requests into a text format (via modifications of SDP existing blobs)
is only one aspect of the many issues the SDP approach creates for
developers. Needlessly, an offer / answer state machine is imposed
on JavaScript developers as well.
Raymond, et al. Expires February 13, 2014 [Page 4]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
While the currently mandated SDP based API allows developers to
quickly implement basic calling demos and interoperability with some
SIP networks, it has many issues that will be explored and explained
in this document and include (but not limited to):
1. Defining a standard universal all-encompassing session
description format for use with WebRTC that describes all
connections, media, constraints, streams and tracks for all
scenarios is especially challenging.
2. Rather than focusing and defining the properties needed for
communication, the focus is put on the best way to express the
format where every nuance and behavior will need to be detailed
for any browser vendor to capably implement the SDP based WebRTC
specification.
3. The bar for browsers (or other applications with WebRTC engines)
to produce a WebRTC engine is raised substantially by forcing
the browser to implement an entire SDP offer / answer engine
too, with little to no added benefit.
4. A universal format built into the browser's API is entirely
unneeded and goes well beyond the RTCWEB chartered mandate for
the RTCWEB Working Group.
5. A flexible and expendable universal exchange format leads to
greater interpretations and mistakes in various implementations,
which in turn leads to increased incompatibilities.
6. Given the format is entirely flexible and open to
interpretation, resulting implementations will more likely be
prone to errors relative to the other truly needed aspects of
RTC (which have better defined boundaries, behaviours, and
scope).
7. Mistakes in the format won't be fixed until a new browser binary
update is released and deployed amongst users.
8. Mistakes in implementation of the session description format can
become enshrined and difficult to deprecate (for the sake of
compatibility).
9. Compatibility issues caused by the format will not be limited to
browsers-only as many hybrid browser-engine based applications
now exist too.
Raymond, et al. Expires February 13, 2014 [Page 5]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
10. Using alternative signaling formats will require complete
understanding of the universal format to be able to translate it
into other alternative signaling formats.
11. JavaScript (or proxies) will need to parse and rewrite the
output session description format with 100% precision and
without loss. They will also require pre-knowledge of what each
browser produces and expects, despite the likelihood of a
multitude of outputted flavors, on various platforms, and from
version to version and despite the inability to easily predict
or detect the variants.
12. JavaScript developers trying to control WebRTC features will
need to manipulate any defined universal format rather than
interacting with JavaScript objects.
13. Offer / answer is mandated and the state machine is required but
the exact rules and violations of the rules ill defined when
used within WebRTC.
14. The rules of how a universal format can be modified before being
delivered to remote parties need to be meticulously defined or
compatibility issues will arise (including the allowed rules of
post browser format regeneration as to what can be modified and
fed back into the browser).
15. Due to the issues defined above, SIP compatibility will worsen,
not strengthen.
An alternative to all of the issues caused by a universal format and
state machine are described later in the document. This alternative
allows JavaScript to control the behavior of the media engine's
plumbing while providing extensible and modifiable shims written
entirely in JavaScript that produce consistent signaling and exchange
formats for the specific network where those formats operate.
2.1. Goal of Minimized Requirements
While the primary goal of WebRTC is to enable browser to browser
communication, the definition of a "browser" is ever expanding.
Beyond just traditional hand-held applications, hybrid applications
that are part HTML-5 and part native code exist. Servers will become
as much as part of the WebRTC infrastructure as browsers. Minimizing
the requirements to the basic wire compatibility necessary to achieve
RTC is essential for maximum compatibility, flexibility and varying
usage scenarios.
Raymond, et al. Expires February 13, 2014 [Page 6]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
The mandate for the RTCWEB charter is to simply define requirements,
provide basic "on-the-wire" compatibility, and define security
requirements (such as enforcing ICE connection agreements). The
RTCWEB charter goals have been exceeded by going well beyond that
scope by mandating an API that works fine for simple SIP
interoperability demos but does not provide easy compatibility to the
basic constructs needed as outlined from the charter for use with
other on-the-wire signaling protocols (other than SIP). If SIP is
the only end goal of the WG, then that goal must be specifically
stated rather than effectively mandated by making alternative
signaling approaches unreasonably difficult to achieve.
2.2. Offer / Answer State Machine
The current SDP approach requires an offer / answer state machine.
Mandating an offer / answer state machine implies that:
1. SDP be generated by browser A and sent to browser B
2. Browser B must respond with the offer with an answer
3. If either party issues a new offer but the offer is rejected, the
state must revert to the previous agreed SDP (or fail to none)
4. If one side receives an offer while the other side has an
outstanding offer, a conflict occurs and both sides must reject
and revert and perform SDP conflict resolution to issue an offer
again
5. The only changes to the media that are allowed happens if both
sides agree
6. Any change required to the SDP requires a network round trip
where both sides mutually agree (at least as traditionally
defined in offer / answer but the rules are in flux)
This offer / answer model is defined as required with the current
implementation. Not only do the browser vendors have to enforce the
rules, all JavaScript authors must also adhere to these rules of
signaling. While WebRTC does not dictate the signaling mechanism
between browsers, effectively it is imposing this signaling state
machine on all implementations (which is not a mandate of the RTCWEB
Working Group).
There are other models for signaling other than offer / answer. For
example, one-sided constraints based negotiation is an alternative
model. This type of negotiation requires each side to determine what
it wants to receive independent of the other. This signaling is akin
Raymond, et al. Expires February 13, 2014 [Page 7]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
to saying "if you plan to send anything, make sure it conforms to the
following". Changes to the media may occur without agreement from
the remote party where each side decides what is acceptable to
receive without agreement from the other. The remote side can decide
if it wants to send within those constraints or not. There is no
round trip offer / answer required in this model to affect change.
Offer / answer introduces the unnecessary asynchronism to the API and
JavaScript implementations. For example, changing the list of codecs
expecting to receive or the current sending codec can be done
immediately without the need for asynchronous calls.
Offer / answer is not required to achieve RTC wire compatibility but
it is currently mandated when alternatives could exist.
2.2.1. Offer / Answer Violations
The offer / answer SDP state machine is already violated in WebRTC.
Trickle ICE precludes offer / answer round trips and other proposed
standards like NoPlan [I-D.ivov-rtcweb-noplan] suggest relaxing the
offer / answer model even more. The rules of what offer / answer at
this point is undefined and in clear violation of the strict previous
rules without clear direction on what exactly constitutes offer /
answer anymore and where it should and should not be used.
A new state for offer / answer called PRANSWER is now defined, which
did not exist as part of the standard offer / answer state machine.
Offer rollback is not adequately defined either should an offer /
answer conflict occur.
Currently, switching codecs requires an SDP offer / answer should
perform a round trip even though it is not technically needed for an
RTC engine to change codecs. Should this be another exception to the
offer / answer state machine?
2.3. Browser to Browser Format Compatibility Issue
SDP is a flexible format, and it allows many alternative methods to
express the same intentions. The smallest change may alter the SDP's
meaning.
Raymond, et al. Expires February 13, 2014 [Page 8]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
This creates a parsing and SDP generation compatibility issues. If
SDP is packaged by JavaScript and delivered to the remote browser
then each browser must support every single possible variant of SDP
for every browser version and platform in existence. They must do
this without failure. To maximize compatibility, a browser should
generate the SDP format in the variant expected by the remote party
(despite not having sufficient knowledge about the remote party to
provide the correct SDP).
2.4. Browser to JavaScript Compatibility Issues
Since WebRTC is not supposed to mandate the format on the wire for
signaling, one supported use case for WebRTC must be allowing the
browser generated SDP to be converted into alternative on-the-wire
formats. This SDP conversion may be performed by JavaScript in the
browser, or later by an intermediate gateway. In either case, the
converter must be entirely aware of all variants to the SDP possible
from every browser platform and version, despite browser version
detection being heavily frowned upon by industry best practices.
Likewise, the JavaScript or gateway must know how to generate the
correct SDP for all browsers and versions before passing the
serialize SDP blob into the browser. Generating compatible SDP may
be impossible unless the exact formats and restrictions are
unquestionably clear by all implementers of the specification (which
is anything but clearly described in the current WebRTC SDP based API
that developers are mandated to use).
2.5. SDP as a surface API for JavaScript developers
The current SDP based API is limited to placing a call and answering
a call and adding media. To perform common edge cases or to utilize
RTC features beyond the basic API typically requires SDP mangling.
Many of the operations from JavaScript to control or fetch properties
from RTC will be through serialization to / from the SDP instead of a
developer using familiar JavaScript language constructs (e.g. object
methods, structures, properties and events). The JavaScript
developer must learn an entirely new protocol called "SDP" and be
able to parse and generate not only basic SDP but any SDP extensions
without introducing a single compatibility issue.
Examples; A JavaScript developer wants to hold / un-hold media
streams. The developer must use a widely adopted but hidden feature
to parse the SDP from the browser, change it to add the appropriate
"hold" state, send that hold state to the remote side, wait for the
"answer" to accept the hold, parse the result on the return to see if
the hold was accepted and feed the result to the browser.
Raymond, et al. Expires February 13, 2014 [Page 9]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
Worse, a flood of extensions to SDP for WebRTC are being written to
"enhance" and "extend" the functionality of the browser with new
features. Many basic things are ill defined in the current SDP based
API, for example, changing non-negotiated codec parameters, such as
codec bandwidth.
There is no facility for JavaScript to detect what SDP the browser is
currently using or capable of delivering. The developer has no idea
of the extensions available, or what SDP will be produced, or what
SDP is compatible. The developer's JavaScript code must be able to
handle everything generated by the browser for any use case beyond
basic call, answer and hang-up. This is a heavy burden to place on a
JavaScript developer who is not familiar with the details of RTC
concepts as expressed in SDP, and is a challenge even for those who
are familiar.
Effective APIs are meant to be contracts between a producer and
consumer, whereas this SDP methodology offers little in the form of
any such contract.
If SDP is to become standardized for use with WebRTC then JavaScript
developers must learn SDP to use RTC's available features and build
new features. Alternatively, accessors will need to be provided to
manipulate the SDP on behalf of the JavaScript (and if so, then why
not move to an object model straight away and do away with SDP?).
2.6. Is SDP allowed to be mangled?
The choice must be made if SDP may be modified or not. If
modifications are the only way to achieve RTC features available then
what is allowed to be modified must be clearly defined in exact
detail and the expected behavior of each feature (and modification of
each feature), as expressed in SDP, must be defined. Anything short
of exact specifications will cause incompatibility. Again, the
implication is that Web / JavaScript developers must learn SDP to
utilize the available RTC features and they must learn the rules of
modification equally well, which virtually do not exist at all today.
If the choice is to not allow complete SDP modification at all, then
the protocol becomes extremely tied to SDP based protocols like SIP.
Yet, there is no mandate for SIP to be the standardized protocol in
WebRTC. In fact, the mandate to require SIP was explicitly denied,
which presents the argument that SDP manipulation must be allowed.
The SDP mangling issue isn't just an issue when the format is sent
on-the-wire. If Browser A sends Browser B an SDP, the current
philosophy is that the SDP is allowed to be modified. However, there
is the possibility of modifying the SDP generated by Browser A and
Raymond, et al. Expires February 13, 2014 [Page 10]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
giving that modified SDP back to Browser A to change it's behavior
(i.e. a serialized text based API call) before the offer is given to
Browser B (and likewise with Browser B when it responds with its SDP
answer).
How much of the SDP is allowed to be modified before giving the SDP
back to the local browser? SDP is a free-form format so anything can
theoretically get changed, but should it be allowed? If not, what
can and cannot be modified? CODECS? SSRC? SDES? Fingerprints?
Transports? M-lines? And so on...
This issue becomes further compounded when extensions are factored in
as well.
2.7. SDP errata and bugs compatibility issues
With the SDP baked into the browser binary, the only way SDP
compatibility issues can be fixed is by releasing a new browser
update, and the JavaScript developers must support or work around
flaws until the browser vendors deliver the fix and the user base
upgrades their browsers.
While it could be argued that any bug must be worked around, SDP is a
unique problem. SDP is a free-form format. Being compatible isn't
as easy as implementing a limited wire protocol for media transport
or a API contract with well defined features and attributes. The
likelihood of free-form SDP containing errors is far greater than a
typical well defined API due to SDPs many flavors, interpretations
and lack of strong definition.
2.7.1. SDP Bugs Become Enshrined
To illustrate a scenario:
1. Browser Vendor A has a bug
2. Browser Vendor B can't work with A because of the bug so it
implements a "work around"
3. Browser Vendor A fixes the bug but implements a work around to be
compatible with Browser Vendor B's "work around"
This situation demonstrates is how browser bugs can become enshrined
as there's no way to update the SDP produced by the browser binary
once it's released until the next update release cycle occurs. This
would not be true if JavaScript was used via a shim to produce SDP as
JavaScript can be dynamically updated as needed at any time and a
service provider can choose to update their JavaScript implementation
Raymond, et al. Expires February 13, 2014 [Page 11]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
to exacting expectations for their network regardless of the browser
version.
The lower level RTC wire protocols that need to be mandated by the
RTCWEB Working Group have limited scopes and well defined behaviors.
Any mistakes are obvious, likely to present very rapidly, and easy to
spot which party is doing something wrong and much easier to fix
earlier as a result. This is not true with a free form highly
descriptive language for sessions. The combinations are limitless
and every scenario is difficult to test, especially in concert with
every other browser vendor with every version released. The session
description will be the likely place of failure across the browsers
when the session description is generated inside the browser's
binary.
2.8. SIP/SDP compatibility worsened
One of the main arguments for using SDP with offer / answer was
supposed to be ease of compatibility with existing signaling
networks, like SIP. Instead, variations in the browser's SDP will
likely worsen SIP compatibility instead of enhance it.
A SIP provider must now be compatible with every browser's SDP on
every platform and version and the browser's SDP must be compatible
with every SDP from a SIP network. Alternatively, JavaScript or SBCs
(Session Border Controller) must be used to re-write any incompatible
SDP to be compatible. However, this moves the problem from the
browser to JavaScript, or requires SBCs to "fix" the problem.
Had SDP been entirely generated by JavaScript rather than come from
the browser engine, the JavaScript could create only SDPs compatible
with a particular SIP provider under control of their own JavaScript
and the SIP provider could chose which JavaScript SDP parsing /
generation code to run, for maximum compatibility.
2.9. Increased surface API
By mandating SDP, the requirement for compatibility with WebRTC is
increased substantially with little benefit. Instead of just
supporting basic media RTP [RFC3550], STUN/ICE/TURN [RFC5389]/
[RFC5245]/[RFC5766], DTLS [RFC6347] and CODECS an additional bar must
be passed, i.e. a browser or other WebRTC compliant API must support
SDP with a full offer / answer state machine (or a state machine with
additional rules to make it flexible for various scenarios).
With an alternative approach, the entire requirement for SDP could be
removed without any loss of compatibility or increase in complexity
while achieving greater compatibility via the JavaScript shim.
Raymond, et al. Expires February 13, 2014 [Page 12]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
2.10. Impossible API to implement to achieve browser compatibility
The current mandated SDP based API cannot be implemented as a
standard by independent browser vendors in its current form. A list
of subsequent behaviors regarding the usage, parsing, handling,
extensions, behaviors, constraints and other such reference documents
must be meticulously defined for SDP with the modified offer / answer
state machine or no browser can ever claim to be "compliant". The
current definition process is far from complete.
The current WebRTC SDP based API is far from achieving that goal due
to the inclusion of free-form SDP with offer / answer and it is
grounds for removing it as it goes beyond the RTCWEB's charter and
limited scope.
Any incremental approach that does not remove the offer / answer
model requirement yields a road block to achieving alternative WebRTC
signaling protocols other than SIP.
An alternative WebRTC JavaScript object model approach that does not
require an all-encompassing session description and related state
machine is being proposed as an alternative solution so the RTCWEB
charter can complete its defined goals in a timely fashion.
2.10.1. Example Oddities That Need Definition
There are many oddities in the SDP RFC [RFC4566] and the various
related extensions.
For example; will RTP CODEC maps be required or not? They are not
required for basic CODECs according to the SDP RFC. However, with
all the flavors of CODECs being offered, defining a mapping between
payloads is critical to compatibility and not just a good idea.
Another example; should "t=0 0" be respected? Is that allowed to be
changed? Do the browser vendors need to enforce the attribute, or
should the JavaScript layer enforce it? Should the streams wait to
start until the NTP time stamp and close when the NTP time completes?
These are just small samples of questions that must all be completely
addressed in detail. This could also cause a cascade of updated
reference drafts and confusion as to which version is to be adhered
by browsers as well as what each browser specifically supports.
Nominally referencing the SDP RFC will not be sufficient, and deltas
from the established standards when violated will need to be defined
when the rules change.
Raymond, et al. Expires February 13, 2014 [Page 13]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
2.11. Plan A, Plan B vs NoPlan
At the time of authoring this document, three plans on how to handle
large number of media streams in SDP have emerged currently under
consideration from the IETF, referred to as PlanA
[I-D.roach-rtcweb-plan-a], PlanB [I-D.uberti-rtcweb-plan] and NoPlan
[I-D.ivov-rtcweb-noplan].
PlanA and PlanB acknowledge that using SDP as it is historically
defined in SIP is inefficient and problematic for large number of
media streams, especially factoring in that each media line must have
its own unique ports.
NoPlan allows for media to be described in a more JavaScript friendly
way and goes a long way towards improving the situation from SDP by
taking out the mapping of the streams from the SDP but does not
remove the reliance upon SDP. This creates a dual format system
where some information is initially carried over SDP and other
information is signaled through an alternative approach (including
the possibility of SDP offer/answer). NoPlan could have been the
sufficient approach if it took one step further and removed SDP
entirely.
PlanA, PlanB and NoPlan are a perfect example of why not to use SDP
as the basis for WebRTC. SDP has some arbitrary limitations as a
description protocol for multiple streams whereas no such limitations
exist at the lower layer transports themselves. RTP allows for
multiplexing multiple SSRCs. In other words, the problem is SDP, not
the real time transportation technologies.
These drafts illustrate the limitations of SDP and attempt to solve
it by introducing even more complex descriptions around SDP and / or
by "relaxation" of the offer answer model combined with altering the
description language of SDP.
None of these drafts address most of the concerns outlined in this
draft. If anything, they further illustrate how divergent the SDP
will become as more and more effort is put into working around
problems inherent to the nature of utilizing SDP (or any universal
format).
The issue that SDP implementers face should be isolated to those who
require SDP for their signaling protocols (namely SIP) where they can
choose the best practices for their networks for interoperability.
These complex approaches do not have to be forced on other signaling
protocols that do not have or require such limitations.
Raymond, et al. Expires February 13, 2014 [Page 14]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
Certainly JavaScript programmers and the W3C should not be impacted
by such limitations by introducing SDP (or any universal format) into
the mix when it adds zero value and fails in its primary objectives,
namely: interoperability with existing SIP vendors & networks.
This further illustrates why SDP baked into the browser binary is not
beneficial for SIP vendors either. They will be forced to upgrade
their SIP infrastructure to support SDP packets from browsers with
these kinds of extensions or be forced to utilize a JavaScript SDP
re-write of SDP approach to "fix" these incompatibilities.
With an object approach, newer signaling protocols could describe
multiple media streams with ease and SIP providers could ensure they
only generate compatible SDP with their networks and agree on their
best practices and launch new features that incorporate approaches
like as PlanA, PlanB or NoPlan in a manner they deem fit rather then
when the browser vendors decide to upgrade the SDP arbitrarily.
2.12. SIP Forking Issue
The current SDP based API model does not allow for SIP parallel
forking even though the RTC engine can allow for demuxing a media
stream. The current model does not allow for one offer to be
transmitted but accepts multiple answers, which is legal in SIP. A
complex UPDATE process is described on how to work around the problem
instead of fixing the original problem, i.e. the state machine being
required.
A WebRTC JavaScript object model is designed to easily allow forking
but does not care if an upper shim supports SDP / SIP style forking
in the negotiation or not, so long as the basic rules of the RTC
media engine is respected.
3. Alternatives to Fixing these Issues Now
3.1. Waiting for WebRTC 2.0
If we don't get WebRTC 1.0 correct, fixing the API in WebRTC 2.0 may
become even more difficult.
At this stage, prototypes are underway but to our knowledge there are
no major commercial services deployed by more that one major vendor
using the current WebRTC API. Yet, the argument to even consider an
alternative is that 'it's too late'. Imagine trying to argue fixing
it after major networks are reliant upon specific browser
implementation. Having a good but simple architecture from the start
could alleviate a lot of pressure to fix a broken 1.0 in a 2.0
release before APIs become entrenched.
Raymond, et al. Expires February 13, 2014 [Page 15]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
3.1.1. Cost now to fix versus fixing later
The cost of fixing the API issues today may pale in comparison to the
cost of compatibility problems spread across entire sets of
industries where constant fixes and work around may be required.
3.1.2. If starting over, would even SIP people want SDP as a surface
API?
Even SIP providers and vendors have started to realize that baking
SDP into the browser is not necessarily in their best interests, but
they do have an interest in a simple API to use since they aren't
specialized JavaScript developers but SIP integrators.
If an alternative approach provides SIP providers a simple JavaScript
API shim they desire and achieves greater interoperability because of
predictable, controllable and tailored SDP for their network, would
they not prefer such a model over the current "baked in the browser"
approach?
If the current WebRTC specification was ever rebooted, the current
mandated SDP based API would undoubtedly be scrapped in favor of a
better approach without its inherent design and use case flaws with
negative long term compatibility consequences.
3.1.3. Incremental Approach may make Compatibility Worse
One argument put forward, to keep the current SDP model, proposes the
current WebRTC SDP-based API must be completed soon and an
incremental improvement approach can be used to gradually move away
from these obvious problems.
The trouble with an incremental approach is that it may increase
incompatibility further. Not all browser vendors will match the
incremental improvements in unison nor will all customers upgrade
simultaneously. This puts the onus on JavaScript developers to
support multiple versions of the WebRTC API and increase the number
of APIs they must learn and maintain. The JavaScript developers must
still perform all the workarounds required for the current API even
if they support the increments. This limits their willingness to use
any additional APIs until all browsers universally support the
incremental improvements. This will likely slow innovation and
adoption of future improvements.
This will likely create a situation where browser vendors cannot
easily achieve compliance because they too must support the existing
API and incremental improvements along the way, or break those
reliant upon the current methods.
Raymond, et al. Expires February 13, 2014 [Page 16]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
Having a good solid simple foundation is key to ensuring basic
compatibility while allowing for innovation to occur for those
developers who are willing to give new APIs a trial without needing
to support multiple sets of equivalent but incompatible APIs
simultaneously.
3.2. Session Description Format Construction API
An alternative JavaScript model has in the past been floated around,
other than the model advocated in this draft. That model creates a
JavaScript session description format construction API in the
browser. Such an API would use JavaScript objects to construct the
session description format rather than allowing direct control of how
media should be plumbed together from JavaScript.
While using SDP as the chosen format for WebRTC highlights the issues
described in this draft particularly well, using an alternative
format like JSON instead of SDP does not remove many of the issues
presented in this draft. The issues expressed are not solely caused
by the lack of expressiveness of the SDP format but the nature of
creating a universal all-encompassing format to describe all
transport, media, constraints, and negotiations with an attached
inflexible state machine is the nature of the issue. This format
must do everything and encompass all concepts and becomes the
effective mandate for signaling even if not explicitly required to
perform signaling.
A few years ago there was an attempt to create a new "SDP 2.0" format
with a draft named Session Description and Capability Negotiation
[I-D.ietf-mmusic-sdpng]. This effort to create the "ultimate" SDP
format in XML was ultimately abandoned, in no small part because of
the difficulties in coming up with a single solution that works for
all scenarios.
Given the difficulty in creating a universal all-encompassing format
that works for all scenarios, the idea that creating a JavaScript
based API that constructs a similar flexible, but well defined
universal session description format using JavaScript objects is
highly suspect to fail equally. The reality is that such an effort
is complex.
Even if successful, this format is not necessarily the format that
will be sent on-the-wire, especially for existing alternative
signaling protocols. As such, the format will still need to be
transformed into alternative formats by JavaScript (or by a gateway).
If the format must be parsed or interpreted by an intermediate then
the format becomes an interaction point to the browser no matter how
clever the JavaScript session description construction API
Raymond, et al. Expires February 13, 2014 [Page 17]
Internet-Draft WebRTC JavaScript Object API Rationale August 2013
implementation. Whatever format is selected, each browser or
alternative protocol format will have to decide how to convert and
interpret the output and generate new compatible inputs and deal with
the variations that will undoubtedly arrive from browser to browser
and from version to version.
Even if JavaScript APIs are made available to simplify the
construction or interpretation of a defined format, this format would
still become a do-everything serialization access point for the
browser and the defined exchange point for the local and remote
browser. Therefore the format itself must be described in meticulous
detail.
The standardization requirements for such an approach would increase
substantially over the WebRTC JavaScript object model advocated by
this draft since not only would such a JavaScript format construction
API have to be standardized (as any JavaScript Model would) but the
formatting rules and state machine it relies upon needs to become
standardized in detail as well.
Every combination of this all-encompassing format would need to be
outlined, rather than minimal definition of fixed properties needed
on a scoped objects as used in the WebRTC JavaScript Object Model.
Any slight variations would likely cause JavaScript developers or
other browsers to break their implementations. Obtaining 100%
stability in such an output equally across all browsers, on all
platforms with all versions is highly doubtful.
While a JavaScript format construction API is merely hypothetical at
the time of writing this draft, any proposal will need to be vetted
to see if it addresses all the concerns and issues brought up in this
draft.
This hypothetical JavaScript session description construction API
still puts the emphasis in driving the developer towards building up
a media signaling exchange format rather than in the logic of how the
media should be controlled and pipelined.
The WebRTC JavaScript object model is being proposed as the
alternative. In a follow-up to this draft the model will describe
how the JavaScript developer gains control over the stream's
pipelining for the browser's media/RTC engine and thus free the
JavaScript developer to express signaling and state machines using
whatever mechanism desired. A simplified shim implemented entirely