GithubHelp home page GithubHelp logo

test-mass-forker-org-1 / packet-queue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/packet-queue

0.0 0.0 0.0 147 KB

License: Apache License 2.0

JavaScript 45.56% Python 50.85% HTML 3.58%

packet-queue's Introduction

Packet Queue

This is a configurable TCP/UDP packet impairment tool for Linux. It looks like this:

Screenshot

Setup

Install the dependencies, including the Linux nfqueue library:

sudo apt-get install libnetfilter-queue-dev
sudo python setup.py develop

To get realistic network simulation on the loopback device, you probably want to set the MTU to something small:

ip link show dev lo  # show current MTU
sudo ip link set dev lo mtu 2048

Running

For example, to impair TCP traffic on loopback port 3000:

sudo scripts/impaired_network_server -p 3000

It can also run as a UDP proxy, without root, if you specify a proxy port:

scripts/impaired_network_server -l user -t udp -p 3000 -x 3001

To see all of the options:

scripts/impaired_network_server --help

Packet Queue will clean up its iptables rules on shutdown. If it ever doesn't shut down gracefully, you can clear the rules like this:

sudo scripts/impaired_network_clear_iptables

Tests

You can run most of the tests like this:

python -m unittest discover tests  # run all tests in the tests/ directory

Some of the end-to-end tests will be skipped with the above command because they require root:

sudo python tests/test_e2e.py

packet-queue's People

Contributors

brian-goldman avatar minkezhang 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.