Imagine a school with many classrooms. Students in each classroom need to communicate with their teachers and classmates. The school also needs a way to organise everyone so that messages reach the correct people.
A computer network works in a similar way. Computers, printers, phones and other devices need to communicate with one another. A network switch helps these devices communicate within a local network.
In this module, you will learn about network switches, how they work, what VLANs are and why organisations divide networks into smaller sections.
At the end of this module, you should be able to:
A network switch is a device that connects computers, printers, servers and other devices within a local area network (LAN).
It helps information travel from one connected device to another. It uses the destination device's MAC address to decide where to send network information.
Think of a switch as a school receptionist. When a message arrives, the receptionist helps direct it to the correct classroom.
In the same way, a network switch receives information from one device and forwards it through the correct connection.
Imagine a computer laboratory containing:
The switch connects these devices so they can communicate on the local network.
COMPUTER 1
|
COMPUTER 2
|
COMPUTER 3
|
+-------------+
| SWITCH |
+-------------+
|
NETWORK PRINTER
|
SERVER
A switch works by receiving network frames and examining their destination MAC addresses.
A MAC address is a unique hardware address assigned to a network interface. It helps identify a device on a local network.
If the switch does not know where the destination device is, it may send the frame through other ports in the same VLAN. This is called flooding.
Imagine a teacher sending a note to a student in Classroom A. If the receptionist knows where the student sits, the note can be delivered directly. If the location is unknown, the receptionist may ask around.
A switch uses MAC addresses to help forward information to the correct device.
A MAC address (Media Access Control address) is a hardware address used to identify a network interface on a local network.
A network interface is the part of a device that allows it to connect to a network.
00:1A:2B:3C:4D:5E
A MAC address is commonly written using hexadecimal characters. These include numbers from 0 to 9 and letters from A to F.
Think of a MAC address as an identification number for a network connection. It helps a switch recognise devices on its network.
| MAC Address | IP Address |
|---|---|
| Identifies a network interface at the link layer. | Identifies a device's network location logically. |
| Usually assigned to the network interface by its manufacturer. | Can be assigned manually or automatically. |
| Used by switches when forwarding local network frames. | Used by devices and routers to deliver packets across networks. |
A MAC address table is a list that a switch builds to remember which MAC addresses can be reached through its ports.
It helps the switch know where to send information.
| Switch Port | MAC Address | Connected Device |
|---|---|---|
| Port 1 | 00:11:22:33:44:55 | Computer A |
| Port 2 | 00:11:22:33:44:66 | Computer B |
| Port 3 | 00:11:22:33:44:77 | Printer |
When Computer A sends information to the printer, the switch can use its MAC address table to forward the frame through Port 3.
Different switches are designed for different networking needs. Here are some common types.
An unmanaged switch is a simple switch that works without requiring users to configure its network settings.
Example: A small office may use an unmanaged switch to connect several computers and a printer.
A managed switch allows a network administrator to configure and control network features.
These features may include:
A Layer 2 switch mainly forwards Ethernet frames using MAC addresses. It works at the Data Link Layer of the OSI model.
A Layer 3 switch can perform normal switching and some routing functions using IP addresses.
| Switch Type | Main Feature |
|---|---|
| Unmanaged | Simple operation with little configuration. |
| Managed | Allows administrators to control network settings. |
| Layer 2 | Forwards frames using MAC addresses. |
| Layer 3 | Can switch and route network traffic. |
A switch and a router are both important networking devices, but they perform different jobs.
A switch connects devices within a local network and forwards frames using MAC addresses.
A router connects different IP networks and forwards packets using IP addresses.
Imagine a school:
| Switch | Router |
|---|---|
| Connects devices within a LAN. | Connects different networks. |
| Uses MAC addresses for normal Layer 2 forwarding. | Uses IP addresses to forward packets. |
| Usually works at Layer 2. | Works at Layer 3. |
Network segmentation means dividing a large network into smaller sections.
Imagine a large school with different departments:
Instead of treating the whole school as one large group, the school can organise each department separately.
A computer network can be organised in the same way. Different groups of devices can be placed into separate network sections.
SCHOOL NETWORK
|
+---------+---------+
| | |
ADMIN STAFF STUDENTS
NETWORK NETWORK NETWORK
| | |
Office Teachers Students'
Computers Computers Computers
VLAN stands for Virtual Local Area Network. It is a way of dividing one physical switched network into separate logical networks.
Imagine that a school has one large computer laboratory. The computers are connected to the same network switch.
The school wants to separate the administration computers from the student computers, even though they use the same physical switch.
VLANs make this possible by placing devices into different logical groups.
| VLAN | Department | Devices |
|---|---|---|
| VLAN 10 | Administration | Office computers |
| VLAN 20 | Teachers | Teachers' computers |
| VLAN 30 | Students | Student computers |
| VLAN 40 | Guests | Guest devices |
ONE PHYSICAL SWITCH
|
+-------------------+
| |
VLAN 10 VLAN 20
ADMINISTRATION TEACHERS
| |
+----+----+ +---+---+
| | | |
PC 1 PC 2 PC 3 PC 4
+-------------------+
|
VLAN 30
STUDENTS
|
+-----+-----+
| |
PC 5 PC 6
The devices are connected to the same physical switch, but they belong to different logical networks.
VLANs provide several important benefits.
VLANs allow network administrators to group devices according to departments, activities or responsibilities.
VLANs help separate groups of devices. Communication between different VLANs can be controlled using routing and security rules.
Broadcast traffic is normally limited to devices within the same VLAN. This can reduce unnecessary network traffic in other VLANs.
Administrators can manage groups of devices more easily.
Devices can belong to the same VLAN even when they are connected to different switches, provided the network is configured correctly.
A VLAN ID is a number used to identify a VLAN.
VLAN IDs are commonly in the range of 1 to 4094. Some values have special uses, so network administrators should follow the rules of their networking equipment.
| VLAN ID | Department |
|---|---|
| 10 | Administration |
| 20 | Teachers |
| 30 | Students |
| 40 | Guests |
The numbers help the switch identify which logical network each frame belongs to.
An access port is a switch port normally assigned to one VLAN. It is commonly used to connect end devices such as computers, printers and ordinary user devices.
If a computer belongs to VLAN 10, the switch port connected to that computer can be configured as an access port in VLAN 10.
COMPUTER
|
|
ACCESS PORT
|
SWITCH
|
VLAN 10
A trunk port is a switch port that can carry traffic from multiple VLANs across a network connection.
Trunk links are often used to connect two switches or connect a switch to a router or another network device.
Imagine a road that carries buses from different school departments. Each bus has a label showing which department it belongs to.
A trunk link carries traffic for different VLANs. Ethernet VLAN tagging, commonly using IEEE 802.1Q, helps identify which VLAN each frame belongs to.
SWITCH A
|
TRUNK LINK
|
SWITCH B
Carries traffic for:
VLAN 10
VLAN 20
VLAN 30
| Access Port | Trunk Port |
|---|---|
| Normally carries traffic for one VLAN. | Can carry traffic for multiple VLANs. |
| Often connects to computers and printers. | Often connects switches and other network devices. |
| Usually sends frames without VLAN tags to ordinary end devices. | Uses VLAN tags to identify traffic for different VLANs. |
By default, devices in different VLANs are separated. They normally need a Layer 3 device, such as a router or Layer 3 switch, to communicate with one another.
This process is called inter-VLAN routing.
Imagine:
If a computer in VLAN 10 needs to communicate with a computer in VLAN 20, a router or Layer 3 switch must route the traffic.
VLAN 10
ADMIN NETWORK
|
|
LAYER 3 DEVICE
(ROUTER OR
LAYER 3 SWITCH)
|
|
VLAN 20
TEACHER NETWORK
Network administrators can also use security rules to decide which groups are allowed to communicate.
A broadcast domain is a group of devices that can receive broadcast messages sent within that network section.
Imagine a teacher making an announcement to every student in one classroom. Everyone in that classroom can hear the message.
A network broadcast works in a similar way. It sends information to all devices within the same broadcast domain.
Each VLAN normally creates a separate broadcast domain.
SWITCH
|
+------+------+
| |
VLAN 10 VLAN 20
| |
Broadcast Broadcast
Domain Domain
A collision domain is a network section where data transmission could interfere with another transmission. Modern switched Ethernet networks using full-duplex connections largely avoid these collisions.
A broadcast domain is the group of devices that receive broadcast traffic from one another.
| Collision Domain | Broadcast Domain |
|---|---|
| Related to possible frame collisions. | Related to broadcast messages. |
| Switch ports normally separate collision domains. | VLANs normally separate broadcast domains. |
| Modern full-duplex Ethernet greatly reduces collision concerns. | Broadcasts remain limited to their VLAN unless routed or otherwise forwarded. |
Port security is a feature available on some managed switches that helps control which devices can connect through a switch port.
Depending on the switch, an administrator may configure rules about which MAC addresses are allowed on a particular port.
Port security is only one part of network security. It should be combined with other protections, such as strong authentication, secure device settings and network monitoring.
Network administrators sometimes use command-line tools to inspect switches and network connections.
The exact commands depend on the switch manufacturer and model. The examples below are common Cisco-style commands for learning in an authorised practice environment.
show mac address-table
This command displays the MAC addresses learned by a switch and the ports where they were discovered.
show vlan brief
This command displays VLAN information, including VLAN IDs and associated access ports.
show interfaces status
This command displays information about switch ports, including whether they are connected.
show interfaces trunk
This command displays information about trunk connections and the VLANs they carry.
Design a simple network for a school with three departments.
| Department | Number of Computers | VLAN ID |
|---|---|---|
| Administration | 2 | 10 |
| Teachers | 2 | 20 |
| Students | 2 | 30 |
ROUTER
|
|
NETWORK SWITCH
|
+-----------+-----------+
| | |
VLAN 10 VLAN 20 VLAN 30
| | |
PC 1 PC 3 PC 5
PC 2 PC 4 PC 6
Administration Teachers Students
If you have access to Cisco Packet Tracer, you can build this network in the simulator and practise the basic configuration under the guidance of your instructor.
| Word | Meaning |
|---|---|
| Switch | A device that connects devices within a local network. |
| MAC Address | A hardware address used to identify a network interface. |
| MAC Address Table | A list of MAC addresses and the switch ports where they are learned. |
| VLAN | A logical division of a switched network. |
| VLAN ID | A number used to identify a VLAN. |
| Network Segmentation | Dividing a network into smaller sections. |
| Access Port | A switch port normally assigned to one VLAN. |
| Trunk Port | A switch port that can carry traffic from multiple VLANs. |
| Broadcast Domain | A group of devices that receive broadcast messages from one another. |
| Inter-VLAN Routing | Communication between different VLANs through a Layer 3 device. |
| Port Security | A switch feature that helps control which devices can use a port. |
1. What is the main purpose of a network switch?
2. Which address does a Layer 2 switch normally use to forward frames?
3. What does VLAN stand for?
4. What is network segmentation?
5. Which port normally carries traffic for one VLAN?
6. Which port can carry traffic from multiple VLANs?
7. What does a MAC address table help a switch do?
8. What is normally needed for devices in different VLANs to communicate?
9. What does a broadcast domain describe?
10. Which command displays VLAN information on many Cisco switches?
A school has 30 computers. Ten computers are used by teachers, ten by students and ten by administrators.
Answer these questions:
In this module, we learned that a network switch connects devices within a local network. It uses MAC addresses to help forward information to the correct devices.
We also learned about network segmentation and VLANs. These technologies help organisations divide large networks into smaller, more organised sections.
Access ports normally connect end devices to one VLAN, while trunk ports can carry traffic from multiple VLANs. When devices in different VLANs need to communicate, inter-VLAN routing makes this possible.
Remember: switches connect devices, VLANs organise network groups, and routers help different IP networks communicate.
Congratulations! You have completed Module Four of Networking Basics Level Three.
In the next module, you will learn about wireless networking, Wi-Fi standards, wireless access points and wireless network security.