Sequence chart script provided by http://www.websequencediagrams.com


Architectural Overview

This page describes architectural approaches to support of connectionless Push for HTML5's Server-Sent Events API. It covers approaches possible today using standardized bearers and protocols, e.g. SMS and OMA Push as is currently widely deployed and supported on most mobile phones.

Connectionless Push refers to the delivery of server-initiated events without an established user-plane IP bearer, by leveraging signaling networks as the bearer, e.g. in the current examples:

The following named entities are referred to:

These entities are illustrated in the conceptual device and service architecture shown below:


Server-Sent Events Basic Operation

Taking the example in Server-Sent Events as a base, an event stream as below, followed by a blank line:

	data: YHOO
	data: +2
	data: 10

...would cause an event message with the interface MessageEvent to be dispatched on the EventSource object. The event's data attribute would contain the string YHOO\n+2\n10 (where \n represents a newline). This could be used as follows:

		
	var stocks = new EventSource("http://stocks.example.com/ticker.php");
	stocks.onmessage = function (event) {
		var data = event.data.split('\n');
		updateStocks(data[0], data[1], data[2]);
	};
	function updateStocks(symbol, delta, value) { ... }
participant "Server\nApplication" as SA
participant "User Agent" as UA
participant "Client\nApplication" as CA

CA->UA: 1) Call EventSource(url)
UA->SA: 2) Open connection
SA->UA: 3) Deliver event stream\ndata: YHOO\ndata: +2\ndata: 10\n(blank line)
UA->CA: 4) Deliver event stream\n through onmessage method\n(YHOO 2 10) 
CA->UA: 5) Call close() on\nEventSource object
UA->SA: 6) Close connection

Server-Sent Events Fallback to Connectionless Delivery over WAP Push/SMS

This example shows use of a Push Server which is not involved in server-sent event delivery until needed, to deliver connectionless events. In this example:

participant "Server\nApplication" as SA
participant "Push Server" as PS
participant "Short Message\nService Center" as SMSC
participant "User Agent" as UA
participant "Client\nApplication" as CA

CA->UA: 1) Create new EventSource\n("http://example.com")
UA->SA: 2) Open connection
SA->UA: 3) Deliver event stream
UA->CA: 4) Deliver event stream\nas it is received
note over CA
 The Webapp decides
 to switch to
 connectionless event
 delivery.
end note
CA->UA: 5) Call close() on\nEventSource object
UA->SA: 6) Close connection
CA->UA: 7) Create new EventSource\n("urn:oma:xml:push")
note over UA
 User Agent opens
 OMA Push event
 reception.
end note
note over SA
 A new event stream is 
 ready for delivery.
end note
SA->PS: 8) PushREST:Push_Message\n(event stream)
PS->SMSC: 9) SMPP:SM_SUBMIT\n(event stream\nin Push-OTA message)
SMSC->UA: 10) Deliver SMS\n(event stream\nin Push-OTA message)
UA->CA: 11) Deliver event stream

Server-Sent Events Access via Push Proxy with Fallback to Connectionless Delivery over WAP Push/SMS

This example shows use of a Push Server which acts as a proxy and has context-aware bearer/protocol selection capabilities (ala an OMA Push Proxy Gateway). In this example:

participant "Server\nApplication" as SA
participant "Push Server" as PS
participant "Short Message\nService Center" as SMSC
participant "User Agent" as UA
participant "Client\nApplication" as CA

CA->UA: 1) Create new EventSource\n("http://esproxy.com?eventsource=\nhttp%3A%2F%2Fexample.com")
UA->PS: 2) Open connection (as proxy)
PS->SA: 3) Open connection
CA->UA: 4) Create new EventSource\n("urn:oma:xml:push")
note over UA
 User Agent opens
 OMA Push event
 reception.
end note
note over CA
 Webapp activates fallback
 option for eventsource 
 delivery via OMA Push
end note
CA->PS: 5) GET http://esproxy.com?action=activatePush&eventsource=http%3A%2F%2Fexample.com
SA->PS: 6) Deliver event stream
PS->UA: 7) Deliver event stream
UA->CA: 8) Deliver event stream\nas it is received
note over CA
 The Webapp decides
 to switch to
 connectionless event
 delivery.
end note
CA->UA: 9) Call close() on normal\nEventSource object
UA->PS: 10) Close connection
note over PS
 Push Server retains
 the connection to the
 eventsource server until
 explicitly told to drop
 all event delivery options
end note
note over SA
 A new event stream is 
 ready for delivery.
end note
SA->PS: 11) Deliver event stream 
PS->SMSC: 12) SMPP:SM_SUBMIT\n(event stream\nin Push-OTA message)
SMSC->UA: 13) Deliver SMS\n(event stream\nin Push-OTA message)
UA->CA: 14) Deliver event stream
note over CA
 The Webapp decides
 to terminate all 
 eventsource delivery.
end note
CA->PS: 15) GET http://esproxy.com?action=deactivatePush&eventsource=http%3A%2F%2Fexample.com
CA->UA: 16) Call close() on Push\nEventSource object
note over UA
 User Agent terminates
 OMA Push event
 reception.
end note