Multi-link and Auto Connect#

Since the release of Sidewalk SDK 1.16, a feature called Multi-link has been introduced. This feature abstracts the process of connection establishment and maintenance for the radio links supported by the Sidewalk stack, making it easier for developers. It offers developers varying degrees of flexibility to control not only the connection behavior of the links but also the transfer of messages over them.

You can find the dedicated application note on Multi-link on the Amazon website.

The multi-link feature introduces a connection policy framework that affects how connections are established and how messages are sent using the supported radio links. It also impacts the uplink message attributes and the link's connection timeout parameters. Downlink messages from the Sidewalk cloud services always follow the link on which the last uplink was received from the endpoint. Note that the link connection policy configuration does not persist across reboots.

The Multi-link feature is divided into two policies: multi-link and auto connect. Auto connect provides developers with the flexibility to configure various link connection attributes, such as link priority and the maximum number of retry attempts for a link. In contrast, multi-link determines the uplink attributes (like cloud ACK per message, the number of transmission retries for a message, and the time to live for a message) and the link connection attributes by selecting a mode that enforces a set of parameters. Developers are expected to choose a mode rather than individual attributes.

Message Uplink Attributes

Description

ACK

Request Acknowledgment from AWS IoT Wireless managed service

Number of retries

Number of times the stack can retry sending this message

Time To Live (TTL)

Time before the message expires in the queue

Link Connection Control Attributes

Description

Link Priority

Defines the order of priority to attempt connection on a link range from 0 to 2, 0 being the highest

Link Timeout

Maximum Time to Attempt Connection for a Link in seconds

The feature relies on the connected state mode of a link to determine if a link is available to send a message or not. The connected state is defined as follows: The link must be started, registered, and time-synced. Additionally, for BLE, it must be connected to the gateway. FSK is always connected as long as it receives beacons; and CSS is connectionless, so it is always considered connected.

Multi-link#

With multi-link, the system determines the message uplink and link connection attributes, so developers do not need to configure these parameters when sending a message. The Sidewalk stack initiates a connection on a link only when a message needs to be transmitted.

The algorithm functions as follows: If the Sidewalk stack has at least one link in a connected state and the message to be sent does not exceed the MTU of that link, the message is transmitted.

  • If multiple links are in a connected state, the message transmission attributes of the link with the higher throughput are applied to the enqueued message (e.g., if both BLE and FSK are connected, BLE is used).

  • If no link is in a connected state, the message transmission attributes of the link with the lowest throughput are applied to the enqueued message (e.g., if BLE, FSK, and CSS are not connected, CSS is used).

  • If the Sidewalk stack has at least one link in a connected state that can send the message, the link auto connection policy algorithm is not triggered, as the connected link can successfully transmit the message.

However, if the Sidewalk stack has no link in a connected state ready to send the message, the multi-link policy will be activated. This policy will then cycle through the links in the priority order set by the policy table (from lowest to highest throughput) multiple times until all the messages queued by the user are sent or expired. Once there are no messages in the endpoint Amazon Sidewalk stack’s send queue, the algorithm will stop attempting to establish a connection (time sync) with the Amazon Sidewalk network.

For background connection maintenance, when the stack is configured with multi-link policies for latency or performance, the multi-link algorithm attempts to maintain a connection (uplink active) with the Sidewalk cloud services via the BLE link. This connection maintenance is achieved by updating the advertisement payload. For other policies, the algorithm maintains the default behavior of the link connection policy.

Multi-link Policy Flow DiagramMulti-link Policy Flow Diagram

The multi-link mode can be set using the sid_option API call using SID_OPTION_SET_LINK_CONNECTION_POLICY or SID_OPTION_GET_LINK_CONNECTION_POLICY. The values for the Message Uplink Attributes and Link Connection Control Attributes are determined by the chosen policy mode. You can see details of the policy modes in the dedicated application note on Multi-link.

Auto Connect#

Auto connect policy offers developers the flexibility to configure the link connection control attributes. The Sidewalk stack initiates a connection on a link only when a message needs to be transmitted, with no background connection maintenance.

The algorithm operates as follows: If the Sidewalk stack has at least one link in a connected state that can send the message, the link auto connection policy algorithm will not be triggered, as the connected link can successfully transmit the message. However, if the Sidewalk stack has no link in a connected state ready to send the message, the auto connect policy will be activated. This policy will then cycle through the links in the priority order set by the developer multiple times until all the messages queued by the user are sent or expired. Once there are no messages in the endpoint Amazon Sidewalk stack’s send queue, the algorithm will cease attempting to establish a connection (time sync) with the Amazon Sidewalk network.

Auto Connection Policy Flow DiagramAuto Connection Policy Flow Diagram

The auto connect policy can be set using the sid_option API call using SID_OPTION_SET_LINK_CONNECTION_POLICY or SID_OPTION_GET_LINK_CONNECTION_POLICY and parameters can be chosen using SID_OPTION_SET_LINK_POLICY_AUTO_CONNECT_PARAMS or SID_OPTION_GET_LINK_POLICY_AUTO_CONNECT_PARAMS. The values for the Link Connection Control Attributes can be configured with Auto Connect. You can see details of the possible values in the dedicated application note on Multi-link.