October 11, 2023

Do you really know difference between switches, routers and firewalls?

Do you really know difference between switches, routers and firewalls?

There are three main devices in almost every network: switches, routers, and firewalls, so these three devices are very important to network and should not be ignored. In this article, low current smart grid will allow you to analyze how these three devices work and differences between them.

Switch - Network Device Bridge

In a local area network (LAN), switch is like an overpass in a city, its main function is to connect other network devices (routers, firewalls and wireless access points) and connect client devices (computers, servers, network cameras and IP printers) . In short, switch provides a central connection point for all various devices on network.

Basic switch functions:

1. Like a hub, a switch provides a large number of ports to which cables can be connected, so that it can be connected in a star topology.

2. Like repeaters, hubs, and bridges, switches restore an undistorted square-wave electrical signal when framing.

3. Like bridges, switches use same OR filtering logic on each port.

4. Like a bridge, switch divides LAN into several conflict domains, and each conflict domain has independent broadband access, which greatly increases bandwidth of LAN.

5. In addition to functionality of bridges, hubs, and relays, switches also provide more advanced features such as virtual local area networks (VLANs) and higher performance.

How switch works

Switches operate at data link layer. The switch has a very high bandwidth backplane and an internal switch matrix. All switch ports are connected to this back bus. After control circuit receives a data packet, processing port will look up an address comparison table in memory to determine NIC (network card) destination MAC address (network card hardware address). On which port data packet is quickly transferred to destination port through internal switching matrix. If destination MAC address does not exist, it is broadcast to all ports. After receiving port response, switch "learns" new address and adds it to internal MAC address table.

You can also "segment" a network using a switch. By comparing MAC address table, switch allows only necessary network traffic to pass through switch. Switch filtering and summarization can effectively reduce collision area, but cannot separate broadcast at network layer, that is, broadcast area. The switch can transfer data between several pairs of ports at same time.

Each port can be considered as an independent network segment, and network devices connectede to it, can use entire bandwidth independently of each other, without competing with other devices for use. When node A sends data to node D, node B can send data to node C at same time, and both transmissions use full network bandwidth and have their own virtual connections. If a 10 Mbps Ethernet switch is used here, then total throughput of switch at this time is 2×10 Mbps=20 Mbps, and if a shared 10 Mbps hub is used, total throughput of hub will not exceed 10 Mbps /With.

In short, a switch is a network device based on MAC address identification and capable of performing function of encapsulating data packets. The switch can "learn" MAC address and store it in an internal address table. By establishing a temporary switching path between sender and destination of a data frame, data frame can directly reach destination address from source address.

The MAC address is usually determined by network interface card (NIC), and each port of each NIC, switch, and router has a unique MAC address. The switch looks up source MAC address and destination MAC address from data frame and stores MAC address found on a specific switch port in a table. If received table does not contain recipient's MAC address, frame will be sent to all ports of switch, this process is called broadcast. When a response is received, the MAC address will be placed in a table and will not be flooded next time.

Do you really know difference between switches, routers and firewalls?

Router - Internet access

So-called routing refers to activity of moving information from a source location to a destination location through an interconnected network. A router is also called a gateway device. It is typically used to route data packets between different networks. It also automatically selects and sets routes according to channel conditions and connects your network to Internet. In fact, Internet is made up of thousands of routers. Generally speaking, during routing process, information will pass through at least one or more intermediate nodes. Usually, people compare routers and switches, mainly because functions they implement are exactly same in eyes of ordinary users. In fact, main difference between routing and switching is that switching occurs at second layer of OSI reference model (link layer), while routing takes place at third layer, network layer. This difference determines that routing and switching must use different control information in process of moving information, so they implement their functions differently.

How routers work

The router checks source and destination IP addresses of each packet, looks up packet's destination in IP routing table, and routes packet again and again to another router or switch until it gets destination IP address and responds. When there are several ways to reach destination IP address, router can skillfully choose most economical and fastest way. When a packet's destination is not listed in routing table, packet will be sent to default router (if any), and if the packet has no destination, it will be dropped.

Do you really know difference between switches, routers and firewalls?
Do you really know difference between switches, routers and firewalls?
Do you really know difference between switches, routers and firewalls?

In addition to isolating internal LAN from outside Internet, firewall can also separate normal data and sensitive data on the LAN, which also prevents internal intrusion.

Do you really know difference between switches, routers and firewalls?

How firewalls work

There are two types of firewalls: hardware firewalls and software firewalls. Hardware firewalls allow you to define blocking rules through Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) of a port, such as denying unnecessary ports and IP addresses. addresses Access. A software firewall is like a proxy server connecting internal and external networks. It can prevent internal network from communicating directly with external network, but many businesses and data centers will combine two types of firewalls, mainly for security reasons. networks can be improved more effectively.

How do I connect switches, routers and firewalls?

Generally speaking, router is first step in LAN, and firewall between internal network and router is used to filter unauthorized access, and then you need to connect switch. It's important to note that many ISPs now offer fiber optic (FiOS) services, so you'll need a modem in front of your firewall to convert digital signal into an electrical signal that can be carried over a copper ethernet cable. So typical connection method is internet modem-router-firewall-switch and then switch connects to other network devices.

Do you really know difference between switches, routers and firewalls?


The switch provides internal communication on local network, router connects you to Internet, and firewall protects your network. So these three devices are indispensable in network.