Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Although I've been developing web applications for close on 6 years now I still do not know what happens when a request reaches the server. I am looking for book that works through what happens when a request reaches the server and how the server knows which code to call. I'm assuming that there is a old book from the early eighties/nineties, when the internet was still relatively new to developers, that would be able to explain this; but my google-fu is failing me in my search for this book.

Whether the book deals with IIS or Apache, I think it would be quite interesting to read and may be useful to know so any recommendations are welcome. Thank you

share|improve this question

closed as off-topic by MichaelT, gnat, jwenting, Bart van Ingen Schenau, amon May 7 at 10:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – MichaelT, gnat, jwenting, Bart van Ingen Schenau, amon
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Is not RFC2616 sufficiently comprehensive? –  SK-logic Mar 23 '11 at 14:33
    
I have never heard of that before, but I have now thanks ;) –  StevenMcD Mar 23 '11 at 14:44

4 Answers 4

up vote 5 down vote accepted

You should start by reading the following documents: RFC 2616 (HTTP/1.1), RFC 793 (TCP), RFC 791 (IP), and RFC 826 (ARP). All of the above RFCs are available via the w3.org web site. Douglas Comer's book is also a good reference.

share|improve this answer
2  
thanks, will look into these. Want to give the question a little more time for accepting an answer. +1 though –  StevenMcD Mar 23 '11 at 14:43
    
The RFCs listed above detail the procotols that are used to communicate with a web server. HTML is enveloped inside of HTTP request/response pairs. HTTP is enveloped inside of TCP packets in order guarantee end-to-end delivery. TCP packets are routed through a network inside of IP packets. ARP is used to resolve IP to machine address translations. The subnet mask is used to determine which machine to ARP. If the source and destination addresses match after the subnet mask is xored with the IP address, It means that we are on the same logical data link, and we can use ARP to resolve the –  bit-twiddler Mar 23 '11 at 15:00
    
(cont) machine's physical machine address. However, if the source and destination addresses do not match, we are on separate data links and have to go through a router; therefore, we use ARP to resolve the router's physical link address. The term "stack" in the web app development world comes from the networking world. –  bit-twiddler Mar 23 '11 at 15:00

I see that the full text of the O'Reilley book Web Client Programming in Perl is online, now that the book is out of print.

Chapter 3 of that book is what really taught me, in as simple language as possible, what's going on under the covers of an HTTP request. Not a word of perl on that page, so don't worry about that, and it starts high-level and drills down to concepts like caching and authentication. It's very nicely done.

share|improve this answer

Write a web server. A basic one is a fairly simple project that shouldnt take you more than a couple weeks doing it as a hobby project. You will learn a lot about whats going on under the hood, plus build some understanding of basic socket programming.

share|improve this answer

I don't know of any book, but beyond basic sockets, you could further do some research on the HTTP protocol, then if you're ASP.NET inclined I recommend touching on ISAPI then finding a good, deep read on the ASP.NET pipeline.

Your basic web server uses a socket to listen on port 80 (or whatever) and parse HTTP verbs from the stream of text received on that port, then write an appropriate response to that port.

share|improve this answer
    
BSD Sockets is just an API that wraps the TCP/IP protocol stack. In order to understand what sockets does, one needs to learn the TCP/IP protocol stack. The TCP/IP protocol stack is defined in a set of documents known as RFCs. –  bit-twiddler Mar 23 '11 at 15:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.