Router: Navigating the Layers of Network


Your switch excels at connecting local devices to Ethernet, creating a seamless internal network. But, has your curious mind ever wondered what truly happened when local devices aren’t connected to switches, data wants to travel beyond the local connection, or what if a computer outside the network wants to communicate with the computer connected to a different network? Let’s delve into this and get to explore how all this works…
Router
For now, if we don’t see the router as a technical term, then in general, the word router is used for the person or thing that creates paths or gives direction. So technically, if we see the meaning of router, it refers to a director or a navigator. How? It’s the navigator or the director, if it is the navigator to whom it navigates??
A router is a device that is used to connect two or more networks. In the early days, routers were referred to as “gateways”( that’s a different history). Here, the question arises if a network is already created by connecting computers to a switch, so what’s the need for a router? Why can't we connect one more switch to connect the previous two or more switches, and make a giant switch??
As switches work on layer 2 (Data Link layer) and deal with MAC addresses and frames, and more importantly, connect devices within the same network. Here, the routers come in to connect different networks (e.g, LAN to LAN, LAN to WAN). It works with IP addresses at Layer 3 normally refers to the Network layer - if we normally refer network, it will be considered as we are talking about IP addresses at Layer 3. Deal with packets and manage traffic between networks.
IP address
At layer 3, everything is done using an IP address. The IP address is crucial because it’s the address that is the identity of the device it decides which data is to be transferred where. So, the thing is HOW a user knows the IP address of another user's IP address in order to communicate and to exchange data??
How does a user learns the IP address of other users??
When a user pings a message, he is going to pinging his IP address. (Ping is used to check whether the other system is up and the message can be reach them and come back). So his message was delivered with the IP address of that user and vice versa. When the message envelope carrying the IP address reaches the switch, the switch will say, Huh…? What is this? Why is it empty? As a switch's love language is MAC address, not the IP address not what will the switch do? Does the message carrying IP address not get received, or will something else happen ??
ARP ( Address Resolution Protocol)
Here comes the ARP, it is used to map the IP address to a MAC address and helps find the MAC address of computers. If there’s a problem in this, ARP spoofing is a common attack a hacker can do.
Broadcast Address
It is a type of special IP address used to send messages to all devices on a local network, allowing communication with other devices, ARP Request, DHCP Discovery, and Ping Broadcast. It supports Layer 2 - Data Link. Let’s understand its working with an analogy: “Suppose a teacher in a classroom addresses all students, it’s the broadcast address, and asks, ‘Who hasn’t done their work?’ its the broadcast/ARP Request, and finally, students answer who hasn’t done as the response with their MAC address known as recongize an ARP Request.”
DNS (Domain Name System)
It’s the phone book of the internet, translating the human-friendly domain name to the IP address. For example, the domain name www.google.com is feasible for humans to read; what DNS does is to convert this into the IP address 127.238.534.67.
Thanks for reading this.
Subscribe to my newsletter
Read articles from Adan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Adan
Adan
I'm a frontend developer, an "enthusiastic" UI/UX Designer, and now getting hands-on cybersecurity.