How does the Internet work?

Writers

“We are all now connected by the internet, like neurons in a giant brain.”

- Stephen Hawking

Introduction

The Internet is a part of our daily life, but have you ever thought of how the Internet actually works? Let’s have a look by moving forward step by step ….

You might think most of the internet works through satellites, but essentially, the internet is a group of hardware, all of which connect using cables and satellite signals. The vast majority of the internet is carried by cables and undersea cables for inter-continental transits.

So, bear with us and hang on in this blog as we explain how the internet works as simply as possible.

A Brief History of the Internet

Back in the late 1960's, the Advanced Research Projects Agency (ARPA) put together ARPANET, based on the designs by Computer Scientists. Computers at Stanford and UCLA universities were joined together using a “Packet-Switching” network, which formed the basis of the modern internet.

In the 1970's and 1980's, concepts like inter-network, email and domain name systems, etc. were invented. Finally, Tim Berners-Lee, while writing the code in 1990, came up with the name “World Wide Web”.

What is Switch and Why do we need it?

If you want the computers in the same environment (in the same house, office, etc.) to communicate with each other, we can use a device called switch. We connect all the computers to the switch using cables, mostly made up of copper. Generally, copper wires of type CAT-5 and CAT-6 are used, where CAT stands for category and CAT-6 cables are faster in data transmission than CAT 5 cables. In addition to copper cables, some switches support Fiber Optic cables which are much faster than copper cables in data transmission.

A switch cannot use wireless technology generally, so we mostly use cables to connect to the switch. However if you want devices in the same environment to be connected using wireless technology, you should use Access Point. Access Point uses wireless technology and switches use cables, but both serve the same purpose of making computers communicate with each other in the same environment. This is how a wireless access point looks like.

All computers can communicate with each other because they are in the same network, and we call this network the Local Area Network. A LAN is a computer network that connects computers within a small restricted area such as a residence, campus, or school. We can create a LAN only in a restricted location in terms of area which means that we cannot create a LAN between India and USA.

Let’s take a closer look at the communication of computers, and what does this event actually represent?

The message generated by a computer has a special name, called a packet/frame. Let’s say PC-1 wants to send a message to PC-4. First PC-1 sends the packet, then this packet goes to the switch. The switch looks in the packet for the destination and allows it to go to PC-4. So the packet gets delivered from PC-1 to PC-4 and we say that PC-1 and PC-4 can communicate with each other.

If a computer can send a message to another computer, this means they are on the same network and they can communicate with each other.

This is how an actual switch with a number of ports looks like. The number of ports varies from one device to another device. Some switches have 10 ports and some have more than 20. In general the higher the number of ports, the higher the price. These ports are called LAN ports and this makes sense because we create LAN's by using switch devices. We have LAN ports in the back of the computer and side of laptops.

What is Router?

If we have a switch, computers can only communicate within themselves on the LAN, and not the internet. So how do we connect these computers to the internet? This is where the router comes into play.

The main task of a Router is to enable computers to connect to the internet. Without a router, it’s impossible to connect to the internet. A computer first sends the message (packet) to switch then to the router and then it finally gets to the internet.

We connect the router to the switch by using copper cables and a special cable comes to our house and we connect to the internet by using this cable, which is given by the Internet Service Provider (ISP). We will learn about ISP ahead, but for now, we can say that ISP provides us a cable so we can connect to the internet for a certain paid amount. Always remember that a switch is efficient for us to communicate within the same LAN. There is definitely no need for a router for devices in the same LAN to communicate, either a switch or access point is sufficient for this purpose.

If a computer can send a packet to the internet, this means that this computer can connect to the Internet without any problem. So let’s see how the PC-1 sends packet to the internet; First PC-1 sends the packet to the switch, after that switch which looks in the packet and understands that the packet needs to be sent to the internet and so it allows the packet to go to the router. Now the router looks inside the packet and understands that it needs to go to the internet and so it allows the packet. As a result, it sends the packet to the internet in other words PC-1 and the internet communicate with each other.

What does the internet represent?

Can you visualise the internet in your mind? and what does the internet actually mean ?

Let’s understand what the internet actually stands for, Connecting to the internet can stand for connecting to another computer anywhere in the other world. The structure that connects all LAN's in the world is the internet. It basically can be thought of as a mesh kind of structure having routers. It can be said as a network of networks.

This model you see is a simplified model so that it is easy to understand, this structure in real life is much more complex.

As you can see there are many routers on the internet and there is a special reason for this. Now we can think of a router as a device we used to communicate with another computer of the world or you can say to communicate with computers of different LAN. We can think of the internet as the structure that connects all LAN's all over the world.

The structure that connects all LAN's in the world is the internet. There are millions of routers which are distributed pretty widely everywhere. If a packet comes from a LAN it is passed through routers in its best path based on the algorithms of routers. Multiple routers avoid extra load and find the best route.

But why are there so many routers instead of one router?

