The benchmark program can run its fake upstream DNS server on its own, answering A queries for any name on a chosen address and port #91

Open
opened 2026-10-31 12:42:04 -04:00 by claude · 0 comments
Owner
  • Draft: PROC-9
  • Priority: medium (the harness needs a shared upstream that is not the internet)
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

FakeUpstreamDnsServer exists but only inside the in-process benchmarks:

  • it binds 127.0.0.1 on an OS-assigned port (src/dotnet/benchmarks/Ninlil.Benchmarks/Pipeline/FakeUpstreamDnsServer.cs:45-47);
  • it answers every question with an A record whatever the query type (:103-121).

A forwarder that asks for AAAA, DS or DNSKEY would get a wrongly typed record. RFC 1035 §4.1 and RFC 2308 §2.2 call for a NODATA answer there.

What changes

  • FakeUpstreamDnsServer.cs:
    • add a constructor overload that takes an IPEndPoint; the default constructor keeps today's loopback, port 0 behaviour, so the Pipeline and Transport benchmarks do not change;
    • answer only A queries with the A record, and answer every other type with NOERROR, no answer and the question echoed;
    • keep the count of received queries, and expose it over a small HTTP or UDP control endpoint (or the 10-second log line below) so the harness can read it per scenario; say which.
  • src/dotnet/benchmarks/Ninlil.Benchmarks/Program.cs: before option parsing (next to the child-process check at Program.cs:78), the first argument fake-upstream runs the server with --listen <address:port> (default 0.0.0.0:53) and --delay-ms <n> (default 0). It prints the bound endpoint and the received count every 10 seconds, and stops on Ctrl+C or SIGTERM. Update the class summary's option list (Program.cs:15-60).
  • src/script/benchmark/alternatives/fake-upstream.Dockerfile (new): builds the benchmark project in Release with the SDK image digest the repository already pins, and runs fake-upstream.

Acceptance

  • A small xUnit test fails first (AAAA gets an A record today): an AAAA query gets NOERROR with no answer, and an A query gets 192.0.2.77. No test project covers the benchmark project, so add src/dotnet/tests/Ninlil.Benchmarks.Tests, or ask the dispatcher if a new test project is not wanted.
  • dotnet run -c Release --project src/dotnet/benchmarks/Ninlil.Benchmarks -- fake-upstream --listen 127.0.0.1:15399 answers dig @127.0.0.1 -p 15399 x.miss.bench.test A.
  • --filter '*PipelineLatency*' --engines Sqlite --scale Small still passes its setup checks.
  • Build 0 warnings. csharpier clean. The AGENTS.md "Benchmark" section gets one sentence on fake-upstream.

Source

  • Memory project_alternatives_benchmarks.md ("one shared local fake upstream"). FakeUpstreamDnsServer.cs:10-18, 103-121.
- **Draft:** PROC-9 - **Priority:** medium (the harness needs a shared upstream that is not the internet) - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why `FakeUpstreamDnsServer` exists but only inside the in-process benchmarks: - it binds `127.0.0.1` on an OS-assigned port (`src/dotnet/benchmarks/Ninlil.Benchmarks/Pipeline/FakeUpstreamDnsServer.cs:45-47`); - it answers every question with an A record whatever the query type (`:103-121`). A forwarder that asks for AAAA, DS or DNSKEY would get a wrongly typed record. RFC 1035 §4.1 and RFC 2308 §2.2 call for a NODATA answer there. ### What changes - `FakeUpstreamDnsServer.cs`: - add a constructor overload that takes an `IPEndPoint`; the default constructor keeps today's loopback, port 0 behaviour, so the Pipeline and Transport benchmarks do not change; - answer only `A` queries with the A record, and answer every other type with NOERROR, no answer and the question echoed; - keep the count of received queries, and expose it over a small HTTP or UDP control endpoint (or the 10-second log line below) so the harness can read it per scenario; say which. - `src/dotnet/benchmarks/Ninlil.Benchmarks/Program.cs`: before option parsing (next to the child-process check at `Program.cs:78`), the first argument `fake-upstream` runs the server with `--listen <address:port>` (default `0.0.0.0:53`) and `--delay-ms <n>` (default 0). It prints the bound endpoint and the received count every 10 seconds, and stops on Ctrl+C or SIGTERM. Update the class summary's option list (`Program.cs:15-60`). - `src/script/benchmark/alternatives/fake-upstream.Dockerfile` (new): builds the benchmark project in Release with the SDK image digest the repository already pins, and runs `fake-upstream`. ### Acceptance - [ ] A small xUnit test fails first (AAAA gets an A record today): an AAAA query gets NOERROR with no answer, and an A query gets 192.0.2.77. No test project covers the benchmark project, so add `src/dotnet/tests/Ninlil.Benchmarks.Tests`, or ask the dispatcher if a new test project is not wanted. - [ ] `dotnet run -c Release --project src/dotnet/benchmarks/Ninlil.Benchmarks -- fake-upstream --listen 127.0.0.1:15399` answers `dig @127.0.0.1 -p 15399 x.miss.bench.test A`. - [ ] `--filter '*PipelineLatency*' --engines Sqlite --scale Small` still passes its setup checks. - [ ] Build 0 warnings. csharpier clean. The AGENTS.md "Benchmark" section gets one sentence on `fake-upstream`. ### Source - Memory `project_alternatives_benchmarks.md` ("one shared local fake upstream"). FakeUpstreamDnsServer.cs:10-18, 103-121.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#91
No description provided.