That has been written about on the web before. And today? at https://learningnetwork.cisco.com/thread/91811
You've rehashed some prior paper or book on the subject so let's say it's correct.
I am currently studying for CCNA R&S 200-120 exam. and as I cover each topic, I like to write something about it. Your feedback is beneficial two fold; I check that my understanding is correct and I learn more from you guys.
Many thanks in advance.
Root Port Election Process.
The RB floods its CBPDU advertising a Cost to RB value of 0, because it is the RB so there is no cost to get to the RB, of course. The other switches will receive this CBPDU and add the cost of the port it received the CBPDU on, to the advertised Cost to RB value on the CBPDU received, which is 0.
For example, if the CBPDU comes in Fa0/1, the switch will ad 19 to 0 (if you look at the Port Costs table you can see that the cost for a 100Mbps link is 19) so, 19 + 0=19. So this switch will forward a copy of the CBPDU received advertising a Cost to RB value of 19. The next switch will receive this BPDU and again add the cost value of the port it received it in (let´s say that it is a 1Gbps link) to the Cost to RB value advertised in the BPDU received, which is 19, so 4 + 19=23. When this switch send its own BPDU, it will advertise a Cost to RB value of 23. This same process will repeat until the port with the lowest -cumulative- path-cost on each non-RB switch is elected Root Port.
Let´s follow this same example step by step:
1.RB floods a CBPDU advertising a Cost to RB of 0 (zero). This makes sense because there is a cost of 0 for the RB to get to the RB.
2.Non-RBs receive this CBPDU and they add the cost of its port to the advertised Cost to RB in the CBPDU. So Cost to RB-0 +100Mbps cost-19 = 19.
3.The non-RB sends a copy of the CBPDU advertising a Cost to RB of 19 (This is true for this non-RB on this step of our example. The other non-RBs in the topology might advertise a different Cost to RB value depending on the cost value of the port they received the CBPDU on.)
4.The next non-RB downstream receives the BPDU advertising a Cost to RB of 19. The port in which this BPDU came into is a 1Gbps port, which has a cost of 4. The switch adds 19 + 4 = 23 and sends out a BPDU with an advertised Cost to RB of 23.
5.The process repeats until all the RPs have been elected.