Giter VIP home page Giter VIP logo

slow-acks's Introduction

Slow ACKs

Delay outgoing packets / ACKs to artificially slow down your internet speed (IPv4 only).

This software exploits the mechanism of congestion control in web servers, which reduces the data flow when ACK packets from the client arrive slowly.

+--------------+       +------+       +-------------------+       +--------+
|    Client    | ----> | PC + | ----> |      Gateway      | ----> |  Web-  |
| 172.28.12.34 |  ACK  | slow |  ACK  | cc:ce:ab:cd:ef:ff | <---- | Server |
+--------------+       +------+       +-------------------+       +--------+
        ^                                       |
        |           Packet from Server          |
        +---------------------------------------+

Disclaimer

This program is still a work in progress!

Undefined behavior such as race conditions or other fatal errors can occur, including those that can destroy important data or compromise the security of your system. Therefore, I recommend using this software in a test environment under constant observation only.

Features may be deleted or changed in functionality without further notice. It may be that the documentation below is not updated in time and therefore may not document the real behavior of the program.

Please let me know or open a Pull Request with a suitable correction if you found any bugs in this project. Any help is appreciated. :)

Use this software at your own risk!

Build

make all cap (requires gcc and setcap)

Usage

This software receives IPv4 packets from a given IP address (the client you want to throttle) and, after delaying it by the set delay, forwards them to a gateway MAC address (most likely your router).

When the packet buffer is full, the newest packets are silently discarded without notification to the client.

./slow --ifnam=<interface name> --ip=<forward ip> --mac=<gateway mac> --bbuf=<packet buffer size> --delay=<delay in ms>

Use a command like ip link to get the name of the network interface you want to monitor (e.g. eno1, wlp0s20f3). The command ip neigh will show you the MAC address of your router.

Experimental features:

Send SIGUSR1 to reset the delay to 0 ms. Send SIGUSR2 to increase the forwarding delay by 5 ms.

Don't forget to statically configure the client you want to throttle, i.e. set your computer's IPv4 address as the gateway IP.

Example

$ ./slow --ifnam=eno1 --ip=172.28.12.34 --mac=cc:ce:ab:cd:ef:ff --bbuf=1024 --delay=100
Interface Name: eno1
Gateway MAC: cc:ce:ab:cd:ef:ff
Forwarding IP: 172.28.12.34
Forwarding Delay: 100 ms
Packet Buffer Size: 1024 Packets/Frames

Debug Packet Count: 0
Eth Frame Size (bytes): 74
IPv4 Packet Size (bytes): 60
Source Address: 172.28.12.34
Destination Address: 12.34.56.78
Protocol: 0x06 (TCP)
Identification: 53735
Src MAC: ab:cd:ef:ab:cd:ef
Dst MAC: aa:bb:cc:dd:ee:ff

...

^C[slow] Interrupted
[slow] Sockets closed

slow-acks's People

Contributors

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