# ravblack/secn architecture

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

- Interactive diagram: https://gitdiagram.com/ravblack/secn
- Repository: https://github.com/ravblack/secn

## Overview

This repository is a set of standalone C demonstrations of data-link framing and reliable transmission. Users run each program in a terminal; interactive examples read parameters and simulated ACKs, then print transmission or framing results. Bit stuffing uses hard-coded input. The README is empty, so the map reflects the sampled source files only.

Main entry points: [`02_character_stuffing.c`](https://github.com/ravblack/secn/blob/main/02_character_stuffing.c) (Character stuffing), [`03_stop_and_wait_arq.c`](https://github.com/ravblack/secn/blob/main/03_stop_and_wait_arq.c) (Stop-and-wait ARQ), [`04_go_back_n_arq.c`](https://github.com/ravblack/secn/blob/main/04_go_back_n_arq.c) (Go-back-N ARQ), [`05_selective_repeat_arq.c`](https://github.com/ravblack/secn/blob/main/05_selective_repeat_arq.c) (Selective-repeat ARQ)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framing["Framing demos"]
  node_bit_stuffing["Bit stuffing<br/>[01_bit_stuffing.c]"]
  node_character_stuffing["Character stuffing"]
end

subgraph group_arq["ARQ demos"]
  node_stop_wait["Stop-and-wait ARQ"]
  node_go_back_n["Go-back-N ARQ<br/>[04_go_back_n_arq.c]"]
  node_selective_repeat["Selective-repeat ARQ"]
end

node_terminal(("Terminal user"))

node_bit_stuffing -->|"prints stuffed bits"| node_terminal
node_terminal -->|"provides data"| node_character_stuffing
node_character_stuffing -->|"prints frame and data"| node_terminal
node_terminal -->|"provides frames and ACKs"| node_stop_wait
node_stop_wait -->|"prints transmission status"| node_terminal
node_terminal -->|"provides frames, window, ACKs"| node_go_back_n
node_go_back_n -->|"prints sends and retries"| node_terminal
node_terminal -->|"provides frames, window, ACKs"| node_selective_repeat
node_selective_repeat -->|"prints sends and retries"| node_terminal

click node_bit_stuffing "https://github.com/ravblack/secn/blob/main/01_bit_stuffing.c"
click node_character_stuffing "https://github.com/ravblack/secn/blob/main/02_character_stuffing.c"
click node_stop_wait "https://github.com/ravblack/secn/blob/main/03_stop_and_wait_arq.c"
click node_go_back_n "https://github.com/ravblack/secn/blob/main/04_go_back_n_arq.c"
click node_selective_repeat "https://github.com/ravblack/secn/blob/main/05_selective_repeat_arq.c"

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_bit_stuffing,node_character_stuffing,node_terminal toneBlue
class node_stop_wait,node_go_back_n,node_selective_repeat toneAmber
```

## Components

### Framing demos

- [Bit stuffing](https://github.com/ravblack/secn/blob/main/01_bit_stuffing.c): `01_bit_stuffing.c`
- [Character stuffing](https://github.com/ravblack/secn/blob/main/02_character_stuffing.c): `02_character_stuffing.c`

### ARQ demos

- [Stop-and-wait ARQ](https://github.com/ravblack/secn/blob/main/03_stop_and_wait_arq.c): `03_stop_and_wait_arq.c`
- [Go-back-N ARQ](https://github.com/ravblack/secn/blob/main/04_go_back_n_arq.c): `04_go_back_n_arq.c`
- [Selective-repeat ARQ](https://github.com/ravblack/secn/blob/main/05_selective_repeat_arq.c): `05_selective_repeat_arq.c`

### Other components

- **Terminal user**

## Connections

- Bit stuffing → Terminal user: prints stuffed bits
- Terminal user → Character stuffing: provides data
- Character stuffing → Terminal user: prints frame and data
- Terminal user → Stop-and-wait ARQ: provides frames and ACKs
- Stop-and-wait ARQ → Terminal user: prints transmission status
- Terminal user → Go-back-N ARQ: provides frames, window, ACKs
- Go-back-N ARQ → Terminal user: prints sends and retries
- Terminal user → Selective-repeat ARQ: provides frames, window, ACKs
- Selective-repeat ARQ → Terminal user: prints sends and retries