Routers on the internet are distributed pretty widely in an organised manner. However routers aren’t the only devices in this structure, there are tons of other devices and routers in this structure distributed pretty widely. Imagine that there is a single router instead of so many routers in the world, then all the devices in the world would be connected to that router; and if we give the entire load to a single point, we call this problem a single point of failure . If the single router gets damaged then the entire internet of the whole world will shut down, which is very much terrible. Also imagine how long the cable might be if there was a single router in the world. Therefore we can say that there can’t be one router and so this structure of having many routers is the best solution to the problem. By using this structure we minimise the mess and also avoid overloading of the router. This also solves the problem of a single point of failure of the router.

A home router is a combo device that is a mixture of a router and a switch. Most home-routers nowadays have an access point feature, in this way you can use wireless technology as well.

Each router must have a special table called a routing table. This table tells us which route the packet should choose. The router Learns the packet’s destination then it looks at the routing table and learns over which path the packet will be sent and we call this process Forwarding. Routers have special processes inside. These processors create Routing Tables by using special algorithms. We can have two computers communicate with each other in Milliseconds using these special algorithms, thanks to the internet.

Think about your own home, you may have a lot of devices that can connect to the internet like computers, laptops, mobile phones, tablets, etc. Similarly, most people have an internet connection like you. There are many small medium-sized LAN's spread all over the world and they themselves represent the network and the combination of all these networks represents the internet. So the internet can be said to be a network of networks.

Meaning Of Connecting to the Internet from a Computer’s perspective:

Assume that we are at our home and we have only a single computer therefore to be able to connect to the internet what we need is only a home router. We don’t need a switch since we don’t have other devices to connect to each other in the home. Let’s say that you want to watch a video on any of your favourite websites like let’s say udemy.com and as soon as you click on any of your favourite videos your computer generates a request message and sends this message to udemy.com through The home router via the internet. And after udemy.com receives the message of the request sent by you to watch the video, udemy.com sends piece by piece of video you want, and we call this process Streaming. This request which you receive for playing the video is passed by the powerful servers of udemy.com which are distributed around the world and to communicate with the most suitable server for you. So while some of you may communicate with the same server, some of you may communicate with different servers but in the end, you all will get the same content as all the servers have the same information.

This is how internet cables distributed in the world looks, all these underwater cables are fiber optic cables. The main purpose of the image is to show the cables underwater and not the cables on the land.

There are 468 cables underwater at a depth of a hill stretching 5,50,000 miles making it the most important part of the internet. Breaking one of these cables can crash down the internet of a whole continent. Almost 200 problems occur each year with cables and these problems are substantially related to ships and natural disasters. A fun fact is that in 2007 sea pirates stole 11 km of cable connecting Thailand, Vietnam, and Hong Kong. This is how an underwater fiber optic cable looks like

Wide Area Network (WAN)

In simple terms, WAN is a combination of different LANs. By WAN we can ensure that LANs located in different parts of the world communicate in such a way that they are in the same environment.

Let’s consider we have to create a WAN from two LAN's, LAN1 and LAN2 so that they can work in the same environment. But for communication, we already have the internet. Then why do we need a WAN? Communication over the internet and communication in a special way as WAN are totally different things. If you notice, the internet is huge and public without any owner. Due to this, security problems arise in data transformation. Hence, WAN comes into the picture.

How does the WAN work?

Setting up a WAN is costly and not an easy task. There are various methods of WAN connections like leased lines, circuit switching networks, and packet switching networks, etc. The most popular and widely used method is ‘Setting up a WAN using VPN’.

VPN stands for Virtual Private Network and people often use VPN to access restricted websites to remain anonymous for security. The most important feature of VPN is Tunnelling which is used in WAN connections. VPN tunnelling provides us privacy, anonymity, and security by creating a special network connection over a public network.

Tunnelling technology makes the packet act as if it is going through a physical tunnel. The packet passes through many routers of LANs and the internet in its journey to the destination. But VPN tunnelling is actually set up between two routers of the first and last LANs. This is called a site-to-site VPN. So, the tunnel is not physical as shown in the below picture. Then what actually it is?

Let’s understand the working of VPN tunnelling by considering examples of post letters. There are two types of letters — open letters and enveloped letters. Postmen carry these letters from one location to another. In this process, postmen can read open letters but not enveloped ones. In the similar way, when a packet is sent over the public internet, it can be noticed by anyone. So, in VPN tunnelling when a packet arrives at the router in LAN, this packet will be put into another packet and then it will be sent further. Due to this, security increases. But, a question can come into your mind that a postman can open an envelope and read a letter. Same thing hackers do to the packet due to some vulnerability. Then, encryption comes into the picture. For more security, the original packet is encrypted first and encapsulated in another packet. Finally, the packet is sent to the destination safely through the VPN tunnel. At the destination LAN, the packet is decapsulated and decrypted. In this way, safe data transformation happens in WAN. But there is no such thing as 100% security, because each system has some kind of vulnerability.

