Hardware and software setup

Are bluetooth 2.0 and 4.0 compatible. How to understand Bluetooth versions

Hello.

On December 3, 2014, the Bluetooth SIG officially announced the bluetooth version 4.2 specification.
The press release lists 3 major innovations:

  • increase in the speed of data reception and transmission;
  • the ability to connect to the Internet;
  • improving privacy and security.

The main thesis of the press release: version 4.2 is ideal for the Internet of things (IoT).
In this article I want to tell you how these 3 points are implemented. Anyone interested is welcome.

Everything described below applies only to BLE, let's go ...

1. Increasing the speed of receiving and transmitting user data.

The main disadvantage of BLE was the low data transfer rate. Although from which side to look, after all, BLE was originally invented for the sake of conserving the energy of the source that feeds the device. And in order to save energy, it is necessary to get in touch intermittently and transmit some data. However, all the same, the entire Internet is filled with indignations about low speed and questions about the possibility of increasing it, as well as increasing the size of the transmitted data.

And with the advent of version 4.2, the Bluetooth SIG announced an increase in the transfer rate by 2.5 times and the size of the transmitted packet by 10 times. How did they achieve this?

I’ll say that these 2 numbers are related to each other, namely: the speed has increased because the size of the transmitted packet has increased.

Let's look at the PDU (protocol data unit) of the data channel:


Each PDU contains a 16 bit header. Now, this header in version 4.2 is different from the header in version 4.1.

Here is the title of version 4.1:

And here is the header of version 4.2:

Note: RFU (Reserved for Future Use) - the field marked with this abbreviation is reserved for future use and is filled with zeros.

As we can see, the last 8 bits of the header are different. The "Lenght" field is the sum of the lengths of the payload and the MIC (Message Integrity Check) field found in the PDU (if the latter is enabled).
If in version 4.1 the "Lenght" field has a size of 5 bits, then in version 4.2 this field has a size of 8 bits.

From here it is easy to calculate that the “Lenght” field in version 4.1 can contain values ​​​​in the range from 0 to 31, and in version 4.2 in the range from 0 to 255. If we subtract the length of the MIC field (4 octets) from the maximum values, we get that payload may be 27 and 251 octets for version 4.1 and 4.2, respectively. In fact, the maximum number of data is even less, because the payload also contains L2CAP (4 octets) and ATT (3 octets) overhead, but we will not consider this.

Thus, the size of the transmitted user data has increased by approximately 10 times. As for the speed, which, for some reason, increased by 10 times, but only 2.5 times, then we can’t talk about a proportional increase, because everything also depends on the guaranteed delivery of data, because guaranteeing the delivery of 200 bytes is a little more difficult than 20.

2. Ability to connect to the Internet.

Perhaps the most interesting innovation, because of which the Bluetooth SIG announced that version 4.2 makes the Internet of things (IoT) better precisely because of this feature.

Back in version 4.1, L2CAP introduced the “LE Credit Based Flow Control Mode”. This mode allows you to control the data flow using the so-called. credit based scheme. The peculiarity of the scheme is that it does not use signal packets to indicate the amount of data to be transmitted, but asks another device for a credit for a certain amount of data for transmission, thereby speeding up the transmission process. In this case, the receiving side, each time a frame is received, reduces the frame counter, and when the last frame is reached, it can break the connection.

There are 3 new codes in the list of L2CAP commands:
- LE Credit Based Connection request – connection request according to the credit scheme;
- LE Credit Based Connection response – response to a connection based on a credit scheme;
- LE Flow Control Credit – message about the possibility to receive additional LE-frames.

In the "LE Credit Based Connection request" package


there is a field "Initial Credits" 2 octets long, indicating the number of LE frames that the device can send at the L2CAP level.

In the response packet "LE Credit Based Connection response"


the same field indicates the number of LE frames that another device can send, and the "Result" field indicates the result of the connection request. A value of 0x0000 indicates success, other values ​​indicate an error. Specifically, a value of 0x0004 indicates a connection failure due to lack of resources.

Thus, already in version 4.1, it became possible to transfer a large amount of data at the L2CAP level.
And now, almost simultaneously with the release of version 4.2, it is published:

  • service: "IP Support Service" (IPSS) .
  • IPSP profile (Internet Protocol Support Profile), which defines support for the transmission of IPv6 packets between devices that have BLE.

The main profile requirement for the L2CAP layer is the "LE Credit Based Connection" introduced in version 4.1, which, in turn, allows packets with MTU >= 1280 octets to be transmitted (I hope the hint to the figure is clear).

