Sunday, October 15, 2000
JINI Pattern Language WorkshopACM OOPSLA 2000
Minneapolis, MN, USA
Patterns in Bluetooth
Aniruddha [email protected] Labs Research,Lucent TechnologiesMurray Hill, NJ, USA
2
Aniruddha S. Gokhale Patterns in Bluetooth
Design patterns capture the static & dynamic roles & relationships in solutions that occur repeatedly
Architectural patterns express a fundamental structural organization for software systems that provide a set of predefined subsystems, specify their relationships, & include the rules and guidelines for organizing the relationships between them
Optimization principle patterns document rules for avoiding common design & implementation mistakes that degrade performance
Patterns codify expert knowledge to help generate software architectures by capturing recurring structures & dynamics and resolving common design forces
Overview of Patterns
www.posa.uci.edu/
4
Aniruddha S. Gokhale Patterns in Bluetooth
Overview of Bluetooth• www.bluetooth.com• De facto standard for low-
cost, short range radio links between mobile devices
• Formed by a consortium of telecommunications
• Goal is to eliminate the need for cable connectivity and promote full scale ad hoc networking
• Operates in the unlicensed ISM band at 2.4 GHzPrimary components include a
radio unit, a link control unit, and a support unit for link management and host-terminal interface
5
Aniruddha S. Gokhale Patterns in Bluetooth
Layers PatternIntent
Helps to structure applications that can be decomposed into groups of subtasks in which each group of subtasks is at a particular level of abstraction
Bluetooth UsageDefines a protocol stack
Known UsesOSI Seven Layers, STREAMS
ForcesTasks independent of each other need to be decoupled
6
Aniruddha S. Gokhale Patterns in Bluetooth
Bluetooth Protocol Stack
Radio Specification• 2.4 GHz ISM band (2,400-
2,483.5 MHz)• Channels spaced 1MHz apart• Gaussian FSK modulation
Baseband Specification• Short range radio link• Uses slotted channel• channels point-to-point or point-
to-multipoint• Supports both circuit-switched
(SCO - synchronous connection-oriented) and packet-switched (ACL - asynchronous connectionless) links.
Link Manager Protocol (LMP)• Used for link setup, security,
and control
7
Aniruddha S. Gokhale Patterns in Bluetooth
Bluetooth Protocol Stack
Logical Link Control and Adaptation Protocol (L2CAP)
• Higher layer protocol multiplexing for SDP, TCS, RFCOMM
• Packet segmentation and reassembly
• Only for ACL links• Provides group abstractions• Provides the means to convey QoS
information• MTU = 64 Kbytes
8
Aniruddha S. Gokhale Patterns in Bluetooth
Multiplexor & Dispatcher PatternIntent
Multiplex messages from differing tasks into one task, and de-multiplex and dispatch messages from one task to one of several tasks
Forces
Support several tasks with differing message formats on top of a single task with its own message format
Known Uses• TCP/IP• System V STREAMS• ACE Reactor
Bluetooth UsageL2CAP Layer multiplexes packets from SDP, RFCOMM, TCS, and IP telephony protocol layers
L2CAP
SDP TCSRFCOMM
9
Aniruddha S. Gokhale Patterns in Bluetooth
SAR PatternIntent
Reassemble fragmented messages in the correct order before dispatching them to their destination task
Forces
Guarantee ordered delivery of messages to upper layers when lower layers fragment messages and can lose or reorder messages
Known Uses• TCP/IP• Reliable multicast over UDP
L2CAP
SDP TCSRFCOMM
Bluetooth Usage• L2CAP segments and reassembles
packets for SDP, RFCOMM, TCS, and IP telephony protocols
10
Aniruddha S. Gokhale Patterns in Bluetooth
Bluetooth Protocol StackService Discovery Protocol
(SDP)• Locating services and their
characteristics• Allows search based on attributes
or service classes• Allows discovery without consulting
a third device• Provides only information about the
service and not direct access to the service
RFCOMM• Provides emulation of serial ports
over L2CAP• Provides a unified interface for
communication medium between Bluetooth devices
11
Aniruddha S. Gokhale Patterns in Bluetooth
Lookup PatternIntent
Describes how to find and retrieve initial references to distributed objects and services
Forces
Discover services in an ad hoc network
Known Uses• JINI Lookup Service• CORBA Naming and Trading
Service
Bluetooth Usage• SDP allows discovery of services,
however, actual initial references must be obtained differentlySDP Client SDP Server
request
response
Client Server
12
Aniruddha S. Gokhale Patterns in Bluetooth
Service Browsing PatternIntent
Allows browsing all services offered by a Lookup Service
Forces
Ability to query based on class or characteristics of services
Known Uses• JINI Lookup Service• CORBA Trading Service
Bluetooth Usage• SDP allows discovering all services
based on attributes
SDP Client SDP Serverrequest
response
Client Server
13
Aniruddha S. Gokhale Patterns in Bluetooth
Bluetooth Protocol StackIrDA Interoperability (IrOBEX)• Protocol to function over both short
range RF and infra red (Ir) media• IrOBEX is a session protocol
mapped over RFCOMM, IrDA, or TCP/IP
• Provides a model for representing objects that follow a client/server request/response paradigm
Telephony Control (TCS)• Defines the call control signaling for
the establishment of speech and data calls between Bluetooth devices
• Defines mobility management issues
14
Aniruddha S. Gokhale Patterns in Bluetooth
Broker Pattern
Intent
Used to structure distributed systems with decoupled components that interact by remote method invocations
Forces
Request/response communication between Bluetooth devices
Known Uses• CORBA ORB• Java RMI• DCOM
Bluetooth Usage• OBEX (OBject EXchange) protocol
provides a model to represent objects using client/server paradigm
IrOBEX IrOBEXrequest
response
Client Server
15
Aniruddha S. Gokhale Patterns in Bluetooth
Facade PatternIntent
Provide a unified interface to a set of interfaces in a subsystem
Forces
Several disparate interfaces that must be unified
Known Uses• ACE
Bluetooth Usage• OBEX (OBject EXchange) protocol
provides a unified interface for the underlying transport
• RFCOMM provides a unified interface over communication medium between Bluetooth devices
IrOBEX IrOBEXrequest
response
Client Server
BTDevice
ModemDevice
BTDevice
BTDevice
RFCOMM
RFCOMM Network
16
Aniruddha S. Gokhale Patterns in Bluetooth
Pluggable Protocol PatternIntent
To be able to use disparate subtasks to deliver messages belonging to a particular task
Forces
Unifying several disparate lower layers in a Layer pattern
Known Uses• TAO ORB supporting several
underlying transports such as TCP/IP, ATM, shared memory
Bluetooth Usage• OBEX (OBject EXchange) protocol
can run on top of IrDA, RFCOMM, and TCP/IP
IrOBEX
TCP/IPRFCOMMIrDA
17
Aniruddha S. Gokhale Patterns in Bluetooth
Interoperability Requirements for Wireless Application Protocol (WAP)
• Many characteristics of Bluetooth devices shared with WAP target platforms
• Same device may be enabled for both protocols
• WAP clients and servers use PPP to use the physical and link control medium provided by Bluetooth
• Provide access to WAP’s value-added services using the ad hoc, dynamic characteristics of Bluetooth
18
Aniruddha S. Gokhale Patterns in Bluetooth
Bridge PatternIntent
Decouples an abstraction from its implementation so that the two can vary independently
Forces
Maintain independence between WAP and Bluetooth, however, allowing WAP applications to communicate over Bluetooth
Known Uses• ET++• libg++• ACE
Bluetooth UsagePPP serves as the bridge between WAP applications and the communication medium offered by Bluetooth
Bearer: e.g., PPP, CDMA
Application Layer (WAE)
Transport Layer (WDP)
Security Layer (WTLS)
Transaction Layer (WTP)
Session Layer (WSP)
WAP
Bluetooth