Semi-automated protocol disambiguation and code generation
Jane Yen, Tamás Lévai, Qinyuan Ye, Xiang Ren, Ramesh Govindan, Barath Raghavan
Abstract
For decades, Internet protocols have been specified using natural language. Given the ambiguity inherent in such text, it is not surprising that protocol implementations have long exhibited bugs. In this paper, we apply natural language processing (NLP) to effect semi-automated generation of protocol implementations from specification text. Our system, sage, can uncover ambiguous or under-specified sentences in specifications; once these are clarified by the spec author, sage can generate protocol code automatically.
Using sage, we discover 5 instances of ambiguity and 6 instances of under-specification in the ICMP RFC; after clarification, sage is able to automatically generate code that interoperates perfectly with Linux implementations. We show that sage generalizes to BFD, IGMP, and NTP. We also find that sage supports many of the conceptual components found in key protocols, suggesting that, with some additional machinery, sage may be able to generalize to TCP and BGP.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 162d4146-876d-4684-9008-24cdb1e84bb1Cited by top-tier papers13
- Automated Attack Synthesis by Extracting Finite State Machines from Protocol Specification DocumentsMaria Leonor Pacheco, Max von Hippel, Ben Weintraub, Dan Goldwasser et al.S&P 2022 · 58 citations
- Hermes: Unlocking Security Analysis of Cellular Network Protocols by Synthesizing Finite State Machines from Natural Language SpecificationsAbdullah Al Ishtiaq, Sarkar Snigdha Sarathi Das, Syed Md. Mukit Rashid, Ali Ranjbar et al.USENIX Security 2024 · 28 citations
- iSyn: Semi-automated Smart Contract Synthesis from Legal Financial AgreementsPengcheng Fang, Zhenhua Zou, Xusheng Xiao, Zhuotao LiuISSTA 2023 · 11 citations
- DAInfer: Inferring API Aliasing Specifications from Library Documentation via Neurosymbolic OptimizationChengpeng Wang, Jipeng Zhang, Rongxin Wu, Charles ZhangFSE 2024 · 5 citations
- 3DGen: AI-Assisted Generation of Provably Correct Binary Format ParsersSarah Fakhoury, Markus Kuppe, Shuvendu K. Lahiri, Tahina Ramananandro et al.ICSE 2025 · 2 citations
Builds on3
- ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
- Switch Code Generation Using Program SynthesisXiangyu Gao, Taegyun Kim, Michael D. Wong, Divya Raghunathan et al.SIGCOMM 2020 · 51 citations
- Learning from Explanations with Neural Execution TreeZiqi Wang, Yujia Qin, Wenxuan Zhou, Jun Yan et al.ICLR 2020 · 41 citations
Related papers
- LLMs Unleashed: Generating Protocol Code from RFC SpecificationsJunfeng Long, Jinshu Su, Biao HanAAAI 2026
- Generating Precise Format Specification for Network Protocols Through Adversarial LLM InteractionsHengdi Ye, Bing Shui, Jielun Wu, Yufan Zhou et al.USENIX Security 2026
- Spec2Code: Mapping Protocol Specification to Function-Level Code ImplementationYuekun Wang, Lili Quan, Xiaofei Xie, Junjie Wang et al.ASE 2025
- Enhancing REST API Testing with NLP TechniquesMyeongsoo Kim, Davide Corradini, Saurabh Sinha, Alessandro Orso et al.ISSTA 2023 · 34 citations
- ProtocolGuard: Detecting Protocol Non-compliance Bugs via LLM-guided Static Analysis and Dynamic VerificationXiangpu Song, Longjia Pei, Jianliang Wu, Yingpei Zeng et al.NDSS 2026 · 3 citations
