Skip to content

A fork for the flowsim code of the MAMI trafic generator

Notifications You must be signed in to change notification settings

paaguti/flowsim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flowsim

A flexible IP traffic generator, originally developed in the scope of https://github.com/mami-project/trafic and heavily modified as a pet project afterwards

Dependencies

A UNIX or UNIX-like OS

Go

flowsim depends on golang-1.13. Follow instructions at https://golang.org/doc/install. We use the modules feature to be able to fix the release of the quic-go fork we want to use.

  • Note: installing an official binary distribution is recommended

quic-go

flowsim depends on https://github.com/paaguti/quic-go (v0.7.7), a specfically tuned fork of the spinvec branch of https://github.com/ferrieux/quic-go, which, in turn is a fork of https://github.com/lucas-clemente/quic-go. We need this specific version, because it implements the spinbit.

Build and install

Clone this repository under $HOME/go/src/github.com/paaguti:

git clone https://github.com/paaguti/flowsim
cd flowsim/
go test
# Ignore the message:
# ?   	github.com/paaguti/flowsim	[no test files]
# The important thing is that all dependencies are installed
#
go build .
go install .

You will need certificates. You can generate self-signed certificates for test purporses using:

./mk_cert.sh

You should use properly generated certificates to run HTTPS tests between two hosts.

flowsim

iperf3 is a good traffic generator, but it has its limitations. While developing trafic, an issue regarding setting the total bytes transferred on a TCP stream was discovered. In order to accurately simulate web-short and ABR video streams, flowsin was developed. It follows the philosophy of iperf3 (server and client mode in one application).

flowsim and trafic

I have started this independent github after the project supporting the initial development of trafic (and flowsim) finished. I intend to contribute back to the original trafic github while that is active.

flowsim modes

flowsim can be started as a HTTP, HTTPS, raw TCP or raw QUIC server or client, or as a UDP source or sink. It supports IPv4 and IPv6 addressing and sets the DSCP field in the IP header of the packets it generates. By default, the server and sink modes use the IPv4 loopback address (127.0.0.1) by default. Interface addresses have to be set explicitly.

flowsim as a server

Once started as a server, flowsim will basically sit there and wait for the client to request bunches of data over a raw TCP, raw QUIC, HTTP or HTTPS connection.

Usage:
  flowsim server [flags]

Flags:
  -T, --TOS string   Value of the DSCP field in the IP layer (number or DSCP id) (default "CS0")
  -h, --help         help for server
  -H, --http         Use HTTP (default is TCP)
  -S, --https        Use HTTPS (default is TCP)
  -I, --ip string    IP address or host name bound to the flowsim server (default "localhost")
  -6, --ipv6         Use IPv6 (default is IPv4)
  -1, --one-off      Just accept one connection and quit (default is run until killed)
  -p, --port int     TCP port bound to the flowsim server (default 8081)
  -Q, --quic         Use QUIC (default is TCP)

Note in the normal mode, flowsim will be executed until killed with a SIGINT signal (i.e. Control-C from the keyboard). The --one-off option will make flowsim quit after one experiment has been served.

The size of the PDU served and the moment where a connection is closed are determined by the client.

flowsim as a TCP or QUIC client

When flowsim is started as a client, fixed size segments will be requested from the server over a raw TCP, raw QUIC, HTTP or HTTPS connections. In raw mode, all segments will be served over the same connection, which is closed afterwards. In HTTP or HTTPS mode, a string with random characters will be requested and each request goes over its own connection.

Usage:
  flowsim client [flags]

Flags:
  -T, --TOS string     Value of the DSCP field in the IP packets (valid int or DSCP-Id) (default "CS0")
  -N, --burst string   Size of each burst (as x(.xxx)?[kmgtKMGT]?) (default "1M")
  -h, --help           help for client
  -H, --http           Use HTTP (default is TCP)
  -S, --https          Use HTTPS (default is TCP)
  -t, --interval int   Interval in secs between bursts (default 10)
  -I, --ip string      IP address or host name of the flowsim server to talk to (default "127.0.0.1")
  -n, --iter int       Number of bursts (default 6)
  -p, --port int       TCP port of the flowsim server (default 8081)
  -Q, --quic           Use QUIC (default is TCP)

flowsim as a UDP source

flowsim can also be used to produce raw UDP connections. Then, you will need a source and a sink.

In UDP source mode, following options are available:

Usage:
  flowsim source [flags]

Flags:  -T, --TOS string      Value of the DSCP field in the IP packets (valid int or DSCP-Id) (default "CS0")
  -h, --help            help for source
  -I, --ip string       IP address or host name of the flowsim UDP sink to talk to (default "127.0.0.1")
  -L, --local string    Outgoing source IP address to use; determins interface (default: empyt-any interface)
  -N, --packet string   Size of each packet (as x(.xxx)?[kmgtKMGT]?) (default "1k")
  -p, --port int        UDP port of the flowsim UDP sink (default 8081)
  -P, --pps int         Packets per second (default 10)
  -t, --time int        Total time sending (default 6)
  -v, --verbose         Print info re. all generated packets```

## flowsim as a UDP sink

flowsim as a UDP sink

In UDP sink mode, following options are available:

Usage:
  flowsim sink [flags]

Flags:
  -h, --help        help for sink
  -I, --ip string   IP address or host name to listen on for the flowsim UDP sink (default "127.0.0.1")
  -m, --multi       Stay in the sink forever and print stats for multiple incoming streams
  -p, --port int    UDP port of the flowsim UDP sink (default 8081)
  -v, --verbose     Print per packet info

Note that it makes no sense to set the DSCP in this mode and this option is therefore not present and that the default mode is to receive one flow and quit after printing the QoE statistics for that flow.

Output format

The TCP, QUIC, HTTP and HTTPS clients output results in JSON format:

{
  "Protocol": "HTTPS",
  "Server": "127.0.0.1:8081",
  "Burst": 1048576,
  "Start": "2019-12-21T13:43:27+01:00",
  "Times": [
   {
    "XferStart": "2019-12-21T13:43:27+01:00",
    "XferTime": "61.769567ms",
    "XferBytes": 1048576,
    "XferIter": 1
   },...
  ]
}
  • Protocol: protocol used (HTTP, HTTPS or QUIC)
  • Burst: programmed burst size
  • Server: remote IP address
  • Start: start time in RFC format
  • Times: a series of individual measurements

The UDP sink also prints result in JSON format

{
  "Protocol": "UDP",
  "Peer": "127.0.0.1:52635",
  "Delay": "4583.90us",
  "Jitter": "847.20us",
  "Loss": 0,
  "Reorder": 0,
  "Samples": 60
 }

About

A fork for the flowsim code of the MAMI trafic generator

Resources

Stars

Watchers

Forks

Packages

No packages published