SC_RXIFD(1)

NAME
sc_rxifd - respond with receive interface name in a DNS TXT packet

SYNOPSIS
sc_rxifd [-?46Dv] [-n name] [-p pps] [-P port]

DESCRIPTION
The sc_rxifd utility provides the ability for a UDP client to determine the interface on a UDP listener that received the packet. This is useful when inferring routing policy. sc_rxifd uses DNS as a wire format for queries and responses. The options are as follows:

-?  prints a list of command line options and a synopsis of each.

-v  prints the version of sc_rxifd and exits.

-D  causes sc_rxifd to operate as a daemon.

-4  causes sc_rxifd to only listen for IPv4-based requests.

-6  causes sc_rxifd to only listen for IPv6-based requests.

-n name
    specifies the name that sc_rxifd will respond to TXT queries for. sc_rxifd will silently ignore non-TXT queries, and TXT queries for names other than the specified name. This is a mandatory parameter.

-p pps
    specifies the maximum number of responses per second that sc_rxifd can send. This is a mandatory parameter.

-P port
    specifies the UDP port to listen for queries on. Typically port 53 requires privilege to listen on, and some networks intercept all UDP port 53 traffic, so it is recommended to choose a higher-numbered port. This is a mandatory parameter.

EXAMPLES
The intended use of sc_rxifd is on a multi-homed system where clients could reach IP addresses on the system in different ways. Typically those IP addresses are assigned to the loopback interface. sc_rxifd will respond to a TXT query for a specific name with a TXT record that contains the name of the physical interface that received the query, even if that packet were destined to an address assigned to the loopback interface, and the source IP address that sc_rxifd saw the query from.

Given sc_rxifd listening on port 53535 for TXT queries for rxif.example.net

    sc_rxifd -P 53535 -n rxif.example.net

Then the following query

    dig @192.0.2.1 rxif.example.net -t txt -p 53535 +short

will obtain a response that looks similar to

    "src=192.0.31.8" "rxif=em0"

SIGNAL HANDLERS
sc_rxifd installs handlers for SIGHUP, SIGINT, and SIGTERM. These signals cause sc_rxifd to exit gracefully.

SECURITY CONSIDERATIONS
sc_rxifd should always be run by a non-root user.

sc_rxifd provides an amplification opportunity, as a DNS response is typically larger than a DNS query. The size of a response depends on the length of the interface name and the length of the string representation of the source IP address reported.

SEE ALSO
dig(1), M. Luckie, S. Wallace, K. Newell, J. Bartig, S. Koçak, N. Den Otter, K. Koole, J. Deaton, k. claffy, R&E Routing Policy: Inference and Implication, Proc. ACM/SIGCOMM Internet Measurement Conference 2025.

AUTHORS
sc_rxifd was written by Matthew Luckie <mjl@luckie.org.nz>.