The profile defines the following roles:
- Router role – used for devices that can route IPv6 packets;
- Node role - used for devices that can only receive or send IPv6 packets; have a service discovery function and have an IPSS service that allows routers to discover this device;

Devices with the router role that need to connect to another router can have the host role.

Oddly enough, the transmission of IPv6 packets is not part of the profile specification, and is specified in the IETF RFC "Transmission of IPv6 packets over Bluetooth Low Energy". This document defines another interesting point, namely, that when transmitting IPv6 packets, the 6LoWPAN standard is used - this is a standard for interworking over IPv6 protocol over low-power wireless personal networks IEC 802.15.4 standard.

Look at the picture:


The profile specifies that IPSS, GATT, and ATT are used only for service discovery, while GAP is used only for device discovery and connection establishment.

But highlighted in red, just says that the transmission of packets is not included in the profile specification. This allows the programmer to write his own packet transfer implementation.

3. Improved privacy and security.

One of the duties of the Security manager (SM) is to pair the two devices. The pairing process generates keys that are then used to encrypt the communication. The pairing process consists of 3 phases:

  • exchange of information on pairing methods;
  • generation of short-term keys (Short Term Key (STK));
  • key exchange.

In version 4.2, the 2nd phase was divided into 2 parts:

  • Short Term Key (STK) generation called "LE legacy pairing"
  • generation of long-term keys (Long Term Key (LTK)) called "LE Secure Connections"

In this regard, in addition to the 3 existing functions, in the cryptographic toolbox of the security manager, 5 more have appeared and these 5 are used only to service the new “LE Secure Connections” pairing process. These functions generate:

  • LTK and MacKey;
  • supporting variables;
  • authentication check variables;
  • 6 digit numbers used to display on paired devices.

All functions use the AES-CMAC encryption algorithm with a 128-bit key.

So, if during pairing in the 2nd phase using the “LE legacy pairing” method, 2 keys were generated:

  • Temporary Key (TK): 128-bit temporary key used to generate the STK;
  • Short Term Key (STK): 128-bit temporary key used to encrypt the connection

then according to the "LE Secure Connections" method, 1 key is generated:

  • Long Term Key (LTK): 128 bit key used to encrypt subsequent connections.

As a result of this innovation, we have received:

  • tracking prevention, as now due to "Numeric Comparison" it is possible to control the ability to connect to your device.
  • improved energy efficiency, as now no additional energy is required to re-generate keys on each connection.
  • industry standard encryption to secure sensitive data.

Strange as it may sound, but by improving security, we have improved energy efficiency.

4. Is there already an opportunity to feel?

Yes, I have.
NORDIC Semiconductor has released the "nRF51 IoT SDK" which includes the stack, libraries, examples and APIs for the nRF51 series devices. This includes:

  • nRF51822 and nRF51422 chips;
  • nRF51 DK;
  • nRF51 Dongle;
  • nRF51822EK.

Every sound starts with a source. Today, there are many wireless protocols for transmitting sound. Some of them are much more interesting than Bluetooth, but have not yet received proper distribution. Today, almost all smartphones, laptops and tablets are equipped with Bluetooth, and equipping a device with its support with a USB output is a matter of five minutes.

Therefore, today we will limit ourselves to sound-reproducing devices using the “blue tooth” (the guide is quite suitable for choosing a Bluetooth speaker). This technology has a rather long history and a lot of pitfalls, the existence of which is not always known to users.

The presence of a Bluetooth transmitter does not mean that the device can be used as a sound source for wireless audio equipment. Not every Bluetooth will allow you to listen to high-quality music without distortion. Not everyone is suitable for listening to files with a high bitrate and in lossless formats.

What to look for in order to listen to music wirelessly - whether it's just an MP3 or a high-quality rip from a vinyl record, we'll tell you in this article.

Let's start with the most important: this parameter directly indicates whether it is possible to listen to music using the device.

VersionBluetooth

IN modern devices most often you can find support for Bluetooth 3.0 or 4.0, in some top-end smartphones and other gadgets - 4.1. In this case, it may well turn out that the purchased headset supports connection only via protocol version 2.1. The adapters are backwards compatible, but the slowest protocol of the two works when connected.

Difference between protocol versions for regular user minimal due to backward compatibility. The main thing that catches the eye is with each new version the power consumption of devices is reduced, and starting with 3.0, a second module has been added for high-speed data transfer at a speed of 24 Mbps.

Version 2.1 + EDR transmits data at a speed of no more than 2.1 Mbps. This is enough to play a low bitrate audio stream. It is recommended to use a Bluetooth version of at least 3.0 to play the audio video stream.

