Skip to main content

Command Palette

Search for a command to run...

Understanding Network Hardware

How Data Travels from the Internet to Your Screen

Updated
9 min read
Understanding Network Hardware

When you go to a web site, watch a video, or send an email, your data goes through a series of interconnected pieces of equipment, known collectively as devices. Each device performs a function, and knowing how this physical connection works will make better software engineers who are developing broadband systems that rely upon consistent, safe, and growable networks.

Typically, software engineers will work with abstractions of the physical elements of the network stack (examples being: HTTP, TCP/IP, REST API, etc.) without actually knowing the physical element that supports the abstraction. Understanding the physical hardware element will be crucial for when an engineer deploys the application code they have been developing, troubleshooting application issues, and designing growable networks.

Let's follow the physical path your data has taken from the global level (the internet) to your local (your computer) before examining how these same principles work on a larger scale to produce outcomes on a global scale.

How the Internet Reaches You

View the Internet as a massive ocean, and your PC as a house that needs an adequate supply of water. To move data from the big ocean to your house, you will have to build a structured framework of pipes and valves to move that data. Network hardware is the backbone of this system by providing the physical pathways (cables), controllers of data flow (routers) and filters for security (firewalls) to deliver data from its source in the ocean to your computer screen.

This is the foundational flow that the internet connection follows. Let’s understand every component in the flow.

The Modem: Your Gateway to the Internet

The ISP (Internet Service Provider) delivers internet using signals through fibers or cables that the computer is unable to understand. As the name ‘Modem’ suggest: Modulator Demodulator, it converts between these analog or specialized digital signals and the standard digital Ethernet packets the network devices expect.

How It Works:

  • Incoming: The modem receives signals from your ISP and demodulates them into digital data packets

  • Outgoing: It takes digital packets from your network and modulates them into the signal format your ISP expects

  • IP Assignment: Your ISP assigns your modem a public IP address—this is your network's identity on the internet

When you deploy applications, your production servers connect through modems (or their datacenter equivalents) to the internet backbone. Understanding this helps you debug connectivity issues and comprehend network boundaries.

Router: The Traffic Director

The modem has only one public IP address, but multiple devices are able to connect to the internet. The router creates a private local network behind the public IP address and routes the packets between the internet and the correct device.

Key functions:

  • NAT: Provides the public IP (modem’s IP) to all devices connected to the modem.

  • DHCP Server: Automatically assigns private IP addresses to all devices connected to it (example: 192.168.x.x)

  • Routing: Routes the packets of data from your network to the internet (and vice versa).

  • Basic firewall: Often includes simple packet filtering

How It Works:

How NAT Functions:

  • The router will provide the devices connect to it with local IP addressing scheme. For example, 192.168.1.x.

  • When a device asks for a web page, the router saves the information about which device requested it, then replaces the source IP of the outgoing packet from its local address to the public IP before it sends the packet to the Internet.

  • When a response comes back, the router will again replace the source address from the public IP to the device’s local IP before forwarding it on to the device.

Making Routing Decisions:

  • Routers maintain a routing table, for example, "packets that are destined for 192.168.1.5 will go device A and packets that are destined for 192.168.1.8 will go to device B".

  • Any packets that are destined for an external network will be forwarded via the router's WAN port to the modem, while any packets that are destined for devices on the same network will stay on the local area network.

In AWS/cloud environments, virtual routers (like VPC route tables) use identical concepts. Understanding routing helps you configure VPCs, subnets, and internet gateways correctly.

Switch vs Hub: Local Network Distribution

One the data passes through the router into the local network, it need to reach the right device. This is done through Hub and Switches.

Hub: The Primitive Broadcaster

It is a simplest networking device, which has become obsolete. The way Hub works is:

  • Receives data from any connected device

  • Broadcasts that data to all the ports connected to Hub

  • Every device sees every packet, even if it's not the intended recipient

  • Devices must filter out packets not meant for them

This create several problems:

  • Creates collision of signals which may lead to corrupt data packets

  • The bandwidth is wasted as all the devices receive data which are not even intended for them

  • The data can be accessed by all the devices connected to it leading to security risks

  • The performance would degrade rapidly if devices are added to it

The Switch: Intelligent Traffic Routing

A switch knows the MAC address of every device connect to its port and only send data to the device it is intended for.

How This Works:

  • MAC Address Table: Keeping track of the hardware address of each device connected to a specific port on the switch.

  • When a packet of data arrives at the switch it reads the destination MAC address of the packet.

  • It will then forward that packet ONLY to the port the device with that MAC address is connected to.

  • If the switch does not have a learned MAC address in its MAC address table it will flood out ALL of its ports like a hub and then learn from the response from the device from which it received the packet.

Benefits to using Switches :

  • Full Duplex: Each device can send and receive data simultaneously with no collisions.

  • Dedicated Bandwidth: Each port on the switch has dedicated full bandwidth

  • Privacy: Each device will only receive data intended for it.

  • Learning: Switches learn the MAC address of the devices connected to each port automatically.

