DEV Community

Cover image for Understanding Network Devices
Ritam Saha
Ritam Saha

Posted on

Understanding Network Devices

Introduction

Every time we connect to Wi-Fi, open any website, or use an online app, a silent conversation starts between multiple network devices. Data moves from our device, through cables and radio waves across networks we never see, and comes back in milliseconds or maybe less than that!! This entire process often feels invisible and confusing.

In this blog, we are going to try to overcome this confusion.

We will start from the very basics and build a clear mental model of how the internet actually reaches our home or office. Step by step, we will explore common network devices, such as modems, routers, switches, hubs, firewalls, and finally, we will learn about the wireless network concept that we use in our daily lives, i.e., Wi-Fi, and how the internet actually works.

Instead of memorizing definitions, we will understand why each device exists, what problem it solves, and how all of them work together in real-world systems.

By the end of this blog, we will be able to look at any network and understand what is happening behind the scenes. Let's dive into it.


Modem: Your Network’s Gateway to the Internet

This is the main thing that you need to connect your home to the internet. Without a modem, it's not possible at all. A modem establishes and maintains a dedicated internet connection to the Internet Service Provider.

A modem is mainly responsible for signal modulation or demodulation. That is, the analog signal gets converted into the digital signal, and also the digital signal gets converted into the analog signal. That's why its name is "Modular Demodulator," which is in short form "Modem." As our computer only reads digital signals and the internet uses analog signals, a modem demodulates the incoming analog signal into a digital signal and modulates the outgoing digital signal into an analog signal. That's why a modem is really very important to establish the internet connection in our home or office.

There are different types of modems in real life, and the structure and the port structure are also different. But mainly there are commonly three ports in a modem:

  1. One power port to have continuous power flow.
  2. The Ethernet port is used to connect the Ethernet cable which is connected with the router.
  3. One is used for internet input, where we use optical fiber cable or coaxial cable or telephone line.

Router: The Traffic Director of the Network

The main thing that comes after the modem is Router, whose sole target is to allow multiple electronic devices in our home to share the same internet connection.

As we know that the internet service provider is providing your home with an internet connection but via a single wire only!! So how can the other devices in our home can have access of the internet?!!

And here the ROUTER comes into the picture!! The router decides where traffic goes.

Router allows internet connection in two different ways.

  1. The Antennas through which the router provides the wireless internet access or Wifi to our home.
  2. Using the Ethernet ports through which we can have the wired connection to the internet. When an electronic device gets connected to the Router, the router sends a private dynamic IP address to distinguish it from other connected devices. This happens only due to the DHCP (Dynamic Host Configuration Protocol) server which also stores the table of MAC addresses of those devices that are already connected to the internet. By this IP address and the MAC address, router can decide on which device as well as at which application, the response should be sent.

There's also a table that is being used within the Router which maintains a list of known connected devices and the best path to reach them (which is calculated by different routing algorithms: Dijkstra's Algorithm, Bellman-Ford Algorithm, Floyd-Warshall Algorithm etc.). This table is known as the Routing Table.

There's also another table is also being used which is NAT (Network Address Translation) Table, which maps internal private IPs to external public IPs for internet access as our devices gets the private IPs but the internet only sees one public IP.


Modem vs. Router: What’s the Difference?

Feature Modem Router
Purpose Connects to ISP Connects multiple devices to the modem
Function Converts analog ↔ digital signals Distributes internet via Wi-Fi or Ethernet
Internet Access Required for internet Not sufficient alone
Example Use Needed to get online Needed to share internet across devices

Modem-Router

Many modern devices combine both functions into a modem-router combo.


Hub vs Switch: How Local Networks Really Work

Hub is a device which is used to connect all of our network devices together on an internal network by multiple Ethernet connection. Hub is not intelligent as it only knows whether any devices are connected to any of its Ports, so it doesn't filter any data or has any intelligence as to where to send the data. So when a data packet arrives at one of the ports, it is copied to all other ports, thus all the devices that are connected to the hub receives the data packets. As it is not only a matter of security concerns but also creates unnecessary traffic in the network wasting the bandwidth, that's why in modern world, Hub is not that much used (obsolete).

In the other hand, Switch is very similar to Hub i.e, a device that has multiple ports that accepts Ethernet connections from network devices, but unlike a hub, Switch is intelligent as it actually stores the IP addresses (maps within the ARP table) as well as the physical addresses of the devices (MAC address) that are connected to the switch (maintains the CAM table). So when a data packet is sent to a switch, it's only directed to the intended destination port. Thus switches are more preferable over hubs in modern world because there will not be any unnecessary traffics over the network.

Both hubs and switches are used to exchange data within a LAN, not used to exchange data outside their own network.

