Maximizing BLE Throughput On iOS and Android
Maximizing BLE Throughput On iOS and Android
Still confused about how fast you can really send data over Bluetooth Low Energy?
It's not just you. A google search will turn up many incomplete answers. Each OS and device has it’s own
restrictions, such as connection interval and number of packets per interval. For example, did you know that
with iOS you can send 4 packets per interval, and that HID devices can communicate 2.6x faster?
If you want to finally clear up how fast you can communicate over BLE with an iPhone, Android device, or
Assuming this to be the maximum throughput is simply ignoring the communication protocol completely.
There are many elements that affect/limit BLE's throughput such as:
- Overhead bytes in a packet such as packet length, data integrity check, and general packet information.
So, how about 50% to 75% of 1mbps? That is still 31.25 to 62.5 kB per second. That is still really good, so is
peripheral (like slave). Each side communicates with the other on a given period called Connection
Interval (minimum of 7.5 milliseconds and increases in steps of 1.25 milliseconds). Each instance of
A communication event starts by the central (master) transmitting a packet while the peripheral device is in
receive mode. If the peripheral received the packet from central successfully, the peripheral will
subsequently transmit its packet while the central is in receive mode. By default, the central and peripheral
each will transmit a packet even if they have nothing to send, this is often called Empty Link Layer PDU .
For the cases when the central and peripheral have queued up messages, they can “ask” or “alert” the other
side that they have more data to send before ending the connection event. This can result in multiple
packets being exchanged during one interval. The connection event continues until a packet either fails to be
received correctly, the sender is satisfied with ending the connection event, or, in a very unlikely scenario,
increases the throughput tremendously. It is important to know that maximum number of packets per
connection event is dependent on the BLE stack/chipsets and is limited to 4 packets per connection event
The equation for number of BLE packets in a given second boils down to the following:
The theoretical maximum application data throughput in BLE can be described as the following formula:
Filling in the previous formula for Packets Per Second, we get the following:
Data Per Packet
In a forthcoming blog post, we will go in depth about the BLE packet structure and the possible sizes of
application data in a packet, but for now it is safe to say that a BLE packet contains a maximum of 20 bytes
of application data for BLE v4.0 and v4.1 (v4.2 includes a data packet length extension, but this is not used
in iOS or Android yet). Remember the actual BLE packet is longer in size but naturally it includes segments
for many important purposes such as CRC and headers for different layers.
you went to school, we learned that we cannot solve an equation with three unknowns, and that is the moral
of the BLE throughput story. BLE throughput requires context for it to be meaningful and the context starts
by determining the connection interval (the smaller generally gets you faster throughput, though there are
some interesting exceptions) and the number of packets in a connection event. For simplicity, let's assume
For iOS 9.2 and iPhone 6, The minimum connection interval is 30 milliseconds unless
you support HID over GATT Profile which allows for connections down to 11.25
milliseconds.
but this is not seen in practice. In our experience, we have observed 8 packets (4 in one direction) per
BLE Data Throughput for a Single Direction with iPhone 6 = (1000 mSecs) * 20 * ( 4 ) / (30 mSecs) =
Throughput is then increased to = (1000 mSecs) * 20 * 4 / (11.25 mSecs) = 7,111.11 Bytes per second
Hint: You have the ability to increase your length of application data in a packet to iPhone 6 by three bytes
which can increase your throughput by 15%. In future blogposts, we will discuss this.
device even if your BLE device can support lower connection intervals or send more than 4 packets per
connection event.
For example, let’s take the same peripheral device that we used to connect to iPhone 6 and connect to a
different client (hardware) at a connection interval of 10mSecs and up to 12 packets (6 in one direction) per
Throughput for a Single Direction = (1000mSecs) * 20 * (6) / (10 mSecs) = 12,000 Bytes per second.
must seek to use all the available time slots in a connection event to transfer a given data payload.
For example, if you perform a loopback for the data, you may find that the throughput measured on the
application layer is well below the maximum value. This could be the result of many factors, such as:
Connection Interval
As a peripheral/slave, you can request for the connection interval to be lowered (if applicable) using a
Connection Parameters Update Request message. Some Android devices may connect at slower
connection intervals initially before lowering the connection interval when requested.
Interference
If interference exists and causes the first packet of the connection event to not be received correctly, the
connection event is subsequently ended and the data will then have to be resent in the next connection
event. Where as if the last packet of the connection even is interfered with, the repercussion is much less.
Importance of Number of Packets per Connection Event and Corner Cases
Let's assume the application's loopback payload to be 100 bytes long and the maximum number of packets
per connection event is 4. This results in two connection events to transfer 100 bytes (ideally) in one
direction. And it takes two connection events to transfer the data back.
Let's increase the application loopback payload to 140 bytes, which is segmented into 7 packets. That still
Interestingly enough, the loopback application will yield similar throughput numbers for payload sizes of 100
and 140 bytes. It is import for the Bluetooth devices to use every time slot available in a connection interval
packet is sent. In many platforms such as smart phones, this is difficult to optimize as the smart-phone may
introduce a latency that cannot be removed; however, in most of the embedded systems, the developer
should seek to find ways to remove this delay, whether it is by processing the packets faster or methods
For example, in the loopback throughput measurement if a device receives 160 bytes of data in two
connection events but it fails to process the payload quickly for the next connection event, then you will be
throughput, the method that allows for more than one packet in a connection event needs to be selected.
Use Write Command instead of Write Request or Blob Write when sending data from GATT Client to GATT
Server, Use Notification instead of Indication when sending data from GATT Server to GATT Client. We will
discuss the pros and cons of the different GATT data transfer methods in a separate blog post.
iPhone 6,6+,6S,6S+:
Connection Interval for HID Over GATT is Present 11.25mSecs: 7,111 bytes/sec
Maximum Connection Interval range of (11.25 - 15mSecs): 7,111 bytes/sec - 5334 bytes/sec
Android
Nexus 4: Minimum Connection Interval of 7.5 mSecs - Packets per connection Interval: 6 - Throughput:
16,000 Bytes/Sec
Nexus 6P: Minimum Connection Interval of 7.5 mSecs - Packets per connection Interval: 6 - Throughput:
16,000 Bytes/Sec
This is part 1 of a 2 part series. You can find part 2 here: Maximizing BLE Throughput Part 2 - Choosing a
larger MTU.
Join the discussion by following our associated forum post: Maximizing BLE Throughput - Article Discussion
Maximizing BLE Throughput Part 2: Use Larger ATT
MTU
November 07, 2016 Kianoosh Karami
It's commonly accepted with BLE that as throughput goes up, so does power consumption. However, by
intelligently choosing your MTU size, you can actually increase throughput while also decreasing power
consumption .
This is the second part to our original post, Maximizing BLE Throughput on iOS and Android.
Generic Attribute Profile (GATT) is the layer developers will often interface with the most and accustomed to.
GATT defines the protocol of transferring data between two Bluetooth Low Energy devices. Application data
is uniquely identified through a small entity known as an Attribute. Group of Attributes form Characteristics
which adds additional properties such as permission and rules of interaction for a unique set of data. A
group of Characteristics form a Large entity known as Service which adds a larger blueprint for a given
feature or functionality. For Example, Battery Service includes a Battery Level Characteristic which includes
the battery level of a given device.
Attribute Protocol (ATT) defines the protocol of transferring the attribute data. This includes GATT related
functionality such as Write Request, Write Response, Notification, Read Response. In short, GATT defines
and creates appropriate attributes for a given application and ATT creates outgoing and parses incoming
Logical Link Control and Adaptation Protocol (L2CAP) is responsible for Quality of Service (QoS), routing,
fragmentation and reassembly of packets for higher layer protocols such as ATT, Security Management
Link Layer (LL) handles the transfer of L2CAP Packets while ensuring guaranteed delivery and integrity of
data.
BLE Packet
A BLE packet containing application and transferred over the air has the following structure:
Note: The Data field is dependent on the Bluetooth specification. In Bluetooth v4.0 and 4.1, the maximum
size of the Data field is 27 bytes. Bluetooth v4.2, a new feature was added to exchange the Data field length.
fragmentation of packets that are longer in length than the allowed the Data Field minus L2CAP header size
of 4 bytes.
When the maximum size of Data field is 27 bytes, this allows for maximum transfer of 23bytes of ATT data
Ideally, We strive to transfer 23 of application data per link layer packet or (Link Layer Data Field
Length - 4 octets).
Larger application data packets of 23 (Link Layer Data Field Length - 4 octets) or more can be
transferred from ATT->GATT->Application.
ATT MTU
ATT Maximum Transmission Unit (MTU) is the maximum length of an ATT packet. The ATT MTU is defined
by the L2CAP and can be anywhere between 23 and infinity. The implementation of the Bluetooth stack is
the key factor of determining the ATT MTU on both client and peripheral.
For the default case of ATT MTU of 23 bytes, the over head bytes result in 13% of overhead data.
If you recall from the previous throughput optimization blog post [link], we chose 20 bytes of application data
per BLE packet to match the default values allowed in Bluetooth v4.0 and 4.1.
Request/Response ATT layer command. Each side cannot transfer larger ATT packets than the other side's
specified ATT_MTU.
Example
iPhone 6 and 6S ATT_MTU is 185. This results in 3/185 or 1.6% of header overhead for a payload of 182
When the ATT_MTU is 23, the payload of 185 bytes will be fragmented into 185/20 or 10 ATT packets, which
Throughput Comparison:
Our calculation in based on 4 BLE packets in a connection event and 30 milliseconds connection interval.
We have graphed the throughput difference when the a given connection uses larger ATT_MTU sizes to
layer overhead bytes and replacing them with data. Using ATT_MTU sizes that are multiples of 23 bytes or
As throughput increases by using larger ATT packets, this can require in creating less BLE packets which will
Join the discussion by following our associated forum post: Maximizing BLE Throughput - Article Discussion