It should be noted that for the full use of the device as a player, it is highly desirable presence of Bluetooth version 4.0 and higher, and better - with reduced power consumption.

You can identify such an adapter thanks to the following categories.

ProfilesBluetooth

Profiles are a set of specific functions supported by devices. Of all those used in Bluetooth for listening to music, the following are interesting:

  1. Headset Profile (HSP) needed to link the headset and smartphone and wireless transmission mono sound with a bit rate of 64 kbps.
  2. Hands Free Profile (HFP) also provides only mono transmission, but with higher quality.
  3. Advanced Audio Distribution Profile (A2DP) necessary for the transmission of two-channel audio stream.
  4. Audio/Video Remote Control Profile (AVRCP) provides control of the functions of playback devices (without it, even changing the volume of music is impossible).

A2DP is required for full listening to music. It not only ensures the transmission of the audio stream, but also manages the compression of the data before transmission.

However, even if both the transmitting and playback device (for example, a smartphone and wireless headphones) are equipped with Bluetooth 3.0 or 4.0 and support the necessary protocol, you need to pay attention to the codec that is used.

CodecsBluetooth

The most important thing for playing music using the A2DP protocol is the codec that compresses the audio stream transmitted to the headset. Total for this moment There are three codecs:

  1. Subband Coding (SBC)- codec used by default by A2DP and created by the profile developers. Unfortunately, SBC presses much rougher than MP3. And therefore, it is not suitable for listening to music.
  2. Advanced Audio Coding (AAC)- a more advanced codec that uses other compression algorithms. Sounds much better than SBC.
  3. AptX- here he is, right choice! At least because of the ability to transfer files to MP3 and AAC without additional manipulations and transcoding. This means no loss of sound. However, it is worth mentioning. There are several versions of aptX to play different bitrates. Each of them is designed for its own sound stream.
Version Number of supported channels Maximum sampling frequency, kHz Quantization, bit Maximum bitrate Compression ratio
AptX 2 44,1 16 320 kbps 2:1
Enhanced AptX 2, 4, 5.1, 5.1+2 48 16, 20, 24 up to 1.28 Mbps 4:1
AptX Live n/a 48 16, 20, 24 n/a 8:1
AptX Lossless n/a 96 16, 20, 24 n/a n/a
AptX Low Latency n/a 48 16, 20, 24 n/a n/a

»
The main features of the last two versions of the codec are the lowest possible delay in audio playback and reduced load on the processor when encoding. The Low Latency version allows you to achieve a delay of 32 ms between the source of the audio stream and the playback device. This will reduce the distortion introduced by the equipment when listening to music.

Thus, with certain preferences, you can choose a specific codec. If playback of a lossless stream is not expected, and a high audio delay is not critical, you should limit yourself to the standard aptX and not overpay for the device to support subsequent versions.

It is worth remembering that the required profile and codec must be supported by both the smartphone (or other audio stream source) and the headset itself (or Bluetooth speaker). IN otherwise the A2DP algorithm will automatically start using the SBC.

With Bluetooth, any two devices always work using the lowest version, simplest codec and protocol. So, if one of them does not support the necessary technology, you will not be able to fully enjoy the sound quality.

Listening to music for a long time requires support for Bluetooth version 3.0 or higher, aptX codec and A2DP profile. To listen to music at a high bitrate, support for the aptX Lossless codec is required - none of the others will do, since the music will be compressed when transferred to the playback device.

Recently, the number of users of mobile gadgets has increased significantly, which means that a large number of various technical issues remain dark horses for novice users. One of these nuances is the Bluetooth version.

Protocols or profiles

Despite the fact that the compatibility of Bluetooth versions is at a fairly high level, there are still situations in which it becomes impossible to pair two devices. And the point here is precisely in the protocols, and not in the profiles. And in order to justify the aforementioned impossibility, you first need to figure out what is the difference between these two concepts.

A protocol is a set of instructions through which the transmission is carried out. various information. It is he who sets the order, operating frequency and duration of the operation of a particular component. And profiles are called additional add-ons that allow you to operate with information of a certain type. For example, A2DP is a profile that allows a bluetooth module to work with stereo sound, where, when paired, the codecs that will be used are also negotiated.

If you look at the global plan, then the version of the protocols is more important than the significance of the profile. If both devices have the same protocol version, then all standard features and features that the module supports. But with profiles, things are different. Since they are added optionally, in order for them to be used and work, they will need to be present in both gadgets. If only one bluetooth module supports the required profile, it will not be involved in data transfer.

