Code Monkey home page Code Monkey logo

storm_control's Introduction

Storm Control for Linux

This is a linux kernel module to prevent BUM storm in layer 2 network.
By using this module, you can limit a specific traffic at the interface you specified.

The reason I implemented is there wasn't Storm control function in Linux.

When a packet come in the interface you specified,
this module use netdev_rx_handler to check a packet type and mesure a traffic amount following the setting.
Then, by one minute, this module check whethere tha traffic amount are more than the threshold or not.
If the blocking started, the traffic amount is checked based on the low threshold.

Compile

We tested this module on

  • Ubuntu 18.04, kernel 4.15.0-43-generic
  • Debian9.8.0, kernel 4.9.0.8 (storm_control_debian.c)
$ sudo apt install flex bison # for iproute2

$ git clone https://github.com/shiibaryu/storm_control.git
$ cd storm_control
$ make # compile a object file for ubuntu version as is.

In addition to the kernel module and tools, a modified iproute2 will be compiled.
If some compilation in this iproute2 files may be failed, you don't neet to mind.(it will not affect)

Install

$ cd storm_control
$ sudo make install
$ cd k_mod
$ insmod test.ko

The modified iproute2 contained in this repository can configure the setting using ip command.

$ ./iproute2-4.10.0/ip/ip storm help

		"Usage: ip storm add dev NAME"
		"          type { broadcast | multicast | unknown_unicast }"
		"          { pps | bps | level } threshold low_threshold"
		"       ip storm del dev NAME"
		"       ip storm show\n"
		"
		);
    
$ sudo /sbin/ip storm add dev ens0 type broadcast pps 1000 100

To do next

We should mesure the performance of it's module and put those results together in a report.

storm_control's People

Contributors

shiibaryu 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.