Rust for Safer Protocol Development


The talk is important because it shows how Rust specifically can help with creating more consistent implementations of network protocols which see widespread use. Not only are our parsers guaranteed to be type-safe by the Rust compiler, they're also far less likely to contain arithmetic or logic errors thanks to being automatically generated. If an implementation of a given protocol does not produce the expected output when run through these parsers, then we've either highlighted a flaw in the implementation or in the standards document: both of these cases are wins, since they both prevent a bug and a potential security flaw from being released into the wild.

The aim of this talk is to show how we can use automatically generated parsers to catch errors and ambiguities in Internet standards documents created by the Internet Engineering Task Force (IETF). Incorrect bit layouts in ASCII diagrams, inconsistent use of packet field names, and other design flaws can lead to inconsistent implementations of often complex protocols being deployed in the wild - generating parsers directly from the standards documents provide a unified, gold standard for testing and a central point for observing and reporting any design flaws in the protocol itself.

Parsers are generated using type information from our python-based backend, known as the network packet representation. These can be generated for any language, but we decided on nom-based Rust parsers for the first language we support because we believe its strict typing and safety requirements are a safer option than C or C++ for low-level systems programming. We have working automatic parser generation for an example draft we wrote as part of the project, and are currently working on testing this for TCP, UDP, and QUIC specifications.

Presented by

  • Vivian Band Vivian Band

    Vivian Band is a second year PhD student at the University of Glasgow, studying IPv6 security. They were an intern working on the automatic generation of Rust parsers as part of the EPSRC-funded "Improving Protocol Standards for a more Trustworthy Internet" project.