What happens when you type https://www.google.com in your browser and press Enter?
Ever wondered what happens when you type anything on your browser and press Enter? How did the news get to you after typing in the URL? How did the images on twitter show up on my screen?
Well, let’s find out what happens between the scenes. Topics covered include:
1. Router/ISP
2. Internet
3. DNS
4. TCP/IP
5. HTTPS/SSL
6. FIREWALL
7. LOAD BALANCING
8. WEB SERVER
9. APPLICATION SERVER
10. DATABASE
1. ROUTER / ISP
The request for https://www.google.com is a request for a website. The collection of websites on the internet is called the World Wide Web which is hosted on the internet.
When you open a browser on a machine connected to the Wi-Fi, the first place your request lands is the router, which is connected to the internet.
If you are connected to an Internet Service Provider (eg Safaricom, Airtel or Faiba, if you are in the East African region), then they will be the first to receive your request.
2. INTERNET
The internet is an increasingly important part of everyday life for people around the world. It is a global network of billions of computers and other electronic devices. Using the internet, it’s possible to access almost any information, communicate with anyone else in the world and do so much more.
3. DNS
DNS – domain name system. Uses a database that stores information associated with domain names in the internet. The ISP assigns a unique IP addresses to all connected devices. For instance the IP address for https://www.google.com is actually 8.8.8.8. This number is translated to us by Domain Name System servers. Humans generally remember words better than numbers, however computers work better with numbers.
In short DNS is the internet version of yellow pages. IP address is similar to a street address for computers to communicate to each other over the internet. DNS servers exist in zones, when an address isn’t immediately found, the request is forwarded upstream until the relevant authority is reached.
DNS lookup method:
a) Start: lookup starts when you try to access another computer on the internet eg google.com. You are trying to access google’s servers.
b) DNS cache: first stop of your DNS request is the local cache. As you access different computers, their IP addresses are stored in a local repository which are easily and quickly available.
c) DNS server. If the IP address being requested is not in the cache, DNS will check with a recursive DNS server. This server is provided by your Internet Service Provider (ISP).
d) Recursive DNS server cache: The recursive DNS server has its own cache where it first looks for the requested IP address. If the IP address is present, it will return a value, if not, it will ask other DNS servers systematically search for your IP address.
e) TLC servers: These servers do not have IP addresses but finds .com addresses and forwards the requests in the right direction.
f) TLC name servers: have the location of the authoritative name server for the requested site. Th IP address is returned and stored in the local DNS cache of the recursive DNS.
g) Local DNS gets the IP address and connects and gets all the desired content.
4. TCP/IP
The Transfer Control Protocol is a suite of protocols that provides end to end communications over the internet. The data is broken down into packets, addressed, transmitted, routed and received at the desired IP destinations.
Some of the common protocols are HTTP, HTTPS and File Transfer Protocol.
TCP/IP protocols are stateless. They are different from the OSI model, which is inspired by TCP/IP. It is also non-proprietary meaning it is not owned by a particular company, is easily modified, scalable, rout-able and compatible with most operating systems.
TCP has four layers:
- Application layer. Protocols used here are HTTP, HTTPS, FTP and the payload is the actual application data.
- Transport layer: Protocols used here are TCP and UDP. This layer determines end to end communications across the network.
- Network layer: Internet layer. Deals with the broken down packets and connects independent networks. The packets are transported here as well.
- Physical Layer – This is the network interface layer. This is where the network connects to the physical machine. An example is an ethernet cable or a Network Interface Card.
Recommended by LinkedIn
5. HTTPS/SSL
HTTP protocol is the language that mediates between client’s requests and server responses. It stands for HyperText Transfer Protocol. This protocol defines different types of requests and responses served to clients ans servers over a network. It is the main way to transfer data back and forth from the server and the client. Some type of requests are GET, POST and PUT.
The biggest disadvantage of HTTP is that the data can be intercepted at any point. The solution for this flaw is the HTTPS protocol where S stands for Secure Socket Shell(SSL). This protocol encrypts data.
6. FIREWALL
Once information is transferred, it is still necessary to protect the computer from received information both in the server and client. This is where the firewall comes in.
Firewall is defined as network security system monitoring and controlling incoming and outgoing network traffic based on predetermined security rules. There are 2 types of firewall, network based and host based. The packet filter filters packets between connected computers using an Access Control Lists.
Filtering is based on source and destination, IP address, protocol types and source of packets. There is tracking on 3 fronts: Connection tracking (on the transport layer of the OSI/TCP model), application layer tracking (on FTP/CNS/HTTP) and finally endpoint specific tracking.
7. LOAD BALANCER
Load balancing is done to effectively distribute incoming network traffic across a group of back end servers. Why is load balancing done? Modern high-traffic websites serve millions of concurrent requests from clients and are expected to return the correct media fast and reliably.
For instance, if a server goes down the balancer redirects traffic to the remaining online servers. It effectively distributes client requests across multiple servers and ensures high availability and reliability by sending requests only to servers that are online.
Balancer algorithms include: Round Robin, Leas Connections, Least Time, Hash, IP Hash, Random with Two choices.
The benefits of using a load balancer between your clients and servers are reduced downtime, scalability, redundancy, flexibility and increased efficiency.
8. WEB SERVER
A web server is a hardware or software using HTTP and other protocols to serve client requests made over the world wide web. Most servers display website content through storing, processing and delivering web pages.
Uses of the web server include: sending and receiving emails, downloading request for File Transfer Protocol and building and publishing web pages.
The content served by a web server can either be static or dynamic content. Static web server consists of HTTP software and a computer. Dynamic web server consists of a web server and other software such as application server and database.
Common web server software on the market are Apache HTTP Server and Nginx.
Best security practices is the use of a reverse proxy, designed to hide an internal server and act as an intermediary for traffic. Another security practice for your server is access restriction through SSH (secure socket shell).
9. APPLICATION SERVER
This type of server is designed to install, operate and host applications. It is used to share application capabilities in an efficient and organized manner. It resides on the server side and provides business logic behind any application.
The application server is used in a web-based application with a 3 tier architecture. Tier 1 is the GUI interface that resides at the client end eg web browser (frontend IP Services). Tier 2 consists of the Application Server (Application Services). Tier 3 is the backend Servers eg databases (Data Backup Services).
How the application server works in a 3 tier architecture: the client sends HTTP Request to tier 1 where tier 1 invokes the relevant component from the application server in tier 2. Tier 2 invokes the relevant query from the database in tier 3. Tier 3 then returns the result to tier2, tier 2 returns response to tier 1 which then returns a HTTP response to the client request.
Major uses of application servers is to process the requests by connecting to the database and returning the information back to web servers.
The application server is a:
a) mechanism for reducing the size and complexity of the client programs
b) cache and control for the data flow (better performance)
c) mechanism for implementing security for data as well as end-user traffic.
There are many different application servers in the market and to choose one, you have to tailor to your web app’s specific needs. Prioritize: performance, administration, development, support, compliance, scalability, reliability and cost.
10. DATABASE
Simply put, a database is a systematic collection of data. Databases make data management easy. Types of databases include Distributed databases, Relational databases, Object-oriented databases, NoSQL databases and Graph databases.
Databases have 5 components:
1. Hardware – computers, I/O devices, storage devices etc. Hardware is the interface between computers and the real world.
2. Software – programs used to manage and control the overall database including the database software itself, the operating system and network software used to share data among users.
3. Data – generally comprises facts, observations, perceptions, numbers, characters, symbols, images etc.
4.Procedure – instructions and rules that help you to use the DBMS (Database Management System). Includes documentation methods.
5. Database Access Language – used to access the data to and from the database, enter new data, update already existing data and retrieving required data from DBMS.