# shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering architecture

> Architecture diagram of the GitHub repository shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering
- Repository: https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering

## Overview

This is a small Ryu OpenFlow 1.3 controller application for selective packet dropping. On switch connection it installs a table-miss rule that sends unknown packets to the controller. For each packet-in, it drops IPv4 traffic from h1 to h2 by installing a higher-priority rule; other traffic follows MAC-learning forwarding, with unknown destinations flooded. The README describes a Mininet topology and ping/iperf and Wireshark observations, but the repository contains only the controller source, so those tools and network elements are represented as external. The graph reflects documented interactions; no topology or measurement implementation is present in the tree.

Main entry points: [`drop_controller.py`](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py) (Flow installation)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_mininet["Mininet network"]
node_hosts(("Hosts h1–h3"))
node_switch["OpenFlow switch"]
node_ryu["Ryu runtime"]
node_controller["Drop controller<br/>[drop_controller.py]"]
node_switch_setup["Switch setup handler<br/>[drop_controller.py]"]
node_packet_handler["Packet-in handler<br/>[drop_controller.py]"]
node_drop_rule["Selective drop rule<br/>[drop_controller.py]"]
node_learning_forward["Learning forward<br/>[drop_controller.py]"]
node_flow_install["Flow installation<br/>[drop_controller.py]"]
node_probe_tools["Ping and iperf"]
node_capture["Wireshark capture"]

node_mininet -->|"hosts topology"| node_hosts
node_hosts -->|"send traffic"| node_switch
node_switch -->|"OpenFlow events"| node_ryu
node_ryu -->|"dispatches events"| node_controller
node_switch_setup -->|"installs miss rule"| node_flow_install
node_packet_handler -->|"checks IP pair"| node_drop_rule
node_packet_handler -->|"otherwise forwards"| node_learning_forward
node_drop_rule -->|"installs drop"| node_flow_install
node_learning_forward -->|"installs forwarding"| node_flow_install
node_flow_install -->|"sends FlowMod"| node_switch
node_learning_forward -->|"sends PacketOut"| node_switch
node_probe_tools -->|"probes flows"| node_hosts
node_switch -.->|"traffic observed"| node_capture

click node_controller "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py"
click node_switch_setup "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py"
click node_packet_handler "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py"
click node_drop_rule "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py"
click node_learning_forward "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py"
click node_flow_install "https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.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_mininet,node_hosts,node_switch,node_ryu,node_probe_tools,node_capture toneIndigo
class node_controller,node_drop_rule,node_learning_forward,node_flow_install toneTeal
class node_switch_setup,node_packet_handler toneMint
```

## Components

### Other components

- **Mininet network**
- **Hosts h1–h3**
- **OpenFlow switch**
- **Ryu runtime**
- [Drop controller](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- [Switch setup handler](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- [Packet-in handler](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- [Selective drop rule](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- [Learning forward](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- [Flow installation](https://github.com/shreelakshmigbhat/flowguard-sdn-based-selective-packet-filtering/blob/main/drop_controller.py): `drop_controller.py`
- **Ping and iperf**
- **Wireshark capture**

## Connections

- Mininet network → Hosts h1–h3: hosts topology
- Hosts h1–h3 → OpenFlow switch: send traffic
- OpenFlow switch → Ryu runtime: OpenFlow events
- Ryu runtime → Drop controller: dispatches events
- Switch setup handler → Flow installation: installs miss rule
- Packet-in handler → Selective drop rule: checks IP pair
- Packet-in handler → Learning forward: otherwise forwards
- Selective drop rule → Flow installation: installs drop
- Learning forward → Flow installation: installs forwarding
- Flow installation → OpenFlow switch: sends FlowMod
- Learning forward → OpenFlow switch: sends PacketOut
- Ping and iperf → Hosts h1–h3: probes flows
- OpenFlow switch → Wireshark capture: traffic observed
