What happens when you open a web page in your browser? On the surface, your browser (the client) loads a page from a remote system (the server) and displays its content. What exactly is displayed, and how it is presented to us, is defined by the HTML, CSS and JavaScript code which the server sends back to our client.

Web browser                     Web server
┌─────────┐                     ┌─────────┐
│         │   requests content  │         │
│ shows   │-------------------->│ provides│
│ page    │                     │ page    │
│ content │                     │ content │
│         │<--------------------│         │
└─────────┘    responds with    └─────────┘
                  content

This is the content of the web page, and this is what the end user is interested in in the first place. But I would like to zoom in and not talk about the content of a web page yet. Instead, I would like to focus on the processes which take place “under the hood” when a browser opens a web page - the stuff that happens before we even see the first content appear on the screen.

How does the browser actually ask the server for its content? How does the server actually respond with the content?

How do browser and server find each other, and how do they exchange information and data?

This is what this chapter is about.