Scroll to navigation

dnsjit.output.dnssim(3) Library Functions Manual dnsjit.output.dnssim(3)

NAME

dnsjit.output.dnssim - Simulate independent DNS clients over various transports

SYNOPSIS


output = require("dnsjit.output.dnssim").new()

Usage


output:udp()
output:target("::1", 53)
recv, rctx = output:receive()
-- pass in objects using recv(rctx, obj)
-- repeatedly call output:run_nowait() until it returns 0

DNS-over-TLS example configuration


output:tls("NORMAL:-VERS-ALL:+VERS-TLS1.3") -- enforce TLS 1.3

DNS-over-HTTPS/2 example configuration


output:https2({ method = "POST", uri_path = "/doh" })

DESCRIPTION

Output module for simulating traffic from huge number of independent, individual DNS clients. Uses libuv for asynchronous communication. There may only be a single DnsSim in a thread. Use dnsjit.core.thread to have multiple DnsSim instances.

With proper use of this component, it is possible to simulate hundreds of thousands of clients when using a high-performance server. This also applies for state-full transports. The complete set-up is quite complex and requires other components. See DNS Shotgun (https://gitlab.nic.cz/knot/shotgun) for dnsjit scripts ready for use for high-performance benchmarking.

Functions

Create a new DnsSim output for up to max_clients.
Check that version of dnssim is at minimum the one passed as req_version and return the actual version number. Return nil if the condition is not met.

If no req_version is specified no check is done and only the version number is returned.

Check that version of dnssim's JSON data format is at minimum the one passed as req_version and return the actual version number. Return nil if the condition is not met.

If no req_version is specified no check is done and only the version number is returned.

Return the Log object to control logging of this instance or module. Optionally, set the instance's log name. Unique name should be used for each instance.
Set the target IPv4/IPv6 address where queries will be sent to.
Specify source IPv4/IPv6 address for sending queries. Can be set multiple times. Addresses are selected round-robin when sending.
Set the preferred transport to UDP.

When the optional argument tcp_fallback is set to true, individual queries are re-tried over TCP when TC bit is set in the answer. Defaults to false (aka only UDP is used).

Set the transport to TCP.
Set the transport to TLS.

The optional argument tls_priority is a GnuTLS priority string, which can be used to select TLS versions, cipher suites etc. For example:

- "NORMAL:%NO_TICKETS" will use defaults without TLS session resumption.

- "SECURE128:-VERS-ALL:+VERS-TLS1.3" will use only TLS 1.3 with 128-bit secure ciphers.

Refer to: https://gnutls.org/manual/html_node/Priority-Strings.html

Set the transport to HTTP/2 over TLS.

http2_options is a lua table which supports the following keys:

method: GET (default) or POST

uri_path: where queries will be sent. Defaults to /dns-query

zero_out_msgid: when true (default), query ID is always set to 0

See tls() method for tls_priority documentation.

Set timeout for the individual requests in seconds (default 2s).

Beware: increasing this value while the target resolver isn't very responsive (cold cache, heavy load) may degrade DnsSim's performance and skew the results.

Set TCP connection idle timeout for connection reuse according to RFC7766, Section 6.2.3 (defaults to 10s). When set to zero, connections are closed immediately after there are no more pending queries.
Set TCP connection handshake timeout (defaults to 5s). During heavy load, the server may no longer accept new connections. This parameter ensures such connection attempts are aborted after the timeout expires.
Run the libuv loop once without blocking when there is no I/O. This should be called repeatedly until 0 is returned and no more data is expected to be received by DnsSim.
Set this to true if DnsSim should free the memory of passed-in objects (useful when using dnsjit.filter.copy to pass objects from different thread).
Number of input packets discarded due to various reasons. To investigate causes, run with increased logging level.
Number of valid requests (input packets) processed.
Number of requests that received an answer
Number of requests that received a NOERROR response
Configure statistics to be collected every N seconds.
Stop the collection of statistics.
Export the results to a JSON file.
Return the C function and context for receiving objects. Only dnsjit.filter.core.object.ip or dnsjit.filter.core.object.ip6 objects are supported. The component expects a 32bit integer (in host order) ranging from 0 to max_clients written to first 4 bytes of destination IP. See dnsjit.filter.ipsplit.
Deprecated: use udp() instead.

Set the transport to UDP (without any TCP fallback).

SEE ALSO

dnsjit.filter.copy(3), dnsjit.filter.ipsplit(3), dnsjit.filter.core.object.ip(3), dnsjit.filter.core.object.ip6(3), https://gitlab.nic.cz/knot/shotgun

AUTHORS

Jerry Lundström (DNS-OARC), Tomáš Křížek (CZ.NIC)

Maintained by DNS-OARC

BUGS

For issues and feature requests please use:

For question and help please use:

admin@dns-oarc.net
1.1.0 dnsjit