# jonaffrye/6lowpan architecture

> Architecture diagram of the GitHub repository jonaffrye/6lowpan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jonaffrye/6lowpan
- Repository: https://github.com/jonaffrye/6lowpan

## Overview

This is an embedded 6LoWPAN stack for IPv6 communication over UWB on GRiSP 2. The documented send workflow is the robot example building an IPv6 packet, then submitting it through the Lowpan API; the API uses the IEEE 802.15.4 MAC layer for transmission. Reception starts with MAC frames and enters through the API. The README describes core compression, fragmentation, meshing, and routing capabilities, but no source excerpts were provided, so internal call relationships beyond documented ones are omitted.

Main entry points: [`src/robot.erl`](https://github.com/jonaffrye/6lowpan/blob/main/src/robot.erl) (Robot examples), [`src/lowpan_api.erl`](https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_api.erl) (Lowpan API), [`src/lowpan_ipv6.erl`](https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_ipv6.erl) (IPv6 packet builder), [`src/ieee802154.erl`](https://github.com/jonaffrye/6lowpan/blob/main/src/ieee802154.erl) (IEEE 802.15.4 MAC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Robot application"]
  node_robot["Robot examples<br/>[robot.erl]"]
end

subgraph group_lowpan["6LoWPAN stack"]
  node_ipv6["IPv6 packet builder<br/>[lowpan_ipv6.erl]"]
  node_api["Lowpan API<br/>[lowpan_api.erl]"]
  node_core["Compression, fragmentation, meshing<br/>[lowpan_core.erl]"]
  node_routing[("Routing table<br/>[routing_table.erl]")]
end

subgraph group_mac["MAC layer"]
  node_ieee["IEEE 802.15.4 MAC<br/>[ieee802154.erl]"]
end

node_operator(("Robot operator"))

node_operator -->|"runs example"| node_robot
node_robot -->|"builds packet"| node_ipv6
node_robot -->|"submits packet"| node_api
node_robot -->|"requests reception"| node_api
node_api -->|"uses MAC"| node_ieee

click node_robot "https://github.com/jonaffrye/6lowpan/blob/main/src/robot.erl"
click node_ipv6 "https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_ipv6.erl"
click node_api "https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_api.erl"
click node_core "https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_core.erl"
click node_routing "https://github.com/jonaffrye/6lowpan/blob/main/src/routing_table.erl"
click node_ieee "https://github.com/jonaffrye/6lowpan/blob/main/src/ieee802154.erl"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_robot toneBlue
class node_ipv6,node_api,node_core,node_routing toneAmber
class node_ieee toneMint
class node_operator toneIndigo
```

## Components

### Robot application

- [Robot examples](https://github.com/jonaffrye/6lowpan/blob/main/src/robot.erl): `src/robot.erl`

### 6LoWPAN stack

- [IPv6 packet builder](https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_ipv6.erl): `src/lowpan_ipv6.erl`
- [Lowpan API](https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_api.erl): `src/lowpan_api.erl`
- [Compression, fragmentation, meshing](https://github.com/jonaffrye/6lowpan/blob/main/src/lowpan_core.erl): `src/lowpan_core.erl`
- [Routing table](https://github.com/jonaffrye/6lowpan/blob/main/src/routing_table.erl): `src/routing_table.erl`

### MAC layer

- [IEEE 802.15.4 MAC](https://github.com/jonaffrye/6lowpan/blob/main/src/ieee802154.erl): `src/ieee802154.erl`

### Other components

- **Robot operator**

## Connections

- Robot operator → Robot examples: runs example (evidence: `README.md`)
- Robot examples → IPv6 packet builder: builds packet (evidence: `README.md`)
- Robot examples → Lowpan API: submits packet (evidence: `README.md`)
- Robot examples → Lowpan API: requests reception (evidence: `README.md`)
- Lowpan API → IEEE 802.15.4 MAC: uses MAC (evidence: `README.md`)
