backoffAlgorithm library - FreeRTOS
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

backoffAlgorithm library

Note

The content on this page may not be up-to-date. Please refer to the FreeRTOS.org library page for the latest update.

Introduction

The backoffAlgorithm library is a utility library that is used to space out repeated retransmissions of the same block of data, to avoid network congestion. This library calculates the backoff period for retrying network operations (like a failed network connection with the server) using an exponential backoff with jitter algorithm.

Exponential backoff with jitter is typically used when retrying a failed connection or network request to a server that is caused by network congestion or high loads on the server. It is used to spread out the timing of the retry requests created by multiple devices attempting network connections at the same time. In an environment with poor connectivity, a client can get disconnected at any time; so a backoff strategy also helps the client to conserve battery by not repeatedly attempting reconnections when they are unlikely to succeed.

The library is written in C and designed to be compliant with ISO C90 and MISRA C:2012. The library has no dependencies on any additional libraries other than the standard C library and has no heap allocation, making it suitable for IoT microcontrollers, but also fully portable to other platforms.

This library can be freely used and is distributed under the MIT open source license.

Code Size of backoffAlgorithm (example generated with GCC for ARM Cortex-M)
File With -O1 Optimization With -Os Optimization
backoff_algorithm.c 0.1K 0.1K
Total estimates 0.1K 0.1K