Bluetooth Host - L2CAP, SDP & GAP
- notes and details about the Bluetooth higher layer stack or Host: L2CAP, logical link control and adaptation protocol; SDP, Service Discovery Protocol & GAP, Generic Access Profile.
The higher layer protocols within the Bluetooth stack are also known as the Bluetooth Host. This is responsible for the communications between the applications and the controller.
Unlike the higher layer stack, the lower layers undertake the connections between devices without need to reference the higher layers or Bluetooth host.
Bluetooth host main elements
There are three main elements that are included in the higher layer stack or Bluetooth host:
- L2CAP - Logical link control and adaptation protocol
- SDP - Service discovery protocol
- GAP - Generic access protocol
These Bluetooth stack components are fundamental to all the profiles and transports within the overall Bluetooth system.
The Bluetooth L2CAP or logical link control and adaptation protocol is used to provide an interface for all the data applications that use the ACL links.
The Bluetooth L2CAP provides multiplexing between the higher layer protocols. This enables multiple applications to utilise the same lower layer links.
In its basic mode the L2CAP enables the following configurability with the packet payload:
- 672 bytes as default.t
- 48 bytes as minimum supported figure.
- 64k bytes as maximum figure.
The L2CAP achieves the transmission of the large data packets by segmenting and then at the receiver, re-assembling the packets so that the data can be fitted into the limits of the lower layer data packets.
The L2CAP also supports flow control and retransmission, performing CRC checks. The latest specifications support two L2CAP modes over those originally included:
- Streaming Mode, SM : This is a basic L2CAP mode with no re-transmission or flow control. Its simplicity is its advantage, but it does not provide the reliability of the other modes.
- Enhanced Retransmission Mode, ERTM: This mode is an update to the original retransmission mode and gives improved performance.
Any error checking and reliability enhancements can be provided by the lower layers.
The SDP or service discovery protocol is a key element of the Bluetooth ad-hoc networking capability.
The Bluetooth SDP allows a Bluetooth device to discover and make many connections during the course of its life. It enables the devices to discover what services other Bluetooth devices support, and also lists everything that the Bluetooth device is capable of supporting.
The Bluetooth SDP uses the Universal Unique Identifier, UUID. Services supported by the Bluetooth Sig are given a short form UUID of 16 bits rather than the complete 128 bits that would otherwise be required.
A profile known as the Service Discovery Applications Profile, or SDAP, is often confused with the Bluetooth SDP. This defines how devices can interrogate each other's SDP after and L2CAP link has been established.
All Bluetooth devices implement the features of an SDP client as well as having and SDP server database.
The Bluetooth GAP or generic access protocol defines the way that Bluetooth devices are able to discover each other and establish connections. It is one of the most basic Bluetooth profiles, but is used by every other profile as the foundation for establishing a link
The Bluetooth GAP can set the Bluetooth device into one of three different discovery modes:
- General discovery
- Limited discovery
The Bluetooth GAP controls the formation of a connection by controlling the inquiry and paging routines. It also looks after pairing and controls the use of security and encryption.
Finally the Bluetooth GAP enables the Bluetooth device to be set into connectable or non-connectable modes.
By Ian Poole
Share this page
Want more like this? Register for our newsletter