27

The Tag Protocol Identifier is set to 16 bits. In the CCNA certification it is said that it's not possible to have more than 4096 VLANs. 4096 in binary is 1000000000000000. Since 16 bits are allocated anyway, the limit could be 65535(1111111111111111)...

Why is that limit set to 4096?

5 Answers 5

33

Only 12 bits are used for VLANs in 802.1q, so you can only use VLANs from 0-4095 (=4096* different VLANs).

*actually 2 less, 0 and 4095 are reserved

http://en.wikipedia.org/wiki/IEEE_802.1Q#Frame_format

PS:

4096(DEC) is 1000000000000(BIN)
4095(DEC) is  111111111111(BIN)
5
  • 4
    ok, I misread the doc.. it's' friday isn't it?? Thanks
    – maxxxou
    Oct 4, 2013 at 14:30
  • 4
    friday = never-enough-coffee day :)
    – mulaz
    Oct 4, 2013 at 14:30
  • 1
    Also in some boxes 1001 to 1005 (I think) are also reserved
    – fredpbaker
    Oct 4, 2013 at 19:56
  • 3
    1001-1005 are cisco "bridge" vlans, used for interconnecting token ring and fddi with ethernet. despite not making such gear anymore, the code remains in IOS to this day. (IOS 15 on 2960S's still have that BS in it.)
    – Ricky
    Oct 4, 2013 at 20:31
  • Note: Some devices (e.g. Brocade) use VLAN 4095, see this ticket for netdot: osl.uoregon.edu/redmine/issues/1623
    – user2084
    Aug 27, 2015 at 9:54
2

Total Vlan tagging is 4 bytes. Here TPI (Tagging Protocol Identifier ) is of 2 bytes(16 bits) and TCI (Tagging Control Information ) is of 2 bytes (16 bits) In TCI, we have PCP(Priority Code Point)=> 3 bits DEI(Drop Eligible Indicator) = > 1 bit and VID(Vlan Identifier) =>12 bits.

2 power 12 is 4096. that is the reason vlan numbers are 4096 (including all reserved vlans)

1

And many boxes are far more limited, really - 255 VLANs picked from 1-4093 (not 4094) is the case on some of my switches. The numerical range is available but the switch can only use 255 individual numbers from it at one time. So far this has never even come close to being a practical problem here.

0

Actually in vlan header contains TPID(16 bits),PCP(3 bits),CFI(1 bit)and VID(12 bits). in vlans we are using vlan id's for transport of traffic from one switch to another switch. so the vlan id i.e vlan identifier is 12 bits.

output:2^12=4096.(in binary format).but we are using traffic of multiple vlans from 1 to 4094 at a time only.the remaining two bits is reserved i.e 0 and 4095.

-1

4 bytes for tagging .. 3 bits of which are PRL . remaining 13 bits would be 4096 : 0 to 4095 . the 0 and 4095 reserved and from 1001 to 1005 are not used nowadays .

Note : if using VTP , can't use more than 1001 VLANS .

3
  • 1
    Ummm, no. 2^13 = 8192. The current answer is correct, 12 bits are used for the VLAN ID. Also, if you're going to mention "4 bytes", it's worth mentioning what the other 2 bytes (16 bits) are for - the protocol ID).
    – robut
    Aug 26, 2015 at 13:09
  • true forgot the DEI one bit identifier . and yes the two remaining bytes are for tag protocol identifiers . thanks
    – Ahmed Z
    Aug 29, 2015 at 6:28
  • The second part of this answer is only true for VTPv2. VTPv3 can handle upper range VLANs. Despite that, VTP is Cisco-only and not relevant for all devices.
    – Daniel
    Jul 30, 2016 at 20:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.