oxidecomputer / oxidecomputer/opte
use smoltcp for parsing
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 77
- Forks
- 11
- Avg merge
- 9d 20h
- Merged PRs (30d)
- 8
Description
NOTE: The goal is to use smoltcp purely for parsing wire data. It is a non-goal to use any part of the networking stack, as OPTE isn't actually in the business of being a network stack.
My homegrown header types and parsing have served me well up until now; but as new functionality is needed (such as #40) it becomes increasingly annoying to have to write parsing for a new header type from the ground up -- especially given that amount of higher-level code I'm trying to iterate on at the moment. The smoltcp wire module, while it looks a lot different from my code, is actually conceptually similar in that there are types that use zerocopy to get raw access to the headers (my XxxHdrRaw type to smoltcp's Packet type) and alloc'd types that verify the logical soundness of the header (my Header trait to smoltcp's Repr type). I also verify the overall soundness of the totality of the packet during the Packet::parse() method.
At some point in the future we (Oxide) may want to have our own std/no-std library that is focused solely on the parsing of packets in an efficient and safe manner. But at this point in time this project is better served by using smoltcp so I can focus on higher-level concerns that get user features delivered.
smoltcp isn't perfect (no project is). It doesn't implement everything OPTE needs. But it has probably 97% of what we need. Any areas where it lacks I'm pretty sure I can extend it from the outside. E.g., it doesn't support DHCP Classless Static Route Option (121), but we can support that with supplemental code of our own while still making use of all the existing DHCP parsing code in smoltcp. If there's something we can't fix with supplemental code, then we can always try to send a patch upstream -- this is OSS after all.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by comparing OPTE's existing header and packet parsing with smoltcp's wire module, then identify the migration scope and any unsupported headers. Done means wire-data parsing uses smoltcp without adopting its networking stack, with supplemental parsing where needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100