System Data Protocol


Introduction


System Data Protocol (SDP) is a bidirectional message protocol for transmitting dynamic data. SDP uses a subscription mechanism allowing the right data to be sent at the right time (reduces bandwith). Messaging over SDP allows many-to-many (peer to peer) communication.

A data package is labeled with a uint16 number called a data id, and an application can be either a subscriber or producer of these. SDP is optimized for communicating over a CAN buss and allowes data up to 32 bits to be addressed and sent using only one CAN frame.

On top of SDP an interface layer called SCS helps the user to package data and controlls configurations allowing sender and receiver to agree on data format.

Data types implemented in SCS

  • Blob (byte[])
  • SCSBoolean
  • SCSDate
  • SCSDouble
  • SCSFloat
  • SCSImage
    • 1st byte; data format
      0 PNG
      1 JPG
      2 GIF
      3 RGB565
      4 ARGB8888
    • n following bytes: data
  • SCSInteger
  • SCSLong
  • SCSShort
  • SCSString (encapsulates encoding information)
    • 1st byte; encoding
      0 UTF8
      1 US-ASCII
      2 ISO-8859-1
      3 UTF-16BE
      4 UTF-16LE
       
      5 UTF-16
    • n following bytes: data
  • Uint8
  • Uint16
  • Uint32

Schematic image of SDP



                                        
 

Usage


SDP usage

Message types


  • Subscribe: Sent from subscriber to publisher to register on data changes.
  • Unsubscribe: Sent from active subscriber to publisher to unregister on data changes.
  • Request: Send a one time request for data value.
  • Query: Ask for a list of provided data ids.
  • Acknowledge: Sent from publisher to subscriber as answer to subscribe to notify about active subscription.
  • Revoke: Sent from provider to active subscribers to notify about subscription revoked.
  • Data: Actual data values.
  • Provide: Send out information about provided data ids.
 

SDP Specifications

  SDP messages are 

SDP Header (short header): 1 header byte followed by one 16-bit data id
+----------------------+---------------------+---------------------+
| SDP Header Byte #1   | SDP Header Bytes #2 | SDP Header Bytes #3 |
+----------------------+---------------------+---------------------+
| Bits 7-4  | Bits 3-0 |                 BITS 0-15                 |
+-----------+----------+-------------------------------------------+
| MSG_FLAGS | MSG_TYPE |                  DATA_ID                  |
| ? ? ? 0   | ? ? ? ?  |       ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?     |
+----------------------+-------------------------------------------+

SDP Header (long header): 1 header byte followed by many 16-bit data ids
+----------------------+---------------------+---------------------+---------------------+---------------------+...
| SDP Header Byte #1   | SDP Header Bytes #2 | SDP Header Bytes #3 | SDP Header Bytes #4 | SDP Header Bytes #5 |
+----------------------+---------------------+---------------------+---------------------+---------------------+...
| Bits 7-4  | Bits 3-0 |                 BITS 0-15                 |                 BITS 0-15                 |
+-----------+----------+---------------------+---------------------+-------------------------------------------+...
| MSG_FLAGS | MSG_TYPE |                  DATA_ID #1               |                DATA_ID #2                 |
| ? ? ? 1   | ? ? ? ?  |       ? ? ? ? ? ? ? ? ? ? ? ? ? ?         |      ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?      |
+-----------+----------+-------------------------------------------+-------------------------------------------+...
+----------------------+---------------------+-------------------------------------------+

+---------------------+---------------------+ ... +-----------------------+-----------------------+
| SDP Header Bytes #5 | SDP Header Bytes #6 |     | SDP Header Bytes #N+3 | SDP Header Bytes #N+4 |
+---------------------+---------------------+     +-----------------------+-----------------------+
|                 BITS 0-15                 |     |                 BITS 0-15                     |
+-------------------------------------------+     +-----------------------------------------------+
|                DATA_ID #2                 |     |                  DATA_ID #N                   |
+-------------------------------------------+     +------------------------------------------Power point presentation file with more details about SDP-----+
MSG_TYPE:
0=subscribe
1=unsubscribe
2=request
3=query
4=acknowledge
5=revoke
6=data
7=provide

Communication


To be able to send SDP frames between different processes, ECUs or networks one have to implement a gateway for the given communication type. Allong with the open sourced SDP code there are gateway-code for TCP implemented with the Java nio interface over socket channels. This implementation can be used to bridge data between two SDP nodes using TCP/IP.

For the client and server to handshake the channel before starting to send data over this TCP/IP implementation a light weight protocal Netsocket is used.


You can find below a power point presentation file with more details about SDP

SDP 2_0.pptx - SDP Presentation (77.6 KB) Joakim Lundvall, 04/01/2014 02:10 PM