Eywa: Automating Model-Based Testing using LLMs

Rajdeep Mondal (UCLA), Rathin Singha (UCLA), Todd Millstein (UCLA), George Varghese (UCLA), Ryan Beckett (Microsoft Research), Siva Kesava Reddy Kakarla (Microsoft Research)

23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26) · Day 1 · Trust but Verify

Overview

Network protocols form the foundational fabric of the internet, operating across complex, interacting layers to enable global communication. However, the implementations of these protocols are notoriously prone to bugs, which can trigger severe cascading consequences such as widespread network outages and critical security vulnerabilities. Industry studies—including internal analyses from Microsoft—reveal that roughly 36% of significant, customer-impacting network incidents stem directly from implementation bugs. To combat this, model-based testing has emerged as a powerful technique, requiring developers to construct behavioral models from Request for Comments (RFC) specifications or vendor documentation and systematically explore them via random walks or symbolic execution. Despite its efficacy, model-based testing suffers from a severe manual modeling bottleneck: writing, maintaining, and updating these complex models demands immense human effort, especially given frequent protocol revisions or intricate systems like the Border Gateway Protocol (BGP).

Watch on YouTube · Slides

Visual summary for Eywa: Automating Model-Based Testing using LLMs by Rajdeep Mondal, Rathin Singha, Todd Millstein, George Varghese, Ryan Beckett, Siva Kesava Reddy Kakarla
Visual summary for Eywa: Automating Model-Based Testing using LLMs by Rajdeep Mondal, Rathin Singha, Todd Millstein, George Varghese, Ryan Beckett, Siva Kesava Reddy Kakarla

Key moments

  1. 0:00 Introduction and background on protocol testing
  2. 2:05 Introduction to Eywa and overview of results
  3. 3:26 Key modeling challenges with LLMs
  4. 4:47 Challenge 1: Modeling complex protocols and function modules
  5. 7:00 Challenge 2: Addressing LLM hallucinations via differential testing
  6. 8:31 Challenge 3: Handling stateful protocols with state transition graphs
  7. 10:04 Example bug discovered in CoreDNS
  8. 11:32 Example bug discovered in BGP confederations
  9. 13:39 Limitations and future work

Eywa: Automating Model-Based Testing using LLMs

Speakers: Rajdeep Mondal (UCLA); Rathin Singha (UCLA); Todd Millstein (UCLA); George Varghese (UCLA); Ryan Beckett (Microsoft Research); Siva Kesava Reddy Kakarla (Microsoft Research)

Conference: USENIX NSDI

YouTube: https://www.youtube.com/watch?v=ddYbCjDXntg

Overview

Network protocols form the foundational fabric of the internet, operating across complex, interacting layers to enable global communication. However, the implementations of these protocols are notoriously prone to bugs, which can trigger severe cascading consequences such as widespread network outages and critical security vulnerabilities. Industry studies—including internal analyses from Microsoft—reveal that roughly 36% of significant, customer-impacting network incidents stem directly from implementation bugs. To combat this, model-based testing has emerged as a powerful technique, requiring developers to construct behavioral models from Request for Comments (RFC) specifications or vendor documentation and systematically explore them via random walks or symbolic execution. Despite its efficacy, model-based testing suffers from a severe manual modeling bottleneck: writing, maintaining, and updating these complex models demands immense human effort, especially given frequent protocol revisions or intricate systems like the Border Gateway Protocol (BGP).

To eliminate this bottleneck, researchers from UCLA and Microsoft Research introduced Eywa, the first automated framework that leverages Large Language Models (LLMs) to build network protocol models and generate test cases rapidly and efficiently. Eywa reduces model construction time from weeks of manual engineering to mere minutes with minimal human intervention. Utilizing this tool, the research team tested three core network protocols—Domain Name System (DNS), BGP, and Simple Mail Transfer Protocol (SMTP)—while modeling previously unexplored protocol components such as BGP confederations and route reflection. Across 16 distinct implementations, Eywa synthesized over 110,000 test cases and successfully uncovered 33 unique, previously unknown bugs.

This article provides a comprehensive technical breakdown of Eywa, examining its modular code synthesis approach, differential testing mechanisms, stateful protocol handling via symbolic execution, and the practical implications for systems and networking infrastructure.

Background

▶ Watch: Introduction and background on protocol testing (0:00)

Model-based testing relies on formal or semi-formal behavioral abstractions to generate comprehensive test suites that exercise edge cases missed by traditional human-written unit tests. In the networking domain, building these models traditionally requires domain experts to painstakingly read dense, hundreds-of-pages-long RFC specifications, interpret ambiguous wording, and hand-code state machines or transition functions in languages compatible with symbolic execution engines like Klee.

