4 ms·
Implementing TCP in Rust
- bbss 3y agoICYMI but https://datatracker.ietf.org/doc/html/rfc9293 https://datatracker.ietf.org/doc/html/rfc9293 may be a better place to start in 2023.
- kccqzy 3y agoI only read the README so far but I'm not sure if the author realizes that the RFC793 being repeatedly referred to has been obsoleted by RFC9293. I encourage people needing a reference to TCP to start with RFC9293 instead. This is the updated specification that brings together changes from a number of previous RFCs.
- QuanSai 3y ago[flagged]
- koverstreet 3y agoThere was nothing backhanded about that, that was useful relevant information.
- seanw444 3y agoWhile I agree with you in most other cases I've seen (this happens a lot), parent wasn't necessarily ragging on the dev, just adding a useful note. I found it helpful, as I wasn't aware there was an updated specification.
- wredue 3y agoIs it a case of one just being monstrously easier? Like how everyone makes an HTTP1.1 server but never a higher version.
- deaddodo 3y agoHTTP1.1 was the standard for decades (1990-2015, technically still extant). People usually just "stop there" because it's what the majority of browsers and devices were targeted to support and does "just enough" of what they're seeking. Of course you would make an HTTP/2 server, if you were looking for active push support and the like.
- AdamJacobMuller 3y agoAlso, HTTP/1 is amazingly simple compared to HTTP/2. I can write you an HTTP/1 server in bash in an hour or two.
- ksherlock 3y ago9293 takes 953 and incorporates the errata (20 of them) and 6 other RFCS, so in that sense it's easier since you don't have to check elsewhere for bugs or updates. 953 is 85 pages. 9293 is also 85 pages (with 13 pages of appendix), although they switched to a proportional font for the PDF so there's probably more text.
- arccy 3y agono, HTTP/1.1 was RFC 2068, then RFC 2616, now most recently RFC 7231. it's still the same protocol, but with updates and clarifications from over the years.
- speed_spread 3y agoShould my shit ever make it to HN, I would be happy for it to get scrutinized by people smarter than me, even for basic stuff. The HN crowd is mostly polite in its criticisms and acknowledges good work. That is, unless you write something like a Rust web framework that's full in unsafes and claim it to be the fastest...
- mcbrit 3y agoThis was going to be a statement in support, read the classics / rfc793. Priors being you should definitely implement http from the RFC a la 199x, and: I assumed rfc793 was shorter than 9293; false. 9293 is significantly shorter. 9293 also has a lot of implementation notes from the past.. many years of folks that have done this. So yeah, 9293. Seems like a solid rec.
- anotherhue 3y agoAh yes, the classics. The Illiad, the Odyssey and of course RFC793.
- Sirizarry 3y agoYou seem like the type to take criticisms well.
- belter 3y agoIt's based on the videos from Jon Gjengset from 4 years ago and he used RFC793. RFC9293 has a publish date of August 2022
- amelius 3y agoCan you please add proper error messages, because this is the main problem I have with all networking related issues: I don't get any error messages, just a dead connection.
- exxos 3y agoThis is a great initiative to help people understand how TCP works. But an "implementing TCP in <an easy, readable language such as Python>" would be so much better IMHO. Rust is good, but not as readable pseudo-code to understand a concept.
- atoav 3y agoAs someone who programs both Python and Rust I found the Rust version very clear. And I would not use Python for this kind of programming.
- bobobar339 3y agoThanks for sharing. I look forward to going through this content.
- tomca32 3y agoOh nice. Just today I started watching Jon Gjengset's video implementing TCP in Rust https://youtu.be/bzja9fQWzdA?si=Gh4s8FHpk9vBVEwZ https://youtu.be/bzja9fQWzdA?si=Gh4s8FHpk9vBVEwZ
- tempusr 3y agoThere needs to be a statue built for this man. My understanding of Rust and low level computing has become oceanic due this man's hours of videos and books.
- Klasiaster 3y agoThere is also the Rust TCP/IP stack https://github.com/smoltcp-rs/smoltcp https://github.com/smoltcp-rs/smoltcp which is not mentioned as reference (and it's probably more useful to have a look there than querying ChatGPT).
- sarupbanskota 3y agoRelated: Build your own Redis — https://app.codecrafters.io/courses/redis/overview https://app.codecrafters.io/courses/redis/overview
- joshka 3y agoAlso https://tokio.rs/tokio/tutorial https://tokio.rs/tokio/tutorial has something similar
- up2isomorphism 3y agoAt certain point, I tends to avoid this kind of tutorial because if you understand both topic well there is no reason why you need to learn implementing X in Y.
- whereistejas 3y agoThis is something similar: https://implement-dns.wizardzines.com/ https://implement-dns.wizardzines.com/