Project 13: Networking & Protocol Workbench (Wi-Fi, BLE, TCP/IP, mDNS)

Build an authorized network protocol lab on Cardputer that combines Wi-Fi metadata capture, BLE services, TCP resilience, and mDNS service discovery.

Quick Reference

Attribute Value
Difficulty Expert
Time Estimate 2-3 weeks
Main Programming Language C
Alternative Programming Languages C++, Rust
Coolness Level Level 4
Business Potential Level 4
Prerequisites TCP/IP fundamentals, BLE basics
Key Topics Promiscuous capture, channel hopping, GATT design, lwIP tuning

1. Learning Objectives

  1. Engineer authorized Wi-Fi metadata capture safely.
  2. Design BLE GATT services with power-aware parameters.
  3. Tune socket behavior for reconnect reliability.
  4. Deploy local-discovery flows with mDNS.

2. Theory

2.1 Wireless and Transport Layers on Constrained Devices

Radio-layer visibility and transport reliability are separate concerns that must be coordinated by policy.

2.2 Reconnection and Discovery

Robust systems rely on deterministic reconnect state machines and explicit discovery fallback logic.

3. Specification

  • Wi-Fi authorized metadata mode (promiscuous + channel plan).
  • BLE GATT server with notifications.
  • TCP probe client with backoff reconnect.
  • mDNS advertisement and discovery test.

Output:

I netlab: wifi capture enabled channels=1,6,11
I netlab: ble service count=3 notify=10Hz
I netlab: tcp reconnect policy=exp_backoff
I netlab: mdns _cardputer._tcp.local announced

4. Architecture

[Radio Policy Manager]
  |-> [Wi-Fi Module]
  |-> [BLE Module]
  |-> [TCP Module]
  |-> [mDNS Module]

5. Implementation Guide

Core question:

“How do I make wireless features robust and legal in real deployments?”

Design questions:

  1. Which capture actions are allowed in your environment?
  2. How will you avoid callback overload and packet drops?
  3. What reconnect thresholds prevent battery drain?

6. Testing

  • AP loss/rejoin loops.
  • BLE connect/disconnect flood.
  • Socket timeout and recovery scenarios.
  • mDNS discovery from multiple hosts.

7. Pitfalls

  • Heavy parsing in promiscuous callback.
  • BLE intervals that hurt power budget.
  • Immediate reconnect loops without backoff.

8. Extensions

  • Add packet classification dashboards.
  • Add BLE HID integration bridge.

9. Completion Checklist

  • Authorized Wi-Fi capture produces stable metadata export.
  • BLE service remains stable under repeated connections.
  • TCP reconnect and mDNS flows survive network disruptions.