Bluetooth protocol stack Basics

Source: Internet
Author: User

With the development of network and other technologies, many of our products have become wireless. For example, wireless headphones and wireless mouse. These products are also integrated with the Bluetooth protocol stack technology. To understand the content of the Bluetooth protocol stack, we need to start with the bluetooth technology.

1. What is Bluetooth?

The so-called bluetooth technology is actually a short-range radio technology. using Bluetooth technology, it can effectively simplify Mobile Communication Terminal devices such as handheld computers, laptops, mobile phones, etc, in addition, it can successfully simplify the communication between these devices and the Internet, so that the data transmission between these modern communication devices and the Internet becomes more rapid and efficient, and broaden the road for wireless communication. in layman's terms, the bluetooth technology enables modern mobile communication devices and computer devices to connect to the Internet without using cables and to connect to the Internet over wireless. its practical application scope can also be expanded to various household appliances, consumer electronic products and information appliances such as automobiles, forming a huge wireless communication network.

2 features of Bluetooth

2.1 architecture of the Bluetooth protocol

The entire Bluetooth protocol architecture can be divided into three parts: the underlying hardware module, the intermediate protocol layer, and the high-end application layer. the Link Management Layer (LMP), baseband layer (BBP), and Bluetooth radio channels constitute the underlying module of Bluetooth. the BBP layer transmits the Hop Frequency and Bluetooth data and information frames. the LMP layer is responsible for establishing and removing connections and ensuring link security and control. They provide different access populations for upper-layer software modules, however, the message and data transmission between the two module interfaces must be explained by the Bluetooth Host Controller Interface. that is to say, the intermediate protocol layer includes the Logical Link Control and Adaptation Protocol (L2CAP), Service Discovery Protocol (SDP), serial port simulation protocol (RFCOMM), and telephone control protocol specification (TCS ). l2CAP functions such as data disassembly, service quality control, protocol reuse, and group extraction are the basis for the implementation of other upper-layer protocols. Therefore, it is also the core part of the Bluetooth protocol stack. SDP provides a mechanism for upper-layer applications to discover available services and their features in the network. at the top of the Bluetooth protocol stack is the high-end application layer, which corresponds to the profile of various application models and is part of the profile. currently, 13 types of sections are defined.

2.2 Bluetooth Low-layer Module

In the Bluetooth protocol stack, the Bluetooth Low-layer module is the core of the Bluetooth Technology and must be included by any bluetooth device.

Bluetooth works in the 720 GHz ISM band. The device end with Bluetooth can provide a data exchange rate of up to kbit/s.

Bluetooth supports two link types: connection-oriented synchronous Link (SCO) and connectionless asynchronous Link (ACL ).

To connect a bluetooth device at a low power, three energy-saving states are defined, namely, the Park status, Hold status, and Sniff) status. these working modes are in ascending order of Energy Efficiency: Sniff mode, Hold mode, and Park mode.

Three error correction schemes are used for Bluetooth: 1/3 forward correction (FEC), 2/3 forward correction, and automatic re-transmission (ARQ ). the purpose of forward correction is to reduce the possibility of re-sending, but it also adds additional overhead. however, in a reasonable error-free environment, excessive bids will reduce the output, so the Group definition itself remains flexible. Therefore, you can define whether to adopt FEC in the software. in general, when the channel noise is large, the Bluetooth system uses a forward correction scheme to ensure the communication quality: For SCO links, 1/3 forward correction is used; for ACL links, use forward 2/3 for error correction. in the unnumbered automatic request re-sending scheme, the data transmitted by one time slot must be confirmed by the next time slot. A confirmation message is sent back to the sender only when the receiver passes the header error detection and cyclic redundancy check (CRC). Otherwise, an error message is returned.

The mobility and openness of the Bluetooth system make security problems important. although the FM technology used by the Bluetooth system has provided certain security protection, the Bluetooth system still needs security management at the link layer and application layer. at the link layer, the Bluetooth system provides functions such as authentication, encryption, and key management. each user has a personal identification code (PIN) which is translated into a-bit Link Key for single-way authentication. once the authentication is completed, the link will be encrypted with a password of different lengths (Encryphon Key) (this password is increased or decreased in shit units, and the maximum length is bits) the Link Layer Security Mechanism provides a large number of authentication schemes and a flexible encryption scheme (that is, the length of the password can be negotiated ). this mechanism is extremely important when devices from different countries communicate with each other because the maximum password length is specified in some countries. the Bluetooth system selects the minimum maximum allowed password length for each device in the micro-network. for example, in the United States, the password length is bits, and in Spain, the password length is only 48 bits. In this way, when devices in the two countries are interconnected, 48 bits are used for encryption. the Bluetooth system also supports the special security mechanisms in different applications of high-level protocol stacks. for example, when two computers exchange business card information, one computer can only access the business of the other computer, but cannot access other services. the Bluetooth security mechanism depends on the PIN to Establish a trust relationship between devices. Once this relationship is established, these PIN can be stored in the device for faster and faster connection in the future.

