Table of contents
Have you wondered how internet works, what if I say the web pages that is displayed on your screen, it was electric signals/voltages or ray of light before reaching your computer, well it sounds amazing and fascinating, well lets find out how internet works in this blog you will get the gist about working of internet.
Understanding Networks before Internet.
Before diving deep into working of internet lets understand what are networks, well networks are interconnected devices it might be computer, tablets, TV or mobile phones it might be within the one roof or it might in different places. Based on this there are three 3 types of networks
Types of Networks
Local Area Of Network (LAN) - A network which covers very small geographical area it might be in one roof or one premises.
Wide Area Of Network (WAN) - A network that covers a large geographic area, often spanning cities, countries, or even continents. The internet is the most prominent example of a WAN.
Metropolitan Area Network (MAN) - This network is combination or multiple LAN networks connected together, it might range from city to city, continents to continents
What is Internet .?
Now we understood what is network, the simple definition of internet is connection or collection of networks well it looks simple with the definition but internet is very complex architecture consisting many components.
By looking at the above image we can deduce that Internet is a connection and collection of networks, within under one roof they are connected with the switches when they are very far from each other they are connected with help of multiple routers and Internet Service Providers, these ISP’s lay the infrastructure for connectivity of multiple networks.
Jargons of Internet
IP Address: It is a unique number which identifying each device in the network Ex: 192.168.1.125
Domain Name: A domain name is a unique identifier name which is mapped to IP Address. Ex: 8.8.8.8 → Google.com
Router: A device that directs data packets between networks.
Switch: A device that connects devices within the same local network.
ISP (Internet Service Provider): Organizations that provide internet access to the users are called ISP’s
Packet: Packet is the smallest part in the internet
How does Internet work.?
Well we have reached how internet works, as I said internet is a connection of multiple networks, internally there are lot of protocols i.e set of guidelines.
Lets understand this with an example.
When you type google.com in your browser it first checks in the local browser cache if the domain name and IP address is matching if not present takes that requests to the primary DNS server, if that server does not have the particular IP address it will recursively call the other DNS servers once the IP address found particular result is sent back to the client.
here whenever the requested is sent to google it returns with various types of files it might be images, text files, html, css, javascript and many more. All these are converted from electric signals to the graphical user interface.
Root Server:
The root DNS does not know IP address of the specific websites but it knows the Top-Level Domain(TLD) names of server to contact for a particular domain extension like (.com, .ai, .org, .dev) etc.
Ex: If the query is devsumukha.vercel.app/ it first looks for .app in TLD.
TLD Name Server:
The TLD server is responsible for managing domains under a specific extension.
For
example.com
, the.com
TLD server provides the address of the authoritative name server forexample.com
.
Authoritative Name Server:
The authoritative name server holds actual DNS records
It returns the IP address for devsumukha.vercel.app/
Result Back to Client
- After getting the IP address the information is sent to the client’s browser or wherever the request has been fetched from it might be from browser or by the operating system etc.
Protocols
Before you start driving the vehicle you would learn the rules for driving vehicle, like learning about signals, lane discipline etc. similarly while transmitting data over internet or network there are some rules and regulations that are followed like HTTP, TCP/IP, UDP and FTP well it looks overwhelming lets look these things in high level. In context to networking protocol describes what are the message formats and how it should be transmitted.
TCP/IP - Transmission Control/Internet Protocol
While communicating in the network, the network has variety of devices it might be mobile, computer, laptops, tablets, smart watches and what not, in order to standardize the communication in the network TCP/IP or other protocols are used.
Layers in the TCP/IP protocol
Application Layer:
Purpose: Provides services for user applications and enables data exchange between different software application.
It converts the data into a format that can be sent over the network.
Common Protocols: HTTP/HTTPS, SMTP, FTP.
Transport Layer:
Purpose: Ensure reliable data transfer between devices and manages connections.
Breaks large messages into smaller segments.
Error detection and correction ensures data integrity during transmission.
Manages multiple connections simultaneously.
Common Protocol: TCP, UDP
Note: In transport layer there are many protocols just like in application layer.
Internet Layer / Network Layer:
Purpose: Establishes connection between multiple networks.
Encapsulates transport-layer data into packets
Assigns source and destination IP address
Determines the best path for data to travel through networks
Common Protocol: IP, ICMP, ARP
Network Access Layer:
Purpose: Converts digital data into signals (electrical, optical or radio) for transmission over the network medium.
Breaks down the data packets into smaller chunks called frames.
If there any errors it detects and rectifies the frames through algorithms.
Protocols: Ethernet(IEEE 802.3), WIFI (IEEE 802.11).
HTTP
HTTP stands for Hypertext Transfer Protocol well lets break down each words for better understanding.
Hypertext: It refers to text that contains links to other text or other resources just like a link, by clicking on that navigated to other web page or resources.
Transfer: Transfer describes the process of sending and receiving data between a client (e.g., browser) and a server.
Protocol: Again protocol are the set of guidelines that must be followed by the users.
Now lets see what exactly it means, HTTP is a protocol used for communication on the World Wide Web. It governs how the client side should establish a connection to the servers and exchange data like web pages, images, videos, or any other resources.
Characteristics:
Request-Response Model: The client sends a request to a server, and the server responds with the requested data or an error.
Stateless: HTTP does not retain any information about previous requests or interactions. Each request is treated independently.
- Example: A server doesn't remember that you previously visited a page unless cookies or session tracking are used.
Plain Text Communication: Requests and responses are human-readable and sent as plain text.
Protocol Layer: HTTP operates on application layer of the TCP/IP model
Lets combine HTTP and TCP model with a real life analogy.
Lets understand with ordering PIZZA🍕
You (Client): You place an order for a pizza, specifying exactly what you want (e.g., size, toppings, crust type).
Pizza Shop (Server): The pizza shop prepares the pizza based on your request and delivers it to you.
Key Aspects of HTTP:
Request:
You communicate your order to the pizza shop (e.g., “I want a large pepperoni pizza”).
This is like sending an HTTP request to the server.
Response:
The pizza shop confirms your order and delivers the pizza to your door.
This is like receiving an HTTP response from the server.
Stateless:
- Once your pizza order is completed and delivered, the pizza shop doesn’t remember your order anymore unless you create an account (similar to using cookies or sessions to maintain state).
TCP/IP: The Delivery System
While HTTP focuses on the "what" (pizza and order details), TCP/IP ensures reliable delivery of the pizza from the shop to your home.
Breaking It Down:
TCP (Reliable Transport):
Pizza in Pieces:
- If the pizza is too large, the delivery person might cut it into smaller boxes (like dividing data into TCP segments).
Order Confirmation:
You receive the pizza and confirm everything is correct (like the ACK packets in TCP).
If something is missing, you notify the shop, and they resend it.
IP (Addressing and Routing):
The pizza shop uses your address to find where to deliver the pizza (like using the IP address for routing data).
It doesn’t care about what’s in the pizza box; it just ensures it reaches the right house.
Network Layers (Physical Delivery):
- The delivery vehicle, roads, and traffic lights ensure the delivery happens physically, similar to the cables, routers, and switches in the network.
Well this all about basics on working of internet, in the next blog we will cover each protocols in a great detail.
Explore:
Versions of HTTP
3 Way Handshake
Does device IP address change.?