Logical Link Control and Adaptation Protocol (L2CAP)
Description
The Bluetooth logical link control and adaptation protocol (L2CAP) supports higher level protocol multiplexing, packet segmentation and reassembly, and the conveying of quality of service information.
L2CAP permits higher level protocols and applications to transmit and receive upper layer data packets(L2CAP Service Data Units, SDU) up to 64 kilobytes in length. L2CAP also permits per-channel flow control and retransmission via the Flow Control and Retransmission Modes.
The L2CAP layer provides logical channels, named L2CAP channels, which are mapped to L2CAP logical links supported by an ACL logical transport
General Operation
L2CAP is based around the concept of ’channels’. Each one of the endpoints of an L2CAP channel is referred to by a channel identifier (CID).
Channel Identifiers
A channel identifier (CID) is the local name representing a logical channel endpoint on the device. CID assignment is relative to a particular device and a device can assign CIDs independently from other devices (unless it needs to use any of the several reserved CIDs)
Operation Between Devices
 |
The figure to the left illustrates the use of CIDs in a communication between corresponding peer L2CAP entities in separate devices. The connection oriented data channels represent a connection between two devices, where a CID identifies each endpoint of the channel. The connectionless channels restrict data flow to a single direction. These channels are used to support a channel ’group’ where the CID on the source represents one or more remote devices. There are also a number of CIDs reserved for special purposes. The signaling channel is one example of a reserved channel. This channel is used to create and establish connection-oriented data channels and to negotiate changes in the characteristics of connection oriented and connectionless channels. |
Modes of Operation
L2CAP may operate in one of three different modes as selected for each L2CAP channel by an upper layer.
The modes are:
- Basic L2CAP Mode (equivalent to L2CAP specification in Bluetooth v1.1) 1
- Flow Control Mode
- Retransmission Mode
Data Packet Format
L2CAP is packet-based but follows a communication model based on channels. A channel represents a data flow between L2CAP entities in remote devices. Channels may be connection-oriented or connectionless.
Signaling Packet Formats
This section describes the signaling commands passed between two L2CAP entities on peer devices. All signaling commands are sent to the signaling channel with CID 0x0001. This signaling channel is available as soon as an ACL logical transport is set up and L2CAP traffic is enabled on the L2CAP logical link. Multiple commands may be sent in a single signaling command (C-frame). Commands take the form of Requests and Responses. All L2CAP implementations support the reception of C-frames with a payload length that does not exceed the signaling MTU. The minimum supported payload length for the C-frame (MTUsig) is 48 octets. L2CAP implementations should not use C-frames that exceed the MTUsig of the peer device. If they ever do, the peer device shall send a Command Reject containing the supported MTUsig.
Configuration Parameter Options
Options are a mechanism to extend the configuration parameters. Options are transmitted as information elements containing an option type, an option length, and one or more option data fields.
|