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:
- Protocols
- 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.
Data Management
The Data Management
profile 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.
Echo
The Echo
profile 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.
Heartbeat
The Heartbeat
profile 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.
Provisioning
There are a number of provisioning profiles used for tasks related to the pairing, authentication, and service registration of resources.
Network Provisioning
The Network Provisioning
profile handles tasks such as scanning for networks, and adding and enabling them for resources in the fabric.Service Provisioning
The Service Provisioning
profile handles tasks such as pairing resources to an account or registering them with a service.Fabric Provisioning
The Fabric Provisioning
profile handles tasks such as creating, joining, and leaving a fabric, or getting the fabric configuration.Recap
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