Skip to content

Commit f602517

Browse files
authored
Merge pull request #81 from wonsuk73/wonsuk250331-2
Revised texts of chapter 5.2.2.2 to chapter 5.3.1 in Transport spec
2 parents 462485e + 0c1be90 commit f602517

File tree

1 file changed

+40
-39
lines changed

1 file changed

+40
-39
lines changed

spec/VISSv3.0_Transport.html

+40-39
Original file line numberDiff line numberDiff line change
@@ -1461,11 +1461,11 @@ <h2>Signal Discovery Read</h2>
14611461
<section id="https-update">
14621462
<h2>Update</h2>
14631463
<p>
1464-
The client may request that the server sets the value of a signal.
1465-
If the server is able to satisfy the request it <em class="rfc2119" title="SHALL">SHALL</em> return a
1464+
The client MAY send a request to update the value of a signal.
1465+
If the server can fulfill the request, it SHALL return a
14661466
<a href="#dfn-setsuccessresponse" class="internalDFN" data-link-type="dfn">setSuccessResponse</a> message.
1467-
If an error occurs e.g. because the client is not authorized to set the requested value, or the value is read-only,
1468-
the server <em class="rfc2119" title="SHALL">SHALL</em> return a
1467+
If an error occurs, e.g. because the client is not authorized to set the requested value, or the value is read-only,
1468+
the server SHALL return a
14691469
<a href="#dfn-seterrorresponse" class="internalDFN" data-link-type="dfn">setErrorResponse</a> message.
14701470
</p>
14711471
<p>
@@ -1503,12 +1503,12 @@ <h2>Update</h2>
15031503
<section id="https-authorized-update">
15041504
<h2>Authorized Update</h2>
15051505
<p>
1506-
JWT tokens will be sent in the <code>Authorization</code> header, following with term <code>Bearer</code> and a space character.
1506+
JWT tokens MUST be included in the <code>Authorization</code> header, prefixed with <code>Bearer</code> followed by a space character.
15071507
</p>
15081508
<p>
15091509
The following example assumes
15101510
<code>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBEb2UifQ.xuEv8qrfXu424LZk8bVgr9MQJUIrp1rHcPyZw_KSsds</code>
1511-
is the actual token. A token header can be combined with all types of update requests.
1511+
is the actual token. A token header MAY be used with all types of update requests.
15121512
</p>
15131513
<pre><code>
15141514
POST /Vehicle/Powertrain/Transmission/PerformanceMode HTTP/1.1
@@ -1526,51 +1526,52 @@ <h2>Authorized Update</h2>
15261526
<section id="mqtt">
15271527
<h2>MQTT</h2>
15281528
<p>
1529-
As the MQTT protocol is based on a pub-sub model, while VISS is based on a client-server model, it is necessary to apply a thin application level protocol
1530-
on top of MQTT to abstract the client-server specific behavior. This is done by embedding the VISS messages in the MQTT messages,
1531-
together with supplementary information that makes this abstraction possible, see the next chapter.<br>
1532-
The VISS messages are adhering to the primary payload format without any deviations.
1529+
The MQTT protocol operates on a publish-subscribe communication model, whereas the VISS is designed around a client-server interaction model.
1530+
To reconcile these differences, a lightweight application-level protocol is introduced on top of MQTT.
1531+
This protocol encapsulates VISS messages within MQTT messages and includes additional metadata required to support client-server semantics.
1532+
Details of this abstraction mechanism are provided in the following chapter.<br>
1533+
The VISS messages transmitted over MQTT SHALL conform to the primary payload format without modification.
15331534
</p>
15341535

