Sequence chart script provided by http://www.websequencediagrams.com
This page describes architectural approaches to support of connectionless Push for HTML5's Server-Sent Events API. It covers approaches possible today using standardized protocols, e.g. 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:
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
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) Call EventSource\n(Server Application url) UA->SA: 2) Open connection SA->UA: 3) Deliver event stream UA->CA: 4) Deliver event stream\nas it is received CA->UA: 5) Call close() on\nEventSource object UA->SA: 6) Close connection CA->UA: 7) Call EventSource\n(connectionless) note over SA A new event stream is ready for delivery. end note SA->PS: 8) PAP: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
This example shows use of a Push Server which acts as a proxy (either transparently, explictly, or through URL aliasing) 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) Call EventSource\n(Push Service url)
UA->PS: 2) Open connection (as proxy)
PS->SA: 3) Open connection
SA->PS: 4) Deliver event stream
PS->UA: 5) Deliver event stream
UA->CA: 6) Deliver event stream\nas it is received
CA->UA: 7) Call close() on\nEventSource object
UA->PS: 8) Close connection
note over CA
Application knows it can
still get events via
connectionless Push.
end note
CA->UA: 9) Call EventSource\n("connectionless")
note over PS
Connection to Server
Application is retained,
by design of the service.
end note
note over SA
A new event stream is
ready for delivery.
end note
SA->PS: 10) Deliver event stream
PS->SMSC: 11) SMPP:SM_SUBMIT\n(event stream\nin Push-OTA message)
SMSC->UA: 12) Deliver SMS\n(event stream\nin Push-OTA message)
UA->CA: 13) Deliver event stream
participant "Server\nApplication" as SA
participant "Push Server" as PS
participant "SIP/IP Core" as SC
participant "User Agent" as UA
participant "Client\nApplication" as CA
CA->UA: 1) Call EventSource\n(Push Service url)
UA->PS: 2) Open connection (as proxy)
PS->SA: 3) Open connection
SA->PS: 4) Deliver event stream
PS->UA: 5) Deliver event stream
UA->CA: 6) Deliver event stream\nas it is received
CA->UA: 7) Call close() on\nEventSource object
UA->PS: 8) Close connection
CA->UA: 9) Call EventSource\n("connectionless")
note over PS
Connection to Server
Application is retained.
end note
note over SA
A new event stream (<1300 bytes)
is ready for delivery.
end note
SA->PS: 10) Deliver event stream
PS->SC: 11) SIP MESSAGE\n(event stream)
SC->UA: 12) SIP MESSAGE\n(event stream)
UA->CA: 13) Deliver event stream
note over SA
A new event stream (>1300 bytes)
is ready for delivery.
end note
SA->PS: 14) Deliver event stream
PS->SC: 15) SIP INVITE
SC->UA: 16) SIP INVITE
UA->SC: 17) 200 OK
SC->PS: 18) 200 OK
PS->SC: 19) SIP ACK
SC->UA: 20) SIP ACK
PS->SC: 21) MSRP SEND\n(event stream)
SC->UA: 22) MSRP SEND\n(event stream)
UA->CA: 23) Deliver event stream
UA->SC: 24) MSRP 200 OK
SC->PS: 25) MSRP 200 OK
participant "Server\nApplication" as SA participant "Push Server" as PS participant "SMSC" as SMSC participant "User Agent" as UA participant "Client\nApplication" as CA CA->UA: 1) Call EventSource\n(server application url) UA->SA: 2) Open connection SA->UA: 3) Deliver event stream UA->CA: 4) Deliver event stream\nas it is received CA->UA: 5) Call close() on\nEventSource object UA->SA: 6) Close connection CA->UA: 7) Call EventSource\n(Push Proxy Service url\n?appid=(server application url)) UA->PS: 8) Push Service Registration\n?appid=(server application url) PS->SA: 9) Open connection note over SA A new event is ready for delivery. end note SA->PS: 10) Deliver event stream PS->SMSC: 11) SMPP:SM_SUBMIT\n(event stream\nin Push-OTA message) SMSC->UA: 12) Deliver SMS\n(event stream\nin Push-OTA message) UA->CA: 13) Deliver event stream
participant "Server\nApplication" as SA participant "Push Server" as PS participant "SMSC" as SMSC participant "User Agent" as UA participant "Client\nApplication" as CA CA->UA: 1) Call EventSource\n(server application url) UA->SA: 2) Open connection SA->UA: 3) Deliver event stream UA->CA: 4) Deliver event stream\nas it is received note over UA Event stream reaches some criteria for switching to connectionless delivery. end note UA->SA: 5) Close connection note over UA Reestablish connection through Push Server, delivering some session-correlating information e.g. Last-Event-ID header. end note UA->PS: 6) Open connection to Push Proxy Service\n(with Last-Event-ID header, and\nserver application url as parameter) PS->SA: 7) Open connection\n(Last-Event-ID header) note over SA A new event is ready for delivery. end note SA->PS: 8) Deliver 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: 1) Deliver event stream
This flow shows a Push message delivered as a new or replacement message, to a target Push Client via the WAP1 Push Connectionless Push service over the GSM SMS bearer.
participant "Push Initiator" as PI participant "Push Proxy Gateway" as PPG participant SMSC participant "Push Client" as PC participant "client application" as CA note over PI Push message is ready to be delivered. end note PI->PPG: 1) PAP Push Message PPG->PPG: 2) Request validation PPG->PI: 3) PAP Push Response (accepted) PPG->PPG: 4) Request processing\ne.g. tokenization PPG->SMSC: 5) Submit SM\n(OTA-WSP/SMS formatted\nPush message) SMSC->PC: 5) SMS (OTA-WSP/SMS\nformatted Push message) PC-->PPG: 6) Push message\ndelivery confirmation PPG-->PI: 7) result notification PC->CA: 8) Push message delivery