-
Notifications
You must be signed in to change notification settings - Fork 4
Changes from Balint for the review #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,201 @@ | ||
| # Bluetooth Link Layer Scheduling | ||
|
|
||
| It is possible to choose between three different scheduling algorithms depending from the different use cases. | ||
| Link Layer scheduling defines how Bluetooth radio tasks share airtime on | ||
| the controller.\ | ||
| This document describes the available scheduling algorithms, Link Layer | ||
| task types,\ | ||
| anchor placement concepts, and configuration parameters. The goal is to | ||
| help developers\ | ||
| choose the most appropriate scheduling mode for their application. | ||
|
|
||
| ## Basic Scheduling | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| Basic scheduling is enabled by default, when the `Bluetooth Controller Anchor Selection` component is **not** installed. | ||
| ## Link Layer Tasks | ||
|
|
||
| Basic scheduling without using the anchor selection algorithm does not try to improve throughput or latency. It ensures that all tasks can share the radio, and it resolves scheduling conflicts if there is an overlap. This is good for advertising / peripheral low throughput applications where latency is not an issue. It is also fit for PAwR synchronizers. | ||
| A *task* is any Link Layer radio activity that must occur at scheduled | ||
| intervals.\ | ||
| The Bluetooth controller treats the following as tasks: | ||
|
|
||
| - One or more **connection events** | ||
| - **Advertising** | ||
| - **Scanning** | ||
| - **Channel Sounding** | ||
| - **Periodic Advertising with Responses (PAwR)** transmissions and | ||
| receptions | ||
| - **Multiple PAwR trains**, each considered a separate task | ||
|
|
||
| Tasks have intervals, required runtime, and anchor points. The scheduler | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggested revision: Tasks are defined by an interval, required runtime, and anchor point. The scheduler allocates radio time among tasks while minimizing overlaps. |
||
| divides radio\ | ||
| time between tasks while attempting to avoid overlaps. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ## Anchor Concept | ||
|
|
||
| An *anchor point* is the reference time for a repeating Link Layer | ||
| procedure\ | ||
| (such as a connection event).\ | ||
| This is a Bluetooth Core Specification term; refer to the Core Spec for | ||
| the formal definition. | ||
|
|
||
| Why anchors matter: | ||
|
|
||
| - Anchor placement affects **throughput**, **latency**, and | ||
| coexistence between tasks. | ||
| - Efficient anchor distribution ensures radio time is used without | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested revision: Efficient anchor distribution enables effective use of radio time while minimizing conflicts. |
||
| unnecessary conflicts. | ||
| - Misaligned anchors may reduce available airtime or increase | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested revision: Misaligned anchors may reduce available airtime or increase the likelihood of collisions. |
||
| collision likelihood. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ## Scheduling Algorithms | ||
|
|
||
| The Bluetooth Link Layer supports three selectable scheduling | ||
| algorithms.\ | ||
| Developers may choose the most suitable one based on device role, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggested revision: Developers can select the most suitable option based on device role, resource needs, and traffic requirements. |
||
| resource needs,\ | ||
| and traffic requirements. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Basic Scheduling | ||
|
|
||
| Enabled when the *Bluetooth Controller Anchor Selection* component is | ||
| **not installed**. | ||
|
|
||
| Basic scheduling does not attempt to optimize latency or throughput.\ | ||
| It ensures tasks share the radio and resolves conflicts only when | ||
| overlaps occur. | ||
|
|
||
| Best for: - Advertising / **Peripheral low‑throughput** applications | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put the first bullet on its own line |
||
| - Applications where **latency is not critical** | ||
| - **PAwR synchronizers** | ||
| - Designs requiring **lowest RAM, flash, and power usage** | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Even Anchor Selection Algorithm | ||
|
|
||
| Enabled when the `Bluetooth Controller Anchor Selection` component is installed and `Anchor selection is done in an even manner` selected, this is the component default setting. | ||
| Enabled when the *Bluetooth Controller Anchor Selection* component is | ||
| installed and\ | ||
| **Anchor selection is done in an even manner** is selected. | ||
|
|
||
| Even anchor selection algorithm is best for single central multi peripheral use case where all connections have the same intervals. It tries to give connections the most airtime without interfering with other link layer tasks. | ||
| Best for: - Local device acting as **Central** connected to **multiple | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. start first bullet on own line throughout section |
||
| Peripherals** | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lower case peripherals |
||
| - Central devices performing **Channel Sounding** where the Central is | ||
| the initiator | ||
|
|
||
| Behavior: - Tries to **maximize airtime for connection events** | ||
| - Distributes anchors evenly across the interval for balanced use across | ||
| connections | ||
|
|
||
| Tradeoffs: - Uses **more RAM, flash, and power** than Basic Scheduling | ||
| - Not recommended for **simple Peripheral-only devices** | ||
| - Does **not fully utilize maximum possible radio time** | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Empty Center Anchor Selection Algorithm | ||
|
|
||
| Enabled when the `Bluetooth Controller Anchor Selection` component is installed and `Anchors are placed in alternating manner` selected. | ||
| Enabled when *Bluetooth Controller Anchor Selection* is installed and\ | ||
| **Anchors are placed in alternating manner** is selected. | ||
|
|
||
| Best for: - Devices acting as **Central + PAwR Advertiser** | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. start the first bullet on its own line in throughout the section |
||
| - Use cases where **PAwR subevents** and **connections** share the same | ||
| interval | ||
|
|
||
| Behavior: - Places anchors to reserve "center" airtime for PAwR | ||
| operations | ||
| - Works best when all task runtimes fit comfortably inside a single | ||
| interval | ||
|
|
||
| Multiple PAwR trains: - Each train is treated as a separate task | ||
| - Developers must ensure **system‑level timing** prevents PAwR response | ||
| slot overlap | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ## Task Runtime Considerations | ||
|
|
||
| Scheduling quality depends on the relationship between task runtimes and | ||
| their intervals: | ||
|
|
||
| - When total runtime is small compared to the interval, anchors can be | ||
| spaced optimally | ||
| - As total runtime approaches the interval: | ||
| - Anchor placement becomes constrained | ||
| - Throughput and latency may degrade | ||
| - PAwR slot alignment becomes more difficult | ||
| - Lower‑priority tasks may lose airtime | ||
|
|
||
| A full PAwR use‑case example is available internally. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this available to users? If not, should the line be removed? |
||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ## Configuration Parameters | ||
|
|
||
| The *Bluetooth Low Energy Controller* component provides parameters | ||
| affecting scheduling. | ||
|
|
||
| ### Bluetooth Controller Minimum Connection Event Duration | ||
|
|
||
| Hints the scheduler to reserve a minimum runtime for each connection. | ||
|
|
||
| Example:\ | ||
| Transmitting + receiving 251‑byte packets on 1M PHY requires \~4.3 ms. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested revision: Transmitting and receiving 251‑byte packets on 1M PHY requires ~4.3 ms. |
||
|
|
||
| If the Host sets a larger minimum event length, the scheduler uses the | ||
| larger value. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Bluetooth Controller Connection Event Extension | ||
|
|
||
| Allows connection events to extend beyond their scheduled window if they | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested revision: Allows connection events to extend beyond their scheduled window if data remains to be exchanged and the maximum connection event length has not been exceeded. |
||
| still\ | ||
| have data to exchange and have not exceeded the maximum connection event | ||
| length.\ | ||
| This may temporarily overrun lower‑priority tasks. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| ### Bluetooth Controller Scanner Reception Early Abort | ||
|
|
||
| Allows the scanner to abort packet reception if continuing would delay a | ||
| higher‑priority task.\ | ||
| Useful for ensuring extended advertisements do not overrun upcoming | ||
| scheduled tasks. | ||
|
|
||
| ------------------------------------------------------------------------ | ||
|
|
||
| Empty center anchor selection algorithm is best for PAwR advertiser use case. This algorithm is best when the PAwR subevent and connections have the same interval. The algorithm relies on the runtime of the tasks, and it works best if there is enough time for all the tasks to execute within one interval. | ||
| ## Choosing a Scheduling Algorithm | ||
|
|
||
| ### Configuration Parameters | ||
| Choose **Basic Scheduling** when: - Peripheral-only roles\ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put first bullet on its own line throughout the Configuration parameters section |
||
| - Low throughput and non‑critical latency | ||
| - PAwR synchronizer use cases | ||
| - Minimal RAM/flash/power usage required | ||
|
|
||
| - `Bluetooth Low Energy Controller` component has some configuration parameters related to Link Layer Scheduling under `Bluetooth Controller Configuration`. | ||
| Choose **Even Anchor Selection** when: - Central device with multiple | ||
| Peripherals | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lower case peripherals and append to previous line |
||
| - Central performing Channel Sounding | ||
| - Balanced airtime allocation across connections is needed | ||
|
|
||
| - `Bluetooth Controller Minimum Connection Event Duration` is helpful to give some idea to the link layer’s scheduling algorithm to reserve the minimum runtime for each connection. | ||
| Choose **Empty Center Anchor Selection** when: - Central + PAwR | ||
| Advertiser roles | ||
| - PAwR and connections share intervals\ | ||
| - Developer can ensure PAwR train timing does not overlap | ||
|
|
||
| For example if the system designer knows that they will be transmitting and receiving the 251 bytes for all connections and they are all using 1M PHY, then the minimum event length configuration should be ~4.3ms. | ||
|
|
||
| This configuration acts as the bare minimum for the connection event length. If the host set a different minimum connection event length when creating the connection, then the link layer will use the bigger of `Bluetooth Controller Minimum Connection Event Duration` and minimum connection event length. | ||
| ------------------------------------------------------------------------ | ||
|
|
||
| - `Bluetooth Controller Connection Event Extension` allows connections to overrun lower priority tasks as long as there is data to transmit or receive on the connection, and the maximum connection event length is not reached. | ||
| ## Summary | ||
|
|
||
| - `Bluetooth Controller Scanner Reception Early Abort` feature allows the controller to control the scanner to abort the reception of a packet if it will conflict with another scheduled higher priority task. | ||
| Link Layer scheduling determines how radio airtime is shared between | ||
| tasks.\ | ||
| Choosing the correct scheduler depends on device role, task mix, | ||
| throughput and\ | ||
| latency requirements, and resource constraints. | ||
|
|
||
| This configuration is useful to ensure that reception of extended advertisements over secondary advertising channels won’t overrun the next scheduled task. | ||
| The anchor selection algorithms allow improved radio‑time distribution | ||
| when needed,\ | ||
| while Basic Scheduling provides the lowest resource footprint. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest removing \ at the end of lines in this file and allow paragraphs to more naturally flow so that DSC builds cleanly