Many users are interested in the question of how to find out the bluetooth version. There are several ways to do this, but the easiest is to read the device specification. But it is much more important to understand what is hidden behind these figures.

How to check Bluetooth version: Video

Technical data of various protocols

This description will contain far from the most complete list versions of protocols, but only the most significant for the entire technology as a whole. And, of course, it’s worth starting with the very first one, which was created without a couple of years almost two decades ago - in 1998, by the SIG partner group or the Special Interested Group. The primary development was established by the then Swedish company Ericsson 4 years before entering the market. As a result of a successful study, a worthy analogue of wired technologies was created and named after the Danish king of the northern Vikings, Harald the First Blue-toothed.

The first version had simply stunning compatibility between devices from different manufacturers. The speed was tiny, and the range clearly did not meet the established standard. If it were not for prompt attempts to refine the technology, the whole idea could have sunk into oblivion. And the professional qualities of the workers did not disappoint, because soon version 1.1 came out first, and then 1.2, which became the pinnacle of the evolution of the first generation modules. General compatibility tightened up enough high level, the range was set to honest ten meters, the transmission speed was made simply sky-high - 721 Kbps, of course, theoretically.

Version 2.1

The second generation made a revolution, but it was version 2.1 that became the guiding star that is still used today. A lot of devices of the primary and middle class use this particular variation of the bluetooth module. The main emphasis was placed on speed, and the EDR add-on became the solution. It was thanks to her that it became possible to transmit at speeds close to 3 Mbps, and the level of energy consumption was reduced by five times. Of course, various profiles and add-ons have appeared, up to the ability to distribute network access.

Third version

The high-speed specification 3.0 had much in common with Wi-Fi, but was not directly compatible with it, and the use of SLI technology, according to which two bluetooth module connected into one system, allowed to increase the transmission speed up to 24 Mbps. And when moving large files a more high-speed, but also energy-consuming protocol was used, and for small files it was very economical.

The fourth generation of devices was based on the idea to refine the previous technology so that power consumption is minimal, and all other functions and capabilities have been increased and expanded. So, in addition to speed, the radius was also increased, which now could reach hundreds of meters. Data packets have become more optimal in size, and their 128-bit encryption has also been added. The dimensions of the transmitter have become just tiny, which makes it possible to use them everywhere. One of the highlights was the addition of three modes of operation.

Sandbox

Pupsen and Vupsen October 26, 2011 at 10:07 pm

Bluetooth 4.0 - a tale about the standard

  • Lumber room *

Bluetooth or "Sinezub", which many first met while still schoolchildren or students, has a rather short biography behind it.

In 1994, two engineers working in Sweden for the then-famous Ericsson company decided to solve the cable problem once and for all and invented their own standard. wireless communication, based on the method of distributed frequency change of radio waves. After 4 years, the "Bluetooth Special Interest Group" or Bluetooth SIG was created, formalizing the first unified wireless standard. It consisted of employees of companies Ericsson, Nokia, Toshiba and Intel. IN currently the group includes more than 13,000 different companies.

Standards
Since the release of the first version of the specification, the standard has already supported the wireless transmission of voice data, remote control audio and video content, work with images and printers, could access the SIM card, contact book and work with data from medical devices. All this - by air and back in 1998!

The fourth version of Bluetooth, which I would like to talk about in detail in this post, received its final form and became available to the public at the end of June 2010. For almost a year, the technology did not appear in mass devices, until at the end of July 2011, Apple announced the release of updated laptop models. Macbook Air And system block Mac Mini, in which one of key features was the advent of Bluetooth 4.0. Technology attracted even more attention from the media after iPhone presentations 4S, which also had a version 4 chip installed.

Bluetooth 4.0
The Quartet specification included 3 main wireless data transfer protocols:
  • Classic Bluetooth. Was introduced for compatibility with all existing devices running on previous versions standard. It supports all the main functions of previous protocols, such as transferring all kinds of data types, working as a modem, wireless data synchronization, communication using other types of connections, like NFC, and so on.
  • High speed Bluetooth protocol. It was introduced back in the 3rd version, its essence is based on the use of additional levels of data transfer. It all looks like this: normal use chip it works on basic technology using the method associated with radio waves. As soon as the device needs to transfer a relatively large file, it switches to other levels of information transfer, namely, the level of data transfer over Wi-Fi. This saves both the energy of the device (additional levels require more energy, but it is saved due to the much shorter file transfer time) and users' time.
  • energy saving protocol. It is the main difference between the 4th specification and its predecessors, it is aimed for use in devices with low power consumption, the range is up to 50 meters. The bottom line is lower power consumption when the device is in standby mode. According to the developers, devices using this protocol will work much longer than their counterparts operating on the classic Bluetooth protocol: according to the calculations of technologists, the system will be able to last more than a year without recharging on a single “button” battery. This protocol is not compatible with the classical implementation of Bluetooth and it has some differences with its progenitor: for example, the wireless data transfer rate is limited to 1 MB/s (the classic has 3 MB/s), and applications can transmit over the protocol up to 0 .25 MB/s (2.1 MB/s). The protocol also uses more advanced 128-bit encryption.

    The Bluetooth SIG proposes to use this protocol for tiny touch devices (not to be confused with devices that have touch screens). An example is various pulse pressure meters, heartbeats, pedometers.

