SNP 4.0

Synopsis

This pages covers the proposed format of the SNP 4.0 notification protocol.

You can contribute suggestions to this protocol on GitHib, tagging them with “SNP4”.

Requirements

  • Must be simple to support
  • Must be cross-platform
  • Must use existing, easily recognisable formats
  • Must be secure

Basic Structure

Header

The header will follow the same format as earlier iterations of the protocol:

SNP/4.0 {COMMAND} [AUTHORISATION] [ENCRYPTION]

Example:

SNP/4.0 NOTIFY

Content

Content will follow the MIME/HTTP header format:

{header}':{space}'{data}

Example:

app-sig: application/x-vnd-fullphat-rainstorm
app-title: RAINSTORM
title: Hello, world!
text: GNU Terry Pratchett

Binary content will be BASE64 encoded with CRLFs removed

Footer

The footer is unchanged from earlier iterations of the protocol:

END

Example

SNP/4.0 NOTIFY
app-sig: application/x-vnd-fullphat-rainstorm
app-title: RAINSTORM
title: Hello, world!
text: GNU Terry Pratchett
END

Commands

Supported commands are:

  • NOTIFY – generate a notification
  • FORWARD – forward a notification to a remote destination
  • SUBSCRIBE – subscribe to notifications from a remote source

Note that there is no REGISTER command; this is implied through the NOTIFY and FORWARD commands.

Responses

Supported responses unchanged from previous iterations and therefore are:

  • OK
  • FAILED

Specifics

Subscribing

Subscriptions are now considered to be between two computers rather than two applications.  Snarl running on computer A can subscribe to notifications on computer B so long as computer A knows which port (and protocol) computer B is listening on.  Communication can be further strengthened through the use of passwords (and, potentially, certificates).  The process is as follows:

Computer A connects to computer B via the correct port and issues a SUBSCRIBE request:

SNP/4.0 SUBSCRIBE
state: 1234567890
END

The ‘state’ header is a unique value which is used to validate the response.  Assuming all goes well, computer B responds with:

SNP/4.0 OK
state: 1234567890
END

Subsequent notifications from computer B are now sent as FORWARDs, which may be encrypted and hashed to protect against tampering.

Forwarding

Forwarding is now considered to be between two computers rather than two applications.  Snarl (or another application which supports SNP 4.0) on computer A can forward a notification to computer B so long as computer A knows which port and protocol computer B is listening on.  The process is as follows:

Computer A connects to computer B via the correct port and issues a FORWARD request:

SNP/4.0 FORWARD
app-sig: application/x-vnd-fullphat-blackice
app-title: BLACKICE
event-id: 1
event-title: Alert
title: Unable to contact Domain Controller
text: This computer has been unable to contact a suitable Domain Controller for 49152 seconds.
END

Once again, the content can be hashed and/or encrypted to protect it during transit.

The application signature and title are still required such that Snarl can display a more meaningful name to the end user (app-title) and so it can be referred to in any rules (app-sig).

Notifying

TBA, however largely unchanged.