WebRTC

1. Mesh

        /---> Peer_1 <---\
        |        ˄       |
        ˅        |       ˅
      Peer_2 <---+---> Peer_3
        ˄        |       ˄
        |        ˅       |
        \---> Peer_4 <---/
  • For just a few participants. Each peer has N-1 uplinks and N-1 downlinks.

1.1 P2P

1.1.1 LAN

              Signaling
         |---  server  ---|
        TCP              TCP
         |                |
       (NAT)            (NAT)
      Peer_1 ---SRTP--- Peer_2
  • They communicate with their local IP:Port

Procedure

  1. The peers negotiate a connection setup via the Signaling server.
  2. The peers trying to setup an SRTP connection to each other.

1.1.2 WAN

              Signaling
         |---  server  ---|
        TCP              TCP
         |                |
Peer_1 |NAT| ---SRTP--- |NAT| Peer_2
         |                |
        UDP              UDP
         |                |
       STUN             STUN
      server           server
  • They communicate with their public IP:Port
  • This works only with non symmetric NATs

Procedure

  1. The peers requesting from a STUN server their public IP:Port.
    This creates an entry in the NAT-table for later on.
  2. The peers negotiate a connection setup via the Signaling server.
  3. The peers trying to setup an SRTP connection to each other.
    This works based on the entry in the NAT-table.1

1 For Full Cone NATs it would also work without the NAT-table entry.

1.2 TURN

              Signaling
         |---  server  ---|
        TCP              TCP
         |                |
Peer_1 |NAT| ----||---- |NAT| Peer_2
         |       ||       |
        UDP     SRTP     UDP
         |       ||       |
       STUN     TURN    STUN
      server   server  server
  • This also works with symmetric NATs

Procedure

  1. The peers requesting from a STUN server their public IP:Port.
  2. The peers negotiate a connection setup via the Signaling server.
  3. The peers trying to setup an SRTP connection to each other. It fails.
  4. The peers connect to a TURN server1, which relays their SRTP connection.

1 A TURN server is an ICE candidate negotiated via the Signaling sever.


3 SFU

          Peer_1  Peer_2
           ↓↑↑↑    ↓↑↑↑
          |------------|
          |    SFU     |
          |------------|
           ↑↓↓↓    ↑↓↓↓
          Peer_3  Peer_4
  • For more then just a few participants. Each peer has 1 uplink and N-1 downlinks.

4 MCU

          Peer_1   Peer_2
            ⇅        ⇅
          |------------|
          |    MCU     |
          |------------|
            ⇅        ⇅
          Peer_3   Peer_4
  • For way more then just a few participants. Each peer has 1 uplink and 1 downlink.