An adaptive segmentation scheme for the Bluetooth-based wireless channel Jesung Kim, Yujin Lim† , Yongsuk Kim‡ , and Joong Soo Ma School of Computer Science and Engineering, Seoul National University, Seoul, Korea Department of Mechanical Engineering, University of Seoul, Seoul, Korea† i-Networking Lab., Samsung Advanced Institute of Technology, Suwon, Korea‡ Information and Communications University, Taejon, Korea
[email protected]
[email protected]
Abstract— Bluetooth has been regarded as a promising solution for wireless connection between hand-held devices. In Bluetooth, a message is segmented into short packets to be transmitted over different frequency bands to randomize error occurrences. There are various kinds of packets with different sizes and error-handling schemes. Since each packet type has its own performance characteristics, care must be taken in selecting a packet type. This paper proposes an adaptive method that selects the best packet type depending on the condition of the channel. One of challenging issues in the proposed scheme is how to predict the packet error rate of one packet type from another. In this paper, we interpolate packet error rates of different packets based on a uniform bit error model. Based on the packet error rates obtained from the interpolation, the proposed scheme selects a packet type that leads to the best performance. We also propose a revised scheme that works even when bit errors occur in a non-uniform pattern. The proposed scheme is especially useful in a harsh environment where the bit error rate is worse than 10 4.
P
I. I NTRODUCTION
ORTABLE devices such as PDA’s, cellular phones and notebook computers are in common place, and we often connect a device to another device to use convenient applications such as wireless Internet or calendar synchronization. In the past, we had to use a bulky serial cable for interconnection between a pair of devices. To avoid such inconvenience, a wireless solution has highly been in demand by consumers. Bluetooth is one of such technologies and especially attractive in the environment This paper is a result of a joint research project of Samsung Advanced Institute of Technology, Information and Communications University, and Seoul National University, This research was supported in part by the Brain Korea 21 Project in 2001. The second author was supported from the Basic Research Program (for the woman scientists) of the Korea Science & Engineering Foundation.
[email protected]
[email protected]
of hand-held devices since a low cost is an important requirement of such a technology [1], [2]. The Bluetooth technology can also be used as a generic layer-two logical link for a higher layer protocol such as TCP/IP. To facilitate a common interface to various upper layer protocols, Bluetooth provides an adaptation layer that receives messages from an upper layer, and reformats the messages to a format suitable for transmission via the Bluetooth physical channel. One of the main functions of the adaptation layer is to segment a large upper layer message into several small fragments each of which fits into a Bluetooth native packet, similar to the ATM adaptation layer. But unlike ATM, Bluetooth provides various packet formats with different sizes and error protection capabilities [1]. Therefore, the adaptation layer need to select a suitable packet format depending on the error rate and/or the required quality of service. A simple but common implementation would let a user or an application choose a packet type depending on the desired quality of service. However, a static packet format selection may not be efficient since the channel error rate varies in time. The received signal strength will vary in time since communication occurs between portable devices in a dynamically changing environment. The channel error rate is also affected by the interference from other devices using the same frequency band, which also varies in time. In this paper, we propose an adaptive method that selects the best packet type depending on the current quality of the communication link. The basic idea behind this scheme is that a large packet has low overheads and is advantageous when the bit error rate is relatively low, while a small packet has a low packet error rate and thus is advantageous when the bit error rate is high. However, it is difficult to estimate the channel bit error rate in a short time when the link is operating under error detection with retransmission. We can approximate the bit error rate from
the measured packet error rate under the assumption that bit errors occur uniformly. This model allows us to interpolate packet error rates of different sizes so that the best packet type can be determined. Non-uniform error patterns may lead to an erroneous approximation. This paper also proposes a scheme that compensates such an error by evaluating the performance gain obtained from the change of the packet type. The organization of the remainder of the paper is as follows. The next section gives an overview of the Bluetooth technology with an emphasis on the adaptation layer. The proposed adaptive segmentation scheme is presented in the following section. Next, we provide an analysis of our scheme based on simulation. Finally, concluding remarks are given in the last section. II. BACKGROUND Bluetooth technology utilizes the license-free ISM band for wireless interconnection between computing devices within a short range. To share the ISM band with many other users effectively, Bluetooth fragments a long message into short packets and transmits each packet over different carrier frequency. For this purpose, an adaptation layer is defined that does the segmentation and reassembly of packets. This adaptation layer resides in L2CAP, which is the layer-two logical link control layer in Bluetooth. With L2CAP, the upper layer may send messages of any length up to 65,535 bytes transparently to the characteristics of the underlying physical layer. The basic unit of the segmentation is a small fixed time unit called a slot, which is 625 µsec long. With a symbol rate of 1 Mbps, a slot can carry up to 625 bits. However, to allow the sender and the receiver a sufficient time to change the direction and the channel frequency, the packet size is limited to 366 bits, leaving 259 µsec as the turnaround delay. Furthermore, due to the required packet header, payload data of only 216 bits are allowed, reducing the efficiency further. There is also a packet type that uses forward error correction (FEC) codes with a payload size of 136 bits. Both packets occupy a single slot and thus called DM1 (data-medium rate-1 slot) and DH1 (data-high rate-1 slot), for the one with FEC and the one without FEC, respectively. For more efficient data transmission, Bluetooth also defines larger packet formats that expand to three or to five slots, namely DH3 and DH5. These packets are more efficient than DH1 in that they can carry more information bits per slot. There are also FEC counterparts for each of the packet, namely DM3 and DM5. In summary, there are six packet formats for data transmission with different lengths and error protection properties. Table 1 summarizes the six packet types.
TABLE I B LUETOOTH DATA PACKETS
Type
DM1 DH1 DM3 DH3 DM5 DH5
Max User Payload (bytes) 17 27 121 183 224 339
FEC
Max Rate (Kbps)
o x o x o x
108.8 172.8 387.2 585.6 477.8 723.2
Each packet gives different performance depending on the bit error rate of the underlying physical channel. Without any bit error, the DH5 packet would give the best performance since it carries the most information bit per unit time. However, as the bit error rate increases, the packet error rate of DH5 increases faster than smaller packets. Thus, a threshold may exist where the benefit of a low packet error rate of DH3 exceeds the benefit of efficiency of DH5. When this threshold can be detected, we can dynamically choose DH3 instead of DH5 to improve performance. Likewise, there may exist a threshold where using of DH1 is more advantageous than using DH3. By detecting such thresholds, we can adapt to the current condition of the channel. An adaptive scheme that selectively uses a packet with FEC depending on the condition of the channel has been proposed by Das et al [3]. Their proposed scheme determines which is more efficient between the packet with FEC and the one without FEC. We generalize the adaptation method into different packet sizes based on a bit error rate estimation model as described in the next section. III. A DAPTIVE S EGMENTATION In this section, we describe our proposed adaptive segmentation scheme. The proposed scheme dynamically chooses a packet type into which an upper layer message is segmented, depending on the condition of the underlying physical channel. The goal of the proposed scheme is to minimize the time to transmit/retransmit a set of segments of a message, i.e., to minimize the number of slots needed to transmit the whole message successfully. In an error-free environment, this goal can be accomplished simply by using the largest packet, i.e., DH5, except for the last fragment that may fit in a smaller packet. For example, a 1500-byte message can be segmented as four 339-byte DH5 packets and a 183-byte DH3 packet (1500 < 339 4 + 183 1), which collectively occupy 23 slots (4 5 + 1 3) plus 5 slots for the acknowledgement of each of five packets. In contrast, using of DH3
or DH1 to segment the same message would take as many as 36 slots and 112 slots, respectively, since these packets carry much smaller amount of user information bits per each slot than DH5 as explained in the previous section. Larger packets, however, generally have a higher packet error rate and may offset the benefit of using larger packets due to frequent retransmissions. Formally, if the packet error rate is given as PER, the average number of trials until a successful transmission occurs is equal to 1=(1 PER). Since the retransmission can be carried out immediately at the next slot in Bluetooth, the average transmission time is given as transmission time 1 packet length = number of packets 1 PER bandwidth 1 message length = 1 PER bits per packet + 1) slot length (slots per packet bandwidth message length = ; (1) (1 PER) efficiency bandwidth where bits per packet is the maximum amount of information bits, message length is the length of the transmitted message in bits that is assumed to be divisible by bits per packet, (slots per packet + 1) is the number of slots occupied by a single packet plus one slot for the acknowledgement, slot length is the length of a slot in bits, and efficiency is bits per packet =((slots per packet + 1) slot length), indicating the ratio of user information bits in a slot to the length of a slot in bits. Maximum efficiency of each packet is calculated as summarized in Table 2. In the equation, only PER and efficiency are affected by packet types. Thus the transmission time can be minimized by selecting packet type X that maximizes the product of efficiency(X ) and (1 PER(X )). This gives an effective bandwidth (EB), which is the bandwidth observed by the upper layer, as EB(X ) = (1
PER(X )) efficiency bandwidth: (2)
For example, if PER(DH5) and PER(DH3) are given as 0.3 and 0.1 and the Bluetooth bandwidth is 1 Mbps, the effective bandwidths of both packets are 0:52 Mbps and 0:50 Mbps, respectively. In this case, DH3 might be a better choice than DH5 since EB(DH3) is greater than EB(DH5). Note that packet error rates of different packet types should be known beforehand to make such a decision. This requires predicting packet error rates of different packet types from the current packet error rate. Assuming a bit error occurs uniformly (i.e., the event of a bit
TABLE II PACKET EFFICIENCY
Type DM1 DH1 DM3 DH3 DM5 DH5
Efficiency 0.10 0.17 0.39 0.59 0.48 0.72
error is independent of others), the packet error rate can be expressed in terms of the bit error rate as PER(X )
=
(1
1
BER)bits per packet (X ) ;
(3)
where BER is the current bit error rate and bits per packet (X ) is the number of information bits in packet type X . Assuming PER is measured for sufficiently long time, we can obtain an approximate bit error rate by solving the above equation for BER, that is, BER = 1 (1 PER(X ))1=bits per packet (X ) . Then we can interpolate the packet error rate of another packet type Y , PER(Y ), from PER(X ) using the equation PER(Y )
=
1
(1
BER)bits per packet (Y )
=
1
(1
PER(X )) bits per packet(X ) :
bits per packet(Y )
(4)
From PER(Y ), we can determine whether a change of the packet type from X to Y is beneficial by comparing the effective bandwidth. Change of packet type is triggered when EB(Y ) is larger than EB(X ). The triggering points occur when EB(DH5) = EB(DH3) = 0:45 and EB(DH3) = EB(DH1) = 0:14 as depicted in Fig. 1. Thus, the packet type is switched when the packet error rate changes such that the effective bandwidth changes beyond such thresholds. This process is represented as a finitestate machine shown in Fig. 2. Similarly, we can also estimate the packet error rates of DM packets from the approximated bit error rate. In DM packets, a five-bit error correction code is appended for each sequence of ten information bits to allow correction of all single-bit errors [1]. From this, we can estimate the packet error rate of DM packets being equal to the probability of a single or no bit error occurrence for all the 15-bit error correction units as PER(X )
=
1
((1
(1
BER)15 + 15 BER
BER)14)bitsper packet (X )=10 ; (5)
where bitsperpacket (X )=10 indicates the number of error correction units in a packet assuming bitsperpacket (X ) is divisible by 10.
0.8 0.7 effectivebandwidth
0.6 0.5
DH1 DH3 DH5
0.4 0.3 0.2 0.1 0 1.E-07 1.E-06 1.E-05 1.E-04 1.E-03 1.E-02 1.E-01 biterrorrate
Fig. 1. model.
Effective bandwidth obtained from the uniform bit error
PERDH3 > 0.14
PERDH5 > 0.36 DH5
DH3 PERDH3 < 0.21
DH1 PERDH1 < 0.19
Fig. 2. Finite-state machine of the proposed scheme.
Fig. 3 plots effective bandwidths of DM packets along with DH packets. From the figure, we can notice that there exist crossing points between different DM packets similarly to DH packets. However, no DM packet is shown to outperform the best DH packet at any condition. This implies that efficiency of DM packets is so low that the benefit of forward error correction is more than offset. Other researchers have found similar results [4], [5]. Thus, DM packets are beneficial only in some real-time applications where regular inter-arrival times are a key factor of quality of service.
0.8 0.7 effectivebandwidth
0.6 DH1 DH3 DH5 DM1 DM3 DM5
0.5 0.4 0.3 0.2 0.1 0 1.E-07 1.E-06 1.E-05 1.E-04 1.E-03 1.E-02 1.E-01 biterrorrate
Fig. 3. Effective bandwidth of all the packet types including DM packets.
Until now, we have assumed that bit errors occur uniformly. In the environment where bit errors occur in a burst, the interpolation of packet error rates based on this assumption may lead to erroneous approximation. One of the most popular bursty bit error models is a two-state markov process that employs two uniform bit error rates, one representing a good channel condition and the other representing a bad channel condition [6]. In this model, the channel is normally in a good state showing a lower bit error rate and occasionally enters short period of a bad state with a higher bit error rate to simulate bursty bit errors. Note that bit errors occur uniformly within each state. This implies that our adaptive scheme can apply to the bursty bit error model provided that the adaptation can be made fast enough to catch up the state transitions. Unfortunately, such an adaptation is not possible since each packet is transmitted over a different frequency band in Bluetooth. We address this issue by adjusting the threshold packet error rates dynamically according to the performance gain obtained from the change of the packet type. For this purpose, we measure the effective bandwidth for a certain period of time after changing the packet type and compare it to the one measured before the packet type is changed. Let ∆EB be EBafter EBbefore , where EBafter and EBbefore represent the effective bandwidth after/before the packet type is changed, respectively. In a normal case, ∆EB should be close to zero since the change of the packet type is triggered when the EB’s of two different packet types are estimated to be equal in our model. If ∆EB is substantially greater or less than zero, it implies that the condition triggering the change of the packet type needs an adjustment. In particular, ∆EB > 0 implies that we could have changed the packet type more aggressively to obtain better performance. In this case, the threshold packet error rate is adjusted depending on whether the action was to select a larger packet type or to select a smaller packet type. When the action was to select a larger packet type, the threshold packet error rate is shifted to a larger value as depicted in Fig. 4a. On the other hand, when the action was to select a smaller packet type, the threshold packet error rate is shifted to a smaller value as depicted in Fig. 4b. This adjustment will encourage the change of the packet type when a similar situation arises in the future. We also need to adjust the threshold packet error rate in the case of ∆EB < 0 since it implies that we should have been more conservative in changing the packet type. The adjustment is done conversely to the former case. That is, the threshold packet error rate is shifted to a smaller value when the action was to select a larger packet type as in Fig. 4b and shifted to a larger value when the action was
0.8 0.7 0.6 effectivebandwidth
effectivebandwidth
Largerpackettype
∆EB Smallerpackettype
0.5
DH5 DH3 DH1 Adaptive
0.4 0.3 0.2 0.1
ThresholdPER
0
packeterrorrate
0.000001
0.00001
0.0001
0.001
0.01
biterrorrate
(a)
(a) 0.6 0.5
∆EB
Smallerpackettype
ThresholdPER
effectivebandwidth
effectivebandwidth
Largerpackettype
0.4 DH5 DH3 DH1 Adaptive
0.3 0.2 0.1
packeterrorrate
0 0
(b) Fig. 4. Adjustment of the threshold packet error rate. (a) Increasing the threshold packet error rate. (b) Decreasing the threshold packet error rate.
to select smaller packet type as in Fig. 4a. Furthermore, we go back to the original packet type since the change of the packet type adversely affected the performance. Repetition of this procedure leads to convergence, as we will see in the next section.
IV. P ERFORMANCE E VALUATION The proposed scheme is implemented over a simple simulation environment that simulates uniform bit errors as well as bursts of bit errors based on the two-state markov process as briefly explained in the previous section. Fig. 5 shows the simulation results when bit errors are generated uniformly as bit error rates given in the x-axis. From the figure, we can notice that the proposed scheme is beneficial when the bit error rate is higher than 10 4 . We can also notice that the simulation results are similar to those obtained from the probabilistic model shown in the previous section. The result is obvious since bit errors are generated exactly as the proposed scheme presumes.
0.0002
0.0004
0.0006
0.0008
0.001
biterrorrate
(b) Fig. 5. Results based on uniform bit errors. (a) 10 (b) 10 4 BER 10 3 .
6
BER 10
2.
Fig. 6 shows the results when bit errors are generated based on the two-state markov process as proposed in [6]. The numbers on the x-axis represent the bit error rate in the good state. The bit error rate of the bad state is set one hundred times higher than that. The probability of being in the good state is set as 0.8. We also assume that the mean time staying in a state is much larger than a slot. The results show that adaptation based on fixed thresholds sometimes gives less-than-the-best performance. For example, when the bit error rate is 0.0007, the adaptation is stuck at DH1 resulting in lower performance than the case of DH3. This phenomenon happens because bit errors are generated in a different pattern than that is assumed by the scheme. To eliminate such an anomaly, we have proposed a revised scheme that adaptively adjusts the thresholds triggering change of packets as described in Section III. Fig. 7 shows the simulation results. The results show that the proposed scheme eliminates the above undesirable behavior through adaptation of thresholds themselves. We have intended to test the proposed scheme in a de-
0.50 0.45 0.40 effectivebandwidth
0.35 0.30
DH5 DH3 DH1 Adaptive
0.25 0.20 0.15 0.10 0.05 0.00 0
0.0002
0.0004
0.0006
0.0008
0.001
biterrorrate(goodstate)
Fig. 6. Results based on bursty bit errors 0.50 0.45 0.40 effectivebandwidth
0.35 0.30
DH5 DH3 DH1 Adaptive
0.25 0.20
also considered the packets with forward error correction codes. However, overheads associated with additional bits in such packets are shown to annul the advantage of error correction. The proposed scheme is simple enough to be easily implemented in small mobile devices. It only requires an error counter for each packet type and a simple calculation of the effective bandwidth that is done periodically in the order of a few seconds. As a future work, we plan to verify our model in the environment where multiple piconets interfere with each other. This requires detailed simulation of a Bluetooth usage model since the inter-piconet interference is dependent on the load carried over the piconets as well as the relative position of the starting point of slots. We expect that the proposed adaptive segmentation scheme is even more useful when the inter-piconet interference becomes severe since a larger packet is more susceptible to the interference. ACKNOWLEDGEMENT
0.15 0.10 0.05 0.00 0
0.0002
0.0004
0.0006
0.0008
0.001
biterrorrate(goodstate)
We would like to thank Jae-yul Lee at Samsung Advanced Institute of Technology and Sang Lyul Min at Seoul National University for their support and helpful comments. We also would like to thank Jihye Kim for her help with performance evaluation.
Fig. 7. Simulation results of the revised adaptive scheme.
R EFERENCES velopment kit equipped with an actual Bluetooth radio. Unfortunately, the development kit we have used does not provide interface for measuring necessary packet error rates. Measurement through a real system would verify the simulation results. V. C ONCLUSION In this paper, we have proposed a segmentation scheme that adaptively chooses a suitable packet types. The idea behind this scheme is to trade packet efficiency of a larger packet for a lower packet error rate of smaller packets. When the packet error rate increases beyond a certain threshold, the proposed scheme selects a smaller packet to reduce overheads associated with frequent transmission errors. On the other hand, when the packet error rate becomes lower below a threshold, a larger packet is advocated to improve efficiency. The threshold packet error rates can be determined from a uniform bit error model where bit errors occur independently of others. We have also proposed a revised adaptation scheme that adjusts the threshold values to compensate overestimation of a bit error rate due to bursts of bit errors. We have
[1] The Bluetooth Special Interest Group, “http://www.bluetooth.com/techn/index.asp,” Feb. 1999. [2] J. Haartsen, M. Naghshineh, J. Inouye, O. J. Joeressen, and W. Allen, “Bluetooth: vision, goals, and architecture,” Mobile Computing and Communications Review, vol. 2, pp. 38–45, Oct. 1998. [3] A. Das, A. Ghose, V. Gupta, A. Razdan, H. Saran, and R. Shorey, “Adaptive link-level er-ror recovery mechanisms in bluetooth,” in Proceedings of IEEE International Conference on Personal Wireless Communications, pp. 85–89, 2000. [4] S. Z¨urbes, W. Stahl, K. Matheus, and J. Haartsen, “Radio network performance of bluetooth,” in Proceedings of the IEEE International Conference on Communications (ICC 2000), pp. 1563– 1567, 2000. [5] A. Das, A. Ghose, A. Razdan, H. Saran, and R. Shorey, “Enhancing performance of asynchronous data traffic over the bluetooth wireless ad-hoc network,” in Proceedings of the Twentieth Annual Joint Conference of the IEEE Computer and Communications Societies (INFOCOM 2001), vol. 1, pp. 591–600. [6] E. N. Gilbert, “Capacity of burst noise channels,” Bell Systems Technical Journal, vol. 39, pp. 1253–1266, Sept. 1960.