Sub topic 1
Why Segment a Switched Network
Prerequisites
This chapter assumes you already know the following:
- Ethernet frames and MAC addresses.
- How a Layer 2 switch learns source MAC addresses, then forwards, floods, or filters frames.
- IPv4 addressing and subnets.
- Basic command-line use on a router or switch.
The problem: one big broadcast domain
A switch forwards a frame only to the port where the destination MAC address was learned. Two kinds of traffic ignore that rule:
- Broadcast frames have the destination
ff:ff:ff:ff:ff:ff. The switch floods them out every port in the same Layer 2 network. - Unknown unicast frames have a destination MAC address the switch has not learned. The switch floods these too.
A broadcast domain is the set of devices that receive a broadcast sent by any one of them. A plain switch, with no other configuration, puts every port in a single broadcast domain. Adding switches and connecting them with cables makes that domain larger.
Common broadcast senders include ARP requests, DHCP discovery messages, and some discovery protocols. Each host must process every broadcast it receives, even when the broadcast is not meant for it. In a small office this cost is tiny. In a network with hundreds of hosts, it adds up. It also makes a fault bigger. A switching loop or a misbehaving network card can flood the whole domain.
Reasons to segment
Segmentation means splitting one large network into several smaller ones. Network designers do this for four main reasons.
- Performance. Smaller broadcast domains mean fewer broadcasts reach each host.
- Security. Hosts in different segments cannot talk directly at Layer 2. Traffic between them must cross a Layer 3 device, where you can apply access control lists (ACLs) or firewall rules.
- Fault containment. A loop or a noisy device affects only its own segment.
- Organization. You can group devices by role, such as users, servers, printers, and guests, and not by where they are plugged in.
Two ways to segment
The first way is to use separate physical switches for each group. This works, but it is costly. A group with only a few ports still needs its own switch, and moving a user to another group means moving a cable to another switch.
The second way is to use virtual LANs (VLANs). A VLAN is a logical Layer 2 network defined in switch configuration. One physical switch can host several VLANs, and each one is its own broadcast domain. The next chapters cover how this works.
| Approach | Broadcast domains | Moving a user to another group | Hardware cost |
|---|---|---|---|
| One flat network | One | Not applicable | Lowest |
| Separate switches per group | One per switch | Recable to another switch | High |
| VLANs on shared switches | One per VLAN | Change one port setting | Moderate |
Segments and subnets
Each segment normally uses its own IP subnet. Hosts in the same subnet talk directly. A host that wants to reach another subnet sends the packet to its default gateway, a router interface in its own subnet. So separating broadcast domains also means traffic between groups must be routed.
For example, users might use 192.168.10.0/24 and servers might use 192.168.20.0/24. A user's PC cannot reach a server by ARP, because the ARP broadcast never leaves the user segment. The PC sends the packet to its gateway, and the router forwards it.
This one-to-one match between a broadcast domain and an IP subnet is a design convention, not a rule enforced by the switch. It is the convention you should follow, because it keeps the network simple to troubleshoot.
Key points
- A switch with no VLANs has one broadcast domain.
- Broadcasts and unknown unicasts are flooded to every port in that domain.
- Segmenting improves performance, limits the impact of faults, and lets you apply policy between groups.
- VLANs let you build many broadcast domains on the same switches, without extra hardware.
- Each broadcast domain should map to one IP subnet, and a router or Layer 3 switch carries traffic between them.
Exercise
A company has 300 hosts on one flat switched network, using a single /23 subnet. Users complain of slowdowns, and a faulty network card on one host causes problems for everyone. Name two benefits of splitting this into several VLANs, each with its own subnet. Then say what device is now needed for hosts in different VLANs to communicate.
Show answer
Any two of these benefits: fewer broadcasts reach each host, a faulty device or loop affects only its own VLAN, and you can apply ACLs or firewall rules between groups. Hosts in different VLANs now need a Layer 3 device, either a router or a Layer 3 switch, to route traffic between the subnets.