Analysis of Bluetooth baseband data transmission mechanism

Source: Internet
Author: User

Bluetooth)It is a new, open, low-cost, and short-range wireless connection technology that can replace short-range cables for wireless voice and data transmission. This effective and inexpensive wireless connection technology can easily connect computers and peripherals, mobile phones, handheld computers, Information appliances, and other devices, all kinds of mobile devices can achieve seamless resource sharing within the scope it can achieve. It can also connect to the Internet through a wireless LAN (wirelesslan) to achieve wireless transmission of multimedia information.

The Bluetooth system adopts a distributed (scatter) structure. The devices and the sub-networks form a network (piconet). It supports point-to-point and point-to-point multi-point communication. It adopts gfsk modulation and has good anti-interference performance. It uses fast frequency hopping and short packet technology to reduce Co-frequency interference and ensure transmission reliability. The frequencies used are GHz ISM frequencies that do not require permission.

The Bluetooth protocol consists of the core protocol, cable replacement protocol (RFCOMM), circuit control protocol, and selection protocol.

Core protocols:It is a patented Bluetooth protocol and is fully developed by the Bluetooth Sig, including the baseband protocol (bb), Connection Management Protocol (LMP), Logical Link Control and Adaptation Protocol (L2CAP) and the Service Discovery Protocol (SDP ).

The architecture of the Bluetooth protocol can be divided into three parts: underlying hardware module, intermediate protocol layer, and high-end application layer. The Link Management Layer (LM), baseband (bb), and RF layer (RF) constitute the underlying module of Bluetooth. It can be seen that the baseband layer is a key component of the Bluetooth protocol. This article mainly analyzes the most important baseband data transmission mechanism in Bluetooth technology.

1. baseband protocol Overview

Figure 1 shows the structure of the Bluetooth system. In a Bluetooth system, a network connected to a device is called the pico network (piconet). It consists of a master node and multiple slave nodes (slaveunit. The master node is the bluetooth device used to synchronize other nodes in the micro-network. It is the initiator of the connection process and can maintain connections with up to seven slave nodes at the same time. The slave node is a device except the master node in the micro-network. Two or more micro networks can be connected to form a scatternet ).

Figure 2 shows the Bluetooth protocol structure. The baseband layer is located above the Bluetooth RF of the Bluetooth protocol stack, and together with the RF layer forms the Bluetooth physical layer. Essentially, as a link controller, it describes the digital signal processing specifications of the baseband link controller and works with the link manager to execute link layers such as connection establishment and power control, 3. The baseband transceiver divides the time (time division) while frequency hopping, and uses the Time Division Duplex (TDD) mode (alternate transmission and receiving ), the baseband is responsible for writing digital signals and reading data from the transceiver. It manages physical channels and links, and is responsible for frequency hopping and transmission of blue tooth Data and Information frames, such as error correction, data whitening, and Bluetooth Security. The baseband also Manages synchronous and asynchronous links, processes packets, performs paging, queries and accesses, and obtains Bluetooth devices.

In the Bluetooth baseband protocol, four types of addresses can be used for the same scenario and status. The 48-bit bluetooth device address bd_addr (IEEE802 standard) is the only standard for the bluetooth device connection process. The 3-bit mini-network activation Node Address am_addr is used to identify the active member in the micro-network, the three-bit address is used for broadcasting information. The eight-bit sleeping Node Address pm_addr is used to identify the sleeping slave node in the micro-network. The sub-network access address ar_addr is allocated to the slave node in which the wake-up process is to be started.

When the micro-network Master communicates from the node, they must be synchronized. The clock used for synchronization includes the clock clkn of the local device that is neither adjusted nor closed, the system clock CLK of the master node in the micro-network and the clock of the master node periodically update the clock of the local device on the slave node to keep the master-slave synchronous compensation clock clke.

Like other wireless technologies, micro-grids in Bluetooth can transmit data wirelessly through various channels. Physical channels represent the pseudo-random frequency hopping sequence of 79 or 23 RF channels. The frequency hopping sequence of each micronetwork is unique, it is determined by the active node's bluetooth device address. In addition, there are five logical channels for transmitting different types of information, which are:

(1) LC channel: control channel used to transmit link layer control information;

(2) LMC channel: A link management channel used to transmit Link Management Information at the link layer;

(3) UA channel: User channel used to transmit Asynchronous User information;

(4) UI channel: User channel, used to transmit user information at the same time;

(5) us Channel: User channel used to transmit synchronized user information.

In the Bluetooth system, master and slave nodes transmit data in turn using the Time Division Duplex (TDD) mechanism. Therefore, the channel can be divided into a time slot (timeslot) with a length of 625 μs and numbered (0-227-1) with the master node clock of the micro-network ), the master and slave nodes send data in odd and even time periods respectively.

2. Bluetooth Data Transmission

Bluetooth supports circuit and group switching. Data is transmitted in the channel in the form of group, and traffic control is used to avoid group loss and congestion. In order to ensure the correct transmission of group package data, we also conduct data Whitening and error correction. The following analyzes these transmission mechanisms respectively.

