Sign inSign up

rootmos/syrup

By rootmos

•Updated almost 11 years ago

Syrup is a utility for simulating degraded network conditions such as latency and flaky connections.

Image
0

3.7K

rootmos/syrup repository overview

⁠Syrup

Build Status

Syrup is a utility for simulating degraded network conditions such as latency and flaky connections. Basically, it's just a glorified port-forwarder with some extra logic to put throw a monkey wrench into the connection.

Syrup is build using Erlang⁠ with Ranch⁠ and Cowboy⁠. It's distributed using Docker⁠, the image can be found here⁠.

⁠Installation

There's two ways to install Syrup:

⁠Installation with Docker

The syrup⁠ script can automagically pull the image⁠ for you, so all you need to do is:

$ wget https://raw.githubusercontent.com/rootmos/syrup/master/syrup
$ chmod +x syrup

⁠Manual installation

The manual building requires:

If these prerequisites are met, then the building should be as easy as:

$ git pull https://github.com/rootmos/syrup
$ cd syrup
$ make

The syrup directory should contain a built distribution in the rel/syrup directory, which will be detected by the syrup script (located in the repository root).

⁠Usage

Syrup is controlled by using the syrup⁠ script. Note that you might need to run it as ./syrup (unless you put in it your PATH) and it might also require sudo (if you want to use Docker).

$ syrup start

$ syrup ping
pong

$syrup stop

To add a port-forwarding from localhost:6001 to localhost:5001, call:

$ syrup add -f 6001 -t 5001

If you want to forward to another address use the -h option:

$ syrup add -f 6001 -h 192.168.0.7 -t 5001

If you want to add some latency to the connection use the -l option:

$ syrup add -f 6001 -t 5001 -l 200

To remove a port-forwarding:

$ syrup rm 6001

⁠Example

Here's an example session using iperf⁠:

In one shell start iperf's server:

$ iperf -s -p 5001
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------

Then in another shell run the client:

$ syrup start

$ syrup add -f 6001 -t 5001

$ iperf -c localhost -p 6001
------------------------------------------------------------
Client connecting to localhost, TCP port 6001
TCP window size: 2.50 MByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 57840 connected with 127.0.0.1 port 6001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  25.7 GBytes  22.1 Gbits/sec

$ syrup stop

Tag summary

Content type

Image

Digest

sha256:50d1e3687…

Size

403 MB

Last updated

almost 11 years ago

docker pull rootmos/syrup