WebAPI/PresentationAPI:Protocol Draft: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Architecture: add details for each components)
(add sequence diagram)
Line 43: Line 43:


== Protocol Details ==
== Protocol Details ==
=== Launch ===
=== Service Discovery ===
[[File:Draft Protocol Service Discovery.png]]
=== Device Pairing ===
=== Establish Control Channel ===
=== Start Presentation  ===
* STEP 1: find device (mDNS/DNS-SD: _presentation-ctrl._tcp)
* STEP 1: find device (mDNS/DNS-SD: _presentation-ctrl._tcp)
** STEP 1a: query device capability (send query message: supported media type, supported URL format)
** STEP 1a: query device capability (send query message: supported media type, supported URL format)
Line 52: Line 56:
** STEP 4a: establish DataChannel via SDP
** STEP 4a: establish DataChannel via SDP
* STEP 5: close control channel (send close message: )
* STEP 5: close control channel (send close message: )
 
[[File:Draft Protocol Start Presentation.png]]
=== Terminate ===
=== Establish Data Channel ===
[[File:Draft Protocol Establish Data Channel.png]]
=== Terminate Presentation ===
* STEP 1: setup control channel to remote device (send connect message: auth token)
* STEP 1: setup control channel to remote device (send connect message: auth token)
** STEP 1a: complete challenge with stored information
** STEP 1a: complete challenge with stored information
* STEP 2: terminate app / page via session Id (send terminate message: session Id)
* STEP 2: terminate app / page via session Id (send terminate message: session Id)
* STEP 3: close control channel (send close message: )
* STEP 3: close control channel (send close message: )
 
[[File:Draft Protocol Terminate Presentation.png]]
=== Reconnect ===
=== Close Connection ===
[[File:Draft Protocol Close Connection.png]]
=== Resume Connection ===
* STEP 1: setup control channel to remote device (send connect message: auth token)
* STEP 1: setup control channel to remote device (send connect message: auth token)
** STEP 1a: complete challenge with stored information
** STEP 1a: complete challenge with stored information
Line 66: Line 74:
** STEP 3a: establish DataChannel via SDP
** STEP 3a: establish DataChannel via SDP
* STEP 4: close control channel (send close message: )
* STEP 4: close control channel (send close message: )
[[File:Draft Protocol Resume Connection.png]]


== References ==
== References ==
* [https://github.com/w3c/presentation-api/blob/gh-pages/interoperability.md Protocol suggestion by Second Screen WG]
* [https://github.com/w3c/presentation-api/blob/gh-pages/interoperability.md Protocol suggestion by Second Screen WG]
* [https://github.com/mfoltzgoogle/freeplay/blob/master/architecture.md Architecture proposed by Google]
* [https://github.com/mfoltzgoogle/freeplay/blob/master/architecture.md Architecture proposed by Google]

Revision as of 08:51, 1 April 2016

This is a draft of protocol proposal for 2-UAs Presentation Scenario

Requirement

  • Device Discovery
    • Device information: unique name, user-friendly name, address for ctrl server
    • Device capability: resolution, supported media type, supported apps, supported IO capability
    • Protocol information: protocol version
  • Service Launching
    • Service information: app/page URL
    • Session information: session Id, bootstrap info for communication
    • Controlling message: launch, reconnect, terminate
    • User settings: preferred locale
  • Communication
    • establish dedicate transportation channel
  • Security
    • device challenge: OOB channel, passkey
    • data encryption: key derived from challenge, key exchange for communication channel

Architecture

Here is the high-level architecture overview of 2-UAs protocol

Architecture overview of 2-UAs Protocol

PresentationControlClient

  • query for available PresentationControlServer
  • query device capability for device filtering
  • initiate connection to server
  • trigger session creation / reconnection / termination
  • reply to device challenge during pairing procedure

PresentationControlServer

  • register as an service profile on mDNS
  • handle session creation / reconnection / termination
  • generate device challenge for pairing procedure

mDNS Registration

  • mDNS stack that supports service registration over mDNS protocol

mDNS Query

  • mDNS stack that supports service query over mDNS protocol

WebRTC

  • WebRTC stack that provides Data Channel implementation
  • Generate SDP for exchanging offer/answer over presentation control protocol

Browser UI

  • display pairing information
  • display sender / receiver page

Protocol Details

Service Discovery

Draft Protocol Service Discovery.png

Device Pairing

Establish Control Channel

Start Presentation

  • STEP 1: find device (mDNS/DNS-SD: _presentation-ctrl._tcp)
    • STEP 1a: query device capability (send query message: supported media type, supported URL format)
  • STEP 2: setup control channel to remote device (send connect message: device name, protocol version, supported challenge method)
    • STEP 2a: device challenge / device pairing (send challenge message: ) (send resolve message: ) (send auth message: encrypted auth token)
  • STEP 3: launch app / page (send launch message: url, session Id)
  • STEP 4: setup communication channel (send offer message: SDP for DataChannel) (send answer message: SDP for DataChannel)
    • STEP 4a: establish DataChannel via SDP
  • STEP 5: close control channel (send close message: )

Draft Protocol Start Presentation.png

Establish Data Channel

Draft Protocol Establish Data Channel.png

Terminate Presentation

  • STEP 1: setup control channel to remote device (send connect message: auth token)
    • STEP 1a: complete challenge with stored information
  • STEP 2: terminate app / page via session Id (send terminate message: session Id)
  • STEP 3: close control channel (send close message: )

Draft Protocol Terminate Presentation.png

Close Connection

Draft Protocol Close Connection.png

Resume Connection

  • STEP 1: setup control channel to remote device (send connect message: auth token)
    • STEP 1a: complete challenge with stored information
  • STEP 2: reconnect app / page via session Id (send reconnect message: session Id)
  • STEP 3: setup communication channel (send offer message: SDP for DataChannel) (send answer message: SDP for DataChannel)
    • STEP 3a: establish DataChannel via SDP
  • STEP 4: close control channel (send close message: )

Draft Protocol Resume Connection.png

References