No matter which role you wanna work in, frontend or backend developer, the concept of Internet is always fundamental and it’s something you cannot miss. So, let’s start answering these questions.
In this page, I’m not gonna answer these questions in deep as each question indeed can lead to other questions. If I have time, I’ll definitely write another page for individual question in detail.
What is Internet?
Before understanding how the internet works, let’s deal with the concept of Internet first.
Internet is the network of hundreds and thousands of networks.
Network is the interconnections of computing devices, including routers and switches. They’re interconnected by wires or wireless.
How does the Internet work?
The whole internet works by sending data packets to transmit information using different kinds of protocols (e.g. TCP, UDP, etc).
What is Protocol?
Protocol is a set of rules that define:
- formats of data packets,
- order of messages sent and receive among the devices,
- actions taken on message transmission
There are many types of network protocols. The most common protocols are TCP, UDP, HTTP, DNS, FTP, SMTP, etc.
What is HTTP?
HTTP(Hypertext Transfer Protocol) is an application protocol. By default, the port number of HTTP server is 80.
A web page consists of the base HTML file with many objects (e.g. images, audio files, etc). Each object is addressable by a URL.
HTTP follows the client/server model. The client(browser) send requests to the server for web content and the web server send objects back to the client in response to the requests.
Browsers and how they work?
A browser is exactly the client that I’ve covered in the previous HTTP section. It’s a tool that takes you anywhere on the internet, allowing you to see anything (e.g. text, images, video) around the globe.
In short, it sends requests to the web server and retrieves information from the responses and shows it on your desktop or your phone.
Actually, a browser uses TCP to establish the connection for sending requests and receiving responses. Here is the detailed process of how browser works:
- browser initiates a TCP connection through port 80 of the web server
- web server accepts the TCP connection from the browser
- browser sends requests and web server sends back the response to exchange HTTP messages
- TCP connection is closed
What is Domain Name?
A Domain Name is the name of a website. As it’s hard for human to remember the IP addresses (strings of long numbers), that’s why the domain names were developed and every domain name is linked to one or multiple IP addresses. This helps us to find and get to servers on the Internet easily.
Analogy: It’s like people’s name linking to their telephone numbers
DNS and how it works?
DNS(Domain Name System) is an application-layer protocol that provides a name-address mapping service. It’s a rule for computer devices(host, routers, name servers) to communicate and resolve IP addresses from the domain names.
DNS is distributed database implemented in hierarchy of many name servers. DNS servers can be classified into Root name servers, Top-level domain (TLD) servers and Authoritative servers.
Let’s take www.google.com as an example. Here is how DNS works:
- client queries a root name server to ask for where the com DNS server (TLD server) is
- client queries the com DNS server to get the google.com DNS server (authoritative server)
- client queries the google.com DNS serve to obtain the IP address of www.google.com
What is Hosting?
Web Hosting is a service for everyone including individuals and organisation to put a web page onto a web server for others to access. It is like a house where your website stays and all websites on the internet, need web hosting.
Web Hosting Service Providers are companies that provide the servers for you to host a website. Some are free and some are charged. For static websites, there are hundreds and thousands of options for web hosting. For example, S3 from AWS (Amazon Web Services), Github Pages, Netlify. Personally, I love using Netlify for my personal website as it can be linked with repo hosting websites like Github and Gitlab and my website can be updated automatically every time I push a commit.
To know more about my backend learning path, check out my journey here: