There are many elements to the full Weave stack, but the majority of the functionality is grouped into logical constructs called profiles. Each profile corresponds to a specific set of Weave functionality which comprises:
- Protocol roles (publisher, subscriber)
- Message types
- Schemas and published data
- Status codes
- Error codes
We won't get into each of these elements right now, as they vary from profile to profile.
As for messaging, profile messages are usually general messages encoded in Weave TLV. However, if space is at a premium or there isn't a need for flexibility in the payload, TLV is not used. Echo and Heartbeat are examples of profiles that don't encode messages in TLV.
There are a variety of profiles built into Weave:
Let's take a quick look at a few of them.
The Data Managementprofile manages all requests for traits using a publish-subscribe model. Almost all functionality in the Nest ecosystem for everyday operation is mapped onto resources and traits as part of the Weave schema.
We'll dive into the schema and the Data Management profile later, but this profile is the workhorse of Weave.
For example, changing the armed state of a Nest Secure from your mobile device uses Data Management. The profile sends requests from the subscriber (mobile device) to other resources in the fabric (Nest Secure and the service), which acknowledge the request, change the armed state in the schema, and send responses confirming the change.
The Echoprofile provides a basic mechanism to test network connectivity and latency. It is modeled after the ICMP echo request and is intended for similar uses. It is analogous to a network ping, but using Weave messages and encryption, if specified.
An Echo payload consists of arbitrary data supplied by the requesting node and is expected to be echoed back verbatim in the response. Echo is used to test connectivity, security, and liveness of the Weave fabric.
The Heartbeatprofile provides a means to indicate liveness of one node to the other nodes in the network. A Weave heartbeat is typically sent at regular intervals. If not received before a configured timeout expires, the node is presumed to have failed.
A heartbeat is how you would check if a Weave node is still connected to the fabric. For example, heartbeat is used between Nest Detects and the Nest Guard to ensure the liveness of the Nest Secure system.
Bulk Data Transfer
The Bulk Data Transfer (BDX)profile provides the ability to transfer files between nodes. Files in this context may be sensor data, logs, or software images for over-the-air updates.
BDX can be run over various reliable transport protocols, including TCP and Weave Reliable Messaging.
There are a number of provisioning profiles used for tasks related to the pairing, authentication, and service registration of resources.
The Network Provisioningprofile handles tasks such as scanning for networks, and adding and enabling them for resources in the fabric.
The Service Provisioningprofile handles tasks such as pairing resources to an account or registering them with a service.
The Fabric Provisioningprofile handles tasks such as creating, joining, and leaving a fabric, or getting the fabric configuration.
What you learned:
- Much of the functionality in Weave is managed by profiles
- Profiles are application protocols that correspond to a specific set of functionality
- Each profile has its own set of message types , usually encoded by Weave TLV