The Internet itself is the largest WAN.

Which is more secure: ‘LAN’ or ‘WAN’?

LAN communicates by switches without public internet while WAN communicates by routers and VPN through the public internet. Then, which one is more secure? The answer is so simple. In LAN communication, a packet never passes over the internet, instead it moves through its own cables. On the other hand, even if a packet is protected in WAN, the packet still passes over the internet and you know there is no 100% security. Hence, a LAN is more secure than a WAN.

Internet Service Provider (ISP)

We have seen that there are a lot of routers in the heart of the internet. An ISP is a mechanism which controls all these routers enabling us to connect to the internet. It is responsible for the transmission of one packet from one location to another. There are thousands of ISP's in the world. We can define ISP's as companies that enable us to connect to the internet for money as charges. There are three types of ISP's; local ISP, regional ISP, and global ISP.

Local ISP

The first step of connecting to the internet is communicating with a local ISP. These are generally responsible for small area communications. e.g. communication between two different LAN's in the same neighbourhood by a router. Local ISP's can have one or more than one routers, switches, servers and together this is called a point of presence (POP).

Regional ISP

Regional ISPs are ISPs that connect different cities within the same country. Thousands of local ISPs connect to regional ISPs which are larger in size, i.e. different local ISPs communicate through regional ISPs.

Network of a country => Local ISPs + Regional ISPs

Global ISP

If the communication wants to be done in different countries, global ISPs come into play. Regional ISPs connect to global ISPs which are largest in size.

Some local ISPs can connect to global ISPs directly without going to regional ISPs. This provides a faster internet experience to users. There are two ways for this connection

  1. Suitable location

  2. Extra cost to build an infrastructure to direct connection

Why different types of ISPs?

If there are only connections between local ISPs, the communication will become difficult as complexity increases among the routers. So, the hierarchical nature of ISPs.

TCP and IP

Earlier there were a bunch of mini internets, not a single worldwide internet for communication. To solve this problem, scientists invented Transmission Control Protocol (TCP) and Internet Protocol (IP).

TCP is responsible for dividing data into packets at one end of a transmission and reassembling those packets at the other end.

IP, in comparison, is responsible for the formatting and addressing of the data packets being sent. That’s why each host computer on the internet needs an IP address: a unique, numerical label that distinguishes one host from another. Without IP addresses, data packets wouldn’t be able to get to their proper destinations.

When implemented together, TCP/IP is the communication language of the internet, and it was the key to making the internet a truly worldwide network.

Modern TCP/IP networks use four distinct layers in order to transmit data, and that data always moves from one layer to the next.

  • First, there’s the application layer, which is responsible for interfacing with computer applications such as web browsers and email clients.

  • Second, there’s the transport layer. This layer is where the Transmission Control Protocol (TCP) goes to work dividing data into packets (and, on the receiving end, it reassembles that data).

  • Third, we have the internet layer, where the Internet Protocol (IP) assigns address information and determines the route the data will take.

  • Finally, we have the network layer, wherein physical hardware actually carries the data via wire, fiber, radio, etc.

Let’s see the data transmission through these layers while sending and receiving data.

How does communication between website and user occur?

ISP provides a service to broadband i.e. routers. They get IP addresses which are public. Further routers provide internet service to several wired and wireless devices. When we search for something on a browser e.g. wlug.com, here we search for a domain name which is understandable and connected to a certain IP. Domain Name System (DNS) converts this domain name into an IP address. An IP address is generally a pair of digits which gives some information. Let’s consider an IPv4 address which contains four pairs of digits separated by dots, e.g. 17.172.224.47 Here, the first pair tells the country of IP, second tells the state, third tells the ISP and last pair tells about device used.

Then, a request is created in the form of a packet and it is sent to the destination server through the internet. On the internet, there are several protocols which define a set of rules for how the data is transmitted in communication, e.g. TCP, UDP, ARP, etc. Network ports are provided by TCP and UDP protocols during the transport of packets. There are 65,535 ports which are like paths for packets and manage traffic on the internet. E.g. port 80 is used by http and port 443 by https.

When a packet reaches the server, the server also sends a response in the form of packet by giving permission to the user after authorising. Hence, the user can access any website in the browser in the same way.

The specific steps involved in this process are :

  1. DNS query: When a browser started to load a webpage, it likely first made a DNS query to find out the website’s IP address.

  2. TCP handshake: Through this browser opens a connection with an IP address.

  3. TLS handshake: Through this browser also sets up encryption between a web server and device to avoid attacks from hackers.

  4. HTTP request: Here, the browser requested the content that appears on the webpage.

  5. HTTP response: Web server transmitted the content in the form of HTML, CSS, and JavaScript code, broken up into a series of packets. The whole process took only a second.

For more information about our club you can visit us on:

Last updated

Was this helpful?