Dear Professor Phil,
We’re thinking of purchasing an IP video encoder; it streams RTSP. The manufacturer recommends that “the video stream run on a separate subnet.” I’ve always heard that the video should be on its own VLAN. Aren’t they the same? In other words, isn’t a VLAN always a subnet, and vice versa?
—Charlene, Ocala, FL
- They are technically not the same. However, in practice, often they are implemented as if they were equivalent. A VLAN is created by grouping devices based on their hardware or mac addresses. Devices communicate only with other devices in the same group. This is enforced by the Ethernet switch of the switch function within a router. When a router does this, other network devices see the router as an Ethernet switch.
A subnet is created based on a range of IP addresses. For example, if a range begins with 192.168.13.128 and extends sequentially to 192.168.13.143, the sixteen addresses create a subnet or subnetwork. Routers make sure that devices in this address range communicate directly with each other. Any Ethernet switch within the subnet would play no role since it would not read IP addresses. If it did, it would actually be acting as a router.
So, why do most people think they are the same? Suppose I have two routers and a segment connecting them as in Figure 1. The most general way of assigning addresses in a link like this is to use what often is called a class C assignment. For example, the network could be designated 192.168.13.0. In such a plan, the highest address in the range would be 192.168.13.255, which would be reserved to designate broadcasts in the subnet. Each router would need an address. So, let’s say we use 192.168.13.1 and 192.168.13.2. The remaining addresses from .3 to .254 could be used for computers in the subnet.
The same configuration could also be VLAN-based, using the hardware addresses of the two routers and the hardware addresses of additional computers that are attached to the link. This would be configured within the switch function of the router. Or, the routers could be replaced by switches. Note, however, that in this instance, the subnet could be subdivided into two, three or more VLANs by using the hardware addresses. This is illustrated in Figure 2.
I hope this helps to clarify the difference between the idea of a subnet and the idea of a VLAN.
Phil Hippensteel, PhD, is an instructor at Penn State Harrisburg. Send your tech question to firstname.lastname@example.org.