This manual approach introduces three primary friction points in systems development:

  1. High Engineering Overhead: Complex protocols involve thousands of pages of specifications. Maintaining consistency between evolving standards and hand-written models is labor-intensive.
  2. Incomplete Coverage: Human developers often overlook obscure protocol features, proprietary extensions, or intricate corner cases (such as BGP route reflection topologies).
  3. Stateful Explosion: Validating stateful protocols requires driving the system under test through complex sequences of preliminary states before the target behavior can be safely evaluated.

While LLMs possess vast parametric memory containing RFCs, technical blogs, and vendor documentation, they cannot be deployed naively for protocol synthesis. Monolithic LLM prompts fail when generating complex, multi-component protocols due to context degradation and output truncation. Furthermore, LLMs are inherently stochastic and prone to hallucinations, meaning an unverified LLM-generated model will produce invalid expected outputs, rendering traditional oracle-based testing ineffective. Eywa was designed specifically to bridge this gap, combining the semantic retrieval capabilities of LLMs with rigorous software verification tooling.

Key Findings

▶ Watch: Key modeling challenges with LLMs (3:26)

Eywa’s deployment across DNS, BGP, and SMTP yielded significant discoveries in widely deployed, production-grade networking software. By generating over 110,000 test cases, the framework detected 33 unique bugs across 16 different implementations, proving that LLM-assisted model generation can uncover deep semantic flaws in mature software.

Among the headline findings are two particularly critical bugs:

  • CoreDNS Authority Section Violation: In CoreDNS, one of the most widely deployed open-source DNS name servers, Eywa generated a test case querying a non-existent domain (bar.test) against a zone file containing relative domain names. While CoreDNS correctly returned an NXDOMAIN (non-existent domain) response code, it erroneously included an out-of-zone authority section. This behavior violates DNS trust boundaries and introduces serious risks: modern resolvers caching these malformed authority sections can become vulnerable to cache poisoning, while strict resolvers discarding them suffer performance degradation due to repeated fallback queries.
  • BGP Confederation Peer-Type Mismatch: In FRRouting (FRR) and Batfish, Eywa exposed a previously unexplored flaw involving BGP confederations—a mechanism used to partition autonomous systems into sub-groups. Eywa constructed a topology placing routers R1 and R2 within confederation AS 512 (sub-AS 256 and sub-AS 65535, respectively), with router R3 in AS 65535. When a route was advertised from R1 to R2, R2 installed the route internally, but R3 failed to receive it. Investigation revealed that R3 attempted an external BGP (EBGP) connection with R2, while R2 assumed an internal BGP (IBGP) connection because their AS numbers matched. This silent mismatch results in unhandled link failures and configuration black-holes in production enterprise networks.

Technical Deep Dive

▶ Watch: Challenge 2: Addressing LLM hallucinations via differential testing (7:00)

Eywa’s architecture is structured around three core technical pillars designed to overcome protocol complexity, LLM hallucinations, and stateful verification challenges.

1. Modular Code Synthesis and Dependency Graphs

To prevent the failures associated with monolithic LLM generation, Eywa requires users to break protocols down into manageable function modules. For each module, the user defines the input/output type structures and a brief natural language model description.

For instance, when modeling BGP route maps (which filter route advertisements across organizations), a user defines two data structs:

  • Route: Containing IP address, prefix mask, and local preference.
  • RouteMapStanza: Containing local preference thresholds and action policies (permit or deny).

The user then supplies a function signature and description matching route advertisements against route map stanzas. Eywa automatically wraps these definitions into structured prompts, querying the LLM to synthesize the missing implementation logic.

To compose these localized components into comprehensive protocol models (e.g., combining route maps with the BGP best-path selection algorithm for BGP import processing), Eywa utilizes dependency graphs. Users define edges between modules, and Eywa orchestrates separate, parallel LLM invocations to synthesize individual module code before automatically composing them into a unified executable model.

2. Differential Testing Against Hallucinations

Because LLMs are stochastic code generators, their outputs inevitably contain hallucinations or subtle logical errors. Relying on an LLM-generated model to dictate the expected output of a test case would introduce unacceptable false positives. Eywa solves this by abandoning model-based oracles in favor of differential testing.

