{"id":19362714,"url":"https://github.com/smartdevicelink/protocol_spec","last_synced_at":"2026-02-28T06:14:24.476Z","repository":{"id":27737214,"uuid":"31224910","full_name":"smartdevicelink/protocol_spec","owner":"smartdevicelink","description":"Describes the communication protocol between a smartdevicelink enabled head unit and mobile application","archived":false,"fork":false,"pushed_at":"2021-10-27T13:45:47.000Z","size":126,"stargazers_count":14,"open_issues_count":8,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-06T20:33:33.429Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://smartdevicelink.github.io/protocol_spec/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartdevicelink.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-23T19:20:49.000Z","updated_at":"2024-03-01T01:54:50.000Z","dependencies_parsed_at":"2022-09-03T03:03:46.709Z","dependency_job_id":null,"html_url":"https://github.com/smartdevicelink/protocol_spec","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fprotocol_spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fprotocol_spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fprotocol_spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartdevicelink%2Fprotocol_spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartdevicelink","download_url":"https://codeload.github.com/smartdevicelink/protocol_spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240483782,"owners_count":19808632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T07:30:02.186Z","updated_at":"2026-02-28T06:14:19.455Z","avatar_url":"https://github.com/smartdevicelink.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartDeviceLink Protocol\n\n**Current Version: 5.4.1**\n\n## 1. Overview\nThe SmartDeviceLink protocol specification describes the method for establishing communication between an application and head unit and registering the application for continued communication with the head unit. The protocol is used as the base formation of packets sent from one module to another. \n\nAll new SDL implementations should implement the newest version of the protocol.\n\n### 1.1 Common Terms\n\n| Term | Description |\n|------|-------------|\n|**Module / Head Unit**| Hardware implementing the sdl_core software|\n|**Application**| Smart device application that implements the proxy library (iOS or Android)|\n\n## 2. Frames\nAll transported data is formed with a header followed by an optional payload. The combination of header and payload is referred to as a frame.\n\n### 2.1 Version 1 Frame Header\n\u003eDeprecated: Protocol versions 2 and higher. Only used as initial `StartService` packet for establishing communication and version negotiation from application\n\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"3\" width=\"25%\"\u003eByte 1\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 2\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 3\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 4\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd width=\"12.5%\"\u003eVersion\u003c/td\u003e\n    \u003ctd width=\"3.125%\"\u003eC\u003c/td\u003e\n    \u003ctd width=\"9.375%\"\u003eFrame Type\u003c/td\u003e\n    \u003ctd\u003eService Type\u003c/td\u003e\n    \u003ctd\u003eFrame Info\u003c/td\u003e\n    \u003ctd\u003eSession ID\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth width=\"250\"\u003eByte 5\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 6\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 7\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 8\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eData Size\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 2.2 Version 2 Frame Header\n\u003eRequired: Protocol versions 2 and higher\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"3\" width=\"25%\"\u003eByte 1\u003c/th\u003e\n    \u003cth colspan=\"1\"width=\"25%\"\u003eByte 2\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 3\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 4\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n    \u003ctd width=\"12.5%\"\u003eVersion\u003c/td\u003e\n    \u003ctd width=\"3.125%\"\u003eE\u003c/td\u003e\n    \u003ctd width=\"9.375%\"\u003eFrame Type\u003c/td\u003e\n    \u003ctd\u003eService Type\u003c/td\u003e\n    \u003ctd\u003eFrame Info\u003c/td\u003e\n    \u003ctd\u003eSession ID\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable \u003e\n  \u003ctr\u003e\n    \u003cth width=\"300\"\u003eByte 5\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 6\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 7\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 8\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eData Size\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth width=\"300\"\u003eByte 9\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 10\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 11\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 12\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eMessage ID\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 2.3 Frame Header Fields\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eField\u003c/th\u003e\n    \u003cth\u003eSize\u003c/th\u003e\n    \u003cth width=\"75%\"\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eVersion\u003c/td\u003e\n    \u003ctd\u003e4 bit\u003c/td\u003e\n    \u003ctd\u003e\n      \u003cb\u003eProtocol Version\u003c/b\u003e\u003cbr\u003e\n      0x1 Protocol version 1 - uses a version 1 Frame Header\u003cbr\u003e\n      0x2 Protocol version 2 - uses a version 2 Frame Header\u003cbr\u003e\n      0x3 Protocol version 3 - uses a version 2 Frame Header\u003cbr\u003e\n      0x4 Protocol version 4 - uses a version 2 Frame Header\u003cbr\u003e\n      0x5 Protocol version 5 - uses a version 2 Frame Header\u003cbr\u003e\n      0x6 - 0xF Reserved\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eC\u003c/td\u003e\n    \u003ctd\u003e1 bit\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eCompression Flag\u003c/b\u003e \u003cbr\u003e 0x0 This packet is not compressed \u003cbr\u003e 0x1 This packet is compressed \u003cbr\u003e \u003cb\u003eNote:\u003c/b\u003e Only available in Protocol Version 1\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eE\u003c/td\u003e\n    \u003ctd\u003e1 bit\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eEncryption Flag\u003c/b\u003e \u003cbr\u003e 0x0 This packet is not encrypted \u003cbr\u003e 0x1 This packet is encrypted \u003cbr\u003e \u003cb\u003eNote:\u003c/b\u003e Only available in Protocol Version 2 and higher. Must be always set to zero for a First Frame\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eFrame Type\u003c/td\u003e\n    \u003ctd\u003e3 bit\u003c/td\u003e\n    \u003ctd\u003e\n      0x00 Control Frame \u003cbr\u003e\n      0x01 Single Frame \u003cbr\u003e\n      0x02 First Frame \u003cbr\u003e\n      0x03 Consecutive Frame \u003cbr\u003e\n      0x04 - 0x07 Reserved\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eService Type\u003c/td\u003e\n    \u003ctd\u003e8 bit\u003c/td\u003e\n    \u003ctd\u003e\n      0x00 Control Service\u003cbr\u003e\n      0x01 - 0x06 Reserved\u003cbr\u003e\n      0x07 Remote Procedure Call (RPC) Service\u003cbr\u003e\n      0x08 - 0x09 Reserved\u003cbr\u003e\n      0x0A Audio Service\u003cbr\u003e\n      0x0B Video Service\u003cbr\u003e\n      0x0C - 0x0E Reserved\u003cbr\u003e\n      0x0F Bulk Data (Hybrid Service)\u003cbr\u003e\n      0x10 - 0xFF Reserved\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eFrame Info\u003c/td\u003e\n    \u003ctd\u003e8 bit\u003c/td\u003e\n    \u003ctd\u003e\n      \u003cb\u003eFrame Type = 0x00 (Control Frame)\u003c/b\u003e\u003cbr\u003e\n      0x00 Heartbeat\u003cbr\u003e\n      0x01 Start Service\u003cbr\u003e\n      0x02 Start Service ACK\u003cbr\u003e\n      0x03 Start Service NAK\u003cbr\u003e\n      0x04 End Service\u003cbr\u003e\n      0x05 End Service ACK\u003cbr\u003e\n      0x06 End Service NAK\u003cbr\u003e\n      0x07 Register Secondary Transport\u003cbr\u003e\n      0x08 Register Secondary Transport ACK\u003cbr\u003e\n      0x09 Register Secondary Transport NAK\u003cbr\u003e\n      0x0A - 0xFC Reserved\u003cbr\u003e\n      0xFD Transport Event Update\u003cbr\u003e\n      0xFE Service Data ACK\u003cbr\u003e\n      0xFF Heartbeat ACK\u003cbr\u003e\n      \u003cb\u003eFrame Type = 0x01 (Single Frame)\u003c/b\u003e\u003cbr\u003e\n      0x00 - 0xFF Reserved\u003cbr\u003e\n      \u003cb\u003eFrame Type = 0x02 (First Frame)\u003c/b\u003e\u003cbr\u003e\n      0x00 - 0xFF Reserved\u003cbr\u003e\n      \u003cb\u003eFrame Type = 0x03 (Consecutive Frame)\u003c/b\u003e\u003cbr\u003e\n      0x00 Last Frame\u003cbr\u003e\n      0x01 - 0xFF Frame Number\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSession ID\u003c/td\u003e\n    \u003ctd\u003e8 bit\u003c/td\u003e\n    \u003ctd\u003eThe session identifier\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eData Size\u003c/td\u003e\n    \u003ctd\u003e32 bit\u003c/td\u003e\n    \u003ctd\u003e\n      \u003cb\u003eFrame Type = 0x00 (Control Frame)\u003c/b\u003e\u003cbr\u003e\n      0x0 - 0xFFFFFFFF reserved.\u003cbr\u003e\n      \u003cb\u003eFrame Type = 0x02 (First Frame)\u003c/b\u003e\u003cbr\u003e\n      0x08 The data size for a first frame is always 8 bytes. In the payload, the first four bytes denote the Total Size of the data contained in all consecutive frames. This is always the size of whole non-encrypted payload (even if consecutive frames are encrypted). The second four bytes denote the number of consecutive frames following this one\u003cbr\u003e\n      \u003cb\u003eFrame Type = 0x01 or 0x03 (Single or Consecutive Frame)\u003c/b\u003e\u003cbr\u003e\n      The total bytes in this frame's payload. If frame is encrypted this is the size of encrypted payload, otherwise size of non-encrypted payload.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMessage ID\u003c/td\u003e\n    \u003ctd\u003e32 bit\u003c/td\u003e\n    \u003ctd\u003eThe message identifier, used to uniquely identify this message.\u003cbr\u003e \n    \u003cb\u003eNote:\u003c/b\u003e Only included in protocol version 2 frame headers and higher\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 2.4 Max Transport Units\nThe max transport unit (MTU) of a frame varies based on version. The MTU includes the frame header and payload. The current supported versions and their MTU's respectively are described below.\n\n| Version | MTU (bytes) |\n|------|-------------|\n|**1**| 1500|\n|**2**| 1500|\n|**3**| 131,084 |\n|**4**| 131,084|\n|**5**| 131,084 default or negotiated *(See Control Frame Payloads)*\n\n\n#### 2.4.1 Payload Size\nThe payload size is determined by the MTU - Frame Header Size. \n\n| Version | Max Payload Size (bytes) |\n|------|-------------|\n|**1**| 1488|\n|**2**| 1488|\n|**3**| 131,072 |\n|**4**| 131,072|\n|**5**| 131,072 default or (Negotiated MTU - 12 bytes) *(See Control Frame Payloads)*\n\n#### 2.4.2 Encrypted MTU\nWhile the supported MTU is the maximum size for that version, if a frame is encrypted it will be subject to the MTU of that encryption protocol as well. That means the MTU will have to be the minimum between SDL's MTU  and the encryption protocol's MTU. \n\n## 3. Frame Types\n\n### 3.1 Control Frame \nControl frames are the lowest-level type of packets. They can be sent over any of the defined services. They are used for the control of the services in which they are sent.\n\n#### 3.1.1 Special Header Definitions:\n| Header Value |Expected values| Description |\n|--------------|---------------|-------------|\n|Frame Info| `0x00` - `0x06`, `0xFE`, `0xFF`|See below \"Frame Info Definitions\"|\n|Data Size| `0x00`, `0x04`|`0x00` - Majority of control packets do not have payloads\u003cbr\u003e\u003cbr\u003e `0x04` - Used for `StartServiceACK` where the payload is a HashID |\n\n\n#### 3.1.2 Frame Info Definitions:\n| Frame Info Value| Name | Description |\n|------------|------|-------------|\n| 0x00| Heartbeat| A ping packet that is sent to ensure the connection is still active and the service is still valid|\n| 0x01 | Start Service |Requests that a specific type of service is started |\n| 0x02 | Start Service ACK | Acknowledges that the specific service has been started successfully\n| 0x03 | Start Service NAK | Negatively acknowledges that the specific service was *not* started\n| 0x04 | End Service | Requests that a specific type of service is ended\n| 0x05 | End Service ACK | Acknowledges that the specific service has been ended successfully\n| 0x06 | End Service NAK |  Negatively acknowledges that the specific service was *not* ended or has not yet been started\n| 0x07 | Register Secondary Transport | Request for a session registered on a primary transport to use a secondary transport. \u003cbr\u003eThis frame should only be sent on the Secondary Transport that the session is requesting.\n| 0x08 | Register Secondary Transport ACK | Acknowledges that the supplied session is registered to use the requested Secondary Transport. The application is only allowed to send additional frames on the Secondary Transport after this frame is received. \u003cbr\u003eThis frame must be sent on the Secondary Transport in which the original request was sent. \n| 0x09 | Register Secondary Transport NAK | Negatively acknowledges that the session is not registered or able to use the current Secondary Transport. The application cannot use this transport for any other messages. \u003cbr\u003eThis frame must be sent on the Secondary Transport in which the original request was sent. \n| 0xFD | Transport Event Update | Indicates that status or configuration of one or more transports are updated. This frame must only be sent after the successful starting of the RPC service which includes the protocol version negotiation.\n| 0xFE | Service Data ACK | *Deprecated*\n| 0xFF | Heartbeat ACK | Acknowledges that a Heartbeat control packet has been received\n\n#### 3.1.3 Payloads\n\u003eAdded: Protocol Version 5\u003cbr\u003e\n\u003e*Note: All parameters are optional*\u003cbr\u003e\n\nControl frames use [BSON](http://bsonspec.org) to store payload data. All payload types are directly from the BSON spec. Each control frame info type will have a defined set of available data. Most types will also have differently available data based on their service type.\n\nIf there is no data to send for a given parameter, the parameter should not be included. \n\n**Note:** Heartbeat, Heartbeat ACK, and Service Data ACK control frame types are not covered for any service as they were deprecated before payloads were introduced.\n\n##### 3.1.3.1 Control Service\n\n###### 3.1.3.1.1 Register Secondary Transport\n\n\u003eNo parameters\n\n###### 3.1.3.1.2 Register Secondary Transport ACK\n\n\u003eNo parameters\n\n###### 3.1.3.1.3 Register Secondary Transport NAK\n\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| reason | String | 5.1.0 | A string describing the reason of failure |\n\n###### 3.1.3.1.4 Transport Event Update\n\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| tcpIpAddress | String | 5.1.0 | IP address that can be used to establish a TCP connection. It can be IPv4 address (example: \"192.168.1.1\") or IPv6 address (example: \"fd12:3456:789a::1\").\u003cbr\u003eAn empty string indicates that the TCP transport becomes unavailable. |\n| tcpPort | int32 | 5.1.0 |  TCP Port number that can be used along with the supplied `tcpIpAddress` to establish a TCP connection. If parameter is included, the `tcpIpAddress` parameter must also be included.|\n\n##### 3.1.3.2 RPC Service\n\n###### 3.1.3.2.1 Start Service\n**Note:** While this includes a payload, it will remain a v1 frame header to ensure backwards compatibility with older systems.\n\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|protocolVersion|String| 5.0.0 | The max version of the protocol supported by client requesting service to start. Must be in the format *\"Major.Minor.Patch\"*|\n\n###### 3.1.3.2.2 Start Service ACK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|protocolVersion|String| 5.0.0 |The negotiated version of the protocol. Must be in the format *\"Major.Minor.Patch\"*. The frame header version should match the major version exactly.|\n|hashId|int32| 5.0.0 | Hash ID to identify this session and used when sending an `EndService` control frame for the RPC service type|\n|mtu| int64 | 5.0.0 | Max transport unit to be used for this service|. If not included the client should use the protocol version default.|\n|secondaryTransports|String Array| 5.1.0 | Array of transport types which are allowed to be used as a Secondary Transport. Refer to the table below for possible values.\u003cbr\u003eAs of this protocol spec version (5.1.0) only a single Secondary Transport may be used beyond a primary transport for a given session.\u003cbr\u003eIf there are no currently available Secondary Transports or the functionality is not supported, this parameter should be omitted or be an empty array.|\n|audioServiceTransports|int32 array| 5.1.0 | Ordered list of transport priority types that support the audio service (`0x0A`). Only the values of `1` (\"Primary Transport\") or `2` (\"Secondary Transport\") shall be used. If both the primary and secondary transport support the audio service, both should be included (`1` and `2`) in the order they are preferred; otherwise only the single transport priority type should be included. An application must not start the audio service on a transport priority type that is not listed in the array.\u003cbr\u003eIf this parameter is not included the Primary Transport should be used for the audio service.|\n|videoServiceTransports|int32 array| 5.1.0 | Ordered list of transport priority types that support the video service (`0x0B`). Only the values of `1` (\"Primary Transport\") or `2` (\"Secondary Transport\") shall be used. If both the primary and secondary transport support the video service, both should be included (`1` and `2`) in the order they are preferred; otherwise only the single transport priority type should be included. An application must not start the video service on a transport priority type that is not listed in the array.\u003cbr\u003eIf this parameter is not included the Primary Transport should be used for the video service.|\n|authToken|String| 5.2.0 | Included exclusively when communicating with cloud applications. This token is used by a cloud application to authenticate a user account associated with the vehicle. |\n|make|String| 5.4.0 | Vehicle make value. Used by OEM exclusive apps to identify whether current vehicle is supported or not. |\n|model|String| 5.4.0 | Vehicle model value. Used by OEM exclusive apps to identify whether current vehicle is supported or not. |\n|modelYear|String| 5.4.0 | Vehicle model year value. Used by OEM exclusive apps to identify whether current vehicle is supported or not. |\n|trim|String| 5.4.0 | Vehicle trim value. Used by OEM exclusive apps to identify whether current vehicle is supported or not. |\n|systemSoftwareVersion|String| 5.4.0 | Vehicle system software version value. Can be specified in any format desired by the OEM. |\n|systemHardwareVersion|String| 5.4.0 | Vehicle system hardware version value. Can be specified in any format desired by the OEM. |\n\n**list of transport type strings**\n\n| String | Description |\n|--------|-------------|\n| IAP\\_BLUETOOTH | iAP over Bluetooth |\n| IAP\\_USB | iAP over USB where it is not possible to distinguish between host or device mode|\n| IAP\\_USB\\_HOST\\_MODE | iAP over USB, and the phone is running as host |\n| IAP\\_USB\\_DEVICE\\_MODE | iAP over USB, and the phone is running as device |\n| IAP\\_CARPLAY | iAP over Carplay wireless |\n| SPP\\_BLUETOOTH | Bluetooth SPP. |\n| AOA\\_USB | Android Open Accessory |\n| TCP\\_WIFI | TCP connection over Wi-Fi |\n\n###### 3.1.3.2.3 Start Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters|\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n###### 3.1.3.2.4 End Service\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|hashId|int32| 5.0.0 | Hash ID supplied in the `StartServiceACK` for this service type|\n\n###### 3.1.3.2.5 End Service ACK\n\n###### 3.1.3.2.6 End Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters such as: [`hashId`] |\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n##### 3.1.3.3 Audio Service\n###### 3.1.3.3.1 Start Service\n\u003eNo parameters\n\n###### 3.1.3.3.2 Start Service ACK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|mtu| int64 | 5.0.0 | Max transport unit to be used for this service. If not included the client should use the one set via the RPC service or protocol version default.|\n\n###### 3.1.3.3.3 Start Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters such as: [`videoProtocol`, `videoCodec`] |\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n###### 3.1.3.3.4 End Service\n\u003eNo parameters\n\n###### 3.1.3.3.5 End Service ACK\n\u003eNo parameters\n\n###### 3.1.3.3.6 End Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters such as: [`hashId`] |\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n##### 3.1.3.4 Video Service\n\n###### 3.1.3.4.1 Start Service\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|height|int32| 5.0.0 | Desired height from the client requesting the video service to start|\n|width|int32| 5.0.0 | Desired width from the client requesting the video service to start|\n|videoProtocol|String| 5.0.0 | Desired video protocol to be used. See `VideoStreamingProtocol ` RPC|\n|videoCodec|String| 5.0.0 | Desired video codec to be used. See `VideoStreamingCodec` RPC|\n\n###### 3.1.3.4.2 Start Service ACK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n|mtu| int64 | 5.0.0 | Max transport unit to be used for this service. If not included the client should use the one set via the RPC service or protocol version default.|\n|height|int32| 5.0.0 | Accepted height from the client requesting the video service to start|\n|width|int32| 5.0.0 | Accepted width from the client requesting the video service to start|\n|videoProtocol|String| 5.0.0 | Accepted video protocol to be used. See `VideoStreamingProtocol ` RPC|\n|videoCodec|String| 5.0.0 | Accepted video codec to be used. See `VideoStreamingCodec` RPC|\n\n\n###### 3.1.3.4.3 Start Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters such as: [`videoProtocol`, `videoCodec`] |\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n###### 3.1.3.4.4 End Service\n\u003eNo parameters\n\n###### 3.1.3.4.5 End Service ACK\n\u003eNo parameters\n\n###### 3.1.3.4.6 End Service NAK\n| Tag Name | Type | Introduced | Description |\n|----------|------|------------|-------------|\n| rejectedParams |String Array| 5.0.0 | An array of rejected parameters such as: [`hashId`] |\n| reason | String | 5.3.0 | A string describing the reason of failure |\n\n\n\n### 3.2 Single Frame\nA frame of type Single Frame contains all the data for a particular packet in the payload. The majority of frames sent over the protocol utilize this frame type.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n  \t\u003cth colspan = \"2\" align=\"center\"\u003eSingle Frame\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"10%\"\u003eHeader\u003c/td\u003e\n    \u003ctd\u003ePayload\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"20%\" style=\"visibility:hidden;\"\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003eData\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 3.2.1 Special Header Definitions:\n\n| Header Value |Expected values| Description |\n|--------------|---------------|-------------|\n|Frame Info| `0x00`|Reserved|\n|Data Size| 0x01-0xFFFFFFFF|Total payload size in bytes for this frame|\n \n### 3.3 Multiple Frame Packets\nSome payloads will be larger than the maximum transport unit will allow. If that is the case, the payload will be broken up over multiple frames. These frame types are First and Consecutive. \n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr style=\"visibility:hidden;\"\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd \u003e\u003c/td\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd width=\"5%\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n    \u003ctr\u003e\n    \u003ctd style=\"visibility:hidden;\" colspan=\"3\"\u003e\u003c/td\u003e\n    \u003ctd align=\"center\" colspan=\"100%\"\u003eData\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd style=\"visibility:hidden;\" colspan =\"3\"\u003e\u003c/td\u003e\n    \u003ctd align=\"center\" colspan=\"2\"\u003eData Chunk 1 \u003c/td\u003e\n    \u003ctd align=\"center\" colspan=\"2\"\u003eData Chunk 2 \u003c/td\u003e\n    \u003ctd style=\"border:0; background-color:white;\" align=\"center\" colspan=\"2\"\u003e...\u003c/td\u003e\n    \u003ctd align=\"center\" colspan=\"2\"\u003eData Chunk n \u003c/td\u003e\n  \u003c/tr\u003e  \n  \u003ctr\u003e\n  \t\u003cth colspan = \"2\" align=\"center\"\u003eFirst Frame\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e Header\u003c/td\u003e\n    \u003ctd colspan = \"1\" \u003ePayload\u003c/td\u003e\n  \u003c/tr\u003e\n  \n  \u003ctr\u003e\n     \u003cth colspan = \"2\" style=\"visibility:hidden;\"\u003e\u003c/th\u003e\n     \u003cth colspan = \"3\"\u003eConsecutive Frame 1\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd colspan=\"2\" style=\"visibility:hidden;\"\u003e\u003c/td\u003e\n\t\u003ctd\u003eHeader\u003c/td\u003e\n\t\u003ctd colspan = \"2\" \u003ePayload\u003c/td\u003e  \n  \u003c/tr\u003e\n  \u003ctr\u003e\n     \u003cth colspan = \"4\" style=\"visibility:hidden;\"\u003e\u003c/th\u003e\n     \u003cth colspan = \"3\"\u003eConsecutive Frame 2\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd colspan=\"4\" style=\"visibility:hidden;\"\u003e\u003c/td\u003e\n\t\u003ctd\u003eHeader\u003c/td\u003e\n\t\u003ctd colspan = \"2\" \u003ePayload\u003c/td\u003e  \n  \u003c/tr\u003e\n  \n  \u003ctr style=\"border:0;\"\u003e\n     \u003ctd colspan = \"7\" style=\"visibility:hidden; border:0;\"\u003e\u003c/td\u003e\n     \u003ctd style=\"font-size:25px; border:0; background-color:white;\" align=\"center\"\u003e...\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\u003c/tr\u003e\n  \u003ctr\u003e\n     \u003cth colspan = \"8\" style=\"visibility:hidden;\"\u003e\u003c/th\u003e\n     \u003cth colspan = \"3\"\u003eConsecutive Frame n\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n   \u003ctd colspan=\"8\" style=\"visibility:hidden;\"\u003e\u003c/td\u003e\n\t\u003ctd\u003eHeader\u003c/td\u003e\n\t\u003ctd colspan = \"2\" \u003ePayload\u003c/td\u003e  \n  \u003c/tr\u003e\n\n\u003c/table\u003e \n\n\n#### 3.3.1 First Frame\nThe First Frame in a multiple frame payload contains information about the entire sequence of frames so that the receiving end can correctly parse all the frames and reassemble the entire payload. The payload of this frame is only eight bytes and contains information regarding the rest of the sequence.\n\n##### 3.3.1.1 Payload:\n\n\u003ctable width = \"100%\"\u003e\n\t\u003ctr align=\"center\"\u003e\n\t\t\u003cth\u003eByte\u003c/th\u003e\n\t\t\u003ctd width = \"10%\"\u003e0\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e1\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e2\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e3\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e4\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e5\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e6\u003c/td\u003e\n\t\t\u003ctd width = \"10%\"\u003e7\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr align=\"center\"\u003e\n\t\t\u003ctd style=\"visibility:hidden;\"\u003e\u003c/td\u003e\n\t\t\u003ctd colspan =\"4\" \u003eTotal size of the original payload being parsed\u003c/td\u003e\n\t\t\u003ctd colspan =\"4\" \u003eNumber of Consecutive Frames in this sequence\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n##### 3.3.1.2 Special Header Definitions:\n\n| Header Value |Expected values| Description |\n|--------------|---------------|-------------|\n|Frame Info| `0x00`|Reserved|\n|Data Size| `0x08`|This frame contains a fixed data size (8 bytes) for the payload.|\n\n#### 3.3.2 Consecutive Frame\nThe Consecutive Frames in a multiple frame payload contain the actual raw data of the original payload. The parsed payload contained in each of the Consecutive Frames' payloads should be buffered until the entire sequence is complete. \n\n##### 3.3.2.1 Special Header Definitions:\n\n| Header Value |Expected values| Description |\n|--------------|---------------|-------------|\n|Frame Info| `0x00` - `0xFF`|Values `0x01` - `0xFF` are used incrementally as each consecutive frame is created and sent in the sequence. eg The first consecutive packet in the sequence will have the value `0x01`, the next consecutive frame that contains the next chunk of data in the sequence will have the value `0x02`. \u003cbr\u003e\u003cbr\u003eIf the sequence reaches `0xFF` with more frames to create, it shall rollover to `0x01` **not** `0x00` as it is reserved. \u003cbr\u003e\u003cbr\u003e`0x00` is only used for the last consecutive frame in a multi-frame sequence and the last frame must have this value.|\n|Data Size| `0x01` - `0xFFFFFFFF`|Payload size in bytes for only this frame |\n\n## 4. Establishing Communication\n\n### 4.1 Transport Layer\n\u003eRequired: All Protocol Versions\n\nA physical transport must be established between a head unit and an application before an SDL session can start. \n\n### 4.2 Version Negotiation\n\u003eRequired: All Protocol Versions\n\n#### 4.2.1 Overview\nOnce a physical transport is established, each application must negotiate the maximum supported protocol version with the head unit. To establish basic communication and register with the head unit, the application must start an RPC service (Service Type: 0x07), using a *Version 1 Protocol Header*.\n\nThere are two types of version negotiation. Protocol versions 1 through 4 use an old style of negotiation, where as versions 5 and newer use a faster and more intelligent negotiation scheme.\n\n##### 4.2.1.1 Version 1-4 Negotiation\n\u003eRequired for Protocol Versions 1 through 4\n\n| Proxy| Direction | Core |\n|------------|------|-------------|\n|`StartService`\u003cbr\u003e **Version:** v1 \u003cbr\u003e **Payload:** no payload| -----------\u003e|\n|| \u003c-----------|`StartServiceACK`\u003cbr\u003e **Version:** Max supported by Core\u003cbr\u003e **Payload:** raw bytes for hashID\n|`SingleFrame` *(or other RPC supporting Frame Type)* \u003cbr\u003e **Version:** Highest version supported by both Core and Proxy \u003cbr\u003e **Payload:** Lots of bytes| -----------\u003e| Sets negotiated version. \n\n##### 4.2.1.2 Version 5+ Negotiation\n\u003eRequired for Protocol Versions 5 and newer\n\n| Proxy| Direction | Core |\n|------------|------|-------------|\n|`StartService`\u003cbr\u003e **Version:** v1 \u003cbr\u003e **Payload:** Constructed payload [protocolVersion: 5.x.x]| -----------\u003e| **v4 Core**: Ignores payload, sends protocol version 4 frame and uses previous negotiation scheme. \u003cbr\u003e **v5+ Core:** Reads in payload data, uses this information to determine version. \n|| \u003c-----------|`StartServiceACK`\u003cbr\u003e **Version:** Highest version supported by both Core and Proxy\u003cbr\u003e **Payload:** Constructed payload [protocolVersion: 5.x.x, hashId: 0x9873, mtu: 130687]\n|`SingleFrame`\u003cbr\u003e **Version:** Highest version supported by both Core and Proxy \u003cbr\u003e **Payload:** Lots of bytes| -----------\u003e|\n\n#### 4.2.2 Starting Communication\nThe application sends a `StartService` frame to the module containing no payload.\n\n##### Application -\u003e Head Unit\n\n#### 4.2.2.1 Versions 1 - 4\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eC\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e1\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0001\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 4.2.2.2 Versions 5 and newer\n\u003e**Note:** Even though this is a Protocol Version 1 frame header it includes a payload. This is a very special exception.\n\nPayload includes a constructed BSON object that has a single parameter of `protocolVersion` that describes the applications max supported Protocol Version.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eC\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e1\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003eSize of Payload\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0001\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003c/table\u003e\n  \n  \u003ctable width=100% \u003e\n  \u003ctr\u003e\n  \t\u003cth colspan=\"8\"\u003ePayload\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr align=\"center\"\u003e\n  \t\u003ctd colspan=\"8\" \u003e [protocolVersion: x.x.x]\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 4.2.3 Success\nIf the head unit allows the RPC service to start, it will respond with a `StartServiceACK`. At this time the version will finish its negotiation process.\n\n##### Head Unit -\u003e Application\n\n##### 4.2.3.1 Protocol Versions 1-4 \n\nThe `StartServiceACK` will contain the module's maximum supported protocol version. The packet structure will also match that of the supplied version; if the module's maximum supported version is 1, the packet will contain an 8 byte header (version 1), otherwise it will contain a 12 byte header (version 2). The application will then find the highest version supported by both the module and the application. This will be the determined version used for this session and will be used for all other packets sent from this point forward as well as all other services.\n\nThe payload of the `StartServiceACK` will contain a hash of the service which was started on the head unit if the payload size is greater than 0. This hash should be stored by an application and is needed in the end communication flow.\n\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax Module Version (4)\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service ACK\u003c/td\u003e\n    \u003ctd\u003eAssigned Session\u003c/td\u003e\n    \u003ctd\u003e4\u003c/td\u003e\n    \u003ctd\u003e2\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x02\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\n    \u003ctd\u003e0x00000004\u003c/td\u003e\n    \u003ctd\u003e0x0000000n\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 4.2.3.2 Protocol Versions 5 and newer \n\nThe `StartServiceACK` will contain a negotiated version between what the application provided in the `StartService` frame and what the module's maximum supported protocol version. Thus, if it is determined that no such information was sent in the `StartService` frame, the module will assume the previous method of version negotiation and send version 4 to assume it's max version supplied to the application and wait for the incoming `RegisterAppInterface` RPC from the application to finally determine the negotiated version. Either way, the determined version will be used for this session including all other packets sent from this point forward as well as all other services.\n\nThe packet structure will also match that of the supplied version; if the module's maximum supported version is 1, the packet will contain an 8 byte header (version 1), otherwise it will contain a 12 byte header (version 2). If the protocol version was determined to be 5 or higher, the payload it contains will be constructed in nature as a BSON object. The application will then find the highest version supported by both the module and the application. This will be the determined version used for this session and will be used for all other packets sent from this point forward as well as all other services.\n\nThe payload of the `StartServiceACK` will contain the agreed upon full protocol version *\"Major.Minor.Patch\"*, a hash of the service which was started on the head unit, and the max transport unit for that session (0x07 RPC). The hash should be stored by an application and is needed in the end communication flow. The MTU should be used as the default MTU for all other services for that session unless otherwise provided in the corresponding `StartServiceACK` for that service. \n\n###### 4.2.3.2.1 Protocol Version Supplied in `StartService`\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported by module and application \u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service ACK\u003c/td\u003e\n    \u003ctd\u003eAssigned Session\u003c/td\u003e\n    \u003ctd\u003eSize of payload\u003c/td\u003e\n    \u003ctd\u003e2\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0bNNNN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x02\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0x0000000n\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable width=100% \u003e\n\t\u003ctr\u003e\n  \t\t\u003cth colspan=\"8\"\u003ePayload\u003c/th\u003e\n  \t\u003c/tr\u003e\n  \t\u003ctr align=\"center\"\u003e\n  \t\t\u003ctd colspan=\"8\" \u003e [protocolVersion: x.x.x, hashId: 0xNNNN, mtu: 130687]\u003c/td\n  \t\u003c/tr\u003e\n\u003c/table\u003e\n\n###### 4.2.3.2.2 Protocol Version Not Supplied  in `StartService`\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax version application can possibly support (4)\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service ACK\u003c/td\u003e\n    \u003ctd\u003eAssigned Session\u003c/td\u003e\n    \u003ctd\u003e4\u003c/td\u003e\n    \u003ctd\u003e2\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x02\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\n    \u003ctd\u003e0x00000004\u003c/td\u003e\n    \u003ctd\u003e0x0000000n\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n##### 4.2.4 Failure\nIf a session has already been started, or can't be started, a `StartServiceNAK` will be sent in response to the `StartService` packet.\n\n##### Head Unit -\u003e Application\n\n##### 4.2.4.1 Protocol Versions 1 through 4\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax Module Version (4)\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service NAK\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x03\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 4.2.4.1 Protocol Versions 5 and Newer\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax Module Version (4)\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRPC\u003c/td\u003e\n    \u003ctd\u003eStart Service NAK\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003eSize of Payload\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0x03\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable width=100% \u003e\n\t\u003ctr\u003e\n  \t\t\u003cth colspan=\"8\"\u003ePayload\u003c/th\u003e\n  \t\u003c/tr\u003e\n  \t\u003ctr align=\"center\"\u003e\n  \t\t\u003ctd colspan=\"8\" \u003e [rejectedParams:[protocolVersion, x, x]]\u003c/td\n  \t\u003c/tr\u003e\n\u003c/table\u003e\n\n##### 4.2.5 Start Service\n\nThe RPC service always needs to be started as unencrypted first, then it can be moved to an encrypted state by sending another `StartService` request containing an encryption flag set to `1` at a later point. Services of another type can be started as encrypted initially, i.e. it is not necessary to start them as unencrypted and then move to encrypted state using second `StartService` request (however such sequence of actions is also valid). See \"7. Secured Communication\" section for more details.\n\n### 4.3 Registration\n\u003eRequired: All Protocol Versions\n\nEach application registers for continued communication with the head unit by sending a `RegisterAppInterface` Request RPC to the head unit via the RPC Service. Additional services can only be started after a successful `RegisterAppInterface` Response RPC has been sent from the head unit to the application.\n\n### 4.4 Starting other services\nWhile the RPC service is the default service that is started to establish a connection and a session, the application may wish to start other services. Similar to the process in Section 4, all services that are to be to started in a session require a `StartService` packet to be sent from the application. If the module supports and allows that service type to be started, it will respond with a `StartServiceACK` that has a payload of the hash ID for that service. If the module is unable to start that service or that application does not have access to that service, it will respond with a `StartServiceNAK`. \n\n### 4.5 Heartbeat\n\u003e**Deprecated: Protocol Versions 4 and higher** \u003cbr\u003e\n\u003eRequired: Protocol Version 3\u003cbr\u003e\n\u003eAdded: Protocol Version 3\n\nAfter a successful start service exchange between the application and head unit both the application and head unit are required to be able to respond to heartbeat messages if the negotiated protocol version is 3. After sending a heartbeat, if the application or head unit does not respond within a timeout (custom per app/head unit), the sender will disconnect. The sender's timer for the heartbeat timeout should be reset every time any message is received. Heartbeats are sent using the Control Service Type (0x00)\n\n#### 4.5.1 Heartbeat Request\n\n\u003eNote: The request can originate from either the Head Unit or the Application\n\n##### Head Unit -\u003e Application\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e4\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eHeartbeat\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 4.5.2 Heartbeat ACK\n\n\u003eNote: The response ACK will originate from the Head Unit or the Application based on the origin of the request\n\n##### Application -\u003e Head Unit\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e4\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eHeartbeat ACK\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0b0100\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0xFF\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 4.5.3 Heartbeat NAK\nThere is currently no heartbeat NAK.\n\n### 4.6 Secondary Transport\n\n\u003eAdded: Protocol version 5.1.0\n\nAfter the RPC service has been established on an initial transport, it is possible to utilize a different transport beyond the initial transport for certain services.  This additional transport is called the \"Secondary Transport\". The initial transport used to start the RPC service is called the \"Primary Transport\".\n\n#### 4.6.1 Secondary Transport Registration\n\nThe RPC `StartServiceACK` will include information on potential Secondary Transports in the parameter `secondaryTransports` if any are supported. Once received, it is possible to register the session on the Secondary Transport if connected; if the transport is not connected it will have to either wait until an update is received through the `TransportEventUpdated` frame or the physical connection is made.\n\nOnce the connection for Secondary Transport is established, if the application wishes to utilize that transport as a SecondaryTransport, the application is required to send a `RegisterSecondaryTransport` frame on that transport. The head unit will respond with either a`RegisterSecondaryTransportACK` or `RegisterSecondaryTransportNAK` frame. If the registration was successful and the application receives a `RegisterSecondaryTransportACK`, it may then utilize the Secondary Transport to start services.\n\n##### 4.6.1.1 RegisterSecondaryTransport\n\n##### Application -\u003e Head Unit\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported by module and application\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRegister Secondary Transport\u003c/td\u003e\n    \u003ctd\u003eSession Id assigned on Primary Transport\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e1\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0bNNNN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\n    \u003ctd\u003e0xNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000001\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 4.6.1.2 RegisterSecondaryTransportACK\n\n##### Head Unit -\u003e Application\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported by module and application\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRegister Secondary Transport ACK\u003c/td\u003e\n    \u003ctd\u003eSession Id assigned on Primary Transport\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e2\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0bNNNN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x08\u003c/td\u003e\n    \u003ctd\u003e0xNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000002\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 4.6.1.3 RegisterSecondaryTransportNAK\n\n##### Head Unit -\u003e Application\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported by module and application if known, otherwise 5\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eRegister Secondary Transport NAK\u003c/td\u003e\n    \u003ctd\u003eSession Id assigned on Primary Transport\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003e2\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0bNNNN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x09\u003c/td\u003e\n    \u003ctd\u003e0xNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n    \u003ctd\u003e0x00000002\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n#### 4.6.2 Transport Event Update\n\nSome Secondary Transports might require additional details on how they can be established. For example, in order to establish a TCP connection between the application and head unit the IP address and port number are required. The `TransportEventUpdate` control frame is used for this purpose. \n\nThe head unit will send out a `TransportEventUpdate` frame whenever its transport configuration is changed, for example when its IP address is updated or Wi-Fi network goes down. The head unit will also send out a `TransportEventUpdate` frame right after the `StartServiceACK` frame that establishes the RPC service so the application can initiate a connection immediately.\n\nThe `TransportEventUpdate` frame must always be sent through the Primary Transport. The head unit should not send the frame to applications that don't support protocol versions 5.1.0 or newer.\n\n##### 4.6.2.1 TransportEventUpdate\n\n##### Head Unit -\u003e Application\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession Id\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported by module and application\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eControl\u003c/td\u003e\n    \u003ctd\u003eTransport Event Update\u003c/td\u003e\n    \u003ctd\u003eSession Id assigned on Primary Transport\u003c/td\u003e\n    \u003ctd\u003eSize of payload\u003c/td\u003e\n    \u003ctd\u003eVariable\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0bNNNN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b000\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0xFD\u003c/td\u003e\n    \u003ctd\u003e0xNN\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003ctable width=100% \u003e\n\t\u003ctr\u003e\n  \t\t\u003cth colspan=\"8\"\u003ePayload\u003c/th\u003e\n  \t\u003c/tr\u003e\n  \t\u003ctr align=\"center\"\u003e\n  \t\t\u003ctd colspan=\"8\" \u003e [tcpIpAddress:\"x.x.x.x\", tcpPort:NNNN]\u003c/td\n  \t\u003c/tr\u003e\n\u003c/table\u003e\n\n#### 4.6.3 Starting Services on Secondary Transports\n\nA Secondary Transport is capable of carrying  the video and audio services. Other services, including RPC and Hybrid service, must always run on the Primary Transport. (Note: Control service is an inherently started service on a transport and does not need to be established, but frames will be handled on a frame by frame basis of Primary vs Secondary Transport support)\n\nThe RPC `StartServiceACK` might include the parameters `audioServiceTransports` and `videoServiceTransports` describing which service is allowed to run on which transport priority type (Primary, Secondary or both). An application honors this information and starts the service(s) only on an allowed transport. For example, if video service is allowed only on a Secondary Transport, the application will not start video streaming until Secondary Transport is established and registered.\n\nThe transport priority types included in these parameters are listed in preferred order, for example, `[2,1]` (Secondary , Primary). In this case the priority of the Secondary Transport is higher than that of Primary Transport, the application may stop and restart service(s) when the Secondary Transport is added or removed. However,  each service type must only be started and carried on a single transport at a time. \n\nWhen starting a service over a Secondary Transport the application, it must follow the previous sections to establish the transport connection and register its session over that transport. At that point it runs the normal sequence described in section 4.4. When starting a service over a Secondary Transport, the session ID that was provided during the establishment of the RPC service should be used.\n\n#### 4.6.4 Terminating Secondary Transport\n\nThere is no procedure to terminate a Secondary Transport. However, if the Primary Transport is disconnected or the RPC service is stopped, any Secondary Transport for that session should be unregistered and if no other sessions are registered over that Secondary Transport it should be disconnected.\n\n## 5. Services\nEvery active session has the ability to start any of the services defined in this protocol spec as long as they have permission on the module in which they are connected. Every session can only have one of each type of service open at a time. \n \nMessages sent have a priority based on their Service Type. Lower values for service type have higher delivery priority. A message's payload's format is based on the different service types defined below.\n\n### 5.1 Control Service\n\u003eRequired: All Protocol Versions\n\nThe control service is the lowest level service available. While Control Frame packets are used frequently, the control service itself is rarely used.\n\n#### 5.1.1 Security Query\n\nWhen establishing a secure connection, the TLS Payload is sent in a control service message with a binary query header. The size of this header is 12 bytes, similar to the RPC Payload Binary Header.\n\n##### 5.1.1.1 Payload\n\nThe security query is able to contain JSON data as well as binary data. During the handshake the TLS handshake data is sent as binary data. See \"Send Handshake Data\" section for details.\n\nIn case of an error, a notification is sent with an error code and error message as JSON data. See \"Send Internal Error\" section for details.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\u003ctd align=\"center\"\u003eBinary Query Header\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd align=\"center\"\u003eJSON Data\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd align=\"center\"\u003eBinary Data\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n##### 5.1.1.2 Binary Header\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth width=\"25%\"\u003eByte 1\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 2\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 3\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 4\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eQuery Type\u003c/td\u003e\n    \u003ctd colspan=\"3\" align=\"center\"\u003eQuery ID\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eSequential Number\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eJSON Size\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n###### 5.1.1.2.1 Binary Header Fields\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eField\u003c/th\u003e\n    \u003cth\u003eSize\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eQuery Type\u003c/td\u003e\n    \u003ctd\u003e8 bit\u003c/td\u003e\n    \u003ctd\u003e\n      0x00 Request \u003cbr\u003e\n      0x01 - 0x0F Reserved\u003cbr\u003e\n      0x10 Response\u003cbr\u003e\n      0x11 - 0x1F Reserved\u003cbr\u003e\n      0x20 Notification\u003cbr\u003e\n      0x21 - 0xFE Reserved\u003cbr\u003e\n      0xFF Invalid Query Type\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eQuery ID\u003c/td\u003e\n    \u003ctd\u003e24 bit\u003c/td\u003e\n    \u003ctd\u003e\n      0x000001 Send Handshake Data\u003cbr\u003e\n      0x000002 Send Internal Error\u003cbr\u003e\n      0x000003 - 0xFFFFFE Reserved\u003cbr\u003e\n      0xFFFFFF Invalid Query ID\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSequential Number\u003c/td\u003e\n    \u003ctd\u003e32 bit\u003c/td\u003e\n    \u003ctd\u003e\n      Message ID can be set by the mobile libraries to track security messages.\u003cbr\u003e\n      The system uses the same Message ID when replying to the query allowing the mobile libraries to correlate messages.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eJSON Size\u003c/td\u003e\n    \u003ctd\u003e32 bit\u003c/td\u003e\n    \u003ctd\u003e\n      The size of the JSON data following the binary query header.\u003cbr\u003e\n      Any additional data following the JSON data in the payload is binary data.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 5.1.1.3 Send Handshake Data\n\nWhen performing the TLS handshake, the server sends a \"Send Handshake Data\" request containing its handshake data to the client, and the client sends a response with its own handshake data accordingly.\n\n###### 5.1.1.3.1 Request Payload\n\n**Note:** Prior to SDL Core version 8.0.0, Core sent the \"Notification\" type (`0x20`) in this message instead of \"Request\" (`0x00`). Client libraries should account for this when communicating with older versions of SDL Core.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary Query Header\u003c/th\u003e\n  \u003ctr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eQuery Type\u003c/th\u003e\n    \u003cth\u003eTLS Message Type\u003c/th\u003e\n    \u003cth\u003eSequential Number\u003c/th\u003e\n    \u003cth\u003eJSON Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRequest\u003c/td\u003e\n    \u003ctd\u003eSend Handshake Data\u003c/td\u003e\n    \u003ctd\u003eAny number to be used to correlate query messages\u003c/td\u003e\n    \u003ctd\u003eZero\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x000001\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth align=\"center\" colspan=\"4\"\u003eBinary Data: SSL Handshake Request\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n###### 5.1.1.3.2 Response Payload\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary Query Header\u003c/th\u003e\n  \u003ctr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eQuery Type\u003c/th\u003e\n    \u003cth\u003eTLS Message Type\u003c/th\u003e\n    \u003cth\u003eSequential Number\u003c/th\u003e\n    \u003cth\u003eJSON Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eResponse\u003c/td\u003e\n    \u003ctd\u003eSend Handshake Data\u003c/td\u003e\n    \u003ctd\u003eAny number to be used to correlate query messages\u003c/td\u003e\n    \u003ctd\u003eZero\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0x10\u003c/td\u003e\n    \u003ctd\u003e0x000001\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth align=\"center\" colspan=\"4\"\u003eBinary Data: SSL Handshake Response\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 5.1.1.4 Send Internal Error\n\nIf an error occurs during the TLS handshake, a notification is sent with both JSON data and binary data describing the error. The JSON data contains the error code and an error text. The binary data is one single byte and only contains the error code.\n\nThe error code in JSON data and the binary data are the same value from the same code list.\n\n##### 5.1.1.4.1 Payload\n\nThe following query header is used by the system and the application to send error messages.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary Query Header\u003c/th\u003e\n  \u003ctr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eQuery Type\u003c/th\u003e\n    \u003cth\u003eTLS Message Type\u003c/th\u003e\n    \u003cth\u003eSequential Number\u003c/th\u003e\n    \u003cth\u003eJSON Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eNotification\u003c/td\u003e\n    \u003ctd\u003eSend Internal Error\u003c/td\u003e\n    \u003ctd\u003eUnused\u003c/td\u003e\n    \u003ctd\u003eSize of the JSON data\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0x20\u003c/td\u003e\n    \u003ctd\u003e0x000002\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eJSON Data\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary Data: Single Byte Error Code\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 5.1.1.4.2 JSON structure\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eKey\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eid\u003c/td\u003e\n    \u003ctd\u003eA decimal value representing an Error code.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003etext\u003c/td\u003e\n    \u003ctd\u003eA string describing the error.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 5.1.1.4.3 Error codes\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eError code\u003c/th\u003e\n    \u003cth\u003eByte\u003c/th\u003e\n    \u003cth\u003eValue\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_SUCCESS\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003eInternal Security Manager value\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_INVALID_QUERY_SIZE\u003c/td\u003e\n    \u003ctd\u003e0x01\u003c/td\u003e\u003ctd\u003e1\u003c/td\u003e\n    \u003ctd\u003eWrong size of query data\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_INVALID_QUERY_ID\u003c/td\u003e\n    \u003ctd\u003e0x02\u003c/td\u003e\u003ctd\u003e2\u003c/td\u003e\n    \u003ctd\u003eUnknown Query ID\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_NOT_SUPPORTED\u003c/td\u003e\n    \u003ctd\u003e0x03\u003c/td\u003e\u003ctd\u003e3\u003c/td\u003e\n    \u003ctd\u003eSDL does not support encryption\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_SERVICE_ALREADY_PROTECTED\u003c/td\u003e\n    \u003ctd\u003e0x04\u003c/td\u003e\u003ctd\u003e4\u003c/td\u003e\n    \u003ctd\u003eReceived request to protect a service that was protected before\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_SERVICE_NOT_PROTECTED\u003c/td\u003e\n    \u003ctd\u003e0x05\u003c/td\u003e\u003ctd\u003e5\u003c/td\u003e\n    \u003ctd\u003eReceived handshake or encrypted data for not protected service\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_DECRYPTION_FAILED\u003c/td\u003e\n    \u003ctd\u003e0x06\u003c/td\u003e\u003ctd\u003e6\u003c/td\u003e\n    \u003ctd\u003eDecryption failed\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_ENCRYPTION_FAILED\u003c/td\u003e\n    \u003ctd\u003e0x07\u003c/td\u003e\u003ctd\u003e7\u003c/td\u003e\n    \u003ctd\u003eEncryption failed\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_SSL_INVALID_DATA\u003c/td\u003e\n    \u003ctd\u003e0x08\u003c/td\u003e\u003ctd\u003e8\u003c/td\u003e\n    \u003ctd\u003eSSL invalid data\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_HANDSHAKE_FAILED\u003c/td\u003e\n    \u003ctd\u003e0x09\u003c/td\u003e\u003ctd\u003e9\u003c/td\u003e\n    \u003ctd\u003eIn case of all other handshake errors\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eINVALID_CERT\u003c/td\u003e\n    \u003ctd\u003e0x0A\u003c/td\u003e\u003ctd\u003e10\u003c/td\u003e\n    \u003ctd\u003eHandshake failed because certificate is invalid\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eEXPIRED_CERT\u003c/td\u003e\n    \u003ctd\u003e0x0B\u003c/td\u003e\u003ctd\u003e11\u003c/td\u003e\n    \u003ctd\u003eHandshake failed because certificate is expired\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_INTERNAL\u003c/td\u003e\n    \u003ctd\u003e0xFF\u003c/td\u003e\u003ctd\u003e255\u003c/td\u003e\n    \u003ctd\u003eInternal error\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eERROR_UNKNOWN_INTERNAL_ERROR\u003c/td\u003e\n    \u003ctd\u003e0xFE\u003c/td\u003e\u003ctd\u003e254\u003c/td\u003e\n    \u003ctd\u003eError value for testing\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 5.2 RPC Service\n\u003eRequired: All Protocol Versions\n\nThe RPC service is used to send requests, responses, and notifications between an application and a head unit. Valid messages are defined in the [RPC Specification](https://github.com/smartdevicelink/sdl_core/blob/master/src/components/interfaces/MOBILE_API.xml).\n\nThe payload of a message sent via the RPC service, which directly follows the Frame Header in the packet, consists of a Binary Header, and JSON data representing the RPC.\n\n##### RPC Payload\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"5000\"\u003eBinary Header\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eJSON Data\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 5.2.1 Binary Header\n\u003eRequired: Protocol Version 2 and greater\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"2\" width=\"25%\"\u003eByte 1\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 2\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 3\u003c/th\u003e\n    \u003cth width=\"25%\"\u003eByte 4\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"12.5%\"\u003eRPC Type\u003c/td\u003e\n    \u003ctd colspan=\"4\" align=\"center\"\u003eRPC Function ID\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"5\" align=\"center\"\u003eCorrelation ID\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"5\" align=\"center\"\u003eJSON Size\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n##### 5.2.1.1 Binary Header Fields\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eField\u003c/th\u003e\n    \u003cth\u003eSize\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRPC Type\u003c/td\u003e\n    \u003ctd\u003e4 bit\u003c/td\u003e\n    \u003ctd\u003e\n      0x0 Request\u003cbr\u003e\n      0x1 Response\u003cbr\u003e\n      0x2 Notification\u003cbr\u003e\n      0x3 Erroneous Response\u003cbr\u003e\n      0x4 - 0xF Reserved\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRPC Function ID\u003c/td\u003e\n    \u003ctd\u003e28 bit\u003c/td\u003e\n    \u003ctd\u003eThe Function ID of each RPC is specific to each version of the \u003ca href=\"https://github.com/smartdevicelink/sdl_core/blob/develop/src/components/interfaces/MOBILE_API.xml#L2146-2207\"\u003eRPC Specification\u003c/a\u003e but in general do not change from version to version.\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eCorrelation ID\u003c/td\u003e\n    \u003ctd\u003e32 bits (signed)\u003c/td\u003e\n    \u003ctd\u003eThe Correlation ID is used to map a request to its response. Requests sent in the same session with the same Correlation ID as a pending request will be rejected with an `INVALID_ID` response. Requests that use a Correlation ID less than 0 will be rejected with an `INVALID_ID` response. In Protocol Version 1, when the Binary Header did not exist, the Correlation ID was included as part of the JSON and has a max value of 65536.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eJSON Size\u003c/td\u003e\n    \u003ctd\u003e32 bits\u003c/td\u003e\n    \u003ctd\u003eThe size of the JSON Data following the Binary Header in the RPC Payload\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 5.3 Hybrid (Bulk Data) Service\n\u003eRequired: Protocol Version 2 and greater\n\nThe Hybrid Service does not need to be explicitly started; all applications that have successfully started the RPC Service have access to the Hybrid Service.\n\nThe Hybrid Service is similar to the RPC Service but adds a bulk data field. The payload of a message sent via the Hybrid service consists of a Binary Header, JSON Data, and Bulk Data.\n\nThe size of the Bulk Data field is the Data Size (Found in the Frame Header) minus the 12 Bytes of the Binary Header minus the JSON Size (Found in the Binary Header).\n\nThe Binary Header of a message using the Hybrid Service is the same as the Binary Header of a message using the RPC Service.\n\n##### Hybrid Service Payload\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" width=\"5000\"\u003eBinary Header\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eJSON Data\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003eBulk Data\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 5.4 Audio Service (PCM)\n\u003eAvailable: Protocol Version 3 and greater\n\nThe application can start the audio service to send PCM audio data to the head unit. After the `StartService` packet is sent and the ACK received, the payload for the Audio Service is only PCM audio data.\n\n### 5.5 Video Service (H.264)\n\u003eAvailable: Protocol Version 3 and greater\n\nThe application can start the video service to send H.264 video data to the head unit. After the `StartService` packet is sent and the ACK received, the payload for the Video Service is only H.264 video data.\n\n\n## 6. Ending Communication\nThe application may request it's session to be ended outside of a transport disconnect, module power cycle, etc. \n### 6.1 Completely Closing  a Session and Ending All Services\nTo close out a communication session with the head unit, an application sends an `EndService` packet with service type 7 (RPC) to the module. The `EndService` packet payload should include the correct hash ID supplied with the `StartServiceACK`. \n\n### 6.2 Closing Specific Services\nIf the application doesn't want to completely stop its session, but only wishes to close a specific session it can do so using an `EndService` packet that's service type matches the service that the application is trying to close. The `EndService` packet should include the hash ID in its payload that was contained in the `StartServiceACK` for  that specific service.\n\n## 7. Secured Communication\n\nIt is possible to establish a secured and encrypted communication with the system by setting the frame header encryption flag to `1` when starting a new service or by sending another `StartService` with the encryption flag set to `1` when the service is already established (this the required flow for the RPC service). If the authentication is successful, the system will reply with a `StartService ACK` frame with the encryption flag also set to `1` indicating that encrypted data is now accepted. If the authentication fails for some reason, the system will reset the TLS connection and return a `StartService NAK` frame.\n\nBelow are possible combinations of the service encryption status and RPCs protection flag value.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth width=\"30%\"\u003eService Encryption Status\u003c/th\u003e\n    \u003cth width=\"10%\"\u003eRPC Type\u003c/th\u003e\n    \u003cth width=\"10%\"\u003eRequires Protection\u003c/th\u003e\n    \u003cth width=\"50%\"\u003eExpected SDL Behavior\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"4\"\u003eEncryption is not established\u003c/td\u003e\n    \u003ctd rowspan=\"2\"\u003eRequest\u003c/td\u003e\n    \u003ctd\u003eyes\u003c/td\u003e\n    \u003ctd\u003eSDL Core rejects the request with result code `ENCRYPTION_NEEDED` (please see policy updates for which RPCs need protection).\u003c/td\u003e\n  \u003c/tr\u003e \n  \u003ctr\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eSDL Core continues processing the RPC request.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"2\"\u003eNotification\u003c/td\u003e\n    \u003ctd\u003eyes\u003c/td\u003e\n    \u003ctd\u003eSDL Core does not send the notification.\u003c/td\u003e\n  \u003c/tr\u003e \n  \u003ctr\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eSDL Core sends the notification unencrypted.\u003c/td\u003e\n  \u003c/tr\u003e\n  \n  \u003ctr\u003e\n    \u003ctd rowspan=\"4\"\u003eEncryption is established\u003c/td\u003e\n    \u003ctd rowspan=\"2\"\u003eRequest\u003c/td\u003e\n    \u003ctd\u003eyes\u003c/td\u003e\n    \u003ctd\u003e\n      If unencrypted, SDL Core rejects the request with an unencrypted response and result code `ENCRYPTION_NEEDED`.\u003cbr\u003e\n      If encrypted, SDL Core continues processing the request and sends an encrypted response.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003e\n      If unencrypted, SDL Core continues processing the request and sends an unencrypted response.\u003cbr\u003e\n      If encrypted, SDL Core continues processing the request and sends an encrypted response.\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"2\"\u003eNotification\u003c/td\u003e\n    \u003ctd\u003eyes\u003c/td\u003e\n    \u003ctd\u003eSDL Core sends the notification encrypted.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eSDL Core sends the notification unencrypted.\u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n### 7.1 Authentication\n\nThe authentication is done using TLS handshake. The TLS handshake process is defined by TLS and is not part of the SDL protocol. \n\nThe below diagram shows the sequence of how the TLS handshake exchanges certificates to compute the master secret.\n\n![TLS Handshake activity diagram](https://user-images.githubusercontent.com/5848997/122258220-cb8b7100-ce9e-11eb-9b2a-a6194b0d1b68.png)\n\nPlease see [SDL Overview Guides](https://smartdevicelink.com/en/guides/pull_request/sdl-overview-guides/security/protected-services/) for more details.\n\nThe system can be configured to support one encryption method. The following methods are supported:\n\n- TLSv1\n- TLSv1.1\n- TLSv1.2\n- DTLSv1\n- SSLv3 (not supported on most newer systems)\n\nThe system has to initiate with the corresponding client method. For instance, if the system is configured to use `DTLSv1`, it has to use the method `DTLSv1_client`. The application role has to be server and must use `DTLSv1_server`.\n\nThe system also supports configurable [SSL Security level](https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_get_security_level.html) introduced in OpenSSL 1.1.0. This parameter can be changed by `SecurityLevel` parameter in the Core configuration file. By default, system uses security level 1 for TLS handshakes. At this time setting the security level higher than 1 for general internet use is likely to cause considerable interoperability issues and is not recommended. This is because the SHA1 algorithm is very widely used in certificates and will be rejected at levels higher than 1 because it only offers 80 bits of security.\n\n### 7.2 Handshake Frames\n\nThe system will initiate a TLS handshake to authenticate the application where the system's role will be the client while the application's role will be the server. The system will do this only once if the application was not authenticated before in the current transport connection. The TLS handshake data is always sent in single frames. The service type for TLS handshake is the control service. \n\n#### 7.2.1 SDL Protocol Frame Header\n\nThe following SDL frame header is used for every frame related to TLS handshake.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"8\"\u003eSDL Protocol Frame Header\u003c/th\u003e\n  \u003ctr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eVersion\u003c/th\u003e\n    \u003cth\u003eE\u003c/th\u003e\n    \u003cth\u003eFrame Type\u003c/th\u003e\n    \u003cth\u003eService Type\u003c/th\u003e\n    \u003cth\u003eFrame Info\u003c/th\u003e\n    \u003cth\u003eSession ID\u003c/th\u003e\n    \u003cth\u003eData Size\u003c/th\u003e\n    \u003cth\u003eMessage ID\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eMax major version supported\u003cbr\u003eby module and application\u003c/td\u003e\n    \u003ctd\u003eno\u003c/td\u003e\n    \u003ctd\u003eSingle Frame\u003c/td\u003e\n    \u003ctd\u003eControl Service\u003c/td\u003e\n    \u003ctd\u003eSingle Frame Info\u003c/td\u003e\n    \u003ctd\u003eAssigned Session ID\u003c/td\u003e\n    \u003ctd\u003e\n      Query Binary Header +\u003cbr\u003e\n      JSON Data size + \u003cbr\u003e\n      Binary Handshake Data size\n    \u003c/td\u003e\n    \u003ctd\u003eEnumerated number\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0xN\u003c/td\u003e\n    \u003ctd\u003e0b0\u003c/td\u003e\n    \u003ctd\u003e0b001\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0xNN\u003c/td\u003e\n    \u003ctd\u003e0xC + 0xNNNNNNNN + 0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### 7.2.2 Security Query Binary Header\n\nThe following query header is used by the system and the application to send TLS handshake data.\n\n\u003ctable width=\"100%\"\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary Query Header\u003c/th\u003e\n  \u003ctr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eQuery Type\u003c/th\u003e\n    \u003cth\u003eTLS Message Type\u003c/th\u003e\n    \u003cth\u003eSequential Number\u003c/th\u003e\n    \u003cth\u003eJSON Size\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eRequest\u003c/td\u003e\n    \u003ctd\u003eSend Handshake Data\u003c/td\u003e\n    \u003ctd\u003eAny number to be used to correlate query messages\u003c/td\u003e\n    \u003ctd\u003eZero\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e0x00\u003c/td\u003e\n    \u003ctd\u003e0x000001\u003c/td\u003e\n    \u003ctd\u003e0xNNNNNNNN\u003c/td\u003e\n    \u003ctd\u003e0x00000000\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth colspan=\"4\"\u003eBinary TLS Handshake Data\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 7.3 Error handling\n\nIn case of an error, the system and the application should reset the active SSL connection of the current transport connection. This impacts already established secured service sessions as all of them will be closed. The application will need to restart all services which require protection.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fprotocol_spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartdevicelink%2Fprotocol_spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdevicelink%2Fprotocol_spec/lists"}