Skip to content

Latest commit

 

History

History
172 lines (96 loc) · 4.37 KB

sdp.md

File metadata and controls

172 lines (96 loc) · 4.37 KB

WebRTC SDP Anatomy

Version (v=)

v=0

SDP version always set to 0 for now, not used.

Origin (o=)

o=- 4611731400430051336 2 IN IP4 127.0.0.1 o=<username> <sessID> <sessVersion> <netType> <addrType> <unicastAddress>

The username can be "-".

The sessID MUST be ignored on a receive.

The sessVersion MUST be a numeric value but the value MUST be ignored on a receive.

The netType MUST be "IN" for Internet.

The addrtype MUST be either "IP4" or "IP6".

the unicastAddress MUST be in "IP4" or "IP6" formatted following addrtype.

Session name (s=)

s=-

session name is not commonly used, not used.

Timing (t=)

t=0 0

Timing field, indicates the session is unbounded (start and stop times are both set to 0).

Attribute (a=)

BUNDLE attribute (a=group:BUNDLE)

a=group:BUNDLE 0

This attribute specifies that media lines are bundled together using a single transport (in this case, media line with the identifier '0').

a=group:BUNDLE m1 m2

This attribute specifies that media lines have 2 media line (identifiers as m1 and m2).

allows mixing attribute (a=extmap-allow-mixed)

a=extmap-allow-mixed

This attribute allows the use of both one-byte and two-byte RTP header extensions in the same RTP session.

the semantic for multiple media streams (a=msid-semantic:)

a=msid-semantic: WMS

This attribute specifies the semantic for multiple media streams (msid). WMS stands for WebRTC Media Stream.

Media (m=)

m=application 50782 UDP/DTLS/SCTP webrtc-datachannel

Media (m) line describes the media type (application), port (50782), transport protocol (UDP/DTLS/SCTP), and media format (webrtc-datachannel).

Media Connection information (c=)

c=IN IP4 115.87.239.220

Connection (c) line specifies the network type (IN for Internet), address type (IP4), and the connection address (115.87.239.220).

Media Attribute (a=)

ice candidates, ice username, ice password, ice options, fingerprint, DTLS role can be equals and reuse on every medias.

For example, if you have more multiple medias the difference is midia id and specific media attributes such as a=sctp-port: and a=max-message-size: that only have for application media type.

ICE Candidate (a=candidate:)

a=candidate:...

These attribute lines represent ICE (Interactive Connectivity Establishment) candidates, which provide information about possible network paths for establishing a connection between peers.

ICE Username (a=ice-ufrag:)

a=ice-ufrag:J8xg

This attribute specifies the ICE username fragment for this session.

ICE Password (a=ice-pwd:)

a=ice-pwd:brYDyKCXku2B1XTvqd2aJgg5

This attribute specifies the ICE password for this session.

ICE Option (a=ice-options:)

a=ice-options:trickle

This attribute specifies the ICE options for this session.

DTLS Fingerprint (a=fingerprint:)

a=fingerprint:sha-256 ...

This line contains the fingerprint of the DTLS (Datagram Transport Layer Security) certificate. It is used to authenticate the DTLS connection, ensuring the integrity and security of the data channel.

DTLS role (a=setup:)

for offer will be

a=setup:actpass

for answer will be

a=setup:active

Media identification (a=mid:)

a=mid:0

The media identification that specific in a=group:BUNDLE

SCTPPort (a=sctp-port:)

a=sctp-port:5000

For the Data Channel, This line indicates the SCTP (Stream Control Transmission Protocol) port used for the data channel. SCTP is the transport protocol used by WebRTC data channels.

Maximum message size (a=max-message-size:)

a=max-message-size:262144

For the Data Channel, The maximum message size in bytes that the endpoint can receive on the data channel.

References

https://webrtchacks.github.io/sdp-anatomy/

https://datatracker.ietf.org/doc/html/draft-roach-mmusic-unified-plan-00

https://datatracker.ietf.org/doc/html/draft-ietf-rtcweb-jsep-24

https://datatracker.ietf.org/doc/html/rfc3264

https://chromestatus.com/feature/5723303167655936