Datacenter networks use sophisticated switches. When designing microservices, understanding how switches segment traffic helps to reason about network performance and security zones.

The Firewall: Your Network's Security Checkpoint

Its role is to inspect and filter network traffic based on the security rules. It allows and blocks the package based on the policies.

Types:

  • Hardware Firewall: It is a physical device that sits between the router and internal network. It is suitable for organisations.

  • Software Firewall: It runs on individual devices, protecting a specific device.

How it works:

  • Packet Filtering: It checks the packets’s source IP, destination IP, the ports and protocols. It examines if the packets checks against a certain set of rules, and in case of any violation, drops the packet.

  • Stateful Inspection: It tracks the state of all the active connections, and only allow the response packets for the query made, blocking the unsolicited incoming data packets.

Cloud security groups (AWS), network policies (Kubernetes), and iptables rules on Linux servers all implement firewall concepts. Your application's exposure to threats depends on correctly configured firewall rules.

Load Balancer: The Traffic Distributor

A load balancer distributes incoming requests across multiple backend servers to handle scale and ensure availability.It sits in front of your application servers and intelligently routes each request to a healthy backend server. This allows services like Google, Netflix, and Amazon to handle millions of concurrent users.

Types:

  • Layer 4 (Transport Layer): Routes based on IP address and TCP/UDP ports. It is fast and simple. Example: AWS Network Load Balancer

  • Layer 7 (Application Layer): Routes based on HTTP headers, URLs, cookies. More intelligent, can route /api to one server pool, /images to another. Example: NGINX, AWS Application Load Balancer

How it works:

Distribution algorithms:

  • Round-robin: Cycle through servers sequentially

  • Least connections: Send to server with fewest active connections

  • IP hash: Same client always routes to same server (session affinity)

Health checks: Continuously monitor backends, remove unhealthy servers from rotation

Session persistence: Keep a user on the same backend for stateful applications

SSL termination: Handle HTTPS encryption/decryption centrally

Load balancers are fundamental to horizontal scaling. When you deploy a web app with "3 instances behind a load balancer," you're using this exact hardware concept (or its virtual equivalent).

How These Devices Work Together: A Real-World Web Application

Every component works together in a production web application architecture:

Let's trace a complete request: when browsing www.example.com to buy a product.

Outbound Request

  1. Computer: Enters a URL into the browser which sends an HTTP GET request to the web page

  2. Router: Checks its routing table and routes the request to the modem because there are no valid local routes available for this destination

  3. Firewall (if present): Inspects outgoing data and allows outgoing HTTPS on port 443

  4. Modem: Converts the digital packets into an ISP specific format then forwards to the ISP

  5. Internet: The packets will pass through multiple routers along their way to the webserver (using BGP)

  6. Example.com’s Load Balancer: Receives the request and checks the server health of all servers and forwards to Example.com Server 2 (because it has the least amount of connections)

  7. Example.com’s Firewall: Allows the HTTPS traffic and blocks anything that looks suspicious

  8. Example.com’s Switch: Forwards the packets from the load balancer over to Example.com Server 2's network port

  9. Example.com Server 2: The web application processes the request, queries the database and builds a response.

Inbound Response

  1. Example.com Server 2: Sends an HTTP response message back to the Example.com load balancer

  2. Switch: Forwards the packet to the load balancer.

  3. Load Balancer: Forwards the packet back to your IP address.

  4. Internet: The packets travel back through all the routers until they reach your modem

  5. Your Modem: Receives the signal and demodulates back to a digital packet

  6. Your Firewall: Recognizes this is a response to your earlier request (stateful) and forwards it through

  7. Your router: Translates your public IP back to your computer’s private IP (192.168.1.5)

  8. Switch: Forwards the packet to your laptops physical port

  9. Your Computer: Once the browser has received the HTML, it will render the page.

Summary: Each Device's Role

Let's crystallize what each device does:

DeviceCore FunctionCloud Equivalent
SwitchConnects devices on same network, forwards to correct portVPC, Virtual switches
RouterConnects different networks, performs NAT, assigns IPsRoute tables, Internet Gateway
ModemTranslates between network signals and ISP formatManaged by cloud provider
FirewallInspects and filters traffic based on security rulesSecurity Groups, NACLs
Load BalancerDistributes traffic across multiple serversALB, NLB, ELB

The foundational concept of the Internet today is layered delegation where every device is designed to perform a single function and hand off the information to the next device in the system that is specifically designed to handle an aspect of the previous device. In developing a proficiency in this flow you will be able to create more effective systems, troubleshoot faster, and design networks that can vary in size from simply on your laptop to millions of end users.

When you click on a hyperlink, think about the fact that the request has travelled through 6 or more devices all of which are processing the request and making intelligent decisions about how to process the information in milliseconds. The result is that the user experiences an instantaneous transfer of information across the internet.