Bhoopesh
Bhoopesh
Bhoopesh
One factor that has limited the use of Bluetooth as a networking technology for publicly
accessible mobile services is the way in which it handles Device Discovery. Establishing
a Bluetooth connection between two devices that have not seen each other before is slow
and, from a usability perspective, often awkward. In this paper we present the implemen-
tation of an end-to-end Bluetooth-based mobile service framework designed specifically to
address this issue. Rather than using the standard Bluetooth Device Discovery model to
detect nearby mobile services, our system relies on machine-readable visual tags for out-
of-band device and service selection. Our work is motivated by the recent proliferation of
cameraphones and PDAs with built-in cameras. We have implemented the described frame-
work completely for Nokia Series 60 cameraphones and demonstrated that our tag-based
connection-establishment technique (i) offers order of magnitude time improvements over
the standard Bluetooth Device Discovery model; and (ii) is significantly easier to use in a
variety of realistic scenarios. Our implementation is available for free download.
I. Introduction 2. The same visual tags are also used for service
selection, enabling users to choose between the
Bluetooth is increasingly becoming integrated into a multiple services or content downloads offered
variety of mobile devices, making its way into cell by a single Bluetooth device.
phones, laptop computers and PDAs. The rapid adop-
3. Unlike many research prototypes our system is
tion of Bluetooth has led many to suggest that it will
built entirely on commodity hardware, demon-
act as a key enabling technology, driving the deploy-
strating that our technique is immediately appli-
ment of mobile services. Although today Bluetooth
cable to a variety of existing devices.
is typically used in a limited fashion (e.g. to transfer
files between a user’s laptop and their PDA, or to con- We demonstrate that our system for out-of-band Blue-
nect their wireless headset to their mobile phone), it tooth connection establishment is (i) an order of mag-
has the potential to do much more. For example, pub- nitude faster than the conventional Bluetooth Device
licly accessible Bluetooth-enabled devices in shops Discovery model; and (ii) that, in a variety of realistic
could enable consumers to query whether a product usage scenarios, it is significantly easier to use.
is currently in stock using their mobile phone and Our work is motivated primarily by the recent pro-
Bluetooth-based active posters could distribute mobile liferation of cameraphones. The Nokia 3660 cam-
content (e.g. 1-minute music samples of a band’s lat- eraphone, for example, is a fully programmable de-
est album) to users’ PDAs. vice (running a general purpose OS) that incorpo-
One factor that has limited the use of Bluetooth rates a camera and has Bluetooth capability. Tens of
as an underlying networking technology for publicly millions of Bluetooth-enabled cameraphones have al-
accessible mobile services is that its device discov- ready been shipped globally, with market trends show-
ery model is inappropriate for this kind of interaction ing that the rapid adoption of such devices is set to
(see Section III). In this paper we describe the imple- continue for the foreseeable future [8]. By running
mentation of an end-to-end Bluetooth mobile service our software on their cameraphone, a user can simply
framework designed specifically to address this issue. “point and click” at a tag representing a Bluetooth ser-
Our implementation has a number of novel features: vice. The connection is set up immediately, eliminat-
ing the need for device discovery entirely. Our imple-
1. Visual tags are used for out-of-band device se- mentation is freely downloadable over the web [14]
lection, bypassing the standard Bluetooth device allowing users to try it for themselves on their ex-
discovery model. isting cameraphones. Note that, although this paper
Mobile Computing and Communications Review, Volume 9, Number 1 41
specifically describes our cameraphone-based imple- over a pre-defined Inquiry [frequency] Hopping Se-
mentation, the work is also applicable to the increas- quence in an attempt to locate other Bluetooth de-
ing number of PDAs with Bluetooth capability and vices nearby. Devices in the Inquiry Scan state that
built-in cameras (e.g. Sony Clie, Palm Zire). hear these inquiry packets respond with a packet con-
The remainder of this paper is structured as fol- taining, amongst other information, their BD ADDR.
lows. Section II gives a brief outline of the parts of the Whilst the precise technical details of Inquiry are be-
Bluetooth specification that are relevant to this paper: yond the scope of this paper, the Bluetooth specifica-
device discovery is considered in Section II.A; ser- tion requires the Inquiry Hopping Sequence to be tra-
vice discovery is described in Section II.B. Section III versed multiple times to ensure all inquiry responses
considers using Bluetooth to connect two devices that have been collated. In an error-free environment, the
have not seen each other before and argues that, in inquiry phase must last for 10.24s if it is to discover
scenarios such as this, the current-generation Blue- all devices [1, 19]. In a noisy or error-prone environ-
tooth device discovery model suffers from a number ment, inquiry can last much longer than this (see Sec-
of usability problems. We describe the implementa- tion VI).
tion of our visual-tag based Bluetooth mobile service Bluetooth Device Discovery starts by performing
framework in Section IV. Realistic usage scenarios, Inquiry and then contacts discovered devices to re-
in which our device discovery technique offers sig- trieve their Device Names. After an inquiry phase,
nificant advantages over the conventional Bluetooth paging is performed to establish a connection with
Device Discovery model, are presented in Section V. each of the discovered devices; Name Discovery itself
A performance evaluation of our system running on then consists of a simple request/response protocol.
Nokia 36x0 cameraphones is presented in Section VI. All this adds to the latency a user experiences when
Security issues surrounding the use of visual tags to they select “discover Bluetooth devices” on their PDA
encode device names are considered in Section VII. or phone.
Related work is described in Section VIII. We con-
clude and give directions for future work in Sec-
II.B. Service Discovery
tion IX.
The Service Discovery Protocol (SDP) provides a
II. A Bluetooth Primer mechanism for applications to discover which Blue-
tooth services are provided by a remote device and
Bluetooth is an open standard for low-power, short- to determine the attributes of those services. The at-
range networking that is based on a frequency- tributes of a service include the type or class of ser-
hopping spread-spectrum scheme in the 2.4 GHz vice offered and the mechanism or protocol informa-
band [1]. This section serves to briefly outline the tion needed to access the service. To perform service
parts of the Bluetooth specification that are relevant discovery, a device establishes an L2CAP connection 1
to the rest of this paper. Readers already familiar with and uses this to talk to a remote device’s SDP server.
the technical details of Bluetooth may wish to skip A client will typically perform a two-stage pro-
straight to Section III. cess to obtain service information. Firstly, a Ser-
vice Search Request is issued by the client, specifying
II.A. Inquiry and Device Discovery which classes of service it is interested in (e.g. generic
printing services). The client sends the Service Search
The Bluetooth Baseband Specification [1] describes
Request to the SDP server, which responds by return-
point-to-point connection establishment as a two step
ing a list of service handles that identify the services
procedure. Firstly, Inquiry is performed to discover
available on the remote device that match the client’s
other Bluetooth devices in the neighborhood. During
service search request. Secondly, the client may per-
this phase, the inquiring device learns its neighbors’
form a Service Attribute Transaction to find out more
Bluetooth Device Addresses (BD ADDRs) and fre-
about one of the available services. During this pro-
quency synchronization information. Secondly, Pag-
cess, the client sends a Service Attribute Request con-
ing is performed to establish an actual connection with
taining a service handle and a list of the service at-
(some of) the discovered device(s).
tributes requested. The SDP server responds with the
Inquiry is an asymmetric process: a device wish-
values of those attributes.
ing to perform inquiry enters the Inquiry state; devices
waiting to be discovered must be in the Inquiry Scan 1
L2CAP is Bluetooth’s datagram-based Logical Link Control
state. The inquiring device repeatedly sends packets and Adaption Protocol.
Select photo: Use the menu system on her phone to III.B. Tag-Based Device Discovery
select the picture to transfer via Bluetooth.
In contrast, by using visual tags to identify devices and
Device Discovery: Wait whilst a list of Bluetooth de- services, Alice can simply point their cameraphone at
vice names appears on the phone’s display. Bob’s phone and click in order to establish a connec-
tion with it. In our framework Bob’s cameraphone
Device Selection: Select the device name corre- has a tag attached to it: either physically printed on
sponding to Bob’s cameraphone. the device itself, or displayed on the device’s screen
(perhaps as the default wallpaper). Then, to transfer
From a usability perspective, this scenario high- the photo, Alice performs the following sequence of
lights three significant issues. Firstly, the device dis- actions:
covery phase takes a significant amount of time. In
a realistic environment it is not uncommon for device Select photo: As before, Alice uses the menu system
inquiry and name discovery to take in excess of 30 on their phone to select the picture to transfer via
seconds (see Section VI). This delay is by far the Bluetooth.
dominant time-cost for the whole transaction, dwarf- Select Physical Device: After selecting a picture to
ing the time taking to transfer the small JPEG file. transfer, Alice aims their cameraphone at the tag
Secondly, device selection requires Alice to know on Bob’s cameraphone and presses the select but-
the device name of Bob’s phone. If Bob has not ton on their phone’s keypad.
thought carefully about giving his device a distin-
guishable name (or, more likely, has left the manufac- The tag is decoded yielding the Device Address of
turer’s default device name unchanged), Alice is likely Bob’s cameraphone. A Bluetooth connection is ini-
to see strings such as “My Phone” or “Nokia 3660”. tiated immediately and the selected picture is trans-
In an environment with many Bluetooth-enabled de- ferred. By encoding Device Addresses in visual tags,
vices it may be unclear which name corresponds to we provide two significant benefits to the user:
Bob’s phone. 1. The time taken to establish the connection and
Thirdly, the list of device names Alice has to choose initiate the picture transfer is an order of mag-
from may be long. Even if Alice knows the name of nitude faster than performing Device Discovery
Bob’s phone it may take considerable time to scroll (see Section VI).
through their device name list and select it. Even
today, in crowded places such as train stations, it is 2. The Bluetooth Device Name is abstracted from
common for device discovery to find as many as 10- the user.
15 neighboring Bluetooth devices. As Bluetooth be- In many ways the use of visual tags in our system is
comes more widely deployed, this problem will be ex- analogous to the use of hyperlinks in hypertext doc-
acerbated. uments. Just as hyperlinks hide URLs from readers,
Mobile Computing and Communications Review, Volume 9, Number 1 43
outside-in and in a clockwise direction. The most sig-
nificant bit of data is located in the outer-most data
ring of the sector below the first bit of the sync-marker.
Of the 63 bits of data encoded in each tag, 48 bits
specify a Bluetooth Device Address (BD ADDR) and
the remaining 15 bits are used for application-specific
purposes.
Our circular tags are designed to work well with the
low-resolution fixed-focal-depth cameras found on to-
day’s cameraphones. Crucially, the individual bits are
Figure 1: [Left] A Visual Tag encoding a 48-bit
large enough to be reliably decoded from distances at
BD ADDR and 15 bits of application-specific data;
which the camera’s lens gives a sharp image. In con-
[Right] Using the tag reader on a Nokia 3650 camera-
trast we found that familiar linear (e.g. UPC) barcodes
phone.
are unsuitable for decoding on cameraphones: when
the phone is positioned near to a linear barcode, the
we use tags to hide device naming information from image is out of focus and cannot be decoded; at dis-
users. Using our technology, a user can focus on per- tances large enough to capture sharp images, the res-
forming the task in hand—connecting two physical olution is insufficient to make out individual bars.
devices to access a mobile service—rather than hav-
ing to establish a connection via (arbitrarily chosen) IV.B. Tag Reader
device names.
We have implemented tag reading software for Nokia
IV. System Architecture Series 60 cameraphones. When running, the reader
turns the cameraphone’s display into a viewfinder: a
In this section we focus on technical details, describ- live video feed continually capturing frames from the
ing our implementation of a tag-based service selec- phone’s embedded camera. The phone performs real-
tion and connection establishment protocol. We start time image processing, locating and decoding tags
by describing the format of the visual tags themselves in every frame. Whenever a tag is visible in the
(Section IV.A) and outlining the implementation of viewfinder and has been decoded successfully, it is
our phone-based tag reading software (Section IV.B). highlighted with a red cross-hair on the phone’s dis-
In Section IV.D, we describe how visual tags are used play (see Figure 1[right]). If multiple tags are de-
to facilitate Bluetooth device and service selection. tected in a single frame, the tag nearest the center of
the viewfinder is highlighted with a red cross-hair. We
IV.A. Tag Format adopt standard GUI terminology, saying that the high-
lighted tag has the focus. Pressing the select button on
Initially based on TRIP [4] and SpotCodes [13], our the phone’s keypad indicates that the user wishes to
visual tags are circular barcodes with 4 data-rings and establish a connection to the mobile service specified
21 sectors. A visual tag, large enough to be detected by the highlighted tag.
by our cameraphone tag reading software, is shown The cameraphone-based tag reading software is im-
in Figure 1[left]. Bits in the data rings are encoded plemented as a native Symbian-OS application, writ-
by using a white block to indicate a value of 1 and a ten in C++. When running on Nokia Series 60 cam-
black block to indicate a value 0. The outermost ring eraphones the tag reading software runs at 15 frames-
contains a sync-marker (the bit pattern 11), used to per-second with very low latency. We have found that
specify the orientation of the tag, and a 5-bit check- a high frame rate and low latency is essential to usabil-
sum which is used to detect decoding errors. The ity. Without these properties a user finds it difficult to
checksum is encoded using the bit pattern 00 to rep- aim the cameraphone at a particular tag.
resent a 0 and the bit pattern 10 to represent a 1. This
ensures that the sync marker is uniquely identifiable IV.C. Connection Establishment
by preventing the bit pattern 11 from occurring any-
where else in the outer ring. The checksum is en- Once a tag containing a device’s BD ADDR has been
coded in a clockwise direction with the most signif- decoded by our tag recognition software, Bluetooth
icant bit located directly after the sync-marker. In the connection establishment can be performed in the
3 inner data-rings, bits are assigned to sectors radially, usual way. For example, in the image-transfer sce-
44 Mobile Computing and Communications Review, Volume 9, Number 1
Tag
nario of Section III, the sending phone would proceed (BD_ADDR, FileID)
35
4
30
25
3
Frequency
Frequency
20
2
15
10
1
0 0
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50
Time (s) Time (s)
Figure 4: [Left]: Distribution of times taken to complete experimental task using Bluetooth alone (50 trials);
[Right]: Distribution of times taken to complete experimental task using visual tags (50 trials). Both figures are
histograms with a bin-size of 1s.
nate the time-consuming Bluetooth device discovery 01”) is displayed clearly on the poster so the user
and selection process, they also provide the user with knows which of the discovered devices to connect to.
an easy way to tell the vending machine which game To ensure that our experiment is a fair compari-
they require. son it is essential that we use “best known methods”
for Bluetooth Device Discovery in our tagless service
VI. Performance Evaluation browser. For this reason we implemented the applica-
tion directly on top of the cameraphone’s native OS,
We compared the performance of our tag-based de- Symbian, and leveraged Symbian’s existing Bluetooth
vice/service/content selection technique against the Device Discovery dialog. The Symbian dialog in-
standard Bluetooth Device Discovery model. As a test corporates a number of features designed specifically
application we designed two versions of a Bluetooth- to reduce the device discovery latency experienced
based active poster designed to distribute mobile con- by the user: (i) Name Discovery is performed to-
tent to a user’s cameraphone/PDA. The first version gether with Inquiry, with names being resolved whilst
of the poster contains six tags, each advertising a dif- other BD ADDRs are still being discovered; (ii) de-
ferent piece of content4 . Clicking on a tag initiates vice names are displayed on the phone’s screen as
a Bluetooth connection and downloads the requested soon as they are discovered—if the device the user is
content onto the user’s device. looking for happens to be found early on in the discov-
The second version of the poster does not make ery procedure they have the option to abort device dis-
use of visual tags; instead, it contains instructions ex- covery immediately and select their required device.
plaining how to select and download content using the The experiments were conducted using Nokia 3650
standard Bluetooth Device Discovery model. To fa- and 3660 cameraphones and a Bluetooth-enabled
cilitate interaction with this poster we implemented a desktop PC (Linux 2.4.20-28.9 running the Bluez
tagless version of our mobile service/content browser. Bluetooth stack) to simulate the mobile service. Us-
This application (i) performs standard Bluetooth De- ing both tag-based and tagless versions of the poster
vice Discovery, prompting the user to select which de- each piece of content was downloaded 50 times.
vice they want to connect to; (ii) connects to the spec- In the case of the tag-based poster we measured (i)
ified device and queries it for a list of available ser- the time between running the tag-reading application
vices/content; (iii) displays the list of services/content and the user selecting the tag; (ii) the time to initi-
on the phone’s display, prompting the user to select ate an L2CAP connection and perform service discov-
one; and (iv) downloads the selected content from the ery (using standard Bluetooth SDP); and (iii) the time
mobile service onto the user’s device. The name of the taken to establish an RFCOMM connection with the
Bluetooth device providing the service (“test-service- mobile service (once SDP has revealed the channel on
4
which to connect).
For the purposes of the experiment it doesn’t matter what the
content is. In a real-life deployment content may be Java applets, In the case of the tagless poster we measured (i) the
music clips, HTML pages etc. time between starting Bluetooth device discovery and
Mobile Computing and Communications Review, Volume 9, Number 1 47
the user selecting the correct device from the resulting
list; (ii) the time taken to establish an L2CAP connec-
tion and perform SDP; (iii) the time taken to establish
an RFCOMM connection; and (iv) the time taken to
display the list of available downloads on the phone’s
screen and for the user to select one.
A group of four users performed the content down-
loads. We made sure that the users were familiar with
both Bluetooth and the UI of the Nokia cameraphones
before starting the experiment. Between each run of
the experiment we performed a hard reset of the cam-
ing the scenario where the devices had not seen each
Visual Tags Bluetooth Only
other before (as is often the case when accessing pub-
(s) (s) (s) (s)
respect (due to the fact that it performs Inquiry imme- phase itself but to the fact that name discovery must be
diately before connection establishment). It could be performed for each of the BD ADDRs discovered by
that the Symbian Bluetooth stack does not use clock- inquiry.
synchronization information learned during Inquiry as
efficiently as it could. However, since the time to es-
tablish an L2CAP connection (in both cases) is small VII. Security Issues
compared to the time to perform Device Discovery,
Although security is not the main thrust of this paper,
our main result (order of magnitude improvement in
in this section we briefly consider the two main se-
task completion time) continues to hold even if we
curity issues arising from accessing mobile services
drop the L2CAP connection time in the “Bluetooth
Only” case to 0. using visual tags and Bluetooth.
.
Press, 1985.
[2] NFC white paper. ECMA International. Avail- [13] High Energy Magic Ltd. The spotcode frame-
able from .
!
) !
! + % ! )
%
&
! .
[14] High Energy Magic Ltd. Visual tag-based blue-
[4] Diego López de Ipiña, Paulo Mendonça, and tooth connection software download. Available
Andy Hopper. Trip: a low-cost vision-based from:
location system for ubiquitous computing. Per-
) !
! + % ! )
/ % ! .
sonal and Ubiquitous Computing, 6(3):206–219,
May 2002. [15] Shwetak N. Patel and Gregory D. Abowd. A
2-way laser-assisted selection scheme for hand-
[5] K. Dorfmueller-Ulhaas and D. Schmalstieg. Fin- helds in a physical environment. In Proceedings
ger tracking for interaction in augmented envi- of The Fifth International Conference on Ubiq-
ronments. In Proc. IEEE International Sympo- uitous Computing (UbiComp 2003). Springer-
sium on Augmented Reality. IEEE Press, 2001. Verlag.
52 Mobile Computing and Communications Review, Volume 9, Number 1
[16] Bruce Schneier. Applied cryptography: proto-
cols, algorithms, and sourcecode in C. John Wi-
ley and Sons, New York, 1994.