# sdnwiselab/sdn-wise-contiki architecture

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

- Interactive diagram: https://gitdiagram.com/sdnwiselab/sdn-wise-contiki
- Repository: https://github.com/sdnwiselab/sdn-wise-contiki

## Overview

SDN-WISE is a software-defined wireless sensor-network runtime for Contiki, with Cooja adapters for simulation. A node initializes its protocol state, exchanges radio or UART packets, dispatches received packets to protocol handlers, and applies flow-table rules; sink nodes also bridge packets to an external controller over TCP. The graph includes packet construction, neighbor discovery, configuration, and simulation support. Evidence is limited to the README and supplied source excerpts and index; unsampled module interactions are omitted where not established.

Main entry points: [`sdn-wise/sdn-wise.c`](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/sdn-wise.c) (Contiki runtime), [`sdn-wise/packet-handler.c`](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-handler.c) (Packet dispatch), [`sdn-wise/packet-buffer.c`](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-buffer.c) (Packet buffer), [`sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java`](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java) (Simulated mote)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Node runtime"]
  node_node["Contiki runtime<br/>[sdn-wise.c]"]
end

subgraph group_protocol["Protocol functions"]
  node_packet_handler["Packet dispatch<br/>[packet-handler.c]"]
  node_packet_creation["Packet creation<br/>[packet-creator.c]"]
  node_flow_table["Flow-table rules<br/>[flowtable.c]"]
end

subgraph group_state["Node state"]
  node_packet_buffer["Packet buffer<br/>[packet-buffer.c]"]
  node_neighbors["Neighbor table<br/>[neighbor-table.c]"]
  node_configuration["Node configuration<br/>[node-conf.c]"]
  node_addresses["Address handling<br/>[address.c]"]
  node_symbols["Protocol symbols<br/>[symbols.c]"]
end

subgraph group_simulation["Cooja simulation"]
  node_cooja_mote["Simulated mote"]
  node_cooja_node["Cooja node<br/>[CoojaMote.java]"]
  node_cooja_sink["Cooja sink<br/>[CoojaSink.java]"]
end

node_radio_actor(("Radio network"))
node_uart_actor(("UART link"))
node_controller(("SDN controller"))
node_java_core["SDN-WISE mote core"]

node_node -->|"initializes"| node_configuration
node_node -->|"initializes"| node_flow_table
node_node -->|"initializes"| node_packet_buffer
node_node -->|"initializes"| node_neighbors
node_node -->|"dispatches packets"| node_packet_handler
node_node -->|"creates beacons"| node_packet_creation
node_node -->|"sends packets"| node_radio_actor
node_uart_actor -->|"delivers bytes"| node_node
node_radio_actor -->|"delivers packets"| node_node
node_packet_handler -->|"matches rules"| node_flow_table
node_packet_handler -->|"updates neighbors"| node_neighbors
node_packet_handler -->|"deallocates packets"| node_packet_buffer
node_packet_handler -->|"checks addresses"| node_addresses
node_packet_creation -->|"builds packets"| node_packet_buffer
node_flow_table -->|"processes packets"| node_packet_buffer
node_neighbors -->|"stores neighbor data"| node_packet_buffer
node_configuration -->|"uses addresses"| node_addresses
node_cooja_node -->|"extends"| node_cooja_mote
node_cooja_sink -->|"extends"| node_cooja_mote
node_cooja_mote -->|"runs core"| node_java_core
node_cooja_sink -->|"exchanges packets"| node_controller
node_cooja_mote -->|"transmits packets"| node_radio_actor

click node_node "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/sdn-wise.c"
click node_packet_handler "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-handler.c"
click node_packet_creation "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-creator.c"
click node_flow_table "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/flowtable.c"
click node_packet_buffer "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-buffer.c"
click node_neighbors "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/neighbor-table.c"
click node_configuration "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/node-conf.c"
click node_addresses "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/address.c"
click node_symbols "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/symbols.c"
click node_cooja_mote "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java"
click node_cooja_node "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaMote.java"
click node_cooja_sink "https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaSink.java"

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_node toneBlue
class node_packet_handler,node_packet_creation,node_flow_table toneAmber
class node_packet_buffer,node_neighbors,node_configuration,node_addresses,node_symbols toneMint
class node_cooja_mote,node_cooja_node,node_cooja_sink toneRose
class node_radio_actor,node_uart_actor,node_controller,node_java_core toneIndigo
```

## Components

### Node runtime

- [Contiki runtime](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/sdn-wise.c): `sdn-wise/sdn-wise.c`

### Protocol functions

- [Packet dispatch](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-handler.c): `sdn-wise/packet-handler.c`
- [Packet creation](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-creator.c): `sdn-wise/packet-creator.c`
- [Flow-table rules](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/flowtable.c): `sdn-wise/flowtable.c`

### Node state

- [Packet buffer](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/packet-buffer.c): `sdn-wise/packet-buffer.c`
- [Neighbor table](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/neighbor-table.c): `sdn-wise/neighbor-table.c`
- [Node configuration](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/node-conf.c): `sdn-wise/node-conf.c`
- [Address handling](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/address.c): `sdn-wise/address.c`
- [Protocol symbols](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise/symbols.c): `sdn-wise/symbols.c`

### Cooja simulation

- [Simulated mote](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java): `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java`
- [Cooja node](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaMote.java): `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaMote.java`
- [Cooja sink](https://github.com/sdnwiselab/sdn-wise-contiki/blob/master/sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaSink.java): `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaSink.java`

### Other components

- **Radio network**
- **UART link**
- **SDN controller**
- **SDN-WISE mote core**

## Connections

- Contiki runtime → Node configuration: initializes (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Flow-table rules: initializes (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Packet buffer: initializes (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Neighbor table: initializes (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Packet dispatch: dispatches packets (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Packet creation: creates beacons (evidence: `sdn-wise/sdn-wise.c`)
- Contiki runtime → Radio network: sends packets (evidence: `sdn-wise/sdn-wise.c`)
- UART link → Contiki runtime: delivers bytes (evidence: `sdn-wise/sdn-wise.c`)
- Radio network → Contiki runtime: delivers packets (evidence: `sdn-wise/sdn-wise.c`)
- Packet dispatch → Flow-table rules: matches rules (evidence: `sdn-wise/packet-handler.c`)
- Packet dispatch → Neighbor table: updates neighbors (evidence: `sdn-wise/packet-handler.c`)
- Packet dispatch → Packet buffer: deallocates packets (evidence: `sdn-wise/packet-handler.c`)
- Packet dispatch → Address handling: checks addresses (evidence: `sdn-wise/packet-handler.c`)
- Packet creation → Packet buffer: builds packets (evidence: `sdn-wise/packet-creator.c`)
- Flow-table rules → Packet buffer: processes packets (evidence: `sdn-wise/flowtable.c`)
- Neighbor table → Packet buffer: stores neighbor data (evidence: `sdn-wise/neighbor-table.c`)
- Node configuration → Address handling: uses addresses (evidence: `sdn-wise/node-conf.c`)
- Cooja node → Simulated mote: extends (evidence: `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaMote.java`)
- Cooja sink → Simulated mote: extends (evidence: `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaSink.java`)
- Simulated mote → SDN-WISE mote core: runs core (evidence: `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java`)
- Cooja sink → SDN controller: exchanges packets (evidence: `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/CoojaSink.java`)
- Simulated mote → Radio network: transmits packets (evidence: `sdn-wise-emulated/src/org/contikios/cooja/sdnwise/AbstractCoojaMote.java`)