Outcome
The conclusion is simple: if the chip is in demand from manufacturers, then the market will soon be filled with sports and medical devices with incredibly low power consumption. In addition, we should expect the first breakthrough in a new category of applications for smartphones that depend on sensors from third-party devices.

Everything modern smartphones equipped with fourth-generation Bluetooth - some get version 4.0, some 4.1, and some 4.2. Meanwhile, the fifth version of the "blue tooth" was released. In this article, we will talk about its advantages over Bluetooth 4.2 and how these advantages will be put into practice.

Two times faster

Data via Bluetooth 5th generation will now be transmitted at maximum speed6.25 MB/s - used to be 3.125 MB/s. That's still a lot less than wired competitors:

  • Apple Lightning - 60MB/s
  • USB 2.0 - 60 MB/s
  • USB 3.0 - 625 MB/s
  • USB 3.1 - 1210 MB/s

But then they are wired!

As a result, the synchronization speed will increase smart watch with a smartphone, elements of the internet of things with each other and with the base.

Four times as far

Increased range indoorsfrom 10 to 40 meters, on the street - from 50 to 200 meters.

It will be possible to run at the stadium without a smartphone in your pocket. Leave it in your backpack, put on your Bluetooth headphones and run for yourself - nothing will hang out in your pocket. Maybe it was the phone that prevented you from running a marathon! True, for 42 kilometers 195 meters from wireless headphones you won't run away.

Perhaps Fabregas is not included in the line-up because he is interfered with by Bluetooth 4.2 headphones

For the organization of the Internet of things, an increased range is especially important. If the apartments were somehow enough for the old Bluetooth versions, then in a big house you had to make compromises. Now you can easily put some IoT element in the yard, away from the rest.

Eight times more data through broadcast channels

Broadcast channels are needed for the Internet of Things to work with third-party Bluetooth devices without pre-connection. In this mode, you can now transfer more information:255 bytes vs 31 in Bluetooth 4.2.

Let me explain with an example why broadcast channels are needed. Imagine a modern hospital that implements the Internet of things. A person comes in and information is immediately sent to him via Bluetooth, which office he needs. He cannot get anything else, because he is not fully connected to the hospital's Internet of Things.

The amount of this information is 31 bytes, because Bluetooth 4.2 is used. And with the 5th version, a person will also receive the name of the doctor, the approximate waiting time and the phone number of the head physician for complaints - the size of this data is already 255 bytes.

Consumes 2.5 times less energy

It seems that with increased speed and range Bluetooth actions 5 will become more gluttonous. In fact, it's exactly the opposite - new standard much more energy efficient. For smartphones with 3,000 mAh batteries, Bluetooth 4.2 power consumption was not critical. In the case with smart watch the increase in autonomy can be tangible, although, of course, you need to check in practice.

Serial connection system

IoT scaling will become easier with the new daisy-chaining system. Previously, each device was connected to a common base, but now it will be enough to connect to a neighboring element.

Remember physics!

Maybe someday we will see an urban IoT system not within an apartment or house, but a whole district or even a city? And it will be based on energy-efficient and easily scalable Bluetooth 5.

Why else is Bluetooth associated with the Internet of things? The fact is that the elements of IoT are too disparate: each manufacturer does something (or everything) in its own way. Bluetooth is one of the things that unites them all. It is used in almost all devices: phones, watches, laptops, cars and so on.

By the way, the new standard is backwards compatible with older protocols.

When to expect?

Yes, we have already waited. All the necessary documentation for the development of devices and software with Bluetooth 5 support appeared on the official website at the beginning of the year, and the other day the first smartphones with the fifth version of the “blue tooth” came out -.

Bluetooth 5 is not a revolution by any means, but rather an evolutionary development of technology. In the new standard, they only improved the performance of the previous one, but the “blue tooth” was not taught to do anything new. Protocol 4.2 can do everything that Bluetooth 5 does, only several times worse.

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thanks. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!