Nit: Rust doesn't prevent memory leak.
A year of Rust and DNS
71–80 of 109 posts
Re: A year of Rust and DNS
#72with erlang you can parse the dns-header like so: ,---- | %% extract dns-header fields from a raw packet. | parse_dns_header(raw_packet) -> | | ID:16, | QR:1, OPCODE:4, AA:1, TC:1, RD:1, RA:1, Z:3, RCODE:4, | QDCOUNT:16, | ANCOUNT:16, | NSCOUNT:16, ARCOUNT:16, | Tail/binary | >> = raw_packet, | | {#dns_header_record { | id = ID, | qr = QR, opcode = OPCODE, aa = AA, tc = TC, rd = RD, ra = RA, z = Z, rcode = RCODE, | q…
#[packet]
struct Dns {
id: u16be,
qr: u1,
opcode: u4,
aa: u1,
tc: u1,
...
#[payload]
data: Vec,
}Re: A year of Rust and DNS
#73Love the idea of reimplementing DNS in Rust. Would love to see more efforts like this so that we have secure-by-design language implementation of core security services. But BIND isn't just failing because "it's written in C", it's failing because it's written in terrible C. That said, "terrible C" is probably most every C routine written by someone with less than 10 years of solid low level experience, so "writing g…
> The article makes a brief reference to DJBDNS, which is written in C About 14 years ago I worked on a project that was a fork of qmail. I got to know DJB's code quite well, to say the least it is awe-inspiring. The level of understanding and craftsmanship he has in C is honestly something I am certain I will never achieve. At the same time, it is some of (for me) the most dense and obtuse code I've had to read. I'm…
https://people.csail.mit.edu/nickolai/papers/bangert-nail-la...
Nail, btw is parser written in the spirit of "language theoretic security", which is a poweful new way of looking at security problems.
Re: A year of Rust and DNS
#74Nit: Rust doesn't prevent memory leak.
Re: A year of Rust and DNS
#75Any benchmarks against the MirageOS TCP/IP stack? It would be interesting to see how the way Rust manages memory and its current optimizer match against OCaml in a production TCP/IP stack.
The question you pose though is awkward. MirageOS is a unikernel, Trust-DNS is an application, a consumer of the TCP stack.
I have seen Rust apps built into rumprun, but as of right now this isn't something on my list, in theory it's possible.
Re: A year of Rust and DNS
#76Earlier quoted context omitted.
> I've heard people decry OpenSSL and it's various warts (it has many), but as a code base, it's worked well for years across an incredible range of platforms. That... really depends on what you consider "worked well". Being a cryptography library, I think I could make a strong argument that working well includes a very good track record with regard to exploits. I don't believe OpenSSL exhibits that[1]. Note the numb…
> I suspect that the vast majority of people would take a 50% performance hit if it yielded a library that had only half as many major flaws as we've seen How would one know whether there are any major flaws in a code base?
Re: A year of Rust and DNS
#77Any benchmarks against the MirageOS TCP/IP stack? It would be interesting to see how the way Rust manages memory and its current optimizer match against OCaml in a production TCP/IP stack.
I'd love to get some benchmarks going. It's not as high a priority for me right now as getting to feature complete (my definition of that anyway). The question you pose though is awkward. MirageOS is a unikernel, Trust-DNS is an application, a consumer of the TCP stack. I have seen Rust apps built into rumprun, but as of right now this isn't something on my list, in theory it's possible.
You can build a DNS server with MirageOS and it is used like that in the context to the new Docker versions for Mac OS X and Windows, which is one example of being used in production.
Re: A year of Rust and DNS
#78Nit: Rust doesn't prevent memory leak.
It is unfortunate you're downvoted for making a true statement. It's extremely important that people don't see Rust as a panacea.
Re: A year of Rust and DNS
#79Earlier quoted context omitted.
It is unfortunate you're downvoted for making a true statement. It's extremely important that people don't see Rust as a panacea.
Fortunately it appears this perfectly legitimate comment has been salvaged. Steve, I was disappointed that this topic[1] received no discussion at all at HN. Has anyone inside Mozilla looked at it? The title is a bit click-baity for academic work, in my opinion, but I do think the points raised are worthy. Much like recent criticism of PostgreSQL by Uber, one hopes the purveyors of Rust are also open and respond well…
(It's been a while, but IIRC the issues they had were more about not understanding what exacty was available and how to use them, at the time. The project has been going really well since then; Amit has been giving a number of cool talks about it at various Rust user groups, and they recently started their own "This week in", though it's called "Talking Tock" because that's a better name, ha!)
Re: A year of Rust and DNS
#80with erlang you can parse the dns-header like so: ,---- | %% extract dns-header fields from a raw packet. | parse_dns_header(raw_packet) -> | | ID:16, | QR:1, OPCODE:4, AA:1, TC:1, RD:1, RA:1, Z:3, RCODE:4, | QDCOUNT:16, | ANCOUNT:16, | NSCOUNT:16, ARCOUNT:16, | Tail/binary | >> = raw_packet, | | {#dns_header_record { | id = ID, | qr = QR, opcode = OPCODE, aa = AA, tc = TC, rd = RD, ra = RA, z = Z, rcode = RCODE, | q…
FWIW you can get code-formatting by prefixing lines with a 4-space indent: parse_dns_header(raw_packet) -> > = raw_packet, Also for readers, this does depend on customisable (per-segment/field) defaults: `ID:16` is a shorthand for `ID:16/big-unsigned-integer-unit:1` aka "16-bits wide segment parsed as an unsigned integer in big endian"
ah thank you ! that is very good to know.
will it be possible to have some formatting guidelines / examples on the site somewhere ? similar to what we see on reddit ?