BLE ❤️ Protobuf: Designing Schemas for the Smallest Packets in...
summary
Shows concrete protobuf techniques and measurements for BLE: use integers instead of floats, signed types for negatives, and fixed64 for UUIDs to shrink a message from 70 bytes to 42 bytes final message; JSON equivalents are 248 bytes (descriptive keys) or 122 bytes (single-char keys). Notes MTU realities: minimum MTU 23 bytes with only 20 bytes usable payload after ATT header, typical modern MTU 517 bytes. Describes an envelope with an 8 byte measured overhead, fragmentation algorithm, and using AES GCM for payload encryption so fragments are the encrypted byte array.
AI-written summary · about
chapters (16)
- 0:00Introduction to BLE and Protobuf
- 3:56BLE packet size constraints
- 5:00Why Protobuf fits BLE
- 7:26Optimizing Protobuf for size
- 11:36Handling negative integers
- 13:23Replacing floats with integers
- 15:28Using fixed-length integers
- 17:55Inlining nested messages
- 19:59JSON vs Protobuf size comparison
- 20:42Data type selection best practices
- 22:33Fragmentation over BLE
- 26:43Measuring envelope overhead
- 28:09Adding encryption to fragments
- 31:41Reducing fragment metadata
- 32:43Optimizing for standard MTUs
- 33:46Summary and key takeaways
