1

For the STP Priority Field, how do you get "multiples of 4096" out of 4 bits?

2
  • 0-15 (your 4 bits) * 4096. I didn't write the spec; that's just how it works.
    – Ricky
    Commented Oct 8, 2019 at 0:51
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Commented Dec 15, 2019 at 19:21

3 Answers 3

2

I think you are confusing a couple of things about the 802.1Q tag. The tag is 32 bits, the first 16 bits of which are the TPID (0x8100) field. The last 16 bits are the TCI that consists of three fields:

  1. The PCP is three bits for priority
  2. The DEI is one bit usually used along with the PCP to create a four-bit priority
  3. The VLAN ID is 12 bits

Since the VLAN ID is 12 bits, it can have 4096 different values. It is the low-order 12 bits of the TCI, the four higher order bits together are multiples of 4096. Taken by themselves, the four bits only have 16 possible values, but they are actually part of the TCI, which has 65,536 different values for all the fields combined.

Looking at it in binary makes it obvious (the priority starts on bit 13):

Bit   |   16|   15|   14|   13|   12|   11|   10|    9|    8|    7|    6|    5|    4|    3|    2|    1|
Value |32768|16384| 8192| 4096| 2048| 1024|  512|  256|  128|   64|   32|   16|    8|    4|    2|    1|

Typically, you take the 4096-based priority and add it to the VLAN ID to come up with the TCI.

3
  • I'm trying to study for the CCNA Exam. In Wendell Odom's ICND2 (2016) book, on page 73, it states the Spanning-Tree Protocol's "Priority Field" has 4 bits and is multiples of 4096. I cannot fathom how you can get 32,768 out of 4 bits. :( Commented Oct 8, 2019 at 0:59
  • 802.1d, 802.1w, and 802.1s -- all the things predating the consolidation in 802.1q-2014. Blame 802.1t... the "priority" is the 4 MSBs of the 16bit priority field, with the remaining 12 being the extended system id.
    – Ricky
    Commented Oct 8, 2019 at 1:10
  • @LeonardBoone, look at the values of the bit number of the 16-bit field. The bit 13 value (where the priority starts) is 4096. The four most significant bits must be a multiple of 4096.
    – Ron Maupin
    Commented Oct 8, 2019 at 1:51
2

Using bridge priority increments of 4,096 is a means to keep compatibility with classic STP where the priority was a 16-bit field. In RSTP/MSTP that field was reduced to 4 bits, so there are 12 lower, "virtual", all-zero bits. This creates unambiguous priority mapping between STP and RSTP/MSTP priorities.

IEEE 802.1D-2004 reads:

The stated ranges and granularities for Bridge Priority and Port Priority differ from the equivalent text and table in IEEE Std 802.1D, 1998 Edition and earlier versions of this standard as explained in 9.2.5 and 9.2.7. Expressing these values in steps of 4096 and 16 (rather than, for example, as a 4-bit value with a range of 0 to 15) allows consistent management across old and new implementations of this standard; the steps chosen ensure that bits that have been reassigned are not modified, but priority values can be directly compared with those based on previous versions of the standard.

As a side effect, those 12 "virtual" bits allow for simpler interoperability with R/PVST+ (where required) which can use the individual VLAN ID in those usually zero bits (PVST has one bridge instance in each VLAN as opposed to IEEE STP with a single default instance for a bridge).

For MSTP, the 12 repurposed bits in the BPDU hold the system ID extension that distinctly identifies the multiple spanning tree instance (MSTI) that the bridge operates in.

See IEEE 802.1Q clause 14.2.5 Encoding of Bridge Identifiers for details.

0

The example bellow helped me to understand the meaning of these 4 bits + what the extended bits are used for.

The Bridge Priority value and the Extended System ID extension together make up a 16 bit (2-byte) value. The Bridge Priority making up the left most bits, is a value of 0 to 61440. The Extended System ID is a value of 1 to 4095 corresponding to the respective VLAN participating in STP. The Bridge Priority increments in blocks of 4096 to allow the System ID Extension to squeeze in between each increment. This is clearly shown in the below analysis:

STP Bridge Priority Bits

source: firewall.cx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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