3 ms·
This is something I'd love to do. Do you have any resources for learning the background info? Everywhere I've looked just plugs in some TCP/socket library, but
by hazz99 8y ago
This is something I'd love to do. Do you have any resources for learning the background info? Everywhere I've looked just plugs in some TCP/socket library, but I think the real learning would come from _making_ the library itself.
- yorwba 8y agoYou mean instead of using the TCP stack included in the kernel, you want to write your own? You could use raw sockets (described in man 7 raw) for that (but note that they require elevated privilege). Use socket(PF_INET, SOCK_RAW, IPPROTO_TCP) to get a raw TCP socket, then send and receive TCP packets as raw bytes over the socket. I found an example demonstrating the approach here: http://www.tenouk.com/Module43a.html http://www.tenouk.com/Module43a.html
- ctnb 8y agoHere's one of three parts on coding your own TCP/IP stack. I haven't gotten around to it, but it looks solid. http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/ http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-ar...