
Modern computer networks depend on several devices working together. Routers, switches, firewalls, wireless access points, gateways, and modems each perform different functions to move traffic, connect users, and protect network resources.
A network switch connects devices within a local area network (LAN), while a router forwards traffic between different IP networks. Managed switches also support VLAN configuration, allowing administrators to separate devices and services without building separate physical networks.
Understanding these devices is essential for designing, managing, and troubleshooting home, business, and enterprise networks.
If you are new to networking, start with our Computer Networking Explained guide to understand the basic concepts behind network communication.
1. What Are Network Devices?
A network device is a hardware or software component that participates in network communication. It may connect endpoints, forward traffic, enforce security policies, or provide access to network services.
Common network devices include:
| Device | Primary Function | Typical OSI Layer |
|---|---|---|
| Network switch | Connects devices within a LAN | Layer 2 or Layer 3 |
| Router | Connects different IP networks | Layer 3 |
| Wireless access point | Connects Wi-Fi clients | Mainly Layer 2 |
| Firewall | Filters and inspects network traffic | Layers 3–7 |
| Hub | Repeats incoming signals | Layer 1 |
| Modem or ONT | Provides access to ISP infrastructure | Depends on technology |
| Load balancer | Distributes application traffic | Layers 4–7 |
These are typical roles, not strict limitations. Modern devices often combine multiple functions. For example, a Layer 3 switch can perform routing, while an enterprise firewall may also provide VPN, NAT, and routing services.
Cisco’s network switching overview provides additional background on how switches connect devices and forward traffic.
2. Router vs Switch: What Is the Difference?
The main difference is the type of traffic each device handles and how it makes forwarding decisions.
- Switch: Primarily forwards Ethernet frames inside a local network using MAC addresses.
- Router: Forwards IP packets between different networks using IP addresses and its routing table.
Consider a simple office network:
PC 1 ─────┐
PC 2 ─────┤
PC 3 ─────┤
|
[SWITCH]
|
[ROUTER]
|
InternetThe switch allows local devices to communicate with one another. The router provides a path to other IP networks, such as the Internet or a remote office.
A traditional Layer 2 switch does not normally route traffic between IP subnets. However, a Layer 3 switch can perform both switching and routing.
For a deeper understanding of IP addressing and packet forwarding, see our TCP/IP Explained guide.
3. How Does a Network Switch Work?
A traditional Ethernet switch operates primarily at Layer 2 of the OSI model.
It learns the source MAC addresses of incoming Ethernet frames and associates them with the ports where those devices are connected. This information is stored in a MAC address table, sometimes called a forwarding database.
Example:
| MAC Address | Switch Port |
|---|---|
| AA:AA:AA:AA:AA:01 | Gi0/1 |
| BB:BB:BB:BB:BB:02 | Gi0/2 |
| CC:CC:CC:CC:CC:03 | Gi0/3 |
When a frame arrives, the switch checks its destination MAC address:
- If the destination is known, the switch forwards the frame through the associated port.
- If the destination is unknown, the switch floods the frame through eligible ports in the same VLAN, except the incoming port.
- The switch continues learning from source MAC addresses as devices communicate.
This process reduces unnecessary traffic compared with traditional hubs.
4. Managed vs Unmanaged Switches
Switches are available in different types depending on the network’s size and management requirements.
Unmanaged Switch
An unmanaged switch provides basic Ethernet connectivity with little or no configuration.
Typical use cases include:
- Small home networks
- Simple office networks
- Temporary network connections
- Basic laboratory environments
Managed Switch
A managed switch provides administrative control over network ports and traffic.
Common features include:
- VLAN configuration
- Access and trunk ports
- Spanning Tree Protocol (STP)
- Port security
- Link aggregation
- Quality of Service (QoS)
- SNMP and monitoring
- Authentication through IEEE 802.1X
- Power over Ethernet (PoE) management
Managed switches are generally preferred in business networks because they provide segmentation, monitoring, and greater control.
5. Layer 2 vs Layer 3 Switches
A Layer 2 switch forwards Ethernet frames using MAC addresses. A Layer 3 switch can also route IP packets between different networks.
For example, an organization might use two VLANs:
VLAN 10
192.168.10.0/24
|
|
[Layer 3 Switch]
|
|
VLAN 20
192.168.20.0/24The Layer 3 switch can route traffic between these VLANs using switched virtual interfaces (SVIs), provided the device and configuration support this function.
This process is called inter-VLAN routing.
Layer 3 switches are common in enterprise networks because they combine high-speed switching with routing between internal networks.
6. What Is a Router?
A router forwards IP packets between different networks.
A typical connection might look like this:
Local Network
192.168.1.0/24
|
|
[ROUTER]
|
|
ISP / WAN
|
InternetRouters maintain routing information that tells them where to forward packets.
A simplified routing table might contain:
192.168.1.0/24 directly connected
192.168.2.0/24 via 10.0.0.2
0.0.0.0/0 via ISP gatewayThe route 0.0.0.0/0 is the IPv4 default route. It is used when no more specific route matches the destination.
Depending on the network, routers may use:
- Static routing
- OSPF
- BGP
- IS-IS
- IPv6 routing
- VRFs
- Policy-based routing
7. How Routers Make Forwarding Decisions
When a router receives an IP packet, it examines the destination IP address and compares it with the entries in its routing table.
The router normally selects the most specific matching route, known as the longest-prefix match.
A simplified traffic path is:
PC
|
v
Access Switch
|
v
Router A
|
v
Router B
|
v
ISP
|
v
InternetThe actual path depends on routing protocols, network topology, policies, and available routes.
8. What Is a Default Gateway?
A default gateway is the Layer 3 next hop a host uses when the destination is outside its local IP subnet and no more specific route is available.
For example:
IP Address: 192.168.1.50
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1A destination such as 192.168.1.100 belongs to the same /24 subnet, so the host can communicate with it directly at the IP layer.
A destination such as 8.8.8.8 is outside that subnet, so the host sends the packet toward its default gateway.
9. Which Network Device Do You Configure VLANs On?
VLANs are primarily configured on managed network switches. Administrators create VLANs on switches and assign switch ports to the appropriate VLAN.
For example:
- Access ports connect endpoint devices to a specific VLAN.
- Trunk ports carry traffic for multiple VLANs between compatible network devices.
- Layer 3 switches can route traffic between VLANs.
- Routers and firewalls can also provide inter-VLAN routing, depending on the network design.
A typical business network might use:
| VLAN | Purpose | Example Subnet |
|---|---|---|
| VLAN 10 | Employees | 192.168.10.0/24 |
| VLAN 20 | Servers | 192.168.20.0/24 |
| VLAN 30 | Guest Wi-Fi | 192.168.30.0/24 |
| VLAN 40 | IoT devices | 192.168.40.0/24 |
VLANs create separate Layer 2 broadcast domains over shared switching infrastructure. They do not automatically provide complete security isolation; routing policies and firewall rules may also be required.
For practical examples of VLAN tagging, access ports, and trunk configuration, read our VLAN Explained: Access and Trunk Ports guide.
Cisco’s official documentation explains how to configure Ethernet switch ports and VLANs.
10. Access Ports vs Trunk Ports
Switch ports commonly operate in access or trunk mode.
Access Port
An access port normally carries traffic for one assigned VLAN and connects to an endpoint such as a computer, printer, or IP phone.
PC
|
|
Access Port
|
[SWITCH]
|
VLAN 10Trunk Port
A trunk port carries traffic for multiple VLANs, usually using IEEE 802.1Q VLAN tagging.
Switch A
|
| VLAN 10
| VLAN 20
| VLAN 30
|
TRUNK
|
Switch BTrunks are commonly used between switches, and between switches and VLAN-aware routers, firewalls, access points, or virtualization hosts.
Both ends must have compatible trunk settings and an appropriate allowed-VLAN configuration.
11. What Is Spanning Tree Protocol (STP)?
Redundant Layer 2 connections can create switching loops.
A loop may cause broadcast storms, duplicate frames, and unstable MAC address learning.
Spanning Tree Protocol (STP) helps prevent these problems by creating a loop-free logical topology while allowing redundant physical links to remain available.
Switch A
/ \
/ \
Switch B---Switch CSTP uses Bridge Protocol Data Units (BPDUs) to exchange topology information and determine which ports should forward or block traffic.
Common versions and related technologies include:
- STP
- Rapid Spanning Tree Protocol (RSTP)
- Multiple Spanning Tree Protocol (MSTP)
Read our Spanning Tree Protocol Explained guide for a detailed explanation of root bridges, port roles, and loop prevention.
12. What Is a Wireless Access Point?
A wireless access point (AP) connects Wi-Fi clients to a wired network.
Laptop )))))
Phone ))))) [Wi-Fi AP] ─── Switch ─── Router
Tablet )))))Access points can provide:
- Wireless connectivity
- Multiple SSIDs
- Wireless authentication
- Guest network access
- VLAN mapping
- Roaming support
- Quality of Service
In business networks, access points commonly connect to managed PoE switches.
Different SSIDs can be mapped to separate VLANs. For example, employee Wi-Fi and guest Wi-Fi can use different VLANs and security policies.
13. What Is a Network Firewall?
A firewall controls network traffic according to defined security policies.
A simplified network design is:
Internet
|
|
[Firewall]
|
|
[Core Switch]
|
+---- Users
+---- Servers
+---- Wi-FiFirewalls may inspect:
- Source and destination IP addresses
- TCP and UDP ports
- Connection state
- Applications
- User identities
- Security indicators
Modern firewalls may also provide VPN connectivity, NAT, intrusion prevention, application control, and network segmentation.
A firewall and a router are not identical, although one physical device may perform both functions.
For more information, read our Firewalls Explained and Network Security Basics guides.
14. What Is NAT?
Network Address Translation (NAT) changes IP address information as traffic crosses a network boundary.
A common example is translating private IPv4 addresses into a public IPv4 address when internal users access the Internet.
Private IP
192.168.1.50
|
v
Router
|
NAT
|
v
Public IP
203.0.113.20
|
InternetNAT and routing perform different jobs:
- Routing determines where packets should be forwarded.
- NAT modifies address information according to configured translation rules.
Routers and firewalls commonly provide NAT at network boundaries.
15. What Is Power over Ethernet (PoE)?
Power over Ethernet allows compatible devices to receive electrical power through Ethernet cabling.
Common PoE devices include:
- Wireless access points
- IP cameras
- VoIP phones
- Sensors
- IoT devices
PoE Switch
|
+------ Wi-Fi Access Point
|
+------ IP Camera
|
+------ VoIP PhoneWhen selecting a PoE switch, administrators should check both the maximum power supported by each port and the total PoE power budget of the switch.
A switch may have enough physical ports but insufficient power capacity to operate every connected device simultaneously.
16. Hub vs Switch
A hub and a switch are not the same.
A traditional Ethernet hub operates at Layer 1 and repeats incoming signals to its other ports.
A switch operates primarily at Layer 2 and forwards frames based on MAC address information.
| Feature | Hub | Switch |
|---|---|---|
| OSI Layer | Layer 1 | Primarily Layer 2 |
| Forwarding | Repeats signals | Uses MAC address table |
| Traffic handling | Shared medium | Selective forwarding |
| Modern usage | Rare | Standard LAN device |
Traditional hubs have largely been replaced by Ethernet switches.
17. Modem, ONT, Gateway, and Router
A modem or Optical Network Terminal (ONT) provides the connection to an Internet service provider using the relevant access technology.
A fiber connection may look like this:
Fiber Connection
|
ONT
|
Router
|
Switch
|
Wi-Fi APConsumer equipment often combines several functions in one physical device:
- Modem or ONT functionality
- Router
- Ethernet switch
- Firewall
- Wireless access point
A gateway is a broader term for a device or system that provides access between networks or systems. In an IP network, a router or Layer 3 interface often acts as the default gateway for a subnet.
18. How Routers and Switches Work Together
Routers and switches perform complementary roles.
A small business network might look like this:
Internet
|
ISP / ONT
|
Router / Firewall
|
Managed Switch
|
+--------+--------+
| | |
PCs Servers Printers
|
Wi-Fi APsThe switch provides local connectivity between devices. The router forwards traffic between IP networks. The firewall enforces security policies, while access points provide wireless connectivity.
In larger enterprise networks, Layer 3 switches may route traffic between internal VLANs while dedicated routers and firewalls handle WAN and Internet connectivity.
For more advanced infrastructure designs, see our Data Center Network Architecture and Servers and Infrastructure Explained guides.
19. How DNS and DHCP Fit Into a Network
Network devices depend on services such as DHCP and DNS to support normal communication.
DHCP
Dynamic Host Configuration Protocol (DHCP) automatically provides network configuration to clients, typically including:
- IP address
- Subnet mask or prefix
- Default gateway
- DNS server
- Lease duration
The basic DHCP exchange is:
Client
|
DISCOVER
|
v
DHCP Server
|
OFFER
|
v
Client
|
REQUEST
|
v
DHCP Server
|
ACK
|
v
Configured ClientThe protocol is documented in RFC 2131.
DNS
Domain Name System (DNS) translates domain names into information such as IP addresses.
For example:
www.example.com
|
v
DNS
|
v
IP AddressRead our DNS Explained guide for more information about DNS records, recursive resolution, authoritative servers, and caching.
20. Network Troubleshooting: A Practical Approach
When a user cannot access a network resource, troubleshoot systematically instead of immediately changing router or switch configurations.
Layer 1: Physical Connectivity
Check:
- Power and device status
- Ethernet cables and fiber connections
- Link LEDs
- Interface status
- Wireless signal strength
Layer 2: Switching
Check:
- VLAN assignment
- Access and trunk configuration
- MAC address learning
- STP state
- Interface speed and duplex
- Port errors
Layer 3: IP Connectivity
Check:
- IP address and subnet mask
- Default gateway
- Routing table
- ARP or neighbor table
- Reachability between subnets
Layer 4 and Above
Check:
- TCP and UDP ports
- Firewall rules
- DNS resolution
- Application availability
- TLS and authentication
Windows Network Commands
Useful Windows commands include:
ipconfig /all
ping 192.168.1.1
tracert 8.8.8.8
route print
nslookup example.com
arp -aPowerShell also provides:
Get-NetIPConfiguration
Get-NetAdapter
Get-NetNeighbor
Test-NetConnection example.com -Port 443Linux Network Commands
Useful Linux commands include:
ip addr
ip route
ip neigh
ping -c 4 192.168.1.1
traceroute 8.8.8.8
dig example.com
ss -tulpnFor more Linux diagnostics, see our Linux Network Tools Guide.
21. Network Security Best Practices
Network devices are important security boundaries and should be managed carefully.
Recommended practices include:
- Change default administrative credentials.
- Keep supported firmware and network operating systems updated.
- Restrict access to management interfaces.
- Use SSH, HTTPS, and SNMPv3 where supported instead of insecure legacy protocols.
- Disable or secure unused switch ports.
- Use VLANs with appropriate routing and firewall policies.
- Back up device configurations.
- Monitor authentication events and configuration changes.
- Review network access regularly.
- Use network access control where appropriate.
For enterprise environments, Network Access Control (NAC) can help authenticate users and devices before granting access to network resources.
22. Network Device Management and Automation
Professional network administration requires more than configuring devices once.
Administrators need to:
- Monitor device health and interface utilization
- Back up configurations
- Track firmware versions
- Review logs and security events
- Document network topology
- Audit configuration changes
- Monitor capacity and performance
- Automate repetitive operations
Tools such as Python, Ansible, REST APIs, and NETCONF can help automate supported network devices.
Cisco and other vendors provide platform-specific automation interfaces. Automation should always include testing, validation, version control, staged deployment, and rollback planning.
23. Network Devices in Cloud Infrastructure
Cloud environments use many of the same networking concepts as traditional networks, even when the underlying physical hardware is managed by a cloud provider.
Common cloud networking components include:
- Virtual networks and subnets
- Route tables
- Internet and NAT gateways
- Network security groups
- Cloud firewalls
- Load balancers
- VPN gateways
- Private connectivity
These services provide software-defined versions of functions traditionally performed by physical routers, switches, and security appliances.
Continue with our Cloud Networking Explained guide to understand VPCs, subnets, routing, gateways, and cloud security.
24. Key Differences Between Network Devices
| Feature | Switch | Router | Access Point | Firewall |
|---|---|---|---|---|
| Main purpose | LAN connectivity | Connects IP networks | Wi-Fi connectivity | Traffic security |
| Main forwarding information | MAC address | IP address | Wireless and Ethernet frames | Rules and connection state |
| VLAN support | Common on managed models | Depends on platform | Often supports SSID-to-VLAN mapping | Common |
| Routing | Layer 3 models | Yes | Usually not its primary role | Often |
| NAT | Usually not | Common | Usually not | Common |
| Wireless connectivity | No, unless integrated | Some models | Yes | Some models |
| Security policies | Some models | Some models | Wireless controls | Extensive |
Modern equipment may combine several of these functions. Always evaluate the actual capabilities of the device rather than relying only on its product name.
25. Frequently Asked Questions
Is a router the same as a switch?
No. A switch primarily connects devices within a local network, while a router forwards packets between different IP networks.
Which network device do you configure VLANs on?
VLANs are primarily configured on managed switches. Administrators create VLANs and assign access ports to them. Trunk ports carry multiple VLANs between compatible devices.
Can a router configure VLANs?
Yes. Some routers support VLAN tagging, subinterfaces, or VLAN-aware interfaces. However, VLAN membership for endpoint access ports is most commonly configured on managed switches.
Which device routes traffic between VLANs?
A Layer 3 switch, router, or firewall can route traffic between VLANs, depending on the network design and supported features.
Can a switch have an IP address?
Yes. A managed switch can have an IP address for management. A Layer 3 switch can also use Layer 3 interfaces to route IP traffic.
Can a switch replace a router?
A Layer 3 switch can perform many routing functions, especially inside a LAN. However, it does not necessarily replace all WAN, Internet-edge, NAT, VPN, or security functions of a dedicated router or firewall.
What is the difference between a Layer 2 and Layer 3 switch?
A Layer 2 switch forwards Ethernet frames using MAC addresses. A Layer 3 switch can additionally route IP packets between networks.
Do I need both a router and a switch?
It depends on the network. Many home routers include built-in Ethernet switch ports. Business networks often use dedicated managed switches for VLANs, PoE, monitoring, redundancy, and larger numbers of connected devices.
Is a firewall the same as a router?
No. A router forwards packets between networks, while a firewall applies security policies to determine which traffic is permitted or blocked. Some devices perform both functions.
Conclusion
Routers, switches, firewalls, access points, and other network devices work together to provide reliable communication and secure connectivity.
The most important distinction is that switches connect devices within a LAN, while routers forward traffic between IP networks. Managed switches provide VLAN segmentation, and Layer 3 devices handle communication between different VLANs.
Understanding these roles makes it easier to design networks, troubleshoot connectivity problems, and manage modern enterprise and cloud infrastructure.