Git Product home page Git Product logo

p4-ddos-ml-detection's Introduction

P4-DDoS-ML-Detection

DDoS detection using Machine Learning and P4 language

Scapy

To install proper scapy which handles sniffing on multiple interfaces not just one we would need to install it from github repo because version 2.4.5 installed in pip by command

pip install scapy==2.4.5

should support sniffing on multiple interfaces but eventually it doesn't. It was fixed in reported issue - sniff fails when the iface parameter is a list To install newest version from github repo

pip uninstall scapy
pip install git+https://github.com/secdev/scapy.git

Config

When installing telegraf remember to create copy of original default configuration

mv /etc/telegraf/telegraf.conf{,.old}

when copy is created we can preform hard link creation for configuration. I don't know why but soft didn't work out.

ln config/telegraf.conf /etc/telegraf/telegraf.conf

changing config files we have to perform

sudo systemctl restart influxdb
sudo systemctl restart telegraf

Check if telegraf and influxdb correctly standing by

sudo systemctl status influxdb
sudo systemctl status telegraf

Workflow

Part 1 - Setup

In terminal no.1 from repo directory

make run

after setup quick check if everything works fine

pingall
h3 ping h1
h2 ping h1

In terminal no.2

sudo python3 utils/receiver.py s1

In terminal no.3

sudo telegraf --debug

In terminal no.4

sudo influx -username telegraf -password telegraf
use ddos_entropy

Part 2 - collecting and training

In topology_app.json field tasks_file can be changed between scenario with normal traffic generation and malicious traffic generation. Firstly setup network with

make run

In terminal no.2 activate sniffing script. On terminal no.4 check if metrics are showing up in database

select from * ddos_e

To see normal format of time in influxdb CLI use

precision rfc3339

After traffic was generated

sudo python3 utils/tag_data.py 0

0 or 1 depends on type of generated traffic. Next we can start the controller

sudo python3 utils/controller.py entropy

p4-ddos-ml-detection's People

Contributors

macw97 avatar

Stargazers

Camellia avatar Sweet_icey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.