Skip to main content

Bluetooth

What is Bluetooth?
Bluetooth is a high-speed, low-power microwave wireless link technology, designed to connect phones, laptops, PDAs and other portable equipment together with little or no work by the user.

Bluetooth is the name for a short-range radio frequency (RF) technology that operates at 2.4 GHz and is capable of transmitting voice and data. The effective range of Bluetooth devices is 32 feet (10 meters). Bluetooth transfers data at the rate of 1 Mbps, which is from three to eight times the average speed of parallel and serial ports, respectively. It is also known as the IEEE 802.15 standards. It was invented to get rid of wires. Bluetooth is more suited for connecting two point-to-point devices, whereas Wi-Fi is an IEEE standard intended for networking.

Why is the technology called Bluetooth?
The heart of the Bluetooth brand identity is the name, which refers to the Danish king Harald "Bluetooth" Blatand who unified Denmark and Norway. In the beginning of the Bluetooth wireless technology era, Bluetooth was aimed at unifying the telecom and computing industries.

Bluetooth can be used to wirelessly synchronize and transfer data among devices. Bluetooth can be thought of as a cable replacement technology. Typical uses include automatically synchronizing contact and calendar information among desktop, notebook and palmtop computers without connecting cables. Bluetooth can also be used to access a network or the Internet with notebook computer by connecting wirelessly to a cellular phone.
Bluetooth SIG
Bluetooth is supported by over 2,500 hardware and software vendors who make up the Bluetooth Special Interest Group (SIG). This consortium, which was originally comprised of only five companies, develops and promotes the Bluetooth global wireless technology. The goals of the SIG are to develop technical specifications that enable Bluetooth products to be used across different vendor devices (interoperability).
The Bluetooth Protocol Stack

Figure: Bluetooth protocol stack
The Bluetooth radio and baseband Layer
 These layers define the transmission characteristics and link level protocols that allow links to be established with other Bluetooth devices.
Link Manager Protocol (LMP) Layer
The duties of Link Manager Protocol (LMP) layer in the Bluetooth stack can be divided into two broad categories: managing the piconet and performing security.
Piconet Management
Managing the piconet involves such actions as regulating the steps for attaching and detaching slaves from the master as well as overseeing the master-slave switch. These are all handled by the LMP layer of the Bluetooth protocol stack.
Another function of this layer involves establishing the links between Bluetooth devices. There are two types of physical links between devices:
Synchronous connection-oriented (SCO) link:
·         It is a symmetric point-to-point link between a master and a single slave in the piconet.
·         The SCO link mainly carries voice transmission at a speed of 64 kbps.
·         This link functions like a circuit-switched link by using reserved slots at regular intervals.
·         The master can support up to three simultaneous SCO links while slaves can support two or three SCO links.

Asynchronous connection-less (ACL) link:
·         It is a packet-switched link that is used for data transmission.
·         The ACL link is from one master to all the slaves participating on the piconet.
·         It is sometime called a point-to-multipoint link.
·         Only a single ACL link can exist.
·         A slave engaged in an SCO link can have an ACL link.
Once a Bluetooth device is connected to a piconet, it can be in one of four connection modes: Active, Hold, Sniff, or Park. Devices synchronized to a piconet can enter into one of the power-saving modes in which device activity is lowered.
·         Active mode: Here, the Bluetooth unit actively participates on the channel. The master schedules the transmission based on traffic (data transmission) demands to and from the different slaves. In addition, it supports regular transmission to keep slaves synchronized to the channel. Active slaves listen in the master-to-slave slots for packets.

·         Sniff mode: Here, a slave device listens to the piconet master at a reduced rate so that it uses less power. The interval is programmable and depends on the application. It is the least power efficient of the power-saving modes.

·         Hold mode: The master unit can put slave units into Hold mode, where only the slave’s internal timer is running. Slave units can also demand to be put into Hold mode. Data transfer restarts instantly whenever the slave moves from Hold mode back to Active modes.

·         Park mode: It is the most efficient power-saving modes. In Park mode, a device is still synchronized to the piconet but it does not participate in the traffic. Bluetooth devices that are in this mode have given up their Active Member Address. These slaves occasionally listen to the traffic of their master in order to resynchronize and check on broadcast messages.

Security
Security for Bluetooth transmission, as with all wireless communications, can be an area of concern. Bluetooth provides security at the LMP layer and also provides encryption services. Security is a Bluetooth piconet based on identifying the device itself and not who is using the device. There are three levels of Bluetooth security.
·         Level 1 – No security. At this level a Bluetooth device will not initiate any security steps.
·         Level 2 – Service-level security. At Level 2 security is established after a connection is made. This is done at the higher levels of the protocol stack.
·         Level 3 – Link-level security. Link-level security is performed before a connection is made and is done at the lower levels of the protocol stack.