Instead of checking whether an implementation matches the LLM model's predicted output, Eywa feeds the raw test case inputs generated via symbolic execution into multiple distinct implementations concurrently. It then cross-examines the outputs for agreement or disagreement. If implementations diverge on identical inputs, a bug or specification ambiguity is isolated—completely eliminating dependence on the correctness of the LLM-synthesized model. Furthermore, Eywa harnesses stochastic hallucination as a feature rather than a bug: by prompting the LLM to generate diverse structural variations of the same model, symbolic execution uncovers a wider distribution of corner-case inputs.

3. State Transition Graphs for Stateful Protocols

Validating stateful protocols like SMTP requires driving the protocol server through precise sequences of handshake and authentication states before testing target logic. Eywa addresses this by using the LLM-generated protocol model to reconstruct the protocol's state transition graph.

For SMTP, Eywa queries the LLM to extract state transition rules corresponding to specific packet inputs. Once the state graph is materialized, Eywa locates the target test state and applies a graph traversal algorithm to compute the exact input sequence required to transition the protocol server from its initial state to the target state. The concrete test input generated by symbolic execution is then appended to this initialization sequence, producing a complete, executable end-to-end test payload.

Experimental Setup & Results

▶ Watch: Example bug discovered in CoreDNS (10:04)

Eywa is implemented as an open-source Python library integrating prompt-generation utilities, module composition engines, and interface bindings for symbolic execution engines. The evaluation targeted three foundational internet protocols:

  • DNS: Testing name resolution, zone file parsing, and authority record generation across implementations like CoreDNS.
  • BGP: Testing path selection, import/export route filtering, confederations, and route reflection across routing stacks like FRR and validation tools like Batfish.
  • SMTP: Testing session state machines, command parsing, and mail transfer sequences.

Across these domains, Eywa’s modular synthesis engine generated over 110,000 unique test cases with minimal user-provided scaffolding (requiring only structural type definitions and high-level behavioral descriptions). This testing matrix exposed 33 unique, previously undocumented bugs distributed across 16 distinct open-source and commercial protocol implementations. Performance-wise, model generation overhead was reduced from weeks of manual RFC interpretation to minutes of LLM inference time.

Practical Implications

▶ Watch: Limitations and future work (13:39)

For infrastructure teams, network operators, and protocol developers, Eywa represents a paradigm shift in how protocol implementations are verified before deployment.

  • Lowering Protocol Verification Barriers: Historically, comprehensive model-based testing was reserved for elite protocol engineering groups due to the prohibitive cost of manual modeling. Eywa democratizes this capability, allowing engineers to test custom proprietary extensions or standard protocols rapidly.
  • Mitigating Zero-Day Implementation Flaws: By automating the generation of tens of thousands of test cases that probe deep protocol logic (such as BGP confederation topologies), teams can catch silent configuration and parsing mismatches before they cause production outages.
  • Tradeoffs and Limitations: Practitioners must account for LLM stochasticity—models generated by Eywa lack formal coverage guarantees and depend heavily on the availability of public training documentation. Consequently, protocols lacking extensive online RFC commentary or vendor documentation require more substantive human-written prompt scaffolding. Furthermore, while Eywa automates test generation, downstream tasks such as test environment setup, container orchestration, and bug triaging remain manual bottlenecks.

Key Takeaways

  • Eliminating the Modeling Bottleneck: Eywa removes the manual modeling phase of model-based testing, synthesizing executable protocol models from LLMs in minutes rather than weeks.
  • Modular Composition: Complex protocols are broken down into manageable function modules and composed using automated dependency graphs, avoiding the context degradation of monolithic LLM prompts.
  • Differential Testing Over Oracles: Eywa bypasses LLM hallucinations by cross-checking test inputs across multiple distinct protocol implementations, removing reliance on model-predicted expected outputs.
  • Stateful Path Generation: By extracting state transition graphs from LLM-generated models, Eywa uses graph traversal algorithms to automatically construct multi-step initialization sequences for stateful protocols like SMTP.
  • Proven Production Impact: Eywa generated over 110,000 test cases across DNS, BGP, and SMTP, successfully uncovering 33 unique bugs across 16 different implementations, including critical flaws in CoreDNS and FRR.

About the Speaker(s)

Rajdeep Mondal is a PhD student at the University of California, Los Angeles (UCLA), conducting systems and networking research advised by faculty members including Todd Millstein and George Varghese. His research focuses on leveraging artificial intelligence, formal methods, and program synthesis to improve the reliability, correctness, and security of network protocol implementations and networked systems.

Reviews

→ Top-rated talks at 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)

All talks from 23rd USENIX Symposium on Networked Systems Design and Implementation (NSDI '26)