Barun's Experience: Learning Networking Devices While Setting Up a New Office

I am Barun Tiwary, learning to scale software to millions of users.
NOTE: There is no sponsherhip from any company for this blog.
In this article, with the real world analogy, we are going to learn about how the internet works and the key hardware and software components which helps us to access the internet.
Analogy
Barun is renting the new office for his new business. He runs a software development agency named RF-Automation, where he helps businesses to automate their time-consuming operational tasks and build the software for them. Till now, he was working alone from his home, now he wants to rent the office and hire 10-20 employees to expand his agency.
Now, Barun has hired 15 employes mix of Software Developer, Project Manager, and other roles. Also, he has rented an office near HSR Layout in Bangalore. He has also arranged 10 computers, a few printers, and other office furniture to make it look like an agency. Now he need the access to the internet. But currently he does not have any. So, he opened the Airtel thanks app and applied to get access to the high-speed internet available.
On the same evening, the engineer from Airtel arrives at the office location to install Airtel X Stream Wi-Fi. First, he finds the available spot on the nearest Airtel Fiber (Fiber Access Terminal) Box so that he can connect the Airtel Modem (ZYXEL Modem + Router) to it and give him access to the internet.
FAT Box → Fiber Access Terminal Box is the main devices installed in the apartments, flats and other premises for distributing the internet from the main fiber cables to the multiple individual subscriber.
Airtel uses modem of ZYXEL company which build networking related solutions.

Once the engineer finds the available spot near his premise inside the fat box, then he add the new fiber optic cable into that spot, which is connected to the coaxial cable, which will then go to inside the office, where the engineer will install the Airtel Wi-Fi or modem.

The black coaxial cable you can see in the above image is the cable that will go to the home modem, as shown in the image. Finally, the engineer joined the black coaxial cable with the fiber optic cable, and it is connected to the ZYXEL Modem. Now, from this modem, Barun can use the internet in his whole office wirelessly.

Now, still there is still an issue; he has 10 computers and a few printers. A few of the computers have the Wi-Fi capabilities, but a few computers and printers can’t use the internet through a modem as they don’t have wifi capabilites in them. Barun can’t spend more money on buying wifi connector, so he decided to add a switch. He bought a switch from D-Link (DES 1008A), which will connect the modem to the computers and printer, which doesn’t have wifi capabilites.
Now, Barun can run the agency smoothly.
Technical Knowledge
Hub

Barun has not used Hub as he knows how dumb hub it is. Though it is one of the early devices from the early internet era, which helps to connect multiple computers in the LAN (Local Area Network → your home network, which consists of your mobile phones, printers, laptop, PCs, etc), it is still not a relevant network device to use. And still some of the broadcasting features of the Hub is used in your home wifi router.
A hub is a dumb device that broadcasts data from one device to all the other devices connected to the hub, as shown in the image below.

Hub is usefull to connect multiple device in the local area to share information.
Hub broadcasts data from device A to all the other devices connected to it. The devices recieves the data and compare its mac address (unique id for each devices world wide) to the mac address in the data packet (recivers mac address). If both mac address matches, the device consume the data; otherwise, it drops the data packet.
Because of its broadcasting nature, it has several drawbacks like when device A sends the data to device B, and at the same time, if device C sends the data to device D, there is a collision in the hub. As the data of device C and device A travel at the same time, they will collide, and the data gets lost. Becuase of this, it is also called SIngle Collision Domain.
Switch
It is the smartest alternative of hub. It knows which device is connected to which port. And it helps devices to connect locally and form a topology like bus, start, mesh, and others.

It uses the computers/devices MAC (Media Access Control) Address to identify each devices uniquely and route the data packets to the specific device.
Switch, when installed fresh or reset, doesn’t know the MAC Address of any devices connected to it. When the device sends the first data from device A to device B, switch first broadcasts the message and sees who receives it, and stores that information into a CAM (Content Addressable Memory) table. Likewise, it learns the MAC address of all the connected devices and the port they are connected to.
CAM is the high-speed hardware component built inside the switch that helps it to maintain records of MAC and its respective port. It also helps to forward Ethernet frames near instantly using hardware-based lookup.

A switch is only used inside the LAN (Local Area Network), unlike a router, which is used to connect the LAN to the internet.
Router & Modem

Sometimes people confuse a router and a modem and use this word interchangeably. Because these days the ISP (Internet Service Providers) like Airtel, JIO and other provided both in the same device. But both of these have different working mechanisms.
As shown in the image above, there is the Modem in the left side and a router on the right side. They are both identical right, just the router has one antenna (In some case you would see more than one). So what’s the difference?
MoDem (Modulator De-Modulator)

As the name suggest it's the guy who is actually responsible for converting the analog signal coming from the ISP’s coaxial cable (or through any other medium like DSL, Satellite, or others) into the digital signal that can be consumed by your LAN devices.
As you can see in the image above modem can only be used with one device. It cannot be connected to multiple devices because its primary use is to convert the analog signals to digital signals, which computers and other devices can understand. This is the reason why we use a router on top of the Modem in the LAN to get the digital signal (Internet) into the router and then route the data packets to multiple devices connected to it respectively.
Router

Again, as the name suggests, it routes the incoming data from the modem to the devices in the LAN. A router can consist of a wireless Access Point and a wired (RJ45) interface.
The router's main purpose is to distribute the data packets between your networks and the outside world (without internet, we can also utilize the router to share data between local devices). Just like switches, a router is also a smart network device, even better than a switch.
Nowadays, routers come with built-in switches and a basic firewall as well. A router also has the functionality of assigning an IP address to the devices in the network, so that they can be identified easily for sharing data.
Firewall

A firewall is a network security device that monitors incoming and outgoing traffic based on configurable security rules (rules can be changed accordingly). It helps us to protect the internal networks from the outside world (untrusted networks/Internet) or maintain a barrier between VLANs (Virtual Local Area Network).
Firewalls can be hardware or software both.






