WebAPI/PresentationAPI:Protocol Draft: Difference between revisions

→‎Requirement: add data integrity
m (→‎Terminate Presentation: update description)
(→‎Requirement: add data integrity)
 
(11 intermediate revisions by the same user not shown)
Line 9: Line 9:
** Service information: app/page URL
** Service information: app/page URL
** Session information: session Id, bootstrap info for communication
** Session information: session Id, bootstrap info for communication
** Controlling message: launch, reconnect, terminate
** Controlling message: connect, disconnect, launch, close, reconnect, terminate
** User settings: preferred locale
** User settings: preferred locale
* Communication
* Communication
** establish dedicate transportation channel
** establish dedicate transportation channel
* Security
* Security
** device challenge: OOB channel, passkey
** device authentication: passcode verification + j-PAKE procedure
** data encryption: key derived from challenge, key exchange for communication channel
** data encryption: TLS for ctrl channel, DTLS for communication channel
** data integrity: provide HMAC for each ctrl message (except for query)


== Architecture ==
== Architecture ==
Line 76: Line 77:


=== Establish Control Channel ===
=== Establish Control Channel ===
Simply establish a TCP socket to the service port received during service discovery
* server generates a self-signed certificate
* client establishes a TLS socket to the service port received during service discovery.
 
=== Close Control Channel ===
* STEP 1: send disconnect command with reason to remote device
* STEP 2: close TCP socket
[[File:Draft Protocol Close Control Channel.png]]


=== Start Presentation  ===
=== Start Presentation  ===
* STEP 1: find device (mDNS/DNS-SD: _presentation-ctrl._tcp)
* STEP 1: controlling page initiate presentation via request.start()
** STEP 1a: query device capability (send query message: supported media type, supported URL format)
* STEP 1a: controlling user agent initiate device selection
* STEP 2: setup control channel to remote device (send connect message: device name, protocol version, supported challenge method)
* STEP 2: setup control channel to server
** STEP 2a: device challenge / device pairing (send challenge message: ) (send resolve message: ) (send auth message: encrypted auth token)
* STEP 3: send connect command with device name, protocol version, supported challenge method
* STEP 3: launch app / page (send launch message: url, session Id)
** STEP 3a: server initiate device challenge / device pairing procedure
* STEP 4: setup communication channel (send offer message: SDP for DataChannel) (send answer message: SDP for DataChannel)
* STEP 3: client send launch command with url, presentation Id (launch command should be encrypted and carried by encrypted-ctrl-msg)
** STEP 4a: establish DataChannel via SDP
* STEP 4: server launch corresponding presented content and send launch-ack command
* STEP 5: close control channel (send close message: )
* STEP 5: client setup communication channel via data channel establishment procedure
* STEP 6: client close control channel
[[File:Draft Protocol Start Presentation.png]]
[[File:Draft Protocol Start Presentation.png]]
=== Establish Data Channel ===
=== Establish Data Channel ===
* STEP 1: client creates data channel and generates SDP as offer
* STEP 1: client creates data channel and generates SDP as offer
Line 100: Line 109:


=== Terminate Presentation ===
=== Terminate Presentation ===
* STEP 1: setup control channel to server
* STEP 1: controlling page initiate presentation termination via connection.terminate()
* STEP 2: send terminate command with presentation Id (terminate command should be encrypted and carried in encrypted-ctrl-msg command)
* STEP 2: setup control channel to server
* STEP 3: receiving user agent close the presented content and close data channel
* STEP 3: send terminate command with presentation Id (terminate command should be encrypted and carried in encrypted-ctrl-msg command)
* STEP 3a: server send terminate-ack to client
* STEP 4: receiving user agent close the presented content and close data channel
* STEP 4: client close control channel and notify onterminate event to controlling page
* STEP 5: server send terminate-ack to client (terminate-ack command should be encrypted and carried in encrypted-ctrl-msg command)
* STEP 6: client close control channel and notify onterminate event to controlling page
[[File:Draft Protocol Terminate Presentation.png]]
[[File:Draft Protocol Terminate Presentation.png]]


=== Close Connection ===
=== Close Connection ===
* STEP 1: controlling page or presented content initiate connection.close()
* STEP 1: controlling page initiate connection.close()
* STEP 2: sending close command to remote device, with closeReason = "closed"
* STEP 2: sending close command to server, with closeReason = "closed"
* STEP 3: close data channel while receiving close command (close command should be encrypted and carry in encrypted-ctrl-msg command)
* STEP 3: close data channel while receiving close command (close command should be encrypted and carry in encrypted-ctrl-msg command)
* STEP 4: notify onclose event to both controlling page and presented content
* STEP 4: notify onclose event to both controlling page and presented content
Line 115: Line 125:


=== Resume Connection ===
=== Resume Connection ===
* STEP 1: setup control channel to remote device
* STEP 1: controlling page initiate connection resumption via request.reconnect();
** STEP 1a: complete challenge with stored information
* STEP 2: setup control channel to server
* STEP 2: reconnect app / page via session Id (send reconnect message: session Id) (reconnect message should be encrypted and carried in encrypted-ctrl-msg)
* STEP 3: send reconnect command with presentation Id (reconnect command should be encrypted and carried in encrypted-ctrl-msg)
* STEP 3: setup communication channel following the Data Channel establish procedure
* STEP 4: setup communication channel following the Data Channel establish procedure
* STEP 4: close control channel
* STEP 5: close control channel
[[File:Draft Protocol Resume Connection.png]]
[[File:Draft Protocol Resume Connection.png]]


Confirmed users
216

edits