Content Index:
Introduction : Bluetooth
Part 1: Bluetooth Framework
Part 2: Physical Layer
Part 3: Logical Transports (Link Layer)
Physical links are eventually managed by a combination of master – slave relationship and the time slots within the medium. The most cogent way to grasp how these slots are used for transferring data is to explore this within the context of the popular BT use cases given below.
- Hands free
& - Music Playback (A2DP)
- SCO (Synchronous Connection Oriented) &
- eSCO (Extended Synchronous Connection Oriented)
- Total six slots are reserved for eSCO.
- Out of the six slots one slot is for master to slave Tx and one for slave to master.
- Four slots are reserved for retransmissions
- There are two unreserved slots between each eSCO window.
As you can see above eSCO support more than 1 MBPS rates, this in turn means that EDR (Extended Data Rate) modulation scheme will be used for eSCO but not for SCO, similarly for ACL there are BDR and EDR modulations supported, usage of the packet type will determine the modulation scheme and vice versa is also true.
ACL transport is also used for other profiles like FTP, DUN, SAP etc. One an ACL connection is established to a device then all these application profiles will share this ACL link, multiplexing all these profiles over one link is responsibility of the L2CAP layer.
Part 2 – Bluetooth Physical Layer
Content Index:
Introduction : Bluetooth
Part 1: Bluetooth Framework
Part 2: Physical Layer
Part 3: Logical Transports (Link Layer)
A bottom up approach is ideal for understanding BT, grasping the aspects of physical medium will clarify how data bits are transmitted over the air and how various abstractions can be enforced over this elementary framework. Two primary attributes which defines the physical layer are explained below:
1. Frequency Usage
BT employs frequency ranging from 2400MHz to 2483.4 MHz, the Unlicensed 2.4GHz ISM, in a typical wireless communication scenario there could be other devices in the vicinity operating with the same frequency and this can cause interference on the BT channel. To overcomes such noise BT articulates a frequency hopping scheme where the particular frequency of communication is switched every 625uS (but it can never switch outside of the 2.4GHz unlicensed spectrum), this unique pattern of hopping is mutually agreed by the devices during the connection establishment.
2. Modulation
Across all the possible frequencies there are multiple modulation schemes, and this determines the speed of the transmission over the air. For example BT supports following types of modulations.
- BDR scheme (Basic Data Rate Scheme has over the air speed of 1MBPS) and
- EDR Scheme (Enhanced Data Rate Scheme has over the air speed of 2 and 3 MBPS).
Packets transmitted over the air could belong to any one of these two modulation schemes and the header tells the receiver about the scheme used, note that header is always send in BDR scheme.
Physical Channel Transmission
We know how frequency and modulation schemes are used for encoding data over the air but there has to be an efficient way for utilizing the medium too. With Ethernet we have CSMA but BT works in a slightly different manner.
- Similar to wired protocols like SPI and I2C we have a master slave relationship between the BT devices, its pure hegemony wherein the master controls the medium and decides when a slave can transmit.
- The physical medium is also divided into time slots of 625 uS and each slot is reserved for either the master or the slave, an illustration is done in the diagram below.
Master Tx always happens over a even numbered slot and slave Tx over an odd one. In the above graphical illustration we can see the following transmissions
- Master and slave exchange single slot packets in the first 3 slots.
- After which slave sends a three slot packet for which master sends a five slot packet response.
- Finally the slave sends another three slot packet.
Each BT device will have a 28 bit clock running in its controller which can identify the 625uS boundaries and initiate a Transmission (Tx) or a Reception (Rx). Data transmission happen using different packet structures, some of these packet types occupy more than one slot and needless to say every packet needs to be acknowledged by the receiving device. It is critical to note that the packet transmission will always occupy odd number of slots, this means that the slot immediately following the last packet will be reserved for the response from the receiver. Understanding the whole protocol stack is simpler if we start by studying its genetic constitution, in other words the physical layer which elaborates the strengths and the weakness in the most absolutely elementary form.
Part 1 – Bluetooth Framework
Content Index:
Introduction : Bluetooth
Part 1: Bluetooth Framework
Part 2: Physical Layer
Part 3: Logical Transports (Link Layer)
The core protocol stack of Bluetooth has the above three main layers:
Physical Layer: Decides how the bits are transmitted over the air, like the modulation schemes and the packet structures to be used for communication.
Logical Layer : Bluetooth is a connection oriented protocol, this means that there is a connection set up, maintenance and tear down. This layer handles these activities. Each type of connection has its own set of associated packets and each connection type is tailored for different purposes like music playback, hands free etc.
L2CAP : L2CAP multiplexes data of various applications (or BT profiles) over the lower layer logical links and connections.
A typical Bluetooth architecture will look like above diagram, L2CAP and above layers will sit on the host while Logical and Physical layers will sit on the controller. “Host” usually means the main processor, and the controller is a small BT chip sold by guys like Broadcom and CSR. “Host” processors in Laptops are usually Intel CPUs running Windows/Linux, in hand held market the host is usually an ARM SoC which may be running Android/iOS/WP7 or any other embedded OS.
There is usually a transport layer which connects the host to the BT controller, usually this is a high speed UART interface. There is one more hardware which is the lowest and below all the layers, this is the analog RF which actually transmits the bits over the air, receives the response and passes it to the physical layer, this analog logic is usually outside of the BT controller chip. An interesting aspect is that the main consumer of power or current in this system will be the RF, better the RF more optimized will be the power consumption.
No comments:
Post a Comment