To exchange data outside their own network there should be a device that needs to be able to read the IP addresses (because both switch and hub can't read IP addresses).

So here comes the Router. Router acts as the gateway of a network. If data packet is received by a router, the router detects the IP of the data packet and determines if the data packet was meant for its own network or another.

So here's the main difference between Hub & Switch:

  1. Hub only detects that a device is physically connected to it.
  2. But Switch can detect the specific devices that are connected to it because of the records of the MAC addresses of those devices.

Switch Hub


Firewall: Where Security Actually Lives

A firewall is a system that is designed to prevent the unauthorised access from entering a private network by just filtering the data packets that comes in from the internet i.e, to create a safety barrier between a private network and the public internet. As we already know, in the internet there are always going to be hackers or any malicious software that may try to penetrate into our private network and that's why a firewall is needed to prevent them. Besides our home, a firewall is very much important for the large organisations or businesses as they would obviously need to protect their secured data from the internet. It works by filtering the incoming network by checking the Access Control List where the sender's IP addresses, the protocols that's being used for the data transmission, the destination's IP address, Domain names, Protocols, Ports are stored. this access control list is designed by the Network Administrator and by this it can be decided what can enter the local network and what can not. A firewall can be either software or can be hardware or it also can be the mixture of both. Firewalls are basically of two types.

  1. Host-based Firewall: This is a software based firewall and it's installed in the computer. It's prime focus is to protect the computer only nothing else. For example: In Windows, there are already pre-installed firewall that are used. Besides that there are also some 3rd party software based firewall that can be used to protect the computer. Besides that, there are a lot of antivirus programs that have built-in host based firewall.
  2. Network-based Firewall: The hardware based or combination of both hardware and software based firewall that are used to protect the entire network; not only focused to only one computer. It works upon the network layer and operates in between the private network and internet. As we have already mentioned, the Network-based firewall can be a stand-alone hardware device or it can also be implemented within the Router.

In the large organisations, they mostly use both the network-based and host-based firewall to ensure maximum protection.

Firewall


What Is Wi-Fi — And What Actually Happens Internally

WIFI, aka IEEE 802.11, is simply a wireless communication method that allows electronic devices to talk to a local network using radio waves.

Let's discuss what actually happens.

When we switch on wifi in our phone, it shows nearby networks, which are actually the SSIDs of the networks. Now the question arises that, what is this SSID?!! Don't be overwhelmed by the fancy name; it's just the name of the network, a unique identifier for that wireless network. Most routers broadcast their SSID by default, making the network visible to nearby devices.

It seems simple that we just click on the network name we need to connect to with our phone, and then it gets connected automatically after the password verification. But it's NOT THAT SIMPLE!!

When we connect, the phone joins the network, the password gets verified & then an IP address is sent to the phone by the router. But here's a question that should arise in your mind that "How does a router get to know to which device it needs to send data or from which device it needs to receive data?"

The answer we have already discussed previously in the router section, each device gets a unique private IP address (e.g., 192.168.1.5) from the router via DHCP server. The router uses this to determine where to send incoming or outgoing data packets. Also, there are some tables that are used, to track which IP addresses are assigned to which MAC addresses(devices) (DHCP Lease Table) and a list of known networks and the best path to reach them (Routing Table).

Now let's assume you want to watch a YouTube video. From your phone, you send a request to access that YouTube video. What actually happens is that your request is at first getting divided into several data packets that are in the bits format (0/1). At first the switch checks the other connected devices for the request, if it's available in other devices then it will be fetched from there, and if not then the request will be forwarded to the Router. The router then will forward the data request to the Internet Service Provider. The Internet Service Provider will then send that data request to the YouTube server. Then the YouTube server will send the response (in data packets and bits format) to the Internet service provider. The Internet service provider will send that response to the router. The router will send that to the switch, and according to the MAC address and the port, the switch will send the response to the device that has requested for it. The device that has requested for the video will merge that data packets according to the ordering and protocols and convert that bitstream into the video format so that the user who has requested it can watch it. And when the data is moving in between the LAN and the WAN, there is always the firewall that maintains the records and checks whether the response is sent by the hackers or the malicious software. All this scenario is happening within, like, some milliseconds or less than that!!

Internet flow


Conclusion

Networking often feels complex not because it is magic, but because most of its work happens silently in the background. Every click, every video, and every message depends on multiple devices working together in perfect coordination — each with a very specific responsibility.

In this blog, we started from the basics and gradually built a clear picture of how data moves from our device to the internet and back. We saw how the modem connects us to the outside world, how the router manages and directs traffic, how switches and hubs handle local communication, how firewalls protect our networks, and how Wi-Fi enables wireless access to all of this infrastructure.

The key takeaway is simple: networks are layered systems. No single device does everything. Each one solves a focused problem, and together they form a reliable, scalable, and secure communication system.

This is just the foundation. With this mental model, you are now better prepared to explore deeper topics like OSI model, TCP vs UDP, DNS, cloud networking, and real-world production architectures.

And that’s where things start to get really interesting.


Follow for more beginner-friendly breakdowns of core software engineering concepts.

Top comments (0)