As has been said already,
Computer Networks by Tanenbaum, and TCP/IP Illustrated by W. Richard Stevens will cover the vast majority of what you need to know about the lower levels of the stack. For most developers, TCP/IP Illustrated is probably a better pick; Computer Networks is an excellent resource, but focuses more on telecommunications theory which probably isn't directly applicable to most web development roles.
One thing that hasn't been mentioned thus far is DNS. I would argue that anyone developing for the web needs to understand how DNS functions; DNS & BIND is the seminal work here.
In terms of HTTP, SMTP and other upper layer protocols, I'll leave that to people more experienced than I.