Git Product home page Git Product logo

steinloss's Introduction

time tracker Lint and test PyPI version PyPI - Downloads

Steinloss:

This is a tool for measuring packages loss, between two endpoint, with a web visualizer.

Usage

On the server end, run:

  • pip install steinloss
  • python -m steinloss --server

On the probe end, run:

  • pip install steinloss
  • python -m steinloss --probe --ip-address $IP_OF_SERVER

The server end will host a gui on port 8050, where the stats are visible. It looks like this: gui

Build and release

To make a new release, go to github release, and draft a new release. A github action will take care of building, and publishing the tar and binary to pypi.

Demo with artificial packet loss

The demo is made for linux
First we install steinloss
pip3 install steinloss

To run a demo of the tool, we're setting up a virtual network on your machine using ip nets. We're making a network n1 and n2 by running

sudo sh demo.sh

Now we would like to run the server on n1 and the probe on n2 This is done with the following commands in two different terminals:

sudo ip netns exec ns1 bash -c "sudo -u $USER python3 -m steinloss -s"
sudo ip netns exec ns2 bash -c "sudo -u $USER python3 -m steinloss -p -i 10.0.0.1"

For example:

To access the browser, we to run a browser in our virtual network like so

sudo ip netns exec ns1 bash -c "sudo -u $USER $BROWSER 127.0.0.1:8050"

Like so:

Now we can modify the packet loss by using the replace command. To set the packet loss to 20%, we run the following command, while everything is running:

sudo ip netns exec ns1 tc qdisc replace dev h1 root netem loss 20%

Cleanup

The virtual networks can be removed again with:

sudo ip netns delete ns1 && sudo ip netns delete ns2

And uninstall steinloss:

pip3 uninstall steinloss

steinloss's People

Contributors

andersspringborg avatar loglund avatar steinwurfbuildbot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

road2018

steinloss's Issues

Deprecated subplots plotly

The graph produces in the dashboard, uses plotly. The api from plotly used is plotly.tools.make_subplots, which is deprecated. It shouhl be changed to plotly.subplots.make_subplots, or refactored completely.

Integrating dummynet package

Now the two namespaces for running the system is created with Linux command, A cleaner solution to this is to create them with dummynet

Introduce more graphs

There's only a loss graph on the dashboard. There's missing information about: latency sent packages received packages, and speed. This information should all be represented in some way

Long installer time client

For installing the package from pipy, on a probe/client, there's a long installation time. To mitigate this, maybe it would be beneficial to move the probe/client to a separate pipy package, as it only uses built-it python libraries.

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.