# sanishpoudel/sdn-gns3-ryu-implementation architecture

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

- Interactive diagram: https://gitdiagram.com/sanishpoudel/sdn-gns3-ryu-implementation
- Repository: https://github.com/sanishpoudel/sdn-gns3-ryu-implementation

## Overview

This repository contains two small Ryu controller apps for an OpenFlow 1.3 testbed. A user launches an app through Ryu; switch connection events trigger either ICMP-drop/normal-forwarding rules or a flow-table reset, which the app sends to the switch. The README also documents the GNS3/OVS ring, management connectivity, and STP loop prevention. The app behavior is visible in the sampled source; topology and STP relationships are based on README documentation.

Main entry points: [`drop.py`](https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/drop.py) (Ping blocker), [`clear.py`](https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/clear.py) (Flow reset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controller["Controller apps"]
  node_ryu["Ryu runtime"]
  node_drop["Ping blocker<br/>[drop.py]"]
  node_clear["Flow reset<br/>[clear.py]"]
end

subgraph group_fabric["Switch fabric"]
  node_ovs["OVS switches"]
  node_flowtable[("Switch flow tables")]
end

subgraph group_lab["Lab topology"]
  node_gns3["GNS3 network"]
  node_stp["STP loop prevention"]
  node_hosts(("Virtual PCs"))
end

node_user(("Operator"))

node_user -->|"launches app"| node_ryu
node_ryu -->|"loads app"| node_drop
node_ryu -->|"loads app"| node_clear
node_ovs -->|"sends connect events"| node_drop
node_ovs -->|"sends connect events"| node_clear
node_drop -->|"sends flow mods"| node_ovs
node_clear -->|"sends delete mod"| node_ovs
node_ovs -->|"stores flows"| node_flowtable
node_gns3 -->|"hosts switches"| node_ovs
node_gns3 -->|"hosts PCs"| node_hosts
node_stp -->|"prevents loops"| node_ovs
node_ryu -->|"connects OpenFlow"| node_ovs

click node_drop "https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/drop.py"
click node_clear "https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/clear.py"

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_ryu,node_drop,node_clear toneBlue
class node_ovs,node_flowtable toneAmber
class node_gns3,node_stp,node_hosts toneMint
class node_user toneIndigo
```

## Components

### Controller apps

- **Ryu runtime**
- [Ping blocker](https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/drop.py): `drop.py`
- [Flow reset](https://github.com/sanishpoudel/sdn-gns3-ryu-implementation/blob/main/clear.py): `clear.py`

### Switch fabric

- **OVS switches**
- **Switch flow tables**

### Lab topology

- **GNS3 network**
- **STP loop prevention**
- **Virtual PCs**

### Other components

- **Operator**

## Connections

- Operator → Ryu runtime: launches app (evidence: `README.md`)
- Ryu runtime → Ping blocker: loads app (evidence: `README.md`)
- Ryu runtime → Flow reset: loads app (evidence: `README.md`)
- OVS switches → Ping blocker: sends connect events (evidence: `drop.py`)
- OVS switches → Flow reset: sends connect events (evidence: `clear.py`)
- Ping blocker → OVS switches: sends flow mods (evidence: `drop.py`)
- Flow reset → OVS switches: sends delete mod (evidence: `clear.py`)
- OVS switches → Switch flow tables: stores flows (evidence: `README.md`)
- GNS3 network → OVS switches: hosts switches (evidence: `README.md`)
- GNS3 network → Virtual PCs: hosts PCs (evidence: `README.md`)
- STP loop prevention → OVS switches: prevents loops (evidence: `README.md`)
- Ryu runtime → OVS switches: connects OpenFlow (evidence: `README.md`)
