ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Real time
communication using
webRTC
hello!
maty21@gmail.com
https://github.com/maty21
https://www.linkedin.com/in/maty-zisserman-a61a6ba8/
2
Agenada
- Introduction (History)
- Signalling communication
- STUN ,TURN, ICE
- Communication patterns
- Code
3
1.
INTRODUCTION
4
WebRTC - D?
Web
Real-Time
Communication
Direct
5
SAMPLE
6
7
Why it useful?
why
- Conference/broadcast
- autonomous cars monitoring
- MMO Games
- Drone navigation
8
Features
- The only native api for creating real time communication
over the browser
- Cross platform support (Browsers,mobile, desktop )
- Encrypted by definition
- P2P communication
9
History and background
10
2007
Voip Buzz
HTML5
2008
VP8
2011
Skype acquisition
WebRTC (initial release)
2013
NPAPI
deprecation
2010
Flash is dead
WebRTC
11
Client
Direct Real-Time Communication
Server
Client
Connect (A)
Ping (Sent)PIng (Received)
Connect (B)
Websocket
WebRTC
12
Client
Direct Real-Time Communication
Signalling
Client
Request For Getting
Video with some query
(A)
Response For
Sending a video
Video to A
WebRTC
Negotiation Negotiation
Direct P2P Communication
WebRTC
13
Direct Real-Time Communication
- No Server involves after Communication
Established
- UDP based *
* tcp allowed in chrome
Core Components
14
Media Stream
- Communication with Hardware
video and audio devices
RTCPeerConnection
- ICE processing
- Codec Handling
- P2P Communication
- Security
RTCDataChannel
- P2P Data Communication
- Ultra low latency
- Secure
- Can be reliable or unreliable
What is the negotiations
thingy all about ?
15
16
2. Signalling Communication
Signalling Communication
17
Alice BobSignalling
getUserMedia()
addStream()
createOffer()
setLocalDescription()
setRemoteDescription()
getUserMedia()
addStream()
createOffer()
setLocalDescription()
*send Receive mode
¡°Offer¡±SDP offer
¡°Answer¡±
SDP answer
SetRemoteDescription()
IceCandidateGathering
Send candidate ¡°Candidate¡±
addIceCandidate()
IceCandidateGathering
¡°Candidate¡±
Send candidate
addIceCandidate()
¡°Addsteram¡± event fired
¡°Addsteram¡± event fired
Watching video
Watching video
SDP Protocol
18
v=0
o=- 487255629242026503 2 IN IP4 127.0.0.1
a=group:BUNDLE audio video
General data
- Session id
- Type of channels
m=audio 9 RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:8a1/LJqQMzBmYtes
a=rtpmap:126 telephone-event/8000
a=fingerprint:sha-256
28:4C:19:10:97:56:FB:22:57:9E:5A:88:28:F3:04:
DF:37:D0:7D:55:C3:D1:59:B0:B2:81 :FB:9D:DF:CB:15:A8
a=mid:audio
a=sendrecv
Audio Data
- Dtls Channel fingerprint
- Support decoders
- Type (sendrecv)
a=rtcp-mux
m=video 9 RTP/SAVPF 100 116 117 96
c=IN IP4 0.0.0.0
a=rtpmap:100 VP8/90000
a=fingerprint:sha-256 28:4C:19:10:97:56:FB:22:57:9E:5A:88:28:F3:04:
DF:37:D0:7D:55:C3:D1:59:B0:B2:81 :FB:9D:DF:CB:15:A8
a=setup:actpass
a=mid:video
a=sendrecv
a=rtcp-mux
VideoData
- Dtls Channel fingerprint
- Support decoders
- Type (sendrecv)
* more Details - https://webrtchacks.com/sdp-anatomy/
3.
STUN TURN and ICE
19
20
Alice
10.0.0.1
Bob
10.0.0.1
Asymmetric
NATAsymmetric
NAT
Signalling
Stun
STUN A STUN B
Who Am I ?
Who Am I ?
209.140.50.43:54323 220.140.32.12:12452
Negotiation Negotiation
10.0.0.1
10.0.0.1
209.140.50.43:54323
220.140.32.12:12452
21
Alice
10.0.0.1
Bob
10.0.0.1
symmetric
NATsymmetric
NAT
Signalling
Turn
STUN A
Who Am I ?
209.140.50.43:54323
Negotiation Negotiation
10.0.0.1
10.0.0.1
209.140.50.43 220.140.32.12
STUN A
209.140.50.43:123456
I have symmetric
nat need TURN
Who Am I ?
220.140.32.12:32465 220.140.32.12:27643
I have symmetric
nat need TURN
STUN B STUN B
Turn
22
ICE ?
23
ICE & Trickle ICE
- Investigate what is the best way to transport the
data via those criteria:
- Same Vlan
- STUN
- TURN
24
4. Network Topology
Communication types
25
P2P Broadcast Conference
Network Topologies
26
Full Mesh MCUSFUPartial Mesh
27
Network Topologies
Full Mesh MCU SFUPartial Mesh
Scalability
Simplicity
Latency
Hardware
Good For
*
**
P2P Broadcast Conference *** Conference
* for conference it¡¯s not scalable
** Depends on hops amount
*** For ¡°dumb¡± clients
28
5. CODE
29
Caller
30
Caller
31
Caller
32
Callee
33
Callee
34
Callee
35
Signalling
36
Useful links
- My code : https://github.com/maty21/webrtcSample/
- Guides:
- https://webrtc.org/
- https://webrtchacks.com/
- https://webrtcglossary.com/
- https://www.webrtc-experiment.com/
- turn : https://github.com/coturn/coturn
- SFU: http://www.kurento.org/
- STUN & TURN public list: https://gist.github.com/yetithefoot/7592580
-
thanks!
Any questions?
You can find me at:
maty21@gmail.com
https://github.com/maty21
https://www.linkedin.com/in/maty-zisserman-a61a6ba8/
37

More Related Content

Real Time communication using WebRTC