Why we need VLANs: broadcast domains and the logical topology
This lesson is open to everyone. The other lessons open with a package: sign in or sign up, then choose a package.
Key points
- In a flat network one broadcast (for example an ARP request) is flooded to every switch. The more computers, the more useless traffic.
- Collision domain = every switch port. Broadcast domain = every device a broadcast reaches. A router does not forward broadcasts, so it is the edge of a broadcast domain.
- VLAN (Virtual LAN) = "a switch inside a switch". Every VLAN is a separate broadcast domain. By default a device only talks directly to devices in the same VLAN.
- The physical topology (cables) differs from the logical topology (VLANs): the Engineering VLAN can span three floors.
- Voice VLAN: an IP phone and the computer behind it share one cable, but the phone is in the voice VLAN and the computer in the data VLAN. This lets QoS (Quality of Service) prioritise voice.
The problem: "one switch per department"
In lesson 3.1 we had a short introduction to VLANs. Now we go deeper, starting with the problem VLANs solve. Look at this network for a minute:
There are many departments and each has its own switch. Users are grouped physically and connected to their own switch. Is this a good design? Ask yourself:
- What happens when a computer on the Research switch sends a broadcast such as an ARP request?
- What happens when the Helpdesk switch fails?
- Will users on the Human Resource (HR) switch have fast connectivity?
- How do we implement security in this network?
1. Broadcasts go everywhere
What do switches do with a broadcast? They flood it! One broadcast frame spreads over the entire network. Switches also flood frames for MAC addresses they have not learned yet (unknown unicast flooding, as you remember from the previous lesson).
2. A single point of failure
If the Helpdesk switch fails, HR users are isolated: they cannot reach other departments or the Internet. The same applies to the other switches. On top of that everyone goes through the Helpdesk switch to reach the Internet, so we share bandwidth. Not a good idea performance-wise.
3. Security
We could use port-security and filter on MAC addresses, but that is not very secure, because MAC addresses are very easy to spoof.
VLANs are one way to solve these problems.
Collision domains and broadcast domains
Two questions to refresh your knowledge:
- How many collision domains are in the picture?
- How many broadcast domains?
In the hubs, bridges and switches lesson we said that every switch port is a separate collision domain. So this picture has a lot of collision domains: more than 20.
And broadcast domains? When a computer on the Sales switch sends a broadcast, every other switch forwards it. What about the router at the top? Does a router forward broadcast frames?
No: a router does not forward broadcasts, so it marks the edge of the broadcast domain. The Internet side of the router is a separate broadcast domain. That gives 2 broadcast domains here.
| Collision domain | Broadcast domain | |
|---|---|---|
| Hub | Does not split (all one) | Does not split |
| Switch / bridge | Every port separate | Does not split (without VLANs) |
| Router | Every interface separate | Every interface separate |
| Switch with VLANs | Every port separate | Every VLAN separate |
A flat network in Wireshark
The Research computer (10.0.0.25) sends an ARP request to learn a printer's MAC. If we run Wireshark in a completely different department, on a Sales computer, this is what we see:
No. Time Source Destination Protocol Info 1 0.000000 Dell_3a:91:0c Broadcast ARP Who has 10.0.0.200? Tell 10.0.0.25 2 0.812330 HP_7e:10:44 Broadcast ARP Who has 10.0.0.1? Tell 10.0.0.61 3 1.204117 Lenovo_c2:5d:e9 Broadcast ARP Who has 10.0.0.14? Tell 10.0.0.133 Frame 1: 60 bytes on wire Ethernet II, Src: Dell_3a:91:0c (f8:bc:12:3a:91:0c), Dst: Broadcast (ff:ff:ff:ff:ff:ff) Address Resolution Protocol (request)
The Sales computer has nothing to do with Research's printer, yet every broadcast reaches its network card and its CPU has to process it. In a flat network with hundreds of computers that means hundreds of useless frames per second. With VLANs, the Sales computer only sees the broadcasts of its own VLAN.
VLAN: a switch inside a switch
When you work with switches, keep the difference between the physical and the logical topology in mind. The physical topology is how the cables are connected. The logical topology is how we have set things up "virtually". In the example above there are 4 switches and we created 3 VLANs: Research, Engineering and Sales. VLAN stands for Virtual LAN: it is like a "switch inside a switch".
Advantages of VLANs:
- One VLAN = one broadcast domain. If a user in the Research VLAN sends a broadcast, only users in the same VLAN receive it.
- Users can only communicate directly within the same VLAN. Between VLANs you need a router (we will see this in this section).
- Users do not have to be grouped physically: the Engineering VLAN has users on the 1st, 2nd and 3rd floor.
VLANs can separate traffic types, not just departments: all printers in one VLAN, servers in another, computers in a third. A separate VLAN for cameras is very common in office and shop projects in Azerbaijan.
Voice VLAN: one cable, two VLANs
What about VoIP (Voice over IP)? Put all IP phones in a separate VLAN so their traffic is separated from other data.
If you look at a Cisco IP phone you will see it has two Ethernet ports: one to connect the phone to the switch and one to connect your computer to the phone. That saves a switch port and an extra cable. But there is something even nicer:
The IP phone is in the Voice VLAN and the computer in the Data VLAN. Only one cable goes to the switch, yet traffic is neatly separated by VLANs.
This also lets us use QoS (Quality of Service), which gives priority to certain traffic types. VoIP is very sensitive to delay and jitter (variation in delay). When the network is congested, voice traffic must always be prioritised so the call does not break up. That is what QoS does. We will look at the QoS basics in the IP Services section.
In practice: when an office complains that "voice breaks up during calls", one of the first things to check is whether the phones are in a separate voice VLAN and whether QoS is configured.
In the next lesson we answer the most important question: when a frame goes from one switch to another, how does the other switch know which VLAN it belongs to?
Check yourself
5 questions · answers are shown instantly · 3 correct answers complete the lesson
1A company has 12 switches, no VLANs and one router for Internet access. A computer in Accounting sends an ARP request. Who receives this broadcast?
2A 24-port switch with no VLANs is connected to a router (2 interfaces). The router's other interface goes to the Internet. How many broadcast domains are there?
3Engineering staff sit on the 1st, 2nd and 3rd floors, with a separate switch on each floor. What is the right way to put them in one broadcast domain?
4Management asks: "If we separate every department by MAC with port-security, do we still need VLANs?" Which answer is most accurate?
5A user's computer is plugged into the PC port of an IP phone, and the phone into the switch. Which configuration is correct?
Comments
Sign in to comment.