2.3 Bluetooth protocol stack software module

L2CAP is part of the data link layer and is located above the baseband protocol. l2CAP provides connection-oriented And connectionless data services to the upstream layer. Its functions include: Protocol reusability, grouping division, And re-assembly (Segmentation And Reaassembly) and the Group sequence action ). l2CAP allows high-level protocols and applications to send and accept data groups up to 64 K bytes.

SDP provides an application with a method to discover available protocols and determine the features of these available protocols. service discovery in the Bluetooth environment is very different from service discovery in the traditional network environment. In the Bluetooth environment, the mobile RF environment changes a lot, therefore, the business parameters are constantly changing. SDP highlights the unique features of the Bluetooth environment. bluetooth uses the customer/Server mechanism to define how to discover services based on the Bluetooth service type and attributes. It also provides a service browsing method.

RFCOMM is a RF communication protocol that simulates the serial cable interface protocol and complies with the ETSI0710 serial port simulation protocol. through RFCOMM, Bluetooth supports high-level protocols, such as PPP, TCP/IP, and WAP, in a wireless environment. in addition, RFCOMM supports AT command sets to achieve wireless connections between mobile phones, fax machines, and modem.

Bluetooth voice support is an important indicator of its difference from WLAN. the bluetooth telephone control specification is a ITU-T-based recommendation Q.931 using bits-oriented laundry, it defines call control signaling for establishing voice and data calls between bluetooth devices and the mobility management process for handling Bluetooth TCS devices.

3 Bluetooth development overview

3.1 significance of Bluetooth Development

In view of the important position of Bluetooth in future information products, it is of great significance to develop Bluetooth products with proprietary rights in China. for some information appliance manufacturers, the main purpose is to integrate Bluetooth as a communication module into their own products, they can use Bluetooth products of other manufacturers, they only need to focus on the development of application; for those manufacturers specialized in Bluetooth R & D and production, they need to carry out comprehensive development from the underlying layer to the high-level level. Only in this way can they master the core technology of Bluetooth, in order to produce products with proprietary intellectual property rights.

3.1.1 preparations before development

(1) have a preliminary understanding of Bluetooth-related specifications and protocols, and conduct detailed research on the areas to be developed. The Protocol requirements must be clear, the application environment of the product must be very clear.

The Bluetooth specification includes the core part of the protocol and the Application Section (user model) of the Bluetooth protocol. The content should be rich and comprehensive understanding of the entire protocol, but it is difficult to implement it objectively, we can start with some simple introductions and have a comprehensive understanding of the Bluetooth architecture system as a whole, and then understand the overview of the Bluetooth system from the user's perspective, select relevant protocols for specific research based on the products you have prepared and developed.

(2) Conduct a detailed survey on similar products. you can view related products by category, as well as product performance and usage methods, and obtain information about related vendors. (3) You can also apply to join the Bluetooth SIG to become a member of the SIG.

(4) Develop a detailed product development plan to be as comprehensive as possible.

(5) establish a development platform and development environment, and prepare and select corresponding development tools.

The Bluetooth development tool should include an interface component of the Bluetooth hardware and the required software. At least one pair of nodes is required to establish a link, more nodes may be required to develop more complex applications. hardware can be in various forms, such as IC card, USB dougle, development tool, UART attachment, etc. It can also be self-developed or specially customized hardware.

When selecting hardware, you must first determine what applications to be developed are for embedded systems or computer systems? If it is used in computer systems, it is enough to use a PC Card or USB dougle. In this case, a simple development tool is used. for embedded systems, more complex development tools are required to allow development of firmware and download to development tools, or if you want to directly test the microprocessor or FPGA, you can create a development board. You need to purchase a PCB consisting of a bluetooth module and a microprocessor or FPGA, peripheral devices also need to program the microprocessor/FPGA. secondly, the question to be noted is whether the application includes speech? Some development systems do not include voice interfaces. If only data transmission is available for applications, you should consider the data rate. You can use UART connectors. For data applications with full speed, USB is required.

After deciding what hardware to use, consider the software stack. if the application to be developed can use a profile in the Bluetooth specification, you only need to implement the software stack related to the profile. in this case, you often need to develop your own custom stack to better meet the application requirements. if the application to be developed cannot use the existing profile structure, it must interact with the device that belongs to the specific profile. compatibility must be kept in mind when designing the protocol stack requirements. before deciding to use a protocol stack, you must carefully check the capabilities provided by the Protocol Stack. Not all protocol stacks implement all the functions listed in the specification, some features may not be implemented yet. in addition to comparing prices, document quality and after-sales support also require special consideration.

(6) before development, you must also understand the relevant authentication and test specifications of the Bluetooth protocol stack, as well as related programs, so as to identify the testing interfaces during the development process.

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.