Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Latest commit

 

History

History
319 lines (249 loc) · 10.3 KB

PROTOCOLS.md

File metadata and controls

319 lines (249 loc) · 10.3 KB

Protocols

DHCPv6

Due to DHCPv6 nature we can only test relay. This means taking ownership of port 547 on the machine we're running the load test, which requires root access. DHCPv6 load test performs a 4-way handshake (Solicit, Advertise, Request, Reply) and results in an error if any of these fail.

Input Format

DeviceMAC

Example input

01:23:45:67:89:ab
E3:63:BD:7B:D2:2C
c8:6c:2c:47:96:fd

Examples

In the first example we will be load-testing a DHCPv6 (relay) server running on example.com on the default port 547. We will perform 3 consecutive tests for each specified QPS (200, 400, 800) each lasting for 1 minute. The solicits will be generated based on the input file macs.txt. The results will be stored as json in results.json.

fbender dhcpv6 throughput fixed \
    --target example.com --duration 1m \
    --input macs.txt --output results.json --format json \
    200 400 800

In the second example we will try to automatically find a maximum QPS a server can handle before it's average latency exceeds 50ms. We will use the same server (example.com:547), starting our test at 400 increasing by 100 with every test. To get more measure points we will run tests for 10 minutes and check for average latency not to exceed 50ms. Just like previously we will generate solicits from macs.txt and save the results as json to results.json.

fbender dhcpv6 throughput constraints \
    --target example.com --duration 10m \
    --input macs.txt --output results.json --format json \
    400 --growth +100 --constraints "AVG(latency) < 50"

DNS

Custom Flags

In addition to other standard flags DNS allows you prefix all queries with randomly generated values to avoid cached responses. When (-r, --randomize ) the queries will be prefixed as follows (the QType remains unchanged)

time.hex.domain

In bash this could have been achieved with the following command:

$(date +%s).$(openssl rand -hex 16).domain

Input Format

Domain QType

Example input

example.com AAAA
another.example.com A
yet.another.example.com MX
example.com TXT

Also, DNS can be load tested over tcp, rather than just the standard udp interface, by specifying (-p, --protocol tcp).

Examples

In the first example we will be load-testing a server running on example.com on the default port 53. We will perform 3 consecutive tests for each specified QPS (2000, 4000, 8000) each lasting for 1 minute. The queries will be generated based on the input file queries.txt, and to avoid hitting the cache we will randomize them with a random hex of 16-character length. The results will be stored as json in results.json.

fbender throughput fixed \
    --target example.com--duration 1m --randomize 16 \
    --input queries.txt --output results.json --format json \
    2000 4000 8000

In the second example we will try to automatically find a maximum QPS a server can handle before its average latency exceeds 20ms. We will use the same server (example.com:53), starting our test at 4000 increasing by 1000 with every test. To get more measure points we will run tests for 10 minutes and only take into an account the minimum data point. Just like previously we will generate queries from queries.txt, randomize them and save the results as json to results.json.

fbender  throughput constraints \
    --target example.com:53 --duration 10m --randomize\
    --input queries.txt --output results.json --format json \
    4000 --growth +1000 --constraints "AVG(latency) < 20"

HTTP

Custom Flags

In addition to standard flags HTTP provides a flag to enable ssl (-s, --ssl). If enabled all requests will be sent over HTTPS instead of default HTTP.

Input Format

Depending on the method lines may have one of two formats. When generating requests a protocol, target and url will be joined together removing excess /. Let's say the target is example.com, the ssl flag is turned on and the input is GET /index.html than the actual request will be GET https://example.com/index.html.

GET RelativeURL
POST RelativeURL FormData

Example input

GET index.html
GET /
POST echo message=Hello
POST hello/ lang=en&name=Mikolaj

Examples

In the first example we will be load-testing a HTTP server running on example.com on the default port 443 (with SSL enabled). We will perform 3 consecutive tests for each specified QPS (2000, 4000, 8000) each lasting for 1 minute. The queries will be generated based on the input file queries.txt. The results will be stored as json in results.json.

fbender http throughput fixed \
    --target example.com --duration 1m --ssl \
    --input queries.txt --output results.json --format json \
    2000 4000 8000

