Extremal Testing for Network Software using LLMs

Rathin Singha, Harry Qian, Srinath Saikrishnan, Tracy Zhao, Ryan Beckett, Siva Kesava Reddy Kakarla, George VarghesearXiv 2025 · DOI

Introduction

Network software, the backbone of the modern internet, must be exceptionally robust. However, protocols like DNS, HTTP, and BGP are governed by complex specifications (RFCs) that are difficult to test comprehensively. Researchers from UCLA and Microsoft Research have introduced a novel approach called "Extremal Testing" using Large Language Models (LLMs). By leveraging the vast technical knowledge embedded in LLMs, this method systematically probes the boundaries of protocol implementations to uncover previously hidden vulnerabilities in mature, production-grade software.

The Challenge of Network Testing

Traditional software testing methodologies often fall short when applied to complex network protocols. Fuzzing, while effective at finding crashes through random input, often fails to generate the specific, structured malformations required to trigger deep logic errors in mature codebases. For instance, the probability of a random fuzzer generating a DNS name with two consecutive dots—a specific violation of RFC 1035—is statistically negligible. Conversely, symbolic execution attempts to map every possible execution path but struggles to scale with the massive complexity of modern network stacks.

The authors identify a gap addressed by "Extremal Testing," a concept borrowed from physics where theories are tested at their limits (e.g., infinite mass). In software, this translates to testing the absolute boundaries of what is permitted by a specification. The primary hurdle is the "oracle problem": knowing exactly what constitutes an invalid input and how the system should respond. Humans often overlook the nuances of complex RFCs, making manual test generation tedious and error-prone.

Methodology: Two-Stage Extremal Prompting

The core innovation of this research is a Two-Stage Prompting (Chain-of-Thought) methodology designed to maximize the LLM's ability to generate high-quality, bug-triggering test cases. The process follows two distinct steps:

  1. Constraint Generation: The LLM (e.g., GPT-4o) is first prompted to list the validity constraints for a specific protocol based on its internal knowledge of technical standards.
  2. Violation Generation: Using the generated list of constraints as a reference, the LLM is then asked to create a set of invalid test cases that specifically violate those rules.

This separation ensures the LLM "reminds" itself of the complex rules before attempting to break them. These generated inputs are then used in Differential Testing, where multiple implementations of the same protocol are compared. If one implementation crashes or processes an input that others correctly reject, a potential bug is identified.

Evaluation and Datasets

The study evaluated several widely used network implementations across different domains, leveraging the LLM's pre-trained knowledge of technical standards rather than a static training set:

  • DNS: BIND, NSD, Knot DNS, and PowerDNS.
  • HTTP: Apache (httpd), Nginx, Caddy, H2O, and Lighttpd.
  • BGP: FRR, GoBGP, and the Batfish simulator.
  • Graph Libraries: NetworkX (Python) and Boost (C++).

Key Results

The two-stage prompting strategy proved remarkably effective, uncovering several new bugs and behavioral discrepancies in mature software.

Comparison of bug discovery rates across different prompting strategies.

As shown in the table above, the two-stage approach consistently outperformed one-stage prompting methods. Across all tested implementations, the two-stage method identified significantly more bugs than one-stage prompting with or without validity constraints. Notable findings include:

  • HTTP Vulnerabilities: Caddy and H2O were found to handle URIs with null bytes (%00) incorrectly, with Caddy returning a 500 Internal Server Error instead of the standard 400 Bad Request.
  • BGP Logic Errors: The Batfish simulator was found to accept negative "local preference" values, an invalid state in standard BGP models. GoBGP was found to accept invalid AS-path regular expressions.
  • Library Overflows: In the Boost C++ library, the LLM generated a graph that triggered an integer overflow, causing the library to report an incorrect shortest path rather than an error.
  • DNS Permissiveness: BIND and NSD were found to be overly permissive, accepting illegal characters (like !) in hostnames in violation of RFC 1035.

Discussion and Future Work

The success of this method highlights the potential of LLMs to serve as "protocol experts" that can recall obscure RFC details often overlooked by human developers. The two-stage process is highly efficient; for HTTP testing, the LLM-based approach required zero lines of manual code to find bugs that a 450-line custom Python script failed to identify.

Current limitations include a focus on static input-based testing rather than internal state transitions. Future research aims to explore "Agentic AI," where multiple LLM agents collaborate in a feedback loop to read specifications, generate tests, and refine their approach autonomously. This could lead to fully automated, high-fidelity testing pipelines for the next generation of network infrastructure.

Summary updated

BibTeX
@misc{singha2025extremal,
  author = {Rathin Singha and Harry Qian and Srinath Saikrishnan and Tracy Zhao and Ryan Beckett and Siva Kesava Reddy Kakarla and George Varghese},
  title = {{Extremal Testing for Network Software using LLMs}},
  year = {2025},
  eprint = {2507.11898},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.11898},
}
Figure