Calculate available VLAN IDs and subinterface count for 802.1Q tagged networking.
IEEE 802.1Q VLAN tagging inserts a 4-byte tag (2 bytes TPID + 2 bytes TCI, carrying the VLAN ID and priority bits) into each Ethernet frame, which adds a small but nonzero bandwidth cost proportional to frame rate — negligible for large frames but more noticeable for small, high-rate traffic. The 12-bit VLAN ID field theoretically allows 4096 values, but 0 (untagged/priority-only) and 4095 (reserved) are excluded, leaving a maximum of 4094 usable VLAN IDs per bridge domain — a hard ceiling relevant to large multi-tenant or service-provider deployments.
VLAN tagging overhead
tagged_frame_size = untagged_size + 4 bytes; max VLAN IDs = 4094
`ip link add link eth0 name eth0.100 type vlan id 100` creates a VLAN subinterface for VLAN ID 100 on eth0; `ip -d link show eth0.100` confirms the VLAN ID and parent link. The `8021q` kernel module must be loaded (`modprobe 8021q`).
The 12-bit VLAN ID field spans 0-4095, but VLAN ID 0 is reserved to mean 'no VLAN, priority tag only' and VLAN ID 4095 is reserved by the 802.1Q standard for implementation use — leaving 1-4094 as the usable range for actual VLAN identifiers.
Yes — adding the 4-byte tag to an already-maximum-size 1500-byte payload frame can push it to 1504 bytes, which is why 802.1Q-aware switches and NICs typically support 'baby giant' frames (1500 + a few bytes) to accommodate tagged traffic without fragmentation.