Network Design and Operations
The VLAN ID in an IEEE 802.1Q tag is 12 bits long, and the values 0 and 4095 are reserved for special purposes. How many VLAN IDs can be used to identify VLANs?
- A4094
- B4095
- C4096
Show answer and explanation
Answer: A. 4094
12 bits can represent 2^12 = 4096 values (0 to 4095). Excluding 0, which is used for tags that carry only a priority, and the reserved value 4095 leaves 4096 − 2 = 4094 IDs for identifying VLANs. An 802.1Q tag is 4 bytes long and is inserted after the source MAC address in an Ethernet frame. It consists of a 2-byte value marking it as a tag (0x8100), a 3-bit priority (PCP), a 1-bit DEI and the 12-bit VLAN ID.
- A. Correct. 2^12 − 2 = 4094.
- B. This excludes only 0. The value 4095 is reserved as well.
- C. This is the total number of 12-bit values, without excluding the two reserved ones.