# jaevibing/npf architecture

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

- Interactive diagram: https://gitdiagram.com/jaevibing/npf
- Repository: https://github.com/jaevibing/npf

## Overview

npf is a Windows Forms network traffic stress-testing tool. The documented workflow is to enter a target, optional message, protocol, and interval, then start sending; the source also contains an HTTP mode. Startup shows a disclaimer and opens the main form. The form checks connectivity before starting its timer, which dispatches to protocol-specific code. The HTTP path starts repeated client connections until stopped. Source excerpts show these flows, but do not establish the behavior of the designer-defined controls or the separate npfhttp project; http.cs is an empty class.

Main entry points: [`Form1.cs`](https://github.com/jaevibing/npf/blob/master/Form1.cs) (Timer Dispatch), [`Program.cs`](https://github.com/jaevibing/npf/blob/master/Program.cs) (Application Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and UI"]
  node_program["Application Startup<br/>[Program.cs]"]
  node_main_form["Main Form<br/>[Form1.cs]"]
end

subgraph group_control["Send Control"]
  node_connectivity["Connectivity Check<br/>[Form1.cs]"]
  node_timer_dispatch["Timer Dispatch<br/>[Form1.cs]"]
end

subgraph group_transport["Protocol Sending"]
  node_udp_sender["UDP Sender<br/>[Form1.cs]"]
  node_tcp_sender["TCP Sender<br/>[Form1.cs]"]
  node_http_sender["HTTP Sender<br/>[Form1.cs]"]
  node_http_placeholder["HTTP Placeholder<br/>[http.cs]"]
end

node_user(("User"))
node_target(("Network Target"))

node_user -->|"configures and starts"| node_main_form
node_program -->|"opens"| node_main_form
node_main_form -->|"checks connection"| node_connectivity
node_main_form -->|"starts timer"| node_timer_dispatch
node_timer_dispatch -->|"dispatches UDP"| node_udp_sender
node_timer_dispatch -->|"dispatches TCP"| node_tcp_sender
node_timer_dispatch -->|"dispatches HTTP"| node_http_sender
node_udp_sender -->|"sends datagram"| node_target
node_tcp_sender -->|"connects and writes"| node_target
node_http_sender -->|"opens connections"| node_target

click node_program "https://github.com/jaevibing/npf/blob/master/Program.cs"
click node_main_form "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_connectivity "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_timer_dispatch "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_udp_sender "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_tcp_sender "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_http_sender "https://github.com/jaevibing/npf/blob/master/Form1.cs"
click node_http_placeholder "https://github.com/jaevibing/npf/blob/master/http.cs"

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_program,node_main_form,node_user toneBlue
class node_connectivity,node_timer_dispatch toneAmber
class node_udp_sender,node_tcp_sender,node_http_sender,node_http_placeholder toneMint
class node_target toneIndigo
```

## Components

### Startup and UI

- [Application Startup](https://github.com/jaevibing/npf/blob/master/Program.cs): `Program.cs`
- [Main Form](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`

### Send Control

- [Connectivity Check](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`
- [Timer Dispatch](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`

### Protocol Sending

- [UDP Sender](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`
- [TCP Sender](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`
- [HTTP Sender](https://github.com/jaevibing/npf/blob/master/Form1.cs): `Form1.cs`
- [HTTP Placeholder](https://github.com/jaevibing/npf/blob/master/http.cs): `http.cs`

### Other components

- **User**
- **Network Target**

## Connections

- User → Main Form: configures and starts (evidence: `README.md`)
- Application Startup → Main Form: opens (evidence: `Program.cs`)
- Main Form → Connectivity Check: checks connection (evidence: `Form1.cs`)
- Main Form → Timer Dispatch: starts timer (evidence: `Form1.cs`)
- Timer Dispatch → UDP Sender: dispatches UDP (evidence: `Form1.cs`)
- Timer Dispatch → TCP Sender: dispatches TCP (evidence: `Form1.cs`)
- Timer Dispatch → HTTP Sender: dispatches HTTP (evidence: `Form1.cs`)
- UDP Sender → Network Target: sends datagram (evidence: `Form1.cs`)
- TCP Sender → Network Target: connects and writes (evidence: `Form1.cs`)
- HTTP Sender → Network Target: opens connections (evidence: `Form1.cs`)