In the second example we will try to automatically find a maximum QPS a server can handle before it's average latency exceeds 200ms. We will use the same server (example.com:443), starting our test at 400 increasing by 100 with every test. To get more measure points we will run tests for 10 minutes and only take into an account the minimum data point. Just like previously we will generate queries from queries.txt and save the results as json to results.json.

fbender http throughput constraints \
    --target example.com --duration 10m --ssl \
    --input queries.txt --output results.json --format json \
    400 --growth +100 --constraints "AVG(latency) < 500.0"

The next example we will be load-testing endpoint which downloads a large file (around 5GB), so instead of using throughput test we will test concurrency. We will use the server example.com:443. We will perform 3 consecutive tests for each specified number of concurrent connections (10, 20, 50) each lasting for 1 minute. The queries will be generated based on the input file queries.txt. The results will be stored as json in results.json.

fbender http concurrency fixed \
    --target example.com --duration 1m --ssl \
    --input queries.txt --output results.json --format json \
    10 20 50

In the last example we will try to automatically find a maximum concurrent connections a server can handle before it's errors rate exceeds 10%. We will use the same server (example.com:443), starting our test at 20 and growth of exponential backoff with precision of 10. To get more measure points we will run tests for 10 minutes and only take into an account the. Just like previously we will generate queries from queries.txt and save the results as json to results.json.

fbender http concurrency constraints \
    --target example.com --duration 10m --ssl \
    --input queries.txt --output results.json --format json \
    20 --growth ^5 --constraints "MAX(errors) < 10.0"

TFTP

Due to a large amount of packets required to download a single file over TFTP instead of queries per second we will test number of concurrent connections. The specified timeout applies to a single datagram in a tftp transfer rather than to the whole session.

Custom Flags

In addition to standard flags TFTP provides a flag to set the tftp block size (-s, --blocksize).

Input Format

Mode can be one of octet or netascii

Filename Mode

Example input

/my/file octet
/my/otherfile octet
/anotherfile netascii

Examples

In the first example we will be load-testing a TFTP server running on example.com on the default port 69. We will perform 3 consecutive tests for each specified concurrent connections (10, 25, 50) each lasting for 1 minute. The queries will be generated based on the input file files.txt. The results will be stored as json in results.json.

fbender tftp concurrency fixed \
    --target example.com:69 --duration 1m \
    --input files.txt --output results.json --format json \
    10 25 50

In the second example we will try to automatically find a maximum QPS a server can handle before it's errors rate exceeds 10%. We will use the same server (example.com:69), starting our test at 25 increasing by 10 with every test. To get more measure points we will run tests for 10 minutes and only take into an account the minimum data point. Just like previously we will generate queries from files.txt and save the results as json to results.json.

fbender tftp concurrency constraints \
    --target example.com --duration 10m \
    --input files.txt --output results.json --format json \
    25 --growth +10 --constraints "MAX(errors) < 10.0"

UDP

Target

Target format accepted by the udp tests is ipv4, ipv6, hostname. The ports are taken from the input file.

Input Format

For udp load-testing the datagram content has to be base64 encoded to allow for easy line by line parsing.

DestinationPort Base64EncodedPayload

Example input

2545 TG9yZW0=
7346 aXBzdW0gZG9sb3Igc2l0
5012 YW1ldCBpbg==

Examples

In the first example we will be load-testing a server running on example.com. We will perform 3 consecutive tests for each specified QPS (2000, 4000, 8000) each lasting for 1 minute. The queries will be generated based on the input file payloads.txt. The results will be stored as json in results.json.

fbender udp throughput fixed \
    --target example.com --duration 1m \
    --input payloads.txt --output results.json --format json \
    2000 4000 8000

In the second example we will try to automatically find a maximum QPS a server can handle before it's errors rate exceeds 10%. We will use the same server (example.com), starting our test at 4000 increasing by 1000 with every test. To get more measure points we will run tests for 10 minutes and only take into an account the minimum data point. Just like previously we will generate requests from payloads.txt and save the results as json to results.json.

fbender udp throughput constraints \
    --target example.com --duration 10m \
    --input payloads.txt --output results.json --format json \
    4000 --growth +1000 --constraints "MAX(errors) < 10.0"