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.
I found an example demonstrating the approach here: http://www.tenouk.com/Module43a.html
http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-ar...