2.1 Bluetooth Group

Group package data can contain voice, data, or both. Packet grouping can take up multiple time periods (Multiple Time Slot groups) and can continue sending at the next time slot. The payload also carries 16-Bit Error verification identification and verification (CRC ). There are 5 common group types, 4 SCO group packages and 7 ACL group packages. Generally, the packet format is 4.

The access code is used for timed synchronization, offset compensation, paging, and query. There are three different types of access codes in Bluetooth:

(1) Channel Access Code (CAC): used to identify a micronetwork;

(2) Device Access Code (DAC): used for device paging and response;

(3) query access code (IAC): used for device query purposes.

The header contains six fields for Link Control. Am_addr indicates the active Member Address, type indicates the group type, flow indicates the ACL traffic control bit, arqn indicates the group package validation ID, and seqn indicates the group number used for group shuffling, HEC verifies the group header. Bluetooth uses a fast and unnumbered packet validation method to determine whether to receive the packet by setting the appropriate arqn value. If the packet times out, the packet is ignored and the next packet is sent.

2.2 link and Flow Control

Bluetooth defines two link types: connection-oriented synchronization Link (SCO) and connectionless asynchronous Link (ACL ). The SCO link is a symmetric point-to-point synchronization link between the master and slave nodes. It is sent to the SCO group during the pre-stay time and is a circuit exchange that carries voice information. The master node supports three SCO links at the same time, and the slave node supports two ~ The three links are SCO, and the SCO group package does not support retransmission. The SCO link is established by sending a SCO message through the master node LMP. The message contains the scheduled parameters (tsco and dsco ).

An ACL Link provides an asynchronous or synchronous data exchange mechanism between a primary node and any slave node in a time slot that is not reserved for the SCO link. A master-slave node can maintain only one ACL link. When multiple ACL groups are used, Bluetooth uses the packet retransmission mechanism to ensure data integrity. When the ACL group does not specify a slave node, it is considered as a broadcast group, and each slave node receives this group.

We recommend that you use FIFO queues for sending and receiving ACLs and SCO links. The Connection Manager is responsible for filling these queues, and the connection Controller is responsible for automatically clearing queues. When the receiving FIFO queue is full, use flow control to avoid group loss and congestion. If data cannot be received, the receiver's link controller sends a Stop command and inserts it into the returned header, and the flow position is 1. When the sender receives the stop instruction, its FIFO queue is frozen to stop sending. If the receiver is ready, send a go group to the sender to resume data transmission. The flow position is 0.

2.3 Data Synchronization, scrambling, and error correction

Because the bluetooth device transmitter uses the Time Division Duplex (TDD) mechanism, it must send and receive data in a synchronous manner. The system clock of the master node is used to synchronize data and determine the phase in the frequency hopping sequence. When the micronetwork is created, the master node clock is transferred to the slave node. Each slave node adds an offset to its local clock to synchronize the clock with the master node. The master node does not adjust its system clock within the same period of time. In order to match the clock of the master node, the slave node will update the cycle at the offset. The Bluetooth clock should have a resolution rate of at least 312 μs. Compared with the ideal 625ms time slot, the average sending time of the master node group cannot exceed 20ppm, And the jitter (jitter) should be less than 1 ms.

Before grouping data is sent out and FEC encoding is performed, the grouping header and the Net Load need to be disturbed to randomize grouping packets. When receiving a Data Group package, use the same white text to remove the disturbance.

To improve data transmission reliability and system anti-interference, bluetooth data transmission adopts three Error Correction Methods: 1/3-rate FEC encoding (that is, each data bit repeats three times) redundant 2/3-rate FEC encoding formula (that is, a polynomial generator is used to encode a 10-bit code into a 15-bit code) and automatic data re-transmission method (that is, the sender resends the data packet until receiving the confirmation message from the receiver ).

Figure 4 Bluetooth group package format

3. Bluetooth device connection

The Bluetooth connection controller works in two major states: standby and connection ). In a bluetooth device, standby is the default low-power status. It only runs the local clock and does not interact with any other device. In the connection status, the master node and slave node can exchange packet for communication. Therefore, to achieve mutual communication between bluetooth devices, you must establish a connection with each other. Because the ISM band used by Bluetooth is open to all radio systems, it may encounter various interference sources, therefore, Bluetooth uses grouping packets to quickly confirm the technology and Frequency Hopping scheme to ensure the stability of links and channels. During connection and communication, the frequency hopping sequence is used as the physical channel. The frequency hopping option is to select the communication channel.

3.1 frequency hopping

The frequency hopping technology divides the frequency band into several frequency hopping channels ). The radio transceiver continuously jumps from one channel to another according to a certain code sequence (by generating random numbers), and both the receiving and sending sides can communicate and synchronize according to this rule. The instantaneous bandwidth of frequency hopping is very narrow, and the impact of interference is minimized by the Spread Spectrum Technology. When a device is activated, the device is assigned 32 Hop Frequency points, and the device will receive and send information on these Hop Frequency Points. The General Frequency Hopping scheme consists of two parts: select a sequence and map the sequence on the frequency hopping point. In each case, two frequency hopping sequences are required: Master and master. The frequency hopping sequence used in the Bluetooth system is as follows:

