Giter VIP home page Giter VIP logo

networkthrottler's Introduction

NetworkThrottler

##Network Throttler

NetworkThrottler NodeJS application implements network traffic shaper/throttler functionality that allows to test applications' behavior in various network conditions.

NetworkThrottler provides web UI frontend to manage network conditions (also contains list of pre-configured network conditions profiles).

NetworkThrottler uses tc/netem on Linux and ipfw on MacOS.

##Contents Sources contents:

  • ./conf - folder contains configuration file
  • ./scripts - folder contains bash scripts to configure app as service (networkThrottler) and config for logrotate (forever)
  • ./throttler - core implementation for network shaper/throttler
  • ./web - frontend core implementation
  • ./app.js - main app

##Raspberry Pi

To run throttler on Raspberry Pi you need to have following:

  • Raspberry Pi board with installed OS. Application functionality were tested on Rasbian but should work out of the box on the most of Linux distributions.
  • WiFi adapter attached to board. As of now application supports traffic throttling only on WiFi adapter that will be changed soon to allow throttling on any network interface.
  • Connect to Raspberry Pi:
    • via ssh (if you know its IP).
    • via serial cable. You may need to check this to find out correct wire colors in serial cable. Its possible that you need to use this command: screen /dev/cu.usbserial 115200)
  • Configured WiFi access point. Follow guide here or here. NOTE: new version of hostapd can be found here. You may experience the issue with update-rc.d to solve it follow this suggestion. Also, to solve issue with WiFi authentication (device can't be authenticated with RPI WiFi access point and following log message ...IEEE 803.11: deauthenticated due to local deauth request will be found in /var/log/messages) you need to install haveged.

##Pre-installed software requirements

  • The latest stable version of NodeJS. Follow guide here or here.

  • Installed NodeJs forever and nodemon modules in case you want to have auto-update and running application continuously. To install do:

      $ sudo npm install forever -g
      $ sudo npm install nodemon -g
    

##Running

Install Node.js packages required by application - go inside the source's root directory and run:

$ node install 

To start Network Throtler just go inside the source's root directory and run:

$ node app.js

To configure Network Throttler as service/daemon use ./scripts/networkThrottler example script. For Debian (or Linux that supports init.d) put it inside init.d directory and run there:

$ sudo update-rc.d networkThrottler defaults 

To start throttler service application run:

$ /etc/init.d/networkThrottler start

To stop throttler service application run:

$ /etc/init.d/networkThrottler stop

##Logging

Network Throttler will log everything to ./logs/node.log file.

To rotate log files logrotate were used and configured with ./scripts/forever example config file (need to be placed in /etc/logrotate.d/). Install logrotate in case your OS doesn't have it.

##LICENSE

Copyright 2015 Twilio.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

networkthrottler's People

Contributors

hongpong avatar mastinno 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.