OSKen / Ryu controller Open vSwitch (OVS) Snort IDS Containerized honeypots Policy-driven forwarding

Turn suspicious traffic into intelligence—without exposing your real services.

NetDefender combines SDN control and IDS visibility to detect hostile behavior early, then reroutes selected connections into honeypots. The result is a defensive “detour”: production stays protected while you still capture attacker activity for analysis.

Overview

NetDefender is a network defense and traffic redirection platform designed to sit at the intersection of SDN and IDS. Instead of only blocking traffic, it can selectively divert suspicious sessions into container-based honeypots to reduce risk and increase visibility.

At a high level, the SDN controller enforces policy through OVS flow rules, while Snort produces real-time alerts that can trigger re-routing decisions. This makes it useful for both protection and research.

What it includes

CapabilityIn practice
Controller planeBuilt on OSKen/Ryu-style controller logic for programmable policy.
Forwarding enforcementOpen vSwitch applies flow rules and steers traffic.
Threat detectionSnort analyzes traffic and raises alerts in real time.
Honeypot redirectionSuspicious connections are mapped by port and redirected to containers.
Basic orchestrationContainer lifecycle controls allow scaling honeypot instances.

System requirements

Choose one deployment model:

Two-server (Controller + IDS)
Ubuntu 22.04+ on both servers; Python 3.9+ on both.
Single-server (Combined)
Ubuntu 22.04+; Python 3.9+.

Order matters: install and configure the controller host first, then set up the Snort host (two-server mode).

Network architecture

The topology below illustrates how forwarding, detection, and diversion connect: OVS forwards traffic, the controller evaluates policy, and alerts from Snort can result in redirecting selected flows into honeypot containers.

NetDefender network architecture diagram

Honeypot configuration (JSON)

Honeypots are declared via a JSON file. Each container definition includes an image name, a unique identifier, and one or more port mappings. Multi-instance scaling can be enabled when you expect higher traffic.

{
  "containers": [
    {
      "image_name": "cowrie/cowrie",
      "name": "ssh",
      "ports": [
        { "host_port": 22, "container_port": 2222, "protocol": "tcp" }
      ],
      "command": "",
      "multi": "yes",
      "max": 10,
      "max_containers": 10,
      "send_response": "yes"
    },
    {
      "image_name": "dinotools/dionaea",
      "name": "dionaea",
      "ports": [
        {"host_port": 21, "container_port": 21, "protocol": "tcp"},
        {"host_port": 69, "container_port": 69, "protocol": "udp"},
        {"host_port": 80, "container_port": 80, "protocol": "tcp"},
        {"host_port": 443, "container_port": 443, "protocol": "tcp"},
        {"host_port": 445, "container_port": 445, "protocol": "tcp"}
      ],
      "multi": "yes",
      "max": 10,
      "max_containers": 10,
      "send_response": "yes"
    }
  ]
}

The example above is shortened for readability on a landing page. For the full multi-port list, see the repository documentation.

Configuration parameters

Container-level fields

FieldTypeRequiredMeaning
image_nameStringYesDocker image for the honeypot.
nameStringYesUnique logical name for the honeypot.
portsArrayYesPort mappings used for matching and redirection.
commandStringNoOptional Docker args; remove if unused.
multiStringNoEnable multiple instances (yes/no).
maxIntegerNoMax concurrent connections per container.
max_containersIntegerNoMax additional instances (excluding the primary).
send_responseStringNoWhether the honeypot actively responds (yes/no).

Port mapping fields

FieldTypeRequiredMeaning
host_portIntegerYesExternally monitored port.
container_portIntegerYesInternal container port receiving redirected traffic.
protocolStringYestcp or udp.

Honeypot types

Cowrie (SSH/Telnet)

Goal: simulate interactive SSH/Telnet to log brute-force attempts, commands, and dropper behavior.

Image: cowrie/cowrieExternal port: 22 • Internal port: 2222

Dionaea (multi-service)

Goal: expose multiple emulated services to attract common scanning and exploitation attempts across protocols.

Image: dinotools/dionaea

Service examplesPortsNotes
Web80 / 443HTTP and HTTPS traffic capture.
File / legacy21 / 69FTP and TFTP are commonly scanned.
Windows-facing445SMB-related probing and exploits.
DB / messaging1433 / 3306 / 1883MSSQL, MySQL, MQTT are frequent targets.

For the complete port list used by Dionaea in this project, see the repository configuration examples.

Installation

VMware Workstation Pro (Linux Usage)

If you run this in VMware Workstation Pro, promiscuous capture may require elevated permissions:

sudo -s
chmod a+rw /dev/vmnet0

Reference: VMware documentation on promiscuous mode.

Controller host (Ryu/OSKen)

sudo -s
apt install git -y
git clone https://github.com/sinyuan1022/NetDefender.git
cd ./NetDefender/ryu/
bash ./ryu_install.sh

Note: If you plan to install Ryu via SSH, it is recommended to use the second network interface.

A second network interface is optional. If you only have one network interface, after the installation is complete, clear the existing OpenFlow rules with:

ovs-ofctl del-flows br0 -O OpenFlow13

Then restart the Ryu controller and reconnect to Snort.

IDS host (Snort)

sudo -s
apt install git -y
git clone https://github.com/sinyuan1022/NetDefender.git
cd ./NetDefender/snort/
bash ./snort_install.sh

Single-server mode (optional)

sudo -s
apt install git -y
git clone https://github.com/sinyuan1022/NetDefender.git
cd ./NetDefender/
bash ./singel.sh

Manual startup mode for multi-server deployment

Note: INTERFACE = monitor interface name (e.g., ens33)


For a two-server deployment, manually start the services as follows:

Ryu Server:
osken-manager ovs.py

Snort Server:
python3 pigrelay.py

Before running the commands, please navigate to the corresponding directory under ./NetDefender/.

Example:

Ryu Server:
  cd ./NetDefender/ryu
  osken-manager ovs.py

Snort Server:
  cd ./NetDefender/snort
  snort -i $INTERFACE -A unsock -l /tmp -c /etc/snort/snort.conf
  python3 pigrelay.py

For single-server deployment, the startup process is the same as the Ryu Server:
  snort -i $INTERFACE -A unsock -l /tmp -c /etc/snort/snort.conf
  cd ./NetDefender/ryu
  osken-manager ovs.py

How it operates (conceptual flow)

NetDefender’s behavior can be understood as an event loop across enforcement, detection, and action: OVS forwards traffic, Snort flags suspicious patterns, the controller evaluates policy, and the system redirects matching ports into the appropriate honeypot container—optionally scaling instances under load.

StageRole
ForwardOVS handles packet forwarding and applies controller flow rules.
DetectSnort inspects traffic and produces alerts.
DecidePolicy layer maps alerts and ports to actions.
DivertSuspicious sessions are redirected to honeypot containers.
ObserveHoneypots interact and log activity for later analysis.

Use cases

Security research
Study scanning, exploitation patterns, and malware behavior in a controlled environment.
Threat intelligence
Collect telemetry from brute-force, SMB probing, SQL attacks, and IoT-style bot activity.
Proactive defense
Keep production surfaces safer by detouring suspicious sessions while preserving evidence.