Support for WDM subscriptions over connections

-- Various changes supporting use of WDM subscriptions over connection-oriented transports.
As part of this effort, a number of general bugs were also fixed.

-- Use AutoRequestAck feature of ExchangeContext for all WRM subscription exchanges.  This
allows the code in SubscriptionClient and SubscriptionHandler classes to be neutral with
regard to connection-oriented/conectionless transports when sending Weave messages.

-- Re-wrote the handling of subscription termination in the SubscriptionClient and
SubscriptionHandler classes.  This greatly simplified the logic, making it easier to reason
about the correctness of the code.  This change also resolves WEAV-2367.

-- Added code to detect binding failures and terminate any associated subscriptions.  This
ensures, for example, that a subscription is terminated whenever its underlying connection
is lost.  This change also fixed a long-standing bug related to connectionless subscriptions
wherein a session failure would not immediate result in the failure of a subscription.

-- Fixed a bug in SubscriptionClient where the OnSubscriptionTerminated event was not
delivered to the application in certain cases.  This left the application unaware that the
underlying subscription was gone.  This fix necessitated various changes to the WDM
functional tests which had been coded to assume the erroneous behavior.

-- Fixed a bug in SubscriptionClient and SubscriptionHandler where the standalone ACK for a
StatusReport received in response to a SubscribeCancelRequest would never be sent.

-- Revised ifdefs in SubscriptionClient and UdpateClient so that both can be built with WRM
disabled. (Note that there are various hard dependencies on WRM in the test tools unrelated
to subscription/update support.  These were not addressed.)

-- Added interface documentation describing new subscription termination behavior.

-- Minor logging clean-ups in TraitData and StatusReportStr().

Updated WDM functional tests

-- Updated the happy-based WDM functional tests to accommodate changes to the
SubscriptionClient and SubscriptionHandler implementations introduced as a result of adding
support for WDM over connection-oriented transports.

-- Changed numerous python test scripts that have hard-coded dependencies on particular C++
method names appearing in log output.

-- Fixed logic bugs in the MockWdmSubscriptionInitiator/Responder classes that depended on
the existence of particular bugs in SubscriptionClient and SubscriptionHandler, which have
now been fixed.

-- Added additional logging as an aid to understanding the behavior of the
MockWdmSubscriptionInitiator/Responder classes.

-- Added option to TestWdmNext tool to enable use of WDM over a TCP connection.  Note that,
as of yet, there are no automated tests that exercise this feature.
77 files changed
tree: f6dd4cc7e7c9052f81b5a274474a2e4455e75be9
  1. .travis/
  2. build/
  3. certs/
  4. doc/
  5. src/
  6. third_party/
  7. .clang-format
  8. .default-version
  9. .gitignore
  10. .travis.yml
  11. bootstrap
  12. BUILDING-ESP32.md
  13. BUILDING.md
  14. CHANGELOG
  15. configure.ac
  16. CONTRIBUTING.md
  17. LICENSE
  18. Makefile-Android
  19. Makefile-bootstrap
  20. Makefile-iOS
  21. Makefile-Standalone
  22. Makefile.am
  23. README.md
  24. repos.conf
README.md

OpenWeave

Build Status Coverage Status


What is OpenWeave?

Weave is the network application layer that provides a secure, reliable communications backbone for Nest's products. OpenWeave is the open source release of Weave.

This initial release makes available some of Weave’s core components. With OpenWeave core, you can preview the technology by inspecting the code, learning about the architecture, and understanding the security model.

At Nest, we believe the core technologies that underpin connected home products need to be open and accessible. Alignment around common fundamentals will help products securely and seamlessly communicate with one another. Nest's first open source release was our implementation of Thread, OpenThread. OpenWeave can run on OpenThread, and is another step in the direction of making our core technologies more widely available.

OpenWeave Features

  • Low Overhead
    Whereas many approaches to the Internet of Things attempt to start from server-based or -grown technologies, struggling to scale down, Weave starts with the perspective that if you can tackle the toughest Internet of Things problems on the constrained product front, you can successfully scale up from there to any product.

  • Pervasive architecture
    By building an application architecture on top of IP and starting with a low overhead architecture, we have achieved a holistic, common, and consistent architecture from low-power, sleepy Thread end nodes to cloud services and mobile devices with end-to-end addressability, reachability, and security, making it easier on your developers and helping instill customer confidence in Weave-enabled products.

  • Robust
    Weave leverages and takes advantages of underlying network attributes, such as Thread’s no single point-of-failure and mesh resiliency. In addition, Weave devices are auto-configuring and enjoy the ability to route among and across different network link technologies.

  • Secure
    Weave employs security as a fundamental and core design tenet with:

    • Defense in depth with end-to-end application security, independent of underlying network
    • Tiered trust domains with application-specific groupwise keys
  • Easy to Use
    Out-of-box experience is key to avoiding a connected product return and an impact on your product’s profitability. Weave’s focus on a smooth, cohesive, integrated provisioning and out-of-box experience ensures returns are minimized. In addition to offering simple setup and administration for the end user, Weave also offers a straightforward but capable platform for the application developer.

  • Versatile
    OpenWeave has been designed to scale to home area networks containing low to mid-100s of devices. The communication support for variety of interaction models / patterns such as device-to-device, device-to-service, device-to-mobile/PC (remote and local).

