A Switch learns which MAC addresses are on each port and builds a MAC Address Table. This way, it sends each Frame only to the correct port, instead of to the entire network.
VLAN — Logical segmentation of the network
PC-A and PC-C sit in VLAN 10, PC-B and PC-D in VLAN 20, connected through access ports to switches SW1 and SW2. A trunk port between the switches carries both VLANs tagged with 802.1Q, while the native VLAN travels untagged. Hosts in different VLANs cannot reach each other until a router or L3 switch provides inter-VLAN routing.
- A VLAN is a 'network within a network' — logical separation without additional cables.
- Access Port — Belongs to one VLAN, connected to a computer or printer.
- Trunk Port — Carries several VLANs between Switches, tagged with 802.1Q.
- Native VLAN — Traffic that passes through the Trunk without a tag (default VLAN 1 — recommended to change).
- Inter-VLAN Routing — A Router or L3 Switch is required to move between VLANs.