L2CAP
·         It stands for Logical Link Control and Adaption Protocol.
·         This protocol is used by upper layer protocols for data transport.
·         It can be thought as an adapter between the upper and lower layers.
·         L2CAP messages are transported in the payload data field of Bluetooth data packets just as LMP messages are.
·         It is responsible for upper-layer protocol data segmentation (divide the data) and reassembly (gather the divided packets) as well as transport of quality of service information.
·         It is a data link layer protocol providing both connection-oriented and connectionless services.
·         It will accept blocks of data up to 64 kilobytes in length and will reliably transport them to its peer in the target device using the services provided by the baseband layers.
RFCOMM
·         It stands for Radio Frequency Communication.
·         Also known as cable replacement protocol. This allows for a simple replacement of serial line cables and enables many legacy applications and protocols to run over Bluetooth.
·         It provides RS-232 serial port emulation to the application or to higher-level protocols.
·         It provides a common programming interface for actual serially connected devices such as printers and modems as well as for communication through a Bluetooth radio link.
·         It supports up to 60 concurrent (simultaneous) port connections.
SDP
Bluetooth devices should work together with other devices in unknown environments in an ad-hoc fashion. It is essential to know what device, or more specifically what services, are available in radio proximity (nearness). To find new services, Bluetooth defined the service discovery protocol (SDP). SDP defines only the discovery of services, not their usage. Discovered services can be cached and gradual discovery is possible. Devices that want to offer a service have to install an SDP server. For all other devices an SDP client is sufficient.
All the information an SDP server has about a service is contained in a service record. This consists of a list of service attributes and is identified by a 32-bit service record handle. SDP does not inform clients of any added or removed services. There is no service access control or service brokerage. A serial attribute consists of an attribute ID and an attribute value. The 16-bit attribute ID distinguishes each service attribute from other service attributes within a service record. The attribute ID also identifies the semantics of the associated attribute value. The attribute value can be an integer, a UUID (universally unique identifier), a string, a Boolean, a URL etc.

Network Topology
When two Bluetooth devices come within range of each other, they automatically connect with one another. One device is the master, which controls all of the wireless traffic. The other device is known as slave, which takes commands from the master. A Bluetooth network that contains one master and at least one slave that use the same channel forms a piconet. Bluetooth slave devices that are connected to the piconet and are sending transmissions are known as active slaves; devices that are not connected but are not actively participating are called parked slaves.
Devices in a piconet can be one of five different modes:
·         Standby – A device in standby mode is waiting to join a piconet.
·         Inquire – In inquiry mode, a Bluetooth device is looking for other devices with which to connect.
·         Page – Page mode is when a master device is asking to connect a specific slave.
·         Connected – When a device is either an active slave or a master it is in connected mode.
·         Park/hold – A device in park/hold mode is part of the piconet but is in a low-power state.




Figure: Piconets
Each Bluetooth device is preconfigured with addresses that are needed when participating in the piconet. Three of the important addresses are summarized in below table:

Name
Description
Bluetooth device address
Unique 48-bit number
Active member address
3-bit number valid only as long as device is an active slave.
Parked member address
8-bit number valid only as long as device is a parked device


Table: Piconet radio module addresses
A connection between Bluetooth devices is normally a two-step process. The first step is known as the inquiry procedure. The inquiry procedure enables a device to discover which devices are in range and identify the addresses for the devices. When a Bluetooth device enters into the range of other devices, it first attempts to find what other devices are in the area. In figure, device A, with its device ID, moves into the area where other Bluetooth devices exist. Device A wants to find the other Bluetooth devices in the area, so it goes into inquire mode and sends out a transmission. Device B, C, D and E receive that transmission.


Figure: Device A inquiry
When Device B receives the inquiry, it responds by sending back its own device ID. Device A now knows the device ID of Device B. Device A sends a confirmation back to Device B. This is illustrated in below figure.


Figure: Device B response
However, when Devices C and D attempt to respond, they simultaneously transmit and the data becomes corrupted, as seen in the below figure.


Figure: Collision
Because Device A does not respond with a confirmation to Devices C and D, they both know that the transmission was not received. Device C may wait for 7 seconds (for example) and Device D may wait for 24 seconds. Device A sends out another inquiry. Because Device C had a shorter time to wait, it “awakens” first, receives the inquiry, and sends its response of its device ID, as seen in below figure. After Device A sends back a confirmation to Device C it again sends out an inquiry. This time Device D awakens, sends its response, and receives confirmation. Device E does the same. Now Device A knows the device ID of all other Bluetooth devices in the area.


