CID 0x0004 / 0x0006
10 → source, 11 → dest
+1 additional
Data starts immediately
10.10 — Practical Examples
Theory makes more sense when you can see it working on real hardware. Section 10.10 provides annotated sniffer captures of actual BLE L2CAP traffic — first a basic connection showing ATT and SMP channels working without any setup PDUs, then a credit-based flow control session showing the full lifecycle of a credit channel. These captures come directly from the textbook and match what you would see using tools like Wireshark with a BLE sniffer or btmon on Linux.
Figure 10.8 — Basic L2CAP Exchange Between Two Devices
The sniffer capture in Figure 10.8 shows L2CAP PDUs being exchanged between two connected BLE devices. Looking at the Channel ID column, two things stand out immediately:
Every packet carrying ATT data shows CID = 0x0004 in the Channel ID field. Every packet carrying Security Manager data shows CID = 0x0006. This confirms exactly what the specification says about fixed channel identifiers — ATT always uses 0x0004, SMP always uses 0x0006, no matter which device or which connection.
Scanning through all the captured frames, there are no L2CAP CONNECT requests and no CONFIGURE requests anywhere in the log. In a BR/EDR capture you would see these before any data flows. In BLE they do not exist. As soon as the link layer connection was established, data started flowing directly on CID 0x0004 and 0x0006 with zero L2CAP setup overhead.
| Frame | PDU Length | Channel ID | Summary |
|---|---|---|---|
| 685 | 14 | 0x0004 | ATT — first data PDU, no setup needed |
| 686 | 7 | 0x0004 | ATT — second frame, same channel |
| 689 | 5 | 0x0004 | ATT — third frame |
| 690 | 7 | 0x0006 | SMP — Security Manager frame appears mid-connection |
| 693 | 7 | 0x0006 | SMP — second Security Manager frame |
| 694 | 17 | 0x0006 | SMP — pairing data frame |
| 697 | 17 | 0x0006 | SMP — further pairing frame |
/* Capturing L2CAP traffic with btmon on Linux */
/* sudo btmon */
/* You will see output like: */
/* @ device hci0 opened
/* > HCI Event: LE Meta Event — Connection Complete */
/* < HCI Command: LE Set Event Mask */
/* ATT traffic (CID 0x0004): */
/* > ACL Data RX: handle 64 flags 0x02 dlen 11 */
/* ATT: Exchange MTU Request (0x02) len 3 */
/* Client RX MTU: 512 */
/* SMP traffic (CID 0x0006): */
/* > ACL Data RX: handle 64 flags 0x02 dlen 7 */
/* SMP: Pairing Request (0x01) len 6 */
/* IO capability: NoInputNoOutput */
Figures 10.9 & 10.10 — Credit-Based Connection Setup
Figure 10.9 shows the LE Credit-Based Connection Request from the source device. The key fields visible in the capture:
PDU Length 14 bytesChannel ID 0x0005 (Signaling)Command Length 10 bytesProtocol/Service MUX 0x003E (example PSM)Source CID 0x0040 (dynamically allocated)Value (MTU) 65535 bytesMax PDU Size (MPS) 230 bytesInitial Credits 10 ← Destination may send 10 LE-frames to SourceThe Initial Credits = 10 in the request means the source device is granting the destination device permission to send up to 10 LE-frames once the channel is open. Until the source issues more credits, the destination cannot send more than 10 frames on this channel.
The destination device replies with an LE Credit-Based Connection Response. The response includes its own Initial Credits field — this grants the source device permission to send LE-frames to the destination.
Destination CID 0x0040 (assigned by responder)Value (MTU) 1280 bytesMax PDU Size (MPS) 128 bytesInitial Credits 11 ← Source may send 11 LE-frames to DestinationResult Code Connection Successful (0x0000)After this two-PDU handshake the channel is fully established. The state is:
Source has 11 credits — can send up to 11 LE-frames before needing more
Destination has 10 credits — can send up to 10 LE-frames before needing more
Figure 10.11 — LE Flow Control Credit
Figure 10.11 shows an LE Flow Control Credit packet sent after the initial channel setup. The capture shows that one additional credit is being sent to the peer device. This is the mechanism by which a device says “I have finished processing one more LE-frame and have buffer space again — you may send one additional frame.”
PDU Length 8 bytesCommand Length 4 bytesChannel ID (CID) 0x0040 (receiving credits endpoint)Additional Credits 1 ← Peer can now send 1 more LE-frameAfter the peer device receives this packet, it adds 1 to its current credit count for CID 0x0040. If it had 0 credits before and was blocked from sending, it can now send exactly 1 LE-frame. If it had 3 credits remaining, it now has 4.
Figure 10.12 — Flow Control Chart
Figure 10.12 from the textbook shows the complete credit-based flow control picture in one view. Combining what we saw in Figures 10.9, 10.10, and 10.11, here is the full credit lifecycle:
This pattern repeats for as long as data needs to be transferred. The destination device controls the pacing — it only issues credits when it has actually processed frames and freed buffer space. This prevents the source from ever overflowing the destination’s buffers regardless of how fast it can produce data.
10.11 — Chapter 10 Summary
The L2CAP layer provides data delivery services to the two upper-layer protocols that sit above it: the Security Manager Protocol (SMP) and the Attribute Protocol (ATT). Both of these use L2CAP’s channels to send their PDUs to the corresponding protocol on the remote device.
Because there are only two protocols using L2CAP in BLE (compared to many in BR/EDR), the LE L2CAP is significantly simplified. The fixed CID approach means there is never a need to negotiate or allocate channel numbers dynamically. Both ATT (CID 0x0004) and SMP (CID 0x0006) are always available the moment a connection is established.
Even the signaling commands are minimal — just three for the basic LE case: Command Reject, Connection Parameter Update Request, and Connection Parameter Update Response. None of these need to be exchanged before data can start flowing. As soon as the Link Layer reports a connection established, the upper layers can hand data to L2CAP and it will be sent immediately.
- Fixed CIDs — no dynamic allocation
- Fragmentation / Defragmentation
- Multiplexing by CID
- B-Frame (Basic Mode) PDUs
- Credit-based channels (4.1)
- No CONNECT / CONFIGURE needed
- No retransmission modes (4 removed)
- Only 3 core signaling commands
- MTU = 23 bytes (not 48 or 672)
- Only Best Effort QoS
- Security Manager (SMP) — Chapter 11
- Attribute Protocol (ATT) — Chapter 12
- Both use the L2CAP channels you just learned
- IPSP (credit-based) — Chapter 15
The next two chapters focus on the Security Manager and the Attribute Protocol — the two protocols that sit directly above L2CAP and use its services. Everything covered in Chapter 10 provides the transport foundation that SMP and ATT rely on.
Chapter 10 Complete — On to Security Manager
L2CAP for BLE is fully covered. Chapter 11 covers the Security Manager Protocol which runs on CID 0x0006 — the channel you just saw in Figure 10.8.