(1) call frequency hopping sequence: Used in the call (PAGE) status;

(2) Call response sequence: Used in the call response (pageresponse) status;

(3) query sequence: Used in the inquiry status;

(4) query response sequence: Used in the inquiryresponse status;

(5) channel frequency hopping sequence: Used in connection status.

3.2 establish a Bluetooth connection

The connection is established from the pending status to the connection status. Generally, the connection process between two devices is as follows:

First, the master node uses Giac and DIAC to query the Bluetooth devices in the specified range (query status ). If any nearby bluetooth device is listening for these queries (querying the scan status), after sending its address and clock information, the slave node can start to listen to Paging Messages (paging scan) from the master node. The master node can call these devices (paging status) to establish a link between devices nearby. After the slave node of the paging scan is called by the master node, the Server Load balancer returns the response with a DAC (Device Access Code ). After receiving the response from the slave node, the master node can send the response to the slave node with the real-time clock, bd_addr, BCH parity, and equipment (FHS packet ), finally, after the FHS group has been received from the node, it enters the connection status. Specific process 5.

Figure 5 shows that the master node and slave node are in different States at different stages of the call established by the Bluetooth connection, including:

Query (Inquiry ):The query is used by the master node to find the bluetooth device in the monitored area, so that the device address and clock of the node are obtained by collecting the response query message from the node. IAC is used during the query;

Query scan (inquiryscan ):The Bluetooth device periodically listens for query messages from other devices so that they can be found. During scanning, the device can listen to the common query access code (Giac) and specific query access code (DIAC );

Query response (inquiryresponse ):The slave node responds to query messages by FHS group. It carries the DAC and local clock information of the slave node;

Page): The master node sends messages in different frequency hopping sequences to activate a slave node and establish a connection. DAC is used during paging;

Pagescan ):The slave node wakes itself up periodically within the scanning window interval and listens to its own DAC. The slave node selects a scanning frequency based on the paging frequency hopping sequence on the scanning window every 1.28s;

Slave node response (slaveresponse ):When receiving a page call message from the master node in the page scan status, the node returns to the response status and responds to the page call message from the master device;

Master node response (masterresponse ):After the master node receives a response from the slave node to its paging message, the master node sends an FHS group to the slave node. If the slave node responds to the response, the master node enters the connection status.

3.3 connection status

Connection)The status starts when the master node sends a poll group, indicating that the connection has been established. The group package can be sent back and forth between the master and slave nodes. Both ends of the connection, that is, the master and slave nodes, use the access code and clock of the master node, and use the Hop Frequency sequence as the channel Hop Frequency Sequence. After the connection is established, the bluetooth device address (bd_addr) of the master node determines the frequency hopping sequence and the channel access code. A Bluetooth device in the connection status may have the following sub-states:

Active: In this mode, the master and slave nodes send and receive packets through the channel, and keep them synchronized;

Sniff: In this mode, the slave node does not currently support ACL grouping, that is, the ACL link enters the low-energy sleep mode, and resources are empty, so that activity and channel such as paging and scanning are still available;

Park: When the slave node does not have to intervene in the micro-network channel, but still wants to maintain synchronization with the channel, it can enter the park (sleep) mode. At this time, there are very few activities in the low consumption mode, the slave node abandons am_addr and uses pm_addr.

4. Complete Bluetooth Mechanism

Bluetooth completeness is important if bluetooth technology can be used to achieve unlocked doors or automatically pay for orders in supermarkets. The Bluetooth protocol provides a reliable security mechanism for data transmission. First, the Bluetooth Baseband module provides users with protection and information encryption mechanisms at the physical layer. On the link layer, it performs equivalent authentication and encrypts user information. The Bluetooth device uses the query/response method for authentication during connection. A device sends a password or query, and the device responds to the password, which can prevent theft and misuse. The information encryption mechanism is to encrypt user data or information by using the sequential password encryption algorithm after the bluetooth device is established, thus increasing the system security. The link layer has four parameters to ensure communication security: the bluetooth device address bd_addr, the authentication private key, the encrypted private key, and the random code Rand. If you have higher confidentiality requirements, you can adopt a more effective transport layer and application layer full mechanism. In short, the purpose of Bluetooth's complete mechanism is to provide appropriate levels of complete protection. Bluetooth is a complicated problem, so we will not discuss it further here.

This article mainly analyzes and discusses the most basic and important baseband layer of Bluetooth technology, and lays the foundation for further in-depth research and development and application of Bluetooth technology. Bluetooth technology is mainly used in small-scale home and office information transmission systems and information appliances. Therefore, the development and application of Bluetooth technology is of great practical significance. In particular, our country is densely populated and has broad application prospects, and will have a significant impact on the establishment of our national economy.

Source Document

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.