Figure: Device C response
The step after the inquiry procedure is known as the paging procedure, when an actual connection can be established. A unit that establishes a connection will carry out a paging procedure and will automatically be the master of the connection. The procedure occurs as follows. Device A switches to page mode and pages Device B with B’s device ID. Device B responds back to the Device A. Device A now sends to B its (Device A’s) device ID. This is the information that Device B needs to synchronize with Device A. Device A now connects with Device B to form a piconet. Device A is the master and Device B is the slave. This is illustrated in below figure.


Figure: Piconet formed
Multiple piconets can cover the same area. Because each piconet has a different master and hop sequence, the risk for collisions (two devices attempting to send at the same microsecond on the same channel) is slim. However, if many more piconets are added, the chances of collisions increases, which will impact the speed of the network.
If multiple piconets cover the same area, a Bluetooth device can be a member in two or more overlaying piconets. A group of piconets in which connections exist between different piconets is called a scatternet. A scatternet is illustrated in below figure. In order to communicate in its respective piconets, the device must use the master device address for each piconet.

Figure: Scatternet
Bluetooth Frames
The packet or frame of a Bluetooth transmission is illustrated in below Figure. Each frame consists of three parts:


Access code
This first field of a packet is needed for timing synchronization and piconet identification (channel access code, CAC). It may represent special codes during paging (device access code, DAC) and inquiry (inquiry access code, IAC). The access code consists of a 4 bit preamable, a synchronization field, and a trailer (if a packet header follows).
Packet header
·         This field contains typical layer 2 features: address, packet type, flow and error control, and checksum.
·         The 3-bit active memory address represents the active address of a slave. Active addresses are temporarily assigned to a slave in a piconet.
·         If a master sends data to a slave the address is interpreted as receiver address. If a slave sends data to the master the address represents the sender address.
Payload
The payload field can contain data, voice, or both. Up to 343 bytes payload can be transferred.  

Switching
The concept of switching is important to all types of telecommunications, wireless as well as wired. Switching involves moving the signal from one wire or frequency to another. Consider for a moment the telephone in your home. You can use that one telephone to call a friend across the street, a classmate in another town, a store in a distant state – or anyone else around the world who also has a phone. How can one single phone be used to call all other telephones on the earth? This is accomplished through a switch at the telephone company’s central office. The signal from your phone goes out your telephone’s wire and is then switched or moved to the wire of the telephone that belongs to your friend across the street. This is illustrated in the below figure.


Figure: Telephone Switch 
Switching is also important for modern local area network transmissions. Signal from the sending computer are sent down the wire to a switch that moves the signal from the sending’s computer wire over to the wire of the receiving computer. Without a switch, each computer would have to be directly connected to all other computers in the network. A wired computer network of 500 computers not using a switch would require 249,500 cables to connect all of the computers.
Although telephone systems and local area networks both use switching, the type of switching that they use is not identical. This is because of how the voice or data is transmitted. Telephone systems use a type of switching known as circuit switching. When a telephone call is made, a dedicated and direct physical connection is made between the caller and the recipient of the call through the switch. While the telephone conversation is taking place, the connection remains open between only these two users. No other calls can be made from that phone while the first conversation is going on, and anyone who calls that phone will receive a busy signal. This direct connection lasts until the end of the call, at which time the switch drops the connection. Circuit switching is used for both wired and cellular wireless telephone systems.
Circuit switching is ideal for voice communications. However, circuit switching is not efficient for transmitting data. This is because data transmissions occur in bursts with periods of delay in between. The delay would result in time wasted while nothing was being transmitted. Instead of using circuit switching, data networks use packet switching. Packet switching requires that the data transmission be broken into smaller units called packets. Each packet is then sent independently through the network to reach the destination as seen in below figure.


Packet switching has several advantages for data transmissions. First, it allows better utilization of the network. Circuit switching ties up the communication line until the transmission is complete, whereas packet switching allows multiple computers to share the same line or frequency. That’s because packets from several different computers can be intermingled together while being sent. It is not necessary for the packets to arrive in the correct sequence; the receiving device accumulates packets and re-assembles them in the correct order based on the packet number. If there is a transmission error it will only affect one small packet. Only that packet and not the entire document would have to be re-sent.

Resources Used:
1.      Guide to Wireless Communication (by Mark Ciampa)
2.      Mobile Communications (by Jochen Schiller)
3.      Principles of Mobile Computing (by Uwe Hansmann)
4.      Bluetooth image (from Google)
5.      All the images (made by Chaudhary Amit V.)

Compiled By: Chaudhary Amit V.


Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...