During my reading, I found one of the best (as in readable) books was Doug Comer's "Internetworking With TCP/IP vol. 1" - an excellent theoretical reference.  However, skip the other volumes from Doug Comer (I think there are 3 volumes).
For writing practical applications, Richard Stevens' "Unix Network Programming"  is usually recommended, I didn't find it an easy read though. Perhaps others can pitch in.
For both the books suggested, getting a used old copy for cheap is a good idea because the core information was already there even in the first editions.
Finally, read up on PlanetLab . Its a fascinating project - a small scale internet built on top of a subset of nodes contributed by universities and research organizations across the globe - that people can contribute to, and if you actually manage to get into the developer's list and make a contribution, you can quite honestly claim to have pushed the state of the art forward.
And lastly, be prepared to spend a good amount of time - I don't think it will be a fast or easy process. For whatever reason, I have found that the community around this work to be a little small, especially in comparison to how much it permeates pretty much everyone's life.
A great book. Highly recommended.
Of course, one of the classics is this one:
Internetworking with TCP/IP vol. 1.
If you are considering Linux, then the implementation is discussed here. I would not suggest this, unless you are actually hacking. In that case, this is okay:
Fresh book recommendations delivered straight to your inbox every Thursday.