This is the first blog post in the series ”What I learned today”. The idea is to explain my journey into something that I have learned recently. And in this post I will explain what I learned about Virtual Local Area Networks, VLAN.
Today at work I got a testing testing task that was about creating new VLAN. I knew what VLAN stands for and had some sort of an idea what it is about. However, I wanted to know more, so I did some digging into.
I started, as any proper engineer would, by searching Google and Youtube. I found some articles and videos that looked kind of promising. I started with this video (mainly because it was short):
As you might expect, it was really basic video explaining the concept of VLAN. That is, it is possible to create Virtual LANs to logically connect devices to a network segment, regardless of their physical location. And this can be done without getting extra network equipment.
That video didn’t provide much new knowledge for me except for one thing: each VLAN has designated interfaces (ports) in the switch. I had a feeling that’s how it is, but I got the confirmation from the video. So, to get more information, I continued with another video:
By default, switches have one VLAN, VLAN 1, to which all the interfaces are assigned to. It is possible to add up to 4094 VLANs, which is kind of staggering number of VLANs.
So, in the illustration below, in addition to VLAN 1, there are VLAN 10 and VLAN 20 configured. Devices connected to interfaces assigned to VLAN 10 can only communicate between each other. And the same applies to devices connected to VLAN 20. A VLAN is not restricted to one switch, it can range over multiple switches. Sounds reasonable, otherwise it probably wouldn’t be possible to support 4094 VLANs.
But if we have more than one switch, how can they communicate with each other. If we used VLAN 1 to connect the switches then VLAN 10 and VLAN 20 couldn’t communicate with the other switch. The solution is a separate VLAN called trunk.
There are two types of ports in a switch: an access port and a trunk port. Access ports are used by devices connected to a VLAN. Trunk ports are used by switches to communicate with each other. Trunk will deliver data from all VLANs.
But the main idea of VLANs was that traffic is separated. If data from all VLANs go through trunk ports, how can it be separated. Well, let’s just say that the switches handle the separation. You may watch the second video to get more details.
So, after this I had enough information to conclude my test task (and actually a bit more). There is plenty of details that I didn’t cover here, but maybe I’ll learn more about it later.