Getting started with OpenWeave Core

All end-user documentation and guides are located at openweave.io. Learn how Weave works with our Weave Primer, or dig right in and learn how to:

Additional build information can also be found in BUILDING.md.

Need help?

There are numerous avenues for OpenWeave support:

The openweave-users Google Group is the recommended place for users to discuss OpenWeave and interact directly with the OpenWeave team.

Directory Structure

The OpenWeave repository is structured as follows:

File / FolderContents
aclocal.m4GNU autotools auto-generated file containing autoconf macros used by the OpenWeave build system.
bootstrapGNU autotools bootstrap script for the OpenWeave build system.
bootstrap-configureConvenience script that will bootstrap the OpenWeave build system, via bootstrap, and invoke configure.
build/OpenWeave-specific build system support content.
BUILDING.mdMore detailed information on configuring and building OpenWeave for different targets.
certs/OpenWeave-related security certificate material.
CHANGELOGDescription of changes to OpenWeave from release-to-release.
configureGNU autotools configuration script for OpenWeave.
configure.acGNU autotools configuration script source file for OpenWeave.
CONTRIBUTING.mdGuidelines for contributing to OpenWeave
.default-versionDefault OpenWeave version if none is available via source code control tags, .dist-version, or .local-version.
doc/Documentation and Doxygen build file.
LICENSEOpenWeave license file (Apache 2.0)
Makefile.amTop-level GNU automake makefile source.
Makefile-AndroidConvenience makefile for building OpenWeave against Android.
Makefile.inTop-level GNU autoconf makefile source.
Makefile-iOSConvenience makefile for building OpenWeave against iOS.
Makefile-StandaloneConvenience makefile for building OpenWeave as a standalone package on desktop and server systems.
README.mdThis file.
src/Implementation of OpenWeave, including unit- and functional-tests, tools, and utilities.
src/ble/Definition and implementation of OpenWeave over BLE
src/device-manager/Library for interacting with a remote OpenWeave device, implementing pairing flows. Bindings are provided for Python, iOS, Java and Android.
src/examples/Example code
src/include/Build support for external headers
src/inet/Abstraction of the IP stack. Currently supports socket- and LWIP-based implementation.
src/lib/Core OpenWeave implementation.
src/lwipLwIP configuration for the standalone OpenWeave build.
src/platformAdditional platform support code required to bind the BLE support to BlueZ libraries.
src/ra-daemon/Route advertisement daemon implementation
src/system/Abstraction of the required system support, such as timers, network buffers, and object pools.
src/test-appsUnit tests and test apps exercising Weave functionality
src/toolsTools for generating Weave security material, and for device support
src/warm/OpenWeave address and routing module
src/wrappersJava wrappers for OpenWeave library
third_party/Third-party code used by OpenWeave.

Contributing

We would love for you to contribute to OpenWeave and help make it even better than it is today! See the CONTRIBUTING.md file for more information.

Versioning

OpenWeave follows the Semantic Versioning guidelines for release cycle transparency and to maintain backwards compatibility.

License

License and the Weave and OpenWeave Brands

The OpenWeave software is released under the Apache 2.0 license, which does not extend a license for the use of the Weave and OpenWeave name and marks beyond what is required for reasonable and customary use in describing the origin of the software and reproducing the content of the NOTICE file.

The Weave and OpenWeave name and word (and other trademarks, including logos and logotypes) are property of Nest Labs, Inc. Please refrain from making commercial use of the Weave and OpenWeave names and word marks and only use the names and word marks to accurately reference this software distribution. Do not use the names and word marks in any way that suggests you are endorsed by or otherwise affiliated with Nest without first requesting and receiving a written license from us to do so. See our Trademarks and General Principles page for additional details. Use of the Weave and OpenWeave logos and logotypes is strictly prohibited without a written license from us to do so.