Computer Science – Network hardware | e-Consult
Network hardware (1 questions)
Login to see all questions.
Click on a question to view the answer
A switch is a networking device that connects multiple devices on a local area network (LAN). It forwards data packets between devices based on their MAC addresses. Unlike a hub, a switch learns the MAC addresses of the devices connected to its ports and creates a MAC address table.
Here's how a switch uses MAC addresses:
- When a data packet arrives at a switch, the switch examines the destination MAC address in the packet header.
- The switch looks up the destination MAC address in its MAC address table.
- If the MAC address is found in the table, the switch forwards the packet only to the port associated with that MAC address. This is called unicast.
- If the destination MAC address is not found in the table, the switch floods the packet to all ports (except the port it received the packet on). This is called flooding. The device with the matching MAC address will then respond, and the switch will learn its location.
Diagram:
| Cell |
- Device A sends a packet to Device B.
- The packet arrives at the switch.
- The switch examines the destination MAC address (MAC address of Device B).
- The switch looks up the MAC address in its MAC address table and finds that Device B is connected to port 3.
- The switch forwards the packet only to port 3.
This selective forwarding based on MAC addresses improves network efficiency by reducing unnecessary traffic. Hubs, in contrast, broadcast all traffic to all ports, which is less efficient.