# adinesh-reddy/mp_quic architecture

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

- Interactive diagram: https://gitdiagram.com/adinesh-reddy/mp_quic
- Repository: https://github.com/adinesh-reddy/mp_quic

## Overview

MP-QUIC Mini is a multipath UDP transport with client/server file-transfer and request/response programs. The main workflow is: an application configures local interfaces and a peer, the endpoint establishes a connection and paths, then streams are packetized, scheduled across paths, delivered in order and acknowledged; flow control, loss recovery and congestion control govern transmission. The README documents these capabilities, while sampled source shows the core interfaces. Some internal call relationships are not visible in the excerpts, so the graph uses documented links and omits uncertain ones.

Main entry points: [`src/connection/connection.cpp`](https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/connection.cpp) (Connection engine), [`src/path/path.cpp`](https://github.com/adinesh-reddy/mp_quic/blob/main/src/path/path.cpp) (Network path), [`apps/mpq_client.cpp`](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_client.cpp) (File client), [`src/connection/client.cpp`](https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/client.cpp) (Client endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Applications"]
  node_mpq_client["File client<br/>[mpq_client.cpp]"]
  node_reqres["Request/response<br/>[mpq_reqres.cpp]"]
  node_mpq_server["File server<br/>[mpq_server.cpp]"]
  node_app_common["App utilities<br/>[app_common.cpp]"]
  node_file_writer["File writer<br/>[file_writer.cpp]"]
  node_sha256["SHA-256<br/>[sha256.cpp]"]
end

subgraph group_endpoints["Connection endpoints"]
  node_socket_manager["Socket event loop<br/>[socket_manager.cpp]"]
  node_udp_socket["UDP sockets<br/>[udp_socket.cpp]"]
  node_client["Client endpoint<br/>[client.cpp]"]
  node_server["Server endpoint<br/>[server.cpp]"]
  node_connection["Connection engine<br/>[connection.cpp]"]
end

subgraph group_protocol["Protocol and streams"]
  node_send_stream["Stream chunking<br/>[send_stream.cpp]"]
  node_receive_stream["Ordered delivery<br/>[receive_stream.cpp]"]
  node_sorter["Reorder buffer"]
  node_packet["Packet codec<br/>[packet.cpp]"]
  node_frame["Frame codec<br/>[frame.cpp]"]
end

subgraph group_transport["Multipath transport"]
  node_path_manager["Path manager<br/>[path_manager.cpp]"]
  node_path["Network path<br/>[path.cpp]"]
  node_scheduler["Path scheduler<br/>[scheduler.cpp]"]
  node_congestion["OLIA control<br/>[olia_sender.cpp]"]
  node_sent_handler["Send recovery"]
  node_received_handler["Receive ACK tracking"]
  node_rtt["RTT statistics<br/>[rtt_stats.cpp]"]
  node_flow["Flow control"]
end

node_user(("User"))

node_user -->|"starts download"| node_mpq_client
node_user -->|"starts measurement"| node_reqres
node_user -->|"starts service"| node_mpq_server
node_mpq_client -->|"uses endpoint"| node_client
node_reqres -->|"uses endpoint"| node_client
node_mpq_server -->|"serves files"| node_server
node_mpq_client -->|"writes download"| node_file_writer
node_mpq_client -->|"verifies data"| node_sha256
node_client -->|"registers sockets"| node_socket_manager
node_server -->|"registers sockets"| node_socket_manager
node_socket_manager -->|"monitors sockets"| node_udp_socket
node_client -->|"owns connection"| node_connection
node_server -->|"creates connections"| node_connection
node_client -->|"manages paths"| node_path_manager
node_server -->|"manages paths"| node_path_manager
node_connection -->|"uses paths"| node_path
node_path_manager -->|"creates paths"| node_path
node_connection -->|"selects paths"| node_scheduler
node_connection -->|"chunks stream data"| node_send_stream
node_connection -->|"delivers stream data"| node_receive_stream
node_connection -->|"enforces windows"| node_flow
node_connection -->|"builds and parses"| node_packet
node_packet -->|"encodes frames"| node_frame
node_receive_stream -->|"orders frames"| node_sorter
node_path -->|"tracks sent packets"| node_sent_handler
node_path -->|"tracks received packets"| node_received_handler
node_path -->|"measures RTT"| node_rtt
node_path -->|"controls window"| node_congestion
node_sent_handler -->|"updates samples"| node_rtt
node_sent_handler -->|"reports loss and ACKs"| node_congestion
node_mpq_server -->|"uses helpers"| node_app_common
node_mpq_client -->|"uses helpers"| node_app_common
node_reqres -->|"uses helpers"| node_app_common

click node_mpq_client "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_client.cpp"
click node_reqres "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_reqres.cpp"
click node_mpq_server "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_server.cpp"
click node_app_common "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/app_common.cpp"
click node_file_writer "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/file_writer.cpp"
click node_sha256 "https://github.com/adinesh-reddy/mp_quic/blob/main/apps/sha256.cpp"
click node_socket_manager "https://github.com/adinesh-reddy/mp_quic/blob/main/src/sockets/socket_manager.cpp"
click node_udp_socket "https://github.com/adinesh-reddy/mp_quic/blob/main/src/sockets/udp_socket.cpp"
click node_client "https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/client.cpp"
click node_server "https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/server.cpp"
click node_connection "https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/connection.cpp"
click node_path_manager "https://github.com/adinesh-reddy/mp_quic/blob/main/src/path/path_manager.cpp"
click node_path "https://github.com/adinesh-reddy/mp_quic/blob/main/src/path/path.cpp"
click node_scheduler "https://github.com/adinesh-reddy/mp_quic/blob/main/src/scheduler/scheduler.cpp"
click node_congestion "https://github.com/adinesh-reddy/mp_quic/blob/main/src/congestion_control/olia_sender.cpp"
click node_sent_handler "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/sent_packet_handler.cpp"
click node_received_handler "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/received_packet_handler.cpp"
click node_rtt "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/rtt_stats.cpp"
click node_flow "https://github.com/adinesh-reddy/mp_quic/blob/main/src/flow_control/flow_controller.cpp"
click node_send_stream "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/send_stream.cpp"
click node_receive_stream "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/receive_stream.cpp"
click node_sorter "https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/stream_frame_sorter.cpp"
click node_packet "https://github.com/adinesh-reddy/mp_quic/blob/main/src/packet/packet.cpp"
click node_frame "https://github.com/adinesh-reddy/mp_quic/blob/main/src/packet/frame.cpp"

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_mpq_client,node_reqres,node_mpq_server,node_app_common,node_file_writer,node_sha256,node_user toneBlue
class node_socket_manager,node_udp_socket,node_client,node_server,node_connection toneAmber
class node_send_stream,node_receive_stream,node_sorter,node_packet,node_frame toneMint
class node_path_manager,node_path,node_scheduler,node_congestion,node_sent_handler,node_received_handler,node_rtt,node_flow toneRose
```

## Components

### Applications

- [File client](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_client.cpp): `apps/mpq_client.cpp`
- [Request/response](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_reqres.cpp): `apps/mpq_reqres.cpp`
- [File server](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/mpq_server.cpp): `apps/mpq_server.cpp`
- [App utilities](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/app_common.cpp): `apps/app_common.cpp`
- [File writer](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/file_writer.cpp): `apps/file_writer.cpp`
- [SHA-256](https://github.com/adinesh-reddy/mp_quic/blob/main/apps/sha256.cpp): `apps/sha256.cpp`

### Connection endpoints

- [Socket event loop](https://github.com/adinesh-reddy/mp_quic/blob/main/src/sockets/socket_manager.cpp): `src/sockets/socket_manager.cpp`
- [UDP sockets](https://github.com/adinesh-reddy/mp_quic/blob/main/src/sockets/udp_socket.cpp): `src/sockets/udp_socket.cpp`
- [Client endpoint](https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/client.cpp): `src/connection/client.cpp`
- [Server endpoint](https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/server.cpp): `src/connection/server.cpp`
- [Connection engine](https://github.com/adinesh-reddy/mp_quic/blob/main/src/connection/connection.cpp): `src/connection/connection.cpp`

### Protocol and streams

- [Stream chunking](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/send_stream.cpp): `src/reliability/send_stream.cpp`
- [Ordered delivery](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/receive_stream.cpp): `src/reliability/receive_stream.cpp`
- [Reorder buffer](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/stream_frame_sorter.cpp): `src/reliability/stream_frame_sorter.cpp`
- [Packet codec](https://github.com/adinesh-reddy/mp_quic/blob/main/src/packet/packet.cpp): `src/packet/packet.cpp`
- [Frame codec](https://github.com/adinesh-reddy/mp_quic/blob/main/src/packet/frame.cpp): `src/packet/frame.cpp`

### Multipath transport

- [Path manager](https://github.com/adinesh-reddy/mp_quic/blob/main/src/path/path_manager.cpp): `src/path/path_manager.cpp`
- [Network path](https://github.com/adinesh-reddy/mp_quic/blob/main/src/path/path.cpp): `src/path/path.cpp`
- [Path scheduler](https://github.com/adinesh-reddy/mp_quic/blob/main/src/scheduler/scheduler.cpp): `src/scheduler/scheduler.cpp`
- [OLIA control](https://github.com/adinesh-reddy/mp_quic/blob/main/src/congestion_control/olia_sender.cpp): `src/congestion_control/olia_sender.cpp`
- [Send recovery](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/sent_packet_handler.cpp): `src/reliability/sent_packet_handler.cpp`
- [Receive ACK tracking](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/received_packet_handler.cpp): `src/reliability/received_packet_handler.cpp`
- [RTT statistics](https://github.com/adinesh-reddy/mp_quic/blob/main/src/reliability/rtt_stats.cpp): `src/reliability/rtt_stats.cpp`
- [Flow control](https://github.com/adinesh-reddy/mp_quic/blob/main/src/flow_control/flow_controller.cpp): `src/flow_control/flow_controller.cpp`

### Other components

- **User**

## Connections

- User → File client: starts download (evidence: `README.md`)
- User → Request/response: starts measurement (evidence: `README.md`)
- User → File server: starts service (evidence: `README.md`)
- File client → Client endpoint: uses endpoint (evidence: `README.md`)
- Request/response → Client endpoint: uses endpoint (evidence: `README.md`)
- File server → Server endpoint: serves files (evidence: `README.md`)
- File client → File writer: writes download (evidence: `apps/mpq_client.cpp`)
- File client → SHA-256: verifies data (evidence: `README.md`)
- Client endpoint → Socket event loop: registers sockets
- Server endpoint → Socket event loop: registers sockets
- Socket event loop → UDP sockets: monitors sockets
- Client endpoint → Connection engine: owns connection
- Server endpoint → Connection engine: creates connections
- Client endpoint → Path manager: manages paths
- Server endpoint → Path manager: manages paths
- Connection engine → Network path: uses paths
- Path manager → Network path: creates paths
- Connection engine → Path scheduler: selects paths
- Connection engine → Stream chunking: chunks stream data
- Connection engine → Ordered delivery: delivers stream data
- Connection engine → Flow control: enforces windows
- Connection engine → Packet codec: builds and parses
- Packet codec → Frame codec: encodes frames
- Ordered delivery → Reorder buffer: orders frames (evidence: `README.md`)
- Network path → Send recovery: tracks sent packets
- Network path → Receive ACK tracking: tracks received packets
- Network path → RTT statistics: measures RTT
- Network path → OLIA control: controls window
- Send recovery → RTT statistics: updates samples
- Send recovery → OLIA control: reports loss and ACKs
- File server → App utilities: uses helpers (evidence: `apps/mpq_server.cpp`)
- File client → App utilities: uses helpers (evidence: `apps/mpq_client.cpp`)
- Request/response → App utilities: uses helpers (evidence: `apps/mpq_reqres.cpp`)
