1. The Internet Explained
Did you ever wonder what happens when you enter https://example.com
in your browser? This starts a series of actions between your browser (a client) and a server. This kind of architecture is called client server model. Here is a simplified explanation:
-
When you type example.com
into your web browser and hit enter...
-
...the browser figures out the server that corresponds to example.com
and makes an HTTP (or HTTPS) request to the server.
-
The server is a computer that runs a web server application. This application is waiting for HTTP(S) requests from clients. The server stores a collection of web pages as HTML files, so called HTML documents.
-
Once a request is received, the web server application sends an HTTP(S) response back to the client. This response contains the code of the HTML document.
-
As soon as the HTTP(S) response arrives in the browser, the HTML code is interpreted and displayed as a website. (Sometimes the response might also be streamed in smaller chunks so that the browser starts working with a partial response already).
How Do Browsers Find a Server and Connect to It?
Between step 2. and 3. a few more things happen. The browser only knows the hostname example.com
and has to find out the IP address of the corresponding server. If a web page with that hostname has never been visited with this browser, it has to request the IP address from a Domain Name System (DNS) server. Otherwise, the IP address might be already stored in the browser and can be used to reach the server.
Once your browser knows the IP address of the server, it establishes a connection to it. This connection can be compared to dialing a phone number and establishing an ongoing call to talk to someone. For this connection a protocol called HTTP (Hypertext Transfer Protocol) is used. This protocol is like the language that both the client and the server speak to communicate with each other.