by eloff · 12y ago · 0 comments
I don't think I could implement it in under 4000 sloc, and I'd guess it'd be over two months worth of work for just a minimal TCP stack that could interoperate with the internet at large.
TCP is complex because it solves a mindbogglingly complex problem. That it is as small as it actually is makes it one of the more elegant things ever to come out of computer networking.
I would argue that this very thing makes TCP inelegant; congestion-control should really have been its own layer between IP and TCP, instead of being something that every protocol that's not UDP has to carefully reimplement.
As a workaround, I wrote a custom tool that avoids sending more than one TCP segment at a time:
https://github.com/dlitz/dlink-firmware-uploader/blob/581b64...