Understanding the Observe pattern

For sensors reporting data regularly and securely, the greatest optimization is the use of the Observe (or Event Subscription) pattern. Using this pattern, the requestor, or subscriber, is only required to send one request, called the subscription. Just as with a normal request, the device returns a response containing the data it wants to return. The difference lies in when the resource changes. When that happens, the device automatically sends a new response to the subscriber, without having to wait for a corresponding request.

Resources that support the Observe pattern are called observable resources. Observing resources is defined in RFC 7641: https://tools.ietf.org/html/rfc7641

In a normal case, this reduces the number of messages sent on the network by a factor of (close to) two. From four messages, it's possible to reduce this to (close to) one, depending on the direction of communication. If data is pushed from the device to the receiver, the number of messages is reduced by a factor of (close to) four in the normal unacknowledged case. If data is polled by the client, the number of messages depends on how often the polling is done. Either a great reduction of messages is achieved (if rapid polling is used to achieve low latency), or an increase in the number of messages is achieved (if slow polling is used with long latency). But in both cases, the latency, or the delay it takes for the receiving party to get its mirrored value updated, is reduced.

Typically, an observable resource updates its value using a regular time interval. More sophisticated methods are possible by using parameters in the request, letting the server know how often to report a value, if interval-based reporting is desired, or when to report it, if event-based or hysteresis-based reporting is desired.

The preceding image shows the transfer of unacknowledged sensor data using the Observe pattern:

Transfer of unacknowledged sensor data using the Observe pattern
Observed data can be transported using both the acknowledged and unacknowledged service. Typically, the server will use the same service as the subscriber did when making the original subscription, if not explicitly defined by the resource itself. Larger content sent using blocked transfer can also be observed.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.31.240