14
2
2
B
B
l
l
u
u
e
e
t
t
o
o
o
o
t
t
h
h
B
B
a
a
s
s
e
e
b
b
a
a
n
n
d
d
s
s
p
p
e
e
c
c
i
i
f
f
i
i
c
c
a
a
t
t
i
i
o
o
n
n
s
s
2.1 Bluetooth TDM communication
As already indicated, Bluetooth is a TDM system, with its exchanged data operating through Basic Rate and Enhanced Data Rate packets. During ACL links, both master and slave BT devices, can send data packets which last more than one time slot. This communication mode is efficient when exchange a great amount of data with a high data rate is desired. This is possible if less information of control are transmitted. It is necessary to remember that a frequency hopping scheme is used, but during a entire slot the radio channel frequency cannot hop. In this way, data are sent with the same frequency during more than one period T which is a disadvantage because it is more probable that an interference or burst of errors may occur. So the price to pay for high data rate is reduced reliability, which is lower than reliability for small packets.
Master Slave A Slave B Slave C Tx Tx Tx Rx Rx Rx Slave -Tx Slave -Tx Slave -Tx Rx Rx Rx Frequency Hopping : Ch(n) Ch(n+1) Ch(n+2) Ch(n+2) Ch(n+2) Ch(n+5) Ch(n+5) Ch(n+5) Ch(n+8) Ch(n+9) T = 625 µs 3 slots-packet 3 slots-packet 1 slot-packets 1 slot-packets
Chapter 2 Bluetooth Baseband specifications
15 In configuration of connection, BT devices can exchange data packets which last 1, 3 or 5 slots. In pre-connection mode (inquiry, paging or scanning) the communication can sometimes occur in half slots. The packets are joined together in transmit and receive pairs. During the connection state, a packet pair can be 2, 4, 6, 8 or 10 slots long and only the master can start communications deciding packet data type and length. With ACL links, the master is able to communicate with several slaves because it transmits in even slots while the polled slave replies accordimg to an odd number. When an SCO link has been established, some slots are reserved and in this way a master can transmit on ACL packet only in free slots. The slave may reply in the reserved slot whether it detects a packet addressed to itself from the master or not.
The general format of the data packets, regards on Basic Rate and Enhanced Data Rate is now analysed. Every packet is made up of an access code, a header and a payload, as shown in Figure 2.2. The access code is used to detect the presence of a packet and to address the packet to a specific device. The header contains all the control information involved with packet types and links. The payload contains the actual message sent from L2CAP or LM, or data if it is at the end of the stack.
Access Code Header Payload
68 or 72 bits 54 bits 0 - 2744 bits
Figure 2.2 – Bluetooth Basic Rate packet structure.
For the Enhanced Data Rate transmission, packet structure is very similar to the Basic Rate packets. The access code and the packet header are identical in format and are re-transmitted with the GFSK modulation, so that acquisition and packet identification is the same as that used in Basic Rate standard. The difference with the basic packet is the introduction of the Guard Time and Synchronization Sequence at the end of the header. A guard time of 4.75÷5.25 µsec starts at the end of the last GFSK symbol of the header and ends at the beginning of the
Chapter 2 Bluetooth Baseband specifications
16 synchronisation sequence. It is useful to allow settling and switching in the hardware during the transition from one modulation scheme to another one. Following the guard time there is a DPSK-modulated synchronisation sequence which is identical for both π/4-DQPSK and 8DPSK modulations. Its length is of 11 µsec (11 symbols) and it is made up of one reference phase symbol followed by ten DPSK symbols. It is used to complete acquisition prior to demodulating the π/4-DQPSK or 8DPSK of the payload.
At the end of course there are two Trailer symbols.
Access Code Header EDR - Payload
68 or 72 bits 54 bits 0 - 8200 bits
Sync.
Sequence Traile
r
Guard Time
4.75 ÷ 5.25 µsec
Figure 2.3 – Enhanced Data Rate packet structure.
2.2 Access
Code
As hinted above, each packet starts with an access code, which is used for identification, synchronisation and DC offset compensation. During a connection mode when a link is active, the access code is used to identify whether a packet is from or to a specific master, as it is made up from the master’s BT Device Address. The access code is also used in paging and inquiry procedures, under a different and shorter structure.
There are four different types of this packet, particularly used during pre-connection mode: Channel Access Code (CAC) derived from the master’s LAP and used by all devices of the same piconet; Device Access Code (DAC) is derived from a specific device’s LAP and used during the paging procedures; General Inquiry Access Code (GIAC) is used during the inquiry states, because
Chapter 2 Bluetooth Baseband specifications
17 there is no prior knowledge of any device’s LAP and finally Dedicated Inquiry Access Code (DIAC) dedicated at the inquiring for some particular device such as printers or cellular handsets.
Now, the complete structure of the access code packet is analysed. It may be split into three parts: Preamble, Synchronization Word and Trailer.
Synchronization Word
34 bits 24 bits 6 bits
Barker Sequence
LAP BCH Parity Word
4 bits 64 bits 4 bits
Preamble Trailer
Figure 2.4 – Bluetooth Access Code structure and Synchronisation Word.
The Preamble is formed by 4 bits, which is useful to detect the edges of the packets; it is a fixed sequence 0101 or 1010, according on the value of the first bit of the Synchronization Word so as to form a known 5 bit sequence. This allows the possibility of having the DC threshold and the clock recovery. A Trailer is used at the end of the access code if there is a payload and its task is to perform more accurately DC threshold and clock recovery.
In brief, the Synchronization Word is formed from the 24 bit Lower Address Part (LAP) of the BT Device Address, using a particular algorithm. The synchronisation word is made up of BCH Parity Word, LAP and Barker Sequence. The most important is BCH (Bose-Chaudhuri-Hocquenghem) because when a device is correlating against its expected sync word, it will seek a strong peak where the reference sync word and received one line up. This also provides the possibility to readjust its sub-slot timing to match up with the master. A match also indicates that this packet is intended for the receiving device and it will continue to receive; otherwise the radio can be shut down.
Chapter 2 Bluetooth Baseband specifications
18
2.3 Header
The packet header contains Link Control information associated with the packet. In total, the header contains 18 bits of information, which can be protected with two Forward Error Correction (FEC) schemes. The first is a 1/3-rate repetition code where each of the 18 bits in the packet header is repeated 3 times, thus producing 54 encoded bits (1/3 means: 18 useful bits on 54 transmitted bits). This big redundancy is used because it is necessary to the Link Protocol to decode each header’s bits. The second coding scheme is the 2/3-rate code that uses a shortened Hamming binary block code, applied to the payload header, payload data and CRC as well as the tail bits. However, the FEC code is avoided for the Enhanced Data Rate Header, so data bits are transmitted without any replication.
Header
3 bits 4 bits 8 bits
AM_ADDR Packet Type Flow ARQN SEQN Header Error Check (HEC) 54 bits
FEC 1/3 encoding replicates data 3 times
1 1 1
Access Code Payload
Figure 2.5 – Packet Header structure.
The header parts are described below. All the slaves will receive an Active Member Address (AM_ADDR) given by the master during the paging process. This will become the connection handle used to address all communications to the slave and for the master to differentiate response from different slaves. The 3 bits used are sufficient as the slaves number seven at maximum. An AM_ADDR of zeros implies a broadcast packet which is received by all slaves.
Chapter 2 Bluetooth Baseband specifications
19 The Packet Type defines the type of traffic is carried out by this packet (ACL, SCO, NULL, POLL), the type of error correction used by payload, and how many slots the packet will actually last.
When a device’s buffer is full, it sets the Flow bit to indicate that it is not now able to receive other packets. The ARQN flag is asserted by a device to indicate that the previous packet was successfully received. In the case of loss of ARQN due to failure of the returned header, the sender will assume a Negative-Acknowledge and accordingly retransmit the packet. If the one bit SEQN transmits the same packet, the flag is not toggled. In this way the receiver is clearly able to understand if it has received a new message or a copy which is to be ignored.
The Header Error Check (HEC) is a simple CRC (Cyclic Redundancy Check) on the header represented in octal notation by the generator polynomial 647. It is used to initialise either the master and/or the slave, through the DCI (Default Check Initialisation).
2.4 ACL
Payload
In this point, it is necessary to clarify some differences between Basic Rate and Enhanced Data Rate (or Medium Rate) packets. The new standard EDR has the same initial structure for access code and header, but introduces some modifications within payload structure, in order to transmit longer packet types. In this way, there are two different structures for the Payload. However, for both, the ACL payload is split into three parts: the Payload Header, the Payload Data itself, and the Cyclic Redundancy Check (CRC).
The ACL Payload Header is formed by 16 bits and contains the following information. The Logical Channel (L_CH) field indicates if this payload is the beginning or the continuation of a L2CAP message (since L2CAP message may be long several packets) or an LMP message (which is carried only in single shot ACL packets). Flow is a flag-control data transfer at the L2CAP level. Length is a
Chapter 2 Bluetooth Baseband specifications
20 field detail containing information on bytes of the payload. The remaining bits are reserved to the EDR packet transmission or are unused, like in Basic Rate.
As shown in Figure 2.6, a Payload Trailer is present only within the new payload structure, relative to the Enhanced Data Rate standard. It is formed by 2 DPSK symbols: 4 bits = {00, 00} for π/4-DQPSK modulation, or 6 bits = {000, 000} for the other, 8DPSK. It is useful not to allow instantaneous interruption of data packets and modulation.
Payload Header
3 bits 8 bits 4 bits
L_CH Lengt h • Basic Rate:
ACL Payload structure.
Flow Undefined 8 or 16 bits 1 0 - 2712 bits 16 bits 16 bits Payload Data CRC Payload Header
2 bits 10 bits 3 bits
L_CH Length • Enhanced Data Rate:
ACL Payload structure.
Flow Reserved 16 bits 1 0 - 8168 bits 16 bits 16 bits EDR-Payload Data CRC 2 DPSK Symbols Trailer
Figure 2.6 – Basic Rate and Enhanced Data Rate ACL Payload structures.
2.5 SCO Packet Structure
SCO packets are quite similar to ACL packets, although the fields Flow, ARQ and SEQ are not necessary in the header, because SCO link has no re-transmission. Also the CRC field is not present. The Payload is made up of 30 bytes, and the packet type that carries 30 data bytes is called an HV3 packet. This packet is transmitted without coding or protection and is not retransmitted if lost.
Chapter 2 Bluetooth Baseband specifications
21 Moreover, to cope with bit errors when the channel conditions are not perfect, some FEC codes are added to the data payload. An HV2 packet carries 20 bytes of data plus 10 bytes of redundant data (2/3 FEC code). Finally, under extreme channel conditions, the Baseband specifications also define an HV1 packet that carries only 10 bytes of data and 20 bytes of FEC code. An HV1 link uses up the entire channel capacity. This means that all data transfer sessions will be suspended when an HV1 SCO connection is in progress.
There is also a particular SCO packet called the DV which has Flow, ARQ, SEQ, CRC and allows retransmissions. All this is valid for the Basic Rate standard 1.1, but inside next standards an extended SCO (eSCO) link is defined, in order to transmit more data during the same time slot. In this way new three packet types are added: EV3, EV4, EV5. Furthermore, new six packets are defined thanks to the two new modulations: they can carry a data amount 2 or 3 times bigger thanks to the π/4-DQPSK and 8DPSK modulation, respectively.
Type Payload Header (bytes) User Payload (bytes) FEC CRC Symmetric Max Rate (Kb/s) HV1 N/A 10 1/3 No 64.0 HV2 N/A 20 2/3 No 64.0 HV3 N/A 30 No No 64.0 DV 1 10 + (O-9D) 2/3 Yes D 64.0 + 57.6D
EV3 N/A 1-30 No Yes 64.0
EV4 N/A 1-120 2/3 Yes 256.0 EV5 N/A 1-180 No Yes 384.0
2-EV3 N/A 1-60 No Yes 128.0
2-EV5 N/A 1-360 No Yes 768.0
3-EV3 N/A 1-90 No Yes 192.0
3-EV5 N/A 1-540 No Yes 1152.0
Table 2.1 − SCO link packet types.
Some special packets defined by Baseband specifications are ID, NULL, POLL and FHS. The ID packet is used during a pre-connection state, when a link is not already established. It consists only of the access code the device is coming from or going to. The NULL packet is made up of access code and packet header and is used to give acknowledgement or flow control back to a device following
Chapter 2 Bluetooth Baseband specifications
22 reception of a packet. It does not require an acknowledgement. It is used in the absence of data to transfer when a link is established. The POLL packet has the same structure of the NULL packet but does require acknowledgement. It is used by a master to check the presence of a slave piconet, which is forced to answer if it is present. The Frequency Hop Synchronisation (FHS) packet provides all the information required by the recipient to address the sender in terms of timing and thus frequency hop channel synchronisation and correct device access code. The contents of the FHS are outside the scope of this report.
2.6 Packets
Summary
All packets that could be sent during a Bluetooth link are briefly described below. As the following table shows, there are many packet types, depending on which kind of link is established, synchronous or asynchronous links, and which kind of modulation is used, GFSK or one of the new DPSK modulations.
Type Code Slots SCO link (1 Mbps) eSCO link (1 Mbps) eSCO link (2-3 Mbps) ACL link (1 Mbps) ACL link (2-3 Mbps)
0000 1 NULL NULL NULL NULL NULL
0001 1 POLL POLL POLL POLL POLL
0010 1 FHS - - - - FHS FHS 0011 1 DM1 - - - - DM1 DM1 0100 1 - - - - - - DH1 2-DH1 0101 1 HV1 - - - - - - - - 0110 1 HV2 - - 2-EV3 - - - - 0111 1 HV3 EV3 3-EV3 - - - - 1000 1 DV - - - - - - 3-DH1 1001 1 - - - - - - AUX/PS AUX/PS 1010 3 - - - - - - DM3 2-DH3 1011 3 - - - - - - DH3 3-DH3 1100 3 - - EV4 2-EV5 - - - - 1101 3 - - EV5 3-EV5 - - - - 1110 5 - - - - - - DM5 2-DH5 1111 5 - - - - - - DH5 3-DH5 - - : Undefined
Chapter 2 Bluetooth Baseband specifications
23 The selection of the packet type column in Table 2.1 is peformed independently for each Logical Transport Address (LT_ADDR) a particular device is listening to. Also modes for ACL and SCO is selected independently. Enhanced Data Rate mode is used with the eSCO logical transport but not on the SCO logical transport; and it is selected when the eSCO logical transport is established via LMP command. For ACL logical transports, the EDR Baseband specifications define a new parameter (packet_type_table) in order to explicitly select via LMP which modulation will be used during the next Payload data transmission. Therefore, the new modulation type is only used to transmit payload packets. In this way, only ACL packets will be analysed in the next chapters.
Now it is necessary to give a summary of the ACL packets, in order to compare several payload structures, lengths and bit rate values of useful data.
Asymmetric Max Rate ACL link (2-3 Mbps) Type FEC Payload Header (bytes) User Payload (bytes) CRC Symmetric Max Rate (Kb/s) Forward Reverse DM1 2/3 1 0 – 17 Yes 108.8 108.8 108.8 DH1 No 1 0 – 27 Yes 172.8 172.8 172.8 DM3 2/3 2 0 – 121 Yes 258.1 387.2 54.4 DH3 No 2 0 – 183 Yes 390.4 585.6 86.4 DM5 2/3 2 0 – 224 Yes 286.7 477.8 36.3 DH5 No 2 0 – 339 Yes 433.9 723.2 57.6 AUX1 Optional 1 0 – 29 Optional 185.6 185.6 185.6
2-DH1 1 2 0 – 54 Yes 345.6 345.6 345.6 2-DH3 1 2 0 – 367 Yes 782.9 1174.4 172.8 2-DH5 1 2 0 – 679 Yes 869.1 1448.5 115.2 3-DH1 3 2 0 – 83 Yes 531.2 531.2 531.2 3-DH3 3 2 0 – 552 Yes 1177.6 1766.4 265.6 3-DH5 3 2 0 – 1021 Yes 1306.9 2178.1 117.1
Table 2.3 − ACL link packet types.
In Table 2.3, it is interesting to see the growth of the max bit rate value, from the GFSK modulation (723.2 Kb/s) to the π/4-DQPSK one (1448.5 Kb/s), up to the 8DPSK modulation, with current maximum value of 2178.1 Kb/s.