DEV Community

Cover image for How the Internet Actually Works: From Your Device to the Server
SATYA SOOTAR
SATYA SOOTAR

Posted on

How the Internet Actually Works: From Your Device to the Server

Before we start discussing about the Networking devices, let's discuss about what a NETWORK is. A computer network is a group of connected devices that communicate with each other to share data and resources. It enables efficient communication and supports services like email, file sharing, and internet access.

In layman’s language, we can say:

Computers + Wires/Wireless + Protocol = Network

Protocol is a set of rules for formatting and processing data

Now, if we connect multiple networks togather then we call it THE INTERNET. The Internet is a global system of interconnected computer networks that uses the Internet Protocol Suite (TCP/IP) to communicate between the networks and devices.

In layman’s language, we can say:

Network of Networks = Internet

The question is how you are using the internet and how it is reaching your home? To understand that we have to understand two fundamental concepts of how the Internet works - packets and protocols

Packets

Packets are the small segments of a larger message that will be sent through the Internet. Each packets contains - Data and Metadata(information about the data)

Data - It is the actual message/Information that is being sent through the Internet.

Headers- It contains the characteristics of the data.

When the data is sent over the Internet, it is broken into smaller packets, which are converted to bits. These bits are routed by various networking devices such as routers and switches.

When all the packets are arrived to the destination. The receiving device reassembles the packets in order to view the data.

The packet travels very fast.

Protocols

In networking, the protocol is a standardised way of doing certain actions and formatting data so that two or more devices are able to communicate with and understand each other.

Because all Internet-connected computers and other devices can interpret and understand these protocols, the Internet works no matter who or what connects to it.

Physical infrastructure that makes the internet work.

There are a lot of different kind of infrastructure that makes the internet possible. Some of them are:-

Hub: A hub is a networking device that connects multiple computers in a Local Area Network. The hub has multiple ports, and it cannot filter the data so when it receives any data, it broadcasts the data through every port to each machine connected to it.

Diagram Hub connection

The receiver machine will receive the data, and others will discard it. By doing so, it consumes a lot of bandwidth.

Bridge: A bridge is a networking device that connects multiple Local Area Networks (LAN) together. The mechanism of connecting LANS is called bridging. It can understand and learn MAC addresses. It generally divides the networks into smaller sections so that the bandwidth can be managed optimally. It usually has two ports.

Diagram of Bridge connection

Switch: A switch is a networking device that divides the network into multiple segments called subnets. It is also responsible for filtering and forwarding the packets. You can also say it is the combination of both the HUB and SWITCH. It uses MAC addresses to forward data.

Diagram of Switch connection

Router: A router is a networking device that connects two or more IP networks or subnetworks. It acts as a doorway between your network and the Internet. It enables multiple devices, such as computers, smartphones and tablets to share a single internet connection.

Diagram Router connections

Modem: A model is generally a translator that translates digital signals from your computer into analogue signals for transmission over physical lines and also converts the incoming analogue signals to digital signals so that the device can understand.

Firewall: A firewall is a network security device that regulates the incoming and outgoing network traffic based on security rules. It protects your network from unauthorised access and harmful activities.

Loadbalancer: A loadbalancer is a networking device that distributes and balances the incoming traffic among the server to provide high availability, efficient utilization of servers and high performance.

Diagram of how internet works

Summary

When you send a request from your device, it does not go directly to the internet or the server.

First, the request usually goes to a switch inside your local network. The switch’s job is simple. It forwards data to the correct device within the same network, such as your router, based on MAC addresses.

Next, the request reaches the router. The router is responsible for moving data between different networks. It takes your local request and decides where it should go next, typically toward your internet service provider and then the wider internet.

Before leaving your device, the data is already in digital form. It get converted to analogue signal by a “modem”.

After routing, the request may pass through a firewall. The firewall inspects the traffic and decides whether it is allowed based on security rules. If the request is permitted, it continues onward.

Once on the internet, the request travels through multiple intermediate routers until it reaches the destination network. Before reaching the actual server, it often goes through a load balancer. The load balancer’s role is to decide which server should handle the request. It distributes incoming traffic across multiple servers to improve performance, reliability, and availability.

Finally, the selected server processes the request and sends a response back through the same path in reverse.

Top comments (0)