# veesix-networks/osvbng architecture

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

- Interactive diagram: https://gitdiagram.com/veesix-networks/osvbng
- Repository: https://github.com/veesix-networks/osvbng

## Overview

osvbng is a virtual broadband network gateway. Its principal workflow is subscriber access over IPoE/DHCP, PPPoE, or L2TP, with session provisioning, routing, and services such as QoS and CGNAT; operators configure and inspect it through the CLI/API. The graph reflects README capabilities and the sampled daemon, API, routing, HA, and VRF code. Many runtime internals are unsampled, so their detailed call paths are omitted.

Main entry points: [`cmd/osvbngd/main.go`](https://github.com/veesix-networks/osvbng/blob/main/cmd/osvbngd/main.go) (Gateway Daemon), [`plugins/northbound/api/handlers.go`](https://github.com/veesix-networks/osvbng/blob/main/plugins/northbound/api/handlers.go) (Northbound API), [`pkg/allocator/context.go`](https://github.com/veesix-networks/osvbng/blob/main/pkg/allocator/context.go) (Address Allocator), [`pkg/ha/manager.go`](https://github.com/veesix-networks/osvbng/blob/main/pkg/ha/manager.go) (High Availability)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Gateway Runtime"]
  node_access["Subscriber Access<br/>[session.go]"]
  node_pppoe["PPPoE Sessions<br/>[session.go]"]
  node_l2tp["L2TP Sessions<br/>[session.go]"]
  node_daemon["Gateway Daemon<br/>[main.go]"]
  node_orchestrator["Component Orchestrator<br/>[orchestrator.go]"]
  node_dataplane["Dataplane<br/>[component.go]"]
end

subgraph group_network["Network Services"]
  node_routing["Routing Services<br/>[component.go]"]
  node_vrf["VRF Manager<br/>[manager.go]"]
  node_evpn["EVPN Manager<br/>[manager.go]"]
  node_southbound["VPP Southbound<br/>[routing.go]"]
  node_cgnat["CGNAT<br/>[component.go]"]
  node_l2gw["L2 Wholesale Gateway<br/>[component.go]"]
  node_qos["Hierarchical QoS"]
end

subgraph group_control["Management Plane"]
  node_cli["osvbngcli<br/>[main.go]"]
  node_api["Northbound API<br/>[handlers.go]"]
  node_config["Configuration Management<br/>[conf.go]"]
  node_show["Operational Show<br/>[handler.go]"]
end

subgraph group_state["State and HA"]
  node_ha["High Availability<br/>[manager.go]"]
  node_allocator["Address Allocator<br/>[context.go]"]
  node_dhcp["DHCP Relay<br/>[client.go]"]
end

node_operator(("Operator"))

node_daemon -->|"starts components"| node_orchestrator
node_daemon -.->|"registers runtime"| node_access
node_daemon -.->|"registers runtime"| node_pppoe
node_daemon -.->|"registers runtime"| node_routing
node_operator -->|"runs commands"| node_cli
node_cli -.->|"sends requests"| node_api
node_api -->|"executes show"| node_show
node_api -->|"reads configuration"| node_config
node_show -->|"queries routes"| node_routing
node_ha -->|"sets SRG state"| node_dataplane
node_ha -->|"sets direction"| node_allocator
node_vrf -->|"creates IP tables"| node_southbound
node_access -.->|"allocates addresses"| node_allocator
node_pppoe -.->|"allocates addresses"| node_allocator
node_daemon -->|"configures sessions"| node_l2tp

click node_access "https://github.com/veesix-networks/osvbng/blob/main/internal/ipoe/session.go"
click node_pppoe "https://github.com/veesix-networks/osvbng/blob/main/internal/pppoe/session.go"
click node_l2tp "https://github.com/veesix-networks/osvbng/blob/main/internal/l2tp/session.go"
click node_daemon "https://github.com/veesix-networks/osvbng/blob/main/cmd/osvbngd/main.go"
click node_orchestrator "https://github.com/veesix-networks/osvbng/blob/main/pkg/component/orchestrator.go"
click node_dataplane "https://github.com/veesix-networks/osvbng/blob/main/internal/dataplane/component.go"
click node_routing "https://github.com/veesix-networks/osvbng/blob/main/internal/routing/component.go"
click node_vrf "https://github.com/veesix-networks/osvbng/blob/main/pkg/vrfmgr/manager.go"
click node_evpn "https://github.com/veesix-networks/osvbng/blob/main/pkg/evpnmgr/manager.go"
click node_southbound "https://github.com/veesix-networks/osvbng/blob/main/pkg/southbound/vpp/routing.go"
click node_cgnat "https://github.com/veesix-networks/osvbng/blob/main/internal/cgnat/component.go"
click node_l2gw "https://github.com/veesix-networks/osvbng/blob/main/internal/l2gw/component.go"
click node_qos "https://github.com/veesix-networks/osvbng/tree/main/pkg/handlers/show/qos"
click node_cli "https://github.com/veesix-networks/osvbng/blob/main/cmd/osvbngcli/main.go"
click node_api "https://github.com/veesix-networks/osvbng/blob/main/plugins/northbound/api/handlers.go"
click node_config "https://github.com/veesix-networks/osvbng/blob/main/pkg/configmgr/conf.go"
click node_show "https://github.com/veesix-networks/osvbng/blob/main/pkg/handlers/show/handler.go"
click node_ha "https://github.com/veesix-networks/osvbng/blob/main/pkg/ha/manager.go"
click node_allocator "https://github.com/veesix-networks/osvbng/blob/main/pkg/allocator/context.go"
click node_dhcp "https://github.com/veesix-networks/osvbng/blob/main/pkg/dhcp/relay/client.go"

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_access,node_pppoe,node_l2tp,node_daemon,node_orchestrator,node_dataplane toneBlue
class node_routing,node_vrf,node_evpn,node_southbound,node_cgnat,node_l2gw,node_qos toneAmber
class node_cli,node_api,node_config,node_show toneMint
class node_ha,node_allocator,node_dhcp toneRose
class node_operator toneIndigo
```

## Components

### Gateway Runtime

- [Subscriber Access](https://github.com/veesix-networks/osvbng/blob/main/internal/ipoe/session.go): `internal/ipoe/session.go`
- [PPPoE Sessions](https://github.com/veesix-networks/osvbng/blob/main/internal/pppoe/session.go): `internal/pppoe/session.go`
- [L2TP Sessions](https://github.com/veesix-networks/osvbng/blob/main/internal/l2tp/session.go): `internal/l2tp/session.go`
- [Gateway Daemon](https://github.com/veesix-networks/osvbng/blob/main/cmd/osvbngd/main.go): `cmd/osvbngd/main.go`
- [Component Orchestrator](https://github.com/veesix-networks/osvbng/blob/main/pkg/component/orchestrator.go): `pkg/component/orchestrator.go`
- [Dataplane](https://github.com/veesix-networks/osvbng/blob/main/internal/dataplane/component.go): `internal/dataplane/component.go`

### Network Services

- [Routing Services](https://github.com/veesix-networks/osvbng/blob/main/internal/routing/component.go): `internal/routing/component.go`
- [VRF Manager](https://github.com/veesix-networks/osvbng/blob/main/pkg/vrfmgr/manager.go): `pkg/vrfmgr/manager.go`
- [EVPN Manager](https://github.com/veesix-networks/osvbng/blob/main/pkg/evpnmgr/manager.go): `pkg/evpnmgr/manager.go`
- [VPP Southbound](https://github.com/veesix-networks/osvbng/blob/main/pkg/southbound/vpp/routing.go): `pkg/southbound/vpp/routing.go`
- [CGNAT](https://github.com/veesix-networks/osvbng/blob/main/internal/cgnat/component.go): `internal/cgnat/component.go`
- [L2 Wholesale Gateway](https://github.com/veesix-networks/osvbng/blob/main/internal/l2gw/component.go): `internal/l2gw/component.go`
- [Hierarchical QoS](https://github.com/veesix-networks/osvbng/tree/main/pkg/handlers/show/qos): `pkg/handlers/show/qos`

### Management Plane

- [osvbngcli](https://github.com/veesix-networks/osvbng/blob/main/cmd/osvbngcli/main.go): `cmd/osvbngcli/main.go`
- [Northbound API](https://github.com/veesix-networks/osvbng/blob/main/plugins/northbound/api/handlers.go): `plugins/northbound/api/handlers.go`
- [Configuration Management](https://github.com/veesix-networks/osvbng/blob/main/pkg/configmgr/conf.go): `pkg/configmgr/conf.go`
- [Operational Show](https://github.com/veesix-networks/osvbng/blob/main/pkg/handlers/show/handler.go): `pkg/handlers/show/handler.go`

### State and HA

- [High Availability](https://github.com/veesix-networks/osvbng/blob/main/pkg/ha/manager.go): `pkg/ha/manager.go`
- [Address Allocator](https://github.com/veesix-networks/osvbng/blob/main/pkg/allocator/context.go): `pkg/allocator/context.go`
- [DHCP Relay](https://github.com/veesix-networks/osvbng/blob/main/pkg/dhcp/relay/client.go): `pkg/dhcp/relay/client.go`

### Other components

- **Operator**

## Connections

- Gateway Daemon → Component Orchestrator: starts components (evidence: `cmd/osvbngd/main.go`)
- Gateway Daemon → Subscriber Access: registers runtime
- Gateway Daemon → PPPoE Sessions: registers runtime
- Gateway Daemon → Routing Services: registers runtime
- Operator → osvbngcli: runs commands
- osvbngcli → Northbound API: sends requests
- Northbound API → Operational Show: executes show (evidence: `plugins/northbound/api/handlers.go`)
- Northbound API → Configuration Management: reads configuration (evidence: `plugins/northbound/api/handlers.go`)
- Operational Show → Routing Services: queries routes
- High Availability → Dataplane: sets SRG state (evidence: `pkg/ha/manager.go`)
- High Availability → Address Allocator: sets direction (evidence: `pkg/ha/manager.go`)
- VRF Manager → VPP Southbound: creates IP tables (evidence: `pkg/vrfmgr/manager.go`)
- Subscriber Access → Address Allocator: allocates addresses
- PPPoE Sessions → Address Allocator: allocates addresses
- Gateway Daemon → L2TP Sessions: configures sessions (evidence: `cmd/osvbngd/main.go`)
