Virtual Local Area Network and Subnetwork
VLAN (Virtual LAN), translated into Chinese as “virtual local area network”. A LAN can be a network composed of a few home computers or an enterprise network composed of hundreds of computers. The LAN referred to by VLAN refers specifically to a network divided by routers - that is, a broadcast domain.
The subnet is also a network divided by routers.
What is the difference between the two? The most essential difference is that, according to the network layering model, ** VLAN is mainly used to divide the broadcast domain of the data link layer, while subnetting is to divide the network layer through IP Address **. If subnetting is done with CIDR, then if the two IP Addresses are calculated through the subnet mask and the result is the same, it is the same subnet.
VLAN
Broadcast domain
Let’s review the concept of broadcast domain before talking about VLAN. Broadcast domain refers to the range to which broadcast frames (all destination MAC addresses are 1) can be transmitted, that is, the range to which direct communication can be made. Strictly speaking, not only broadcast frames, multicast frames (Multicast Frame) and unknown unicast frames (Unknown Unicast Frame) can also travel unimpeded in the same broadcast domain.
Originally, the Layer 2 switch could only build a single broadcast domain, but using the VLAN function, it can split the network into multiple broadcast domains.
Why do you need to split the broadcast domain?
That’s because if there is only one broadcast domain, it may affect the overall transmission performance of the network.
Reading this, you may ask: Is broadcast information really so frequent?
The answer is: yes! In fact, broadcast frames will appear very frequently. When communicating with TCP/IP Protocol Stack, in addition to the ARP mentioned earlier, there may be many other types of broadcast messages such as DHCP and RIP.
ARP broadcasts are issued when communication with other hosts is needed. When a client requests a DHCP server to assign an IP address, it must issue a DHCP broadcast. When using RIP as a routing protocol, the router broadcasts routing information to other neighboring routers every 30 seconds. Routing protocols other than RIP use multicast to transmit routing information, which is also switch-forwarded (Flooding). In addition to TCP/IP, protocols such as NetBEUI, IPX, and Apple Talk often require broadcasts. For example, when you double-click to open “Network Computer” under Windows, a broadcast (multicast) message will be issued. (Except for Windows XP…)
In short, radio is all around us. Here are some common broadcast communications:
ARP request: Establish the mapping relationship between IP Address and MAC Address.
RIP: A routing protocol.
DHCP: Protocol for automatically setting IP Addresses.
NetBEUI: The network protocol used under Windows.
IPX: The network protocol used by Novell Netware.
Apple Talk: The network protocol used by Apple’s Macintosh computers.
If there is only one broadcast domain in the entire network, once the broadcast information is sent, it will spread throughout the entire network and bring additional burden to the hosts in the network. Therefore, when designing a LAN, you need to pay attention to how to effectively segment the broadcast domain.
The Segmentation of Broadcast Domain and the Necessity of VLAN
When splitting the broadcast domain, a router must generally be used. After using the router, the broadcast domain can be divided in units of the network interface (LAN Interface) on the router.
However, usually there are not many network interfaces on the router, and the number is around 1 to 4. With the popularity of broadband connections, broadband routers (or IP sharers) have become more common, but it should be noted that although they have multiple (usually about 4) network interfaces connected to the LAN side, they are actually built-in switches of routers and cannot split the broadcast domain.
Moreover, if a router is used to divide the broadcast domain, the number that can be divided depends entirely on the number of network interfaces of the router, so that users cannot freely divide the broadcast domain according to actual needs.
Compared with routers, Layer 2 switches generally have multiple network interfaces. Therefore, if it can be used to divide the broadcast domain, the flexibility of application will undoubtedly be greatly improved.
The technology used to divide the broadcast domain on the Layer 2 switch is VLAN. By using VLAN, we can freely design the composition of the broadcast domain and improve the freedom of network design.
How to divide VLAN
On how to achieve VLAN partitioning, you can see这篇博客
In fact, no matter what kind of division method, it is to find a way to store the mapping and forwarding relationship of addresses, which is somewhat similar to the idea of NAT.
Subnet
Regarding the division of subnets and the difference between subnets and intranets, you can see my other blog: https://sunra.top/posts/991b3de7/