15351536
<section id="application-level-protocol">
15361537
<h2>Application Level Protocol</h2>
15371538
<p>
1538-
For MQTT to support the complete VISSv3 interface, as decribed in the <a data-link-type="dfn" href="https://github.com/COVESA/vehicle-information-service-specification/blob/gh-pages/spec/VISSv3.0_Core.html#interface">interface</a> chapter of the [[CORE]] specification,
1539-
an application level protocol that runs on top of MQTT is added.
1540-
It is described in the following, please also see the sequence diagram below.
1541-
To emulate the client-server pattern that is described in the [[CORE]] specification, the vehicle server, via its vehicle client,
1542-
issues a subscribe request to the broker on a topic named VID/Vehicle,
1543-
where VID is an identity that uniquely links to the vehicle in the access control ecosystem.
1544-
This vehicle identity is not necessarily the manufacturer's Vehicle Identification Number (VIN).<br>
1545-
The client on the "cloud side" of the broker is expected to have access to this vehicle identity.
1539+
For MQTT to support the full VISSv3 interface, as decribed in the <a data-link-type="dfn" href="https://raw.githack.com/COVESA/vehicle-information-service-specification/main/spec/VISSv3.0_Core.html#interface">chapter 5. Interface</a> of the [[CORE]] specification,
1540+
an application-level protocol that runs on top of MQTT is required.
1541+
This protocol is described below and illustrated in the accompanying sequence diagram.
1542+
To emulate the client-server pattern that is described in the [[CORE]] specification,
1543+
the vehicle server—via its vehicle-side client—MUST subscribe to the broker on a topic named VID/Vehicle,
1544+
where VID represents a unique identifier that links the vehicle to the access control ecosystem.
1545+
This vehicle identifier is not necessarily the manufacturer's Vehicle Identification Number (VIN).<br>
1546+
The cloud-side client is expected to have access to this vehicle identifier.
15461547
How it obtains it is out of scope for this specification.
1547-
When the cloud client wants to issue a request to the vehicle server it first generates a unique topic name,
1548-
which it subscribes to at the broker. It then generates a JSON formatted payload with the general structure
1548+
When the cloud client intends to send a request to the vehicle server,
1549+
it first generates a unique topic name and subscribes to it via the broker.
1550+
The client then generates a JSON formatted payload with the following structure:
15491551
<pre><code>
15501552
{"topic":"aUniqueTopic", "request":"VISSv3Request"}
15511553
</code></pre>
1552-
where "aUniqueTopic" is the uniques topic name it just subscribed to, and "VISSv3Request" is the request for the vehicle server.
1554+
Here, "aUniqueTopic" is the topic name just subscribed to, and "VISSv3Request" is the actual request directed to the vehicle server.
15531555
This request MUST follow the primary payload format of this specification.
1554-
This JSON message is then issued to the broker, associated to the topic VID/Vehicle.
1555-
This message will then be forwarded by the broker to the vehicle client, which forwards the string being the value of the
1556-
"request" key in the message to the vehicle server. When the vehicle client receives the response to this request,
1557-
it publishes it to the broker associated with the topic name that was the string value of the "topic" key name in the
1558-
message it previously received from the broker.<br>
1559-
The broker will then forward this message to the cloud side client that earlier subscribed to this topic name,
1560-
which concludes the client-server based request-response as described in the [[CORE]] specification.<br>
1561-
In the case of subscription requests the vehicle client needs to save the subscriptionId found in the subscribe response,
1556+
This JSON message is then published to the broker under the VID/Vehicle topic.
1557+
The broker forwards the message to the vehicle client, which extracts the value of the "request" field and forwards it
1558+
to the vehicle server. Upon receiving a response, the vehicle client publishes the response message to the topic specified
1559+
by the original "topic" field in the received message.
1560+
The broker then forwards this response to the cloud client, completing the client-server request-response cycle
1561+
as described in the [[CORE]] specification.<br>
1562+
For subscription requests, the vehicle client MUST store the subscriptionId from the subscribe response,
15621563
together with the topic name associated to the subscribe request. When the vehicle server later issues event messages,
1563-
the vehicle client must parse the subscriptionId from it, and retrieve the topic name associated to it.
1564-
The vehicle client shall delete the saved topic name and subscriptionId when it receives
1564+
the vehicle client SHALL extract the subscriptionId from it, and retrieve the topic name associated to it.
1565+
The vehicle client SHALL delete the saved topic name and subscriptionId when it receives
15651566
an unsubscribe request in a message from the broker.<br>
1566-
In following requests from the cloud side client, the unique topic name may be reused from the previous request-response cycle,
1567-
or a new unique topic name may be generated. If a new topic name is generated, an unsubscribe should be issued on the old topic name.
1568-
The vehicle client can continue to use the topic name it subscribes to.<br>
1569-
The payload format of the response/event messages SHALL follow the primary payload format of this specification.
1570-
The access control model is applicable also over this transport alternative.
1571-
The Access Token server should then implement its own version of the application level protocol described here,
1572-
using the topic name "VID/ATS". The Access Grant Token server may also do the same, with the topic name "VID/AGTS",
1573-
or if it is deployed in the cloud it may expose the HTTPS interface that is defined in this specification.
1567+
In subsequent requests from the cloud client, the unique topic name MAY be reused from the previous request-response cycle,
1568+
or a new unique topic name MAY be generated. If a new topic name is used, the previous one SHOULD be unsubscribed.
1569+
The vehicle client MAY continue using the topic name to which it initially subscribed.<br>
1570+
The payload format of all response and event messages SHALL conform to the primary payload format defined in this specification.
1571+
The access control model is also applicable to this transport mechanism.
1572+
The Access Token Server SHOULD implement its own version of the application-level protocol described here,
1573+
using the topic name "VID/ATS". Similarly, the Access Grant Token Server MAY implement the same mechanism using the topic "VID/AGTS",
1574+
or if it is deployed in the cloud it MAY expose the HTTPS interface defined in this specification.
15741575

15751576
<figure id="VISSv3-over-mqtt">
15761577
<img src="images/mqtt_vissv3_protocol.jpg" alt="VISSv3 over MQTT">

0 commit comments

Comments
 (0)