Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.89 KB

backoffalgorithm-library.md

File metadata and controls

19 lines (11 loc) · 1.89 KB

backoffAlgorithm library

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