# Flow Control in Aeron

DevFeed: [Flow Control in Aeron](<https://devfeed.tech/articles/flow-control-in-aeron-30656.md>)

Original publisher: [Read original article](<http://bad-concurrency.blogspot.com/2020/03/flow-control-in-aeron.html>)

Author: Michael Barker (noreply@blogger.com)

Published: 2020-03-19T22:20:00Z

Content type: tutorial

Language: en

Sources: [Bad Concurrency](<https://devfeed.tech/sources/bad-concurrency.md>)

Topics: [networking](<https://devfeed.tech/topics/networking.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [distributed-system](<https://devfeed.tech/tags/distributed-system.md>), [messaging](<https://devfeed.tech/tags/messaging.md>), [multicast](<https://devfeed.tech/tags/multicast.md>), [networking](<https://devfeed.tech/tags/networking.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [udp](<https://devfeed.tech/tags/udp.md>)

## AI overview

This article explains flow control in Aeron, focusing on sliding-window behavior over UDP. It compares Aeron's receiver status messages with TCP acknowledgements and describes how receiver-window limits help prevent senders from overrunning receivers and causing message loss.

## Source excerpt

One of my more recent projects has led me to become more involved in the Aeron project. If you are unaware of Aeron, then head over to the Github site and check it out. At its core is an reliable messaging system that works over UDP, Multicast UDP and IPC. It also contains an archiving feature for recording and replay and (still under active development) an implementation of the Raft protocol for clustering. Did I mention that it was fast too. I've spent the last few weeks buried in the various strategies the Aeron has for flow control. Specifically modifying the existing flow control strategies and adding more flexible configuration on a per channel basis. Before I jump into that it would be useful to cover a little background first. What is flow control? Within a distributed system the purpose of flow control is to limit the rate of a sender so that is does not overrun it's associated receiver. UDP does not come with any form of flow control, therefore it is easy to create a sender that will out pace the receiver, leading to message loss. There are a number of different forms of flow control, but I'm going to focus on the sliding window flow control protocol used by TCP and Aeron. The sliding window protocol requires that the sender maintain a buffer of data (referred to as a window). The size of this window will typically communicated from the receiver to the sender as part of the protocol. With a bi-directional protocol like TCP the size of the window is communicated in each TCP segment header. This is the amount of data that the sender can transmit to the receiver before having to wait until an acknowledgement is received. If the application thread on the receiver side is busy and does not read the data from the socket and the sender continues to transmit, the window size value will decrease until it reaches 0, at which time the sender must stop and wait for an acknowledgement with a non-zero window size before sending again. There is a lot more networking theo