Try our training for free.

Gain instant access to our entire IT training library for 1 week. Train anytime on your desktop, tablet, or mobile devices.

Employers know that CCNP-certified job applicants have a real-world knowledge of networking.  They also know that Cisco awards big discounts to companies that hire Cisco-certified staff. 

After watching Jeremy Cioara's new CCNP 642-813 SWITCH training, you'll be a master-level consultant on Cisco switched networks. You'll also have brighter career prospects and be an important step closer to CCNP certification.

Jeremy covers everything you ever wanted to know about switching in this update to his existing BCMSN course.  In no time, you'll be designing your network for maximum uptime and preparing it for advanced services like WiFi, VoIP and Video over IP. 

Jeremy's training maps to Cisco CCNP certification exam 642-813....
Employers know that CCNP-certified job applicants have a real-world knowledge of networking.  They also know that Cisco awards big discounts to companies that hire Cisco-certified staff. 

After watching Jeremy Cioara's new CCNP 642-813 SWITCH training, you'll be a master-level consultant on Cisco switched networks. You'll also have brighter career prospects and be an important step closer to CCNP certification.

Jeremy covers everything you ever wanted to know about switching in this update to his existing BCMSN course.  In no time, you'll be designing your network for maximum uptime and preparing it for advanced services like WiFi, VoIP and Video over IP. 

Jeremy's training maps to Cisco CCNP certification exam 642-813.
1. Welcome to Cisco Switch: Watch Me First! (17 min)
2. The Switches Domain: Core Concepts and Design (42 min)
3. VLANs: Configuration and Verification (13 min)
4. VLANs: In-Depth Trunking (35 min)
5. VLANs: VLAN Trunking Protocol (33 min)
6. STP: Foundation Per-VLAN Spanning Tree Concepts, Part 1 (23 min)
7. STP: Foundation Per-VLAN Spanning Tree Concepts, Part 2 (34 min)
8. STP: Rapid Spanning Tree Concepts and Configuration (24 min)
9. EtherChannel: Aggregating Redundant Links (24 min)
10. L3 Switching: InterVLAN Routing Extraordinaire (28 min)
11. L3 Switching: Understanding CEF Optimization (16 min)
12. Redundancy in the Campus: HSRP, VRRP, and GLBP Part 1 (43 min)
13. Redundancy in the Campus: HSRP, VRRP, and GLBP Part 2 (23 min)
14. Campus Security: Basic Port Security and 802.1x (32 min)
15. Campus Security: VLAN and Spoofing Attacks (31 min)
16. Campus Security: STP Attacks and Other Security Considerations (15 min)
17. Campus VoIP: Overview, Considerations, and AutoQoS (44 min)
18. Wireless LAN: Foundation Concepts and Design Part 1 (26 min)
19. Wireless LAN: Foundation Concepts and Design Part 2 (22 min)
20. Wireless LAN: Frequencies and 802.11 Standards (34 min)
21. Wireless LAN: Understanding the Hardware (30 min)
22. The Switches Domain: Additional Life-Saving Technology (22 min)
23. Monitoring: Your Pulse on the Network (45 min)
24. Campus Security: VACLs (14 min)

Welcome to Cisco Switch: Watch Me First!

The Switches Domain: Core Concepts and Design

VLANs: Configuration and Verification

VLANs: In-Depth Trunking

VLANs: VLAN Trunking Protocol

STP: Foundation Per-VLAN Spanning Tree Concepts, Part 1

00:00:00

To start this video I have two random Christmas tree facts for you. Number one, in the year 2005, 32.8 million Christmas trees were purchased. Number two, an acre of Christmas trees provides for the daily oxygen of 18 people. Truly random facts and that leads into the foundation concepts. Somehow

00:00:25

it leads us into the foundation concepts of the spanning tree protocol. Part one, there's a lot to it. Spanning tree, dropping trees around the world, we're going to talk about why that statement is true and what spanning tree does, then we'll look at the original and start enhancing that as we go. 802.1D Spanning Tree and the details behind it, there is a lot to spanning tree. It is one

00:00:50

of the huge concepts in modern switch networks. Finally, when we get to part two of the per VLAN Spanning Tree, we'll start getting into the STP port states, we'll get into the configuration, and finally the optimization steps. Work is over. You walk out the door. It's Friday afternoon. You

00:01:10

hop in the car and drive home. You fight the rush hour and get through the door, flop on the couch and, ah, it's good to be home for the weekend. You know that feeling. You're watching that ceiling fan, kind of turn circles around. And you think now what am I going to do? Glad you asked because now is the time for a little Friday night fun. Here's what you do on that

00:01:32

Friday night, you grab a couple switches, now these are generic switches, no expensive Cisco gear needed here, Linksys, D-link, whatever you want, go ahead and take those switches and plug the computer into each side, could be a laptop, could be a desktop, just one computer into each switch, then take a crossover cable and connect the two switches like so. Now turn off all the lights

00:01:57

in the room, go ahead and kick in a Pink Floyd CD and grab a second crossover cable, may need a little light for this and connect the two generic switches like so. Within seconds you will have a dance party. The switches will start blinking like mad, lights going every which way, strangely to the tune of the Pink Floyd song and you're sitting there going what on earth is going on? You look at the computers and open the task manager and you find out the processor utilization is somewhere near 100%. The reason this happened is because the two switches that you hooked up are generic switches, meaning low end switches. They

00:02:39

don't have spanning tree protocol installed, Which means the very first broadcast packet that's sent by a computer and it will be sent, computers do send broadcasts, will come into that switch, get sent down here and then begin looping endlessly around the network, loop, loop, loop, loop, loop hitting every computer every single time it loops around. Somebody will call this a

00:03:01

broadcast storm. Now I've heard it said, people go, well, what about the TTL field? I've heard that comment a lot, the time to live won't that packet die? Well, remember TTL is in the layer 3 header of the packet. The only thing that decrements the TTL and makes it less is the packet going through a router and in this picture I'm not seeing any routers. So what you have is

00:03:25

an immortal packet that is like the highlander. It's running around with its little sword chopping up all the computers on your network because the computers can't stop it and neither can the switches. Now let me walk through the foundations of spanning tree protocol. Switches will forward broadcast packets

00:03:44

all out all ports by design that's the way they work. And in enterprise networks redundant connections are good; they're necessary. You want redundancy. Okay, maybe not basic connections like two connections to every single switch, but I mean you want switches to where you can have the ability to you know have a switch connected to another switch and another and you know some sort of redundancy like this. So if any one switch fails, you still have a redundant

00:04:09

path around the network. So redundancy is good but as we saw from this little scenario right here redundancy can also be very bad. So the place of the spanning tree protocol is to drop trees on redundant links until they are needed. That's my little homonym,

00:04:30

if you will, to help people remember what spanning tree is all about. Spanning tree will look at your switch network and say, oh, there's a redundant link, let's go ahead and drop a tree on that line and disable it. It's really what spanning tree does. It looks more like a big cauliflower. The only the active link

00:04:49

will forward traffic, the single link. Now anybody can unplug a network connection so spanning tree will always be watching that primary link and if it ever goes down it will erect the tree off the line and allow the back up link to go active and all the traffic to forward across that one. So spanning tree

00:05:09

is a good thing to allow you to have redundancy in the network but not cause broadcast storms because broadcasts go over all of the redundant links. I have to confess this spanning tree protocol is one of the most difficult concepts for me to talk about. The reason why is because

00:05:29

what I just showed you is it that's all there is to spanning tree protocol. It is designed to drop trees on the redundant links, disable them until they are needed. The reason it's so complex and the reason there's entire books written on spanning tree is because our networks don't look like our Friday night scenario. Our networks look like this in a smaller size network

00:05:52

where we have all kinds of layers of switches. We have core switches in the middle tied to distribution layer switches in the major VLAN's, we have access layer switches up here that connect to our end user PC's. Now let me ask you looking at this picture:

00:06:06

Would you say there is redundancy? Huh, yeah, lots of it. Every single switch has a redundant up link to every upper layer switch. The access layer has redundant links to the distribution layer. The distribution layer has redundant links to the core. Servers even have redundant links to their

00:06:25

own switches so if any one switch fails we always have a back up path that can reroute around it for critical devices. But if we didn't have spanning tree imagine what one broadcast would do. Within the VLAN it would spin around non stop wiping out all of the different devices that are connected to the network within each layer two domain. Now remember the broadcast does

00:06:49

stop at the boundary so every single VLAN has its own little storm going on and there's no way to stop that without spanning tree. So the reason spanning tree gets complex is because you look at this picture right here and you go, okay, redundancy is good. But now where do you drop the trees? What would be the

00:07:11

most efficient links to block in order to for us to get the best performance out of the links that we have? Now this is where we start moving into some of the concepts behind spanning tree. Now let me restate that these are the core concepts of spanning tree as in everything will build on these 4 statements right here. Number 1 Original Spanning Tree which is 802.1D it's an industry standard not developed by Cisco was created to prevent loops and I should add to that, a long time ago. This protocol has

00:07:43

been around for a good decade since switches have been in existence. Switches in order to work with spanning tree will send probes into the network called bridge protocol data units, you'll hear it abbreviated BPDU's that discover loops. Now what these probes

00:08:02

will do, let me expound on that a little, is they will search through the network and they will find all the redundant links and all the switches will get their own probes back. It's like picture a boomerang, right, if you could chuck a boomerang the boomerang kind of flies through the air and flies around and flies its way back. Now imagine that concept with the switches,

00:08:22

they've got these BPDU's that kind of goes with boomerang, boomerang protocol data units. It chucks this packet into the network, it goes choo, choo, choo, choo, choo kind of flipping through out the switch, you know what boomerangs are right? I hope I'm talking to a boomerang fan club here, and it's going through all the switches checking out every single link swarming the network it's actually a multicast packet. So that boomerang will

00:08:46

fly through and if there is redundancy in the network the switch will get its own boomerang or BPDU back and it's gonna go, oh, hey, I wasn't supposed to get that back, I was I expected to send that boomerang out and never returned so there must be redundancy in the network. Now let's find out where it is. That's the goal

00:09:06

of these BPDU's. Now these BPDU's also help elect the core switch of the network called the root bridge. Essentially that's where all the boomerangs point to, ha, they're all trying to find their way to the core of the network and here's the big item to note, the root bridge of the network, or I should state it this way, spanning trees election will pick the oldest switch in your network as the root bridge by default. Now you might be thinking oh,

00:09:38

well, that's good, right? You know, the one that's been up the longest, wow, no, no, no, not's saying that's been up the longest, I mean literally the oldest switch in your network. You know the one that's sitting in some wiring closet that people have forgot about that was bought in 1989, you know that's gonna end up becoming the root bridge if it supports spanning tree because the way it decides the election, I'm getting a little ahead of myself. Let's just put it this way, you don't

00:10:08

want to leave at the default or your network will be optimized in the worst possible way and I'll talk about some of the consequences when we get into some bigger pictures. So the simplistic view of STP you can see at the bottom, all switches will find the best way to reach the root bridge then block all the other redundant links. Get that concept? That's the core concept all the switches

00:10:33

will chuck their boomerangs and they all want to find the path that is fastest, the best possible path to reach whoever get elected as the root bridge, then all the other paths the ones that aren't as fast to have reached the root will end up getting blocked which disables all the redundancy in your network. Lets

00:10:53

look at some examples of spanning tree protocol using the classic spanning tree diagram. Ha, anytime you want to learn about spanning tree you'll see this picture come up because it's one of the easiest ways to talk about it. First thing is that those boomerangs,

00:11:08

the BPDU's are sent once every two seconds out every single port, now your might be thinking, wow, that's a lot of stuff. I mean, you think about rip and that's once every 30 seconds but you're at once every two. Well, remember what kind of port these are,

00:11:22

we're looking at gig links, 10 gig links, even 100 meg links to send a little ping out once every two seconds, no worries that not gonna bog down your traffic or kill the processors because their just little ping packets, little boomerangs just making sure that there is no loop and the more frequent you send them like once every two seconds the faster the switch is going to be able to determine if one of the primary links is gone down and start trying to find a back up. So here's the idea, let before

00:11:49

we get into the two fields right here, let me just take this switch C over here in the lower right hand corner. It's going to send a boomerang a little BPDU out every single active port once every two seconds. Now let's follow the trail of this little boomerang right here. It's gonna go choo, choo, choo, choo, choo.

00:12:06

It makes this noise, over to switch A, switch A is gonna get that and go, wow, I see the boomerang, I see this priority which we'll talk about in a second of 32768 and I see this MAC address of all c's so that just kind of goes into switch A's brain up here, it's gonna go, okay, I see that.

00:12:26

But it's gonna pass that boomerang right along, choo, choo, choo, choo, it follows along, switch B gets it and goes, oh, I see there is a switch C out there that says 32768 same thing and it's gonna forward it out all ports, choo, choo, choo, choo, switch C gets it back and it goes, ah, I see me, you know, panic, wait a sec, I'm not suppose to see me. This boomerang is supposed to go out

00:12:58

and never come back, immediately switch C knows there is a loop in the network. Now the good news is that when it sent that little boomerang out every switch got it and every switch saw it so it actually went through an election process while it was discovering loops and in every single BPDU packet there are two major fields, the priority and the MAC address. Now the priority is some value

00:13:21

between zero and 61,440, the default is 32,768. Can you say random on that one? That is some developer going let's just pick this one and threw a dart on the dartboard, so that one right in the middle is the default value. Now unfortunately or fortunately you cannot set the priority to 1 or 2 or 9, it has to go in increments of 4,096 because there's only 4 bits that are reserved for the priority. So using 4 bits you definitely cannot get 61,000 values. So that's why every single one of those bit increments represents a chunk of 4,096. Now by default we said it was 32768. So by default every switch ties on the priority there, it doesn't there's no way to break the tie. So every single switch has to

00:14:18

rely on its MAC address. Now it didn't say a MAC address, I said its MAC address because we all know switches learn MAC address. That's their major function. But the switch also has its own MAC address that it uses to communicate and that will be the one that breaks the tie. And

00:14:38

here's a big point, lower is better. So when you're talking about switch A, C, and B over here I just made up these MAC address because there real simple, A is lower than B, B is lower than C, and C is lower than D. This is hexadecimal world over here. So the lowest MAC address wins the election, thus let's go back to the statement I mentioned on the previous screen, the lower the MAC address typically the older the switch because every single vendor start, you know got these blocks of MAC addresses that they were allocated. And when they first started producing

00:15:15

switches they started from the first numbers of MAC address. And as they produced more and more and more switches they kept going up and up, higher and higher in MAC address. And so the newer switches will have higher MAC addresses which you usually want the newer switch to become the root bridge. So all of that

00:15:33

aside, let's talk a little bit about what then happens between switch A, B, and C. Remember these three switches saw the BPDU's flying around the network so they all know about each other, they all know that they all have the priority of 32,768 and they know that switch A up here has the lowest MAC address, A lower than B, B lower than C. So A ends up becoming the root

00:16:00

bridge the core of the network, the other two lost the election. So now as its reward for being the root bridge switch A will never ever block a port. All of its ports will be considered forwarding or what Cisco likes to call a designated port, one port per link will be considered a forwarding port and switch A became the root. So congratulations switch A, all your ports

00:16:27

will be forwarding. Now all the other switches in the network will find the best way to get to that root bridge, the best way to get to the core of the network. They all look at their links. Now notice right in the middle here I have a link cost of 19 we'll talk about the cost in a moment but 19 happens to be the cost for a fast Ethernet 100 megabit per second link. So the BPDU's traveled through all these links, they know how fast they are, so they added them up, switch C flew around and said, well, it's 19 to reach the root bridge by going up or I can go this way. It's 19 plus I saw my BPDU fly across here. That's 38 to reach the root bridge. So this will be my root port. Same thing

00:17:12

for switch B, they both designate their own root port. The best way to get to the root. Now that's a tip for you. If you're ever doing some show commands on a switch and you see that a switch has a root port, don't be fooled. That is not a root bridge. If a switch has a root port it is, it can't be the root bridge because it's going out that port to reach the root bridge. I've

00:17:36

gotten confused myself many times in doing show spanning tree commands real quick and I see, oh, root port this must be the root but it's not. So we've now found the best way to get to the root we can kind of assume what's gonna happen here right, you're eyeing that bottom link right now and going, uh, that one's not looking so good because both of them found their own little root bridge here, or the root port so looking at this link here's what happens. This side sees that it's redundant

00:18:07

and so does this side but this side marks it as a designated port, what you might be thinking why, whoa, why did that happen? I thought that was gonna be blocked. A designated port is a forwarding port. But notice what I have after the comma, one per link. This

00:18:27

is a link, there due to spanning tree standard, the way they have it there is always one designated port per link. This side blocks. This becomes the blocking port. That's the final type. Where the, ha, notice I put where the tree. Fell, so by one side of the connection disabling its link both sides are down. But

00:18:50

the pain about spanning tree is if your sitting on this switch right here doing show commands, it'll be like, oh, yeah, oh, yeah, this port right here, that one's totally fine, it's forwarding traffic, life is good, green light on the switch. You're gonna

00:19:02

be thinking, man, I thought I understood spanning tree, I thought that one would be the blocked. Well, the truth is it is, it is, but only one side blocks the link. Now as a side note, why do think this guy did it? Why did switch C block his link and not switch B? Any guesses? That's because switch C probably forgot it has the higher MAC address. The higher MAC addresses are not

00:19:26

only used for electing the root bridge or the lower ones but also used to determine who will end up blocking the link. When it's trying to figure out the best link, best switch to block its link, it's gonna say the one that has the higher MAC address. So the worst effect is going to end its connection.

00:19:45

So I'd like to wrap things up in this spanning tree video by talking about how spanning tree finds the best path. Now you saw in that previous graphic that spanning tree will look for the lowest cost link and that's you can see step two, step one, figure out who the root is. Step two, find the lowest cost path

00:20:03

to the root. Now you can see a list of link bandwidths and STP costs over here to the right hand side. Believe it or not, that is ratified list because the previous STP standard maxed out at 1 gig, mean that was the end of the cost. You couldn't go any lower than a 1 gig link. So they revised it. And now you can see they're gonna have to revise it again probably when we get to maybe 1000 gig because the 100 gig will probably be a cost of 1. Once we reach a 1000 gig will extend beyond what normal standard spanning tree can do. Now you don't need to commit all

00:20:38

these values to memory by any means, but I would keep in mind that 100 meg link is the cost of 19. 10 meg is the cost of 100. So when it's comparing, if you have these switch ports that are uplinked, if it's looking and trying to find the best one to get to a location and this is a 10 and maybe you got your root up here, a 10 meg and this is a 100 meg link, it can tell the difference, it can look and say au this is 19 and this is 100. So if this is 19 a cost of 38 is by far better to get to the root going that direction than to use the 10 meg link. This one will end up getting blocked. What

00:21:16

we didn't talk about on our little example was what if the costs were tied, meaning what if we had a scenario like this underneath step three where the one up top got elected the root. We've got 100 meg links everywhere, so we've got cost of 19 going for every switch and this one's looking and saying, well, I've got two paths where if I go to reach the root out either one it's gonna be a cost of 38. Well, that case it's gonna use the lower bridge ID unequal cost path. The bridge ID is that combination of the

00:21:49

priority plus the MAC address. Remember the two fields in that packet that I was showing you before. Priority plus the MAC address. That is known as the bridge ID. So it's gonna look and say, okay, do you have the lower bridge ID or do you? This one says I do.

00:22:04

I do. You know if that happens to have the lower MAC address or priority and it's gonna say, well, then you are my preferred path to get there, this will end up being the blocked link. Now if all else fails, meaning it can't find a tie between the lower port costs, you can't find a lower bridge ID, then you probably have a scenario like our Friday night party where you have two switches connected with two crossover cables just like so. So

00:22:30

in that case it's gonna use the lower port, it's gonna look here and say, okay, well, this a lower port, maybe port fast Ethernet 0/1, this is 0/2 so you were the lower port, I will choose this one and end up blocking that. all right. Well, that's where we'll stop climbing our spanning tree

00:22:48

for now. To hit the high points: We talked about spanning tree dropping trees around the world, meaning it is the feature in any managed switch, any mainline upper end switch that can block the redundant links and keep loops from happening. We looked at the original 802.1D spanning tree. It is an industry standard, not just a Cisco thing. And then I would say we can color half

00:23:14

of this bullet right here. We understand a little bit about oh, I colored the whole thing. Well, you get the idea. We understand a little bit about the BPDU's, the boomerangs that detect the loops in the network. We understand how the elections work based

00:23:27

on the priority and MAC address in the BPDU. And we started getting into some of the other STP details. That's where part two is gonna pick up. So we'll end right there and then pick up with a very large example of spanning tree as we begin part two. I hope this has been informative for you, and I'd like to thank you for viewing.

00:00:00

To start this video I have two random Christmas tree facts for you. Number one, in the year 2005, 32.8 million Christmas trees were purchased. Number two, an acre of Christmas trees provides for the daily oxygen of 18 people. Truly random facts and that leads into the foundation concepts. Somehow

00:00:25

it leads us into the foundation concepts of the spanning tree protocol. Part one, there's a lot to it. Spanning tree, dropping trees around the world, we're going to talk about why that statement is true and what spanning tree does, then we'll look at the original and start enhancing that as we go. 802.1D Spanning Tree and the details behind it, there is a lot to spanning tree. It is one

00:00:50

of the huge concepts in modern switch networks. Finally, when we get to part two of the per VLAN Spanning Tree, we'll start getting into the STP port states, we'll get into the configuration, and finally the optimization steps. Work is over. You walk out the door. It's Friday afternoon. You

00:01:10

hop in the car and drive home. You fight the rush hour and get through the door, flop on the couch and, ah, it's good to be home for the weekend. You know that feeling. You're watching that ceiling fan, kind of turn circles around. And you think now what am I going to do? Glad you asked because now is the time for a little Friday night fun. Here's what you do on that

00:01:32

Friday night, you grab a couple switches, now these are generic switches, no expensive Cisco gear needed here, Linksys, D-link, whatever you want, go ahead and take those switches and plug the computer into each side, could be a laptop, could be a desktop, just one computer into each switch, then take a crossover cable and connect the two switches like so. Now turn off all the lights

00:01:57

in the room, go ahead and kick in a Pink Floyd CD and grab a second crossover cable, may need a little light for this and connect the two generic switches like so. Within seconds you will have a dance party. The switches will start blinking like mad, lights going every which way, strangely to the tune of the Pink Floyd song and you're sitting there going what on earth is going on? You look at the computers and open the task manager and you find out the processor utilization is somewhere near 100%. The reason this happened is because the two switches that you hooked up are generic switches, meaning low end switches. They

00:02:39

don't have spanning tree protocol installed, Which means the very first broadcast packet that's sent by a computer and it will be sent, computers do send broadcasts, will come into that switch, get sent down here and then begin looping endlessly around the network, loop, loop, loop, loop, loop hitting every computer every single time it loops around. Somebody will call this a

00:03:01

broadcast storm. Now I've heard it said, people go, well, what about the TTL field? I've heard that comment a lot, the time to live won't that packet die? Well, remember TTL is in the layer 3 header of the packet. The only thing that decrements the TTL and makes it less is the packet going through a router and in this picture I'm not seeing any routers. So what you have is

00:03:25

an immortal packet that is like the highlander. It's running around with its little sword chopping up all the computers on your network because the computers can't stop it and neither can the switches. Now let me walk through the foundations of spanning tree protocol. Switches will forward broadcast packets

00:03:44

all out all ports by design that's the way they work. And in enterprise networks redundant connections are good; they're necessary. You want redundancy. Okay, maybe not basic connections like two connections to every single switch, but I mean you want switches to where you can have the ability to you know have a switch connected to another switch and another and you know some sort of redundancy like this. So if any one switch fails, you still have a redundant

00:04:09

path around the network. So redundancy is good but as we saw from this little scenario right here redundancy can also be very bad. So the place of the spanning tree protocol is to drop trees on redundant links until they are needed. That's my little homonym,

00:04:30

if you will, to help people remember what spanning tree is all about. Spanning tree will look at your switch network and say, oh, there's a redundant link, let's go ahead and drop a tree on that line and disable it. It's really what spanning tree does. It looks more like a big cauliflower. The only the active link

00:04:49

will forward traffic, the single link. Now anybody can unplug a network connection so spanning tree will always be watching that primary link and if it ever goes down it will erect the tree off the line and allow the back up link to go active and all the traffic to forward across that one. So spanning tree

00:05:09

is a good thing to allow you to have redundancy in the network but not cause broadcast storms because broadcasts go over all of the redundant links. I have to confess this spanning tree protocol is one of the most difficult concepts for me to talk about. The reason why is because

00:05:29

what I just showed you is it that's all there is to spanning tree protocol. It is designed to drop trees on the redundant links, disable them until they are needed. The reason it's so complex and the reason there's entire books written on spanning tree is because our networks don't look like our Friday night scenario. Our networks look like this in a smaller size network

00:05:52

where we have all kinds of layers of switches. We have core switches in the middle tied to distribution layer switches in the major VLAN's, we have access layer switches up here that connect to our end user PC's. Now let me ask you looking at this picture:

00:06:06

Would you say there is redundancy? Huh, yeah, lots of it. Every single switch has a redundant up link to every upper layer switch. The access layer has redundant links to the distribution layer. The distribution layer has redundant links to the core. Servers even have redundant links to their

00:06:25

own switches so if any one switch fails we always have a back up path that can reroute around it for critical devices. But if we didn't have spanning tree imagine what one broadcast would do. Within the VLAN it would spin around non stop wiping out all of the different devices that are connected to the network within each layer two domain. Now remember the broadcast does

00:06:49

stop at the boundary so every single VLAN has its own little storm going on and there's no way to stop that without spanning tree. So the reason spanning tree gets complex is because you look at this picture right here and you go, okay, redundancy is good. But now where do you drop the trees? What would be the

00:07:11

most efficient links to block in order to for us to get the best performance out of the links that we have? Now this is where we start moving into some of the concepts behind spanning tree. Now let me restate that these are the core concepts of spanning tree as in everything will build on these 4 statements right here. Number 1 Original Spanning Tree which is 802.1D it's an industry standard not developed by Cisco was created to prevent loops and I should add to that, a long time ago. This protocol has

00:07:43

been around for a good decade since switches have been in existence. Switches in order to work with spanning tree will send probes into the network called bridge protocol data units, you'll hear it abbreviated BPDU's that discover loops. Now what these probes

00:08:02

will do, let me expound on that a little, is they will search through the network and they will find all the redundant links and all the switches will get their own probes back. It's like picture a boomerang, right, if you could chuck a boomerang the boomerang kind of flies through the air and flies around and flies its way back. Now imagine that concept with the switches,

00:08:22

they've got these BPDU's that kind of goes with boomerang, boomerang protocol data units. It chucks this packet into the network, it goes choo, choo, choo, choo, choo kind of flipping through out the switch, you know what boomerangs are right? I hope I'm talking to a boomerang fan club here, and it's going through all the switches checking out every single link swarming the network it's actually a multicast packet. So that boomerang will

00:08:46

fly through and if there is redundancy in the network the switch will get its own boomerang or BPDU back and it's gonna go, oh, hey, I wasn't supposed to get that back, I was I expected to send that boomerang out and never returned so there must be redundancy in the network. Now let's find out where it is. That's the goal

00:09:06

of these BPDU's. Now these BPDU's also help elect the core switch of the network called the root bridge. Essentially that's where all the boomerangs point to, ha, they're all trying to find their way to the core of the network and here's the big item to note, the root bridge of the network, or I should state it this way, spanning trees election will pick the oldest switch in your network as the root bridge by default. Now you might be thinking oh,

00:09:38

well, that's good, right? You know, the one that's been up the longest, wow, no, no, no, not's saying that's been up the longest, I mean literally the oldest switch in your network. You know the one that's sitting in some wiring closet that people have forgot about that was bought in 1989, you know that's gonna end up becoming the root bridge if it supports spanning tree because the way it decides the election, I'm getting a little ahead of myself. Let's just put it this way, you don't

00:10:08

want to leave at the default or your network will be optimized in the worst possible way and I'll talk about some of the consequences when we get into some bigger pictures. So the simplistic view of STP you can see at the bottom, all switches will find the best way to reach the root bridge then block all the other redundant links. Get that concept? That's the core concept all the switches

00:10:33

will chuck their boomerangs and they all want to find the path that is fastest, the best possible path to reach whoever get elected as the root bridge, then all the other paths the ones that aren't as fast to have reached the root will end up getting blocked which disables all the redundancy in your network. Lets

00:10:53

look at some examples of spanning tree protocol using the classic spanning tree diagram. Ha, anytime you want to learn about spanning tree you'll see this picture come up because it's one of the easiest ways to talk about it. First thing is that those boomerangs,

00:11:08

the BPDU's are sent once every two seconds out every single port, now your might be thinking, wow, that's a lot of stuff. I mean, you think about rip and that's once every 30 seconds but you're at once every two. Well, remember what kind of port these are,

00:11:22

we're looking at gig links, 10 gig links, even 100 meg links to send a little ping out once every two seconds, no worries that not gonna bog down your traffic or kill the processors because their just little ping packets, little boomerangs just making sure that there is no loop and the more frequent you send them like once every two seconds the faster the switch is going to be able to determine if one of the primary links is gone down and start trying to find a back up. So here's the idea, let before

00:11:49

we get into the two fields right here, let me just take this switch C over here in the lower right hand corner. It's going to send a boomerang a little BPDU out every single active port once every two seconds. Now let's follow the trail of this little boomerang right here. It's gonna go choo, choo, choo, choo, choo.

00:12:06

It makes this noise, over to switch A, switch A is gonna get that and go, wow, I see the boomerang, I see this priority which we'll talk about in a second of 32768 and I see this MAC address of all c's so that just kind of goes into switch A's brain up here, it's gonna go, okay, I see that.

00:12:26

But it's gonna pass that boomerang right along, choo, choo, choo, choo, it follows along, switch B gets it and goes, oh, I see there is a switch C out there that says 32768 same thing and it's gonna forward it out all ports, choo, choo, choo, choo, switch C gets it back and it goes, ah, I see me, you know, panic, wait a sec, I'm not suppose to see me. This boomerang is supposed to go out

00:12:58

and never come back, immediately switch C knows there is a loop in the network. Now the good news is that when it sent that little boomerang out every switch got it and every switch saw it so it actually went through an election process while it was discovering loops and in every single BPDU packet there are two major fields, the priority and the MAC address. Now the priority is some value

00:13:21

between zero and 61,440, the default is 32,768. Can you say random on that one? That is some developer going let's just pick this one and threw a dart on the dartboard, so that one right in the middle is the default value. Now unfortunately or fortunately you cannot set the priority to 1 or 2 or 9, it has to go in increments of 4,096 because there's only 4 bits that are reserved for the priority. So using 4 bits you definitely cannot get 61,000 values. So that's why every single one of those bit increments represents a chunk of 4,096. Now by default we said it was 32768. So by default every switch ties on the priority there, it doesn't there's no way to break the tie. So every single switch has to

00:14:18

rely on its MAC address. Now it didn't say a MAC address, I said its MAC address because we all know switches learn MAC address. That's their major function. But the switch also has its own MAC address that it uses to communicate and that will be the one that breaks the tie. And

00:14:38

here's a big point, lower is better. So when you're talking about switch A, C, and B over here I just made up these MAC address because there real simple, A is lower than B, B is lower than C, and C is lower than D. This is hexadecimal world over here. So the lowest MAC address wins the election, thus let's go back to the statement I mentioned on the previous screen, the lower the MAC address typically the older the switch because every single vendor start, you know got these blocks of MAC addresses that they were allocated. And when they first started producing

00:15:15

switches they started from the first numbers of MAC address. And as they produced more and more and more switches they kept going up and up, higher and higher in MAC address. And so the newer switches will have higher MAC addresses which you usually want the newer switch to become the root bridge. So all of that

00:15:33

aside, let's talk a little bit about what then happens between switch A, B, and C. Remember these three switches saw the BPDU's flying around the network so they all know about each other, they all know that they all have the priority of 32,768 and they know that switch A up here has the lowest MAC address, A lower than B, B lower than C. So A ends up becoming the root

00:16:00

bridge the core of the network, the other two lost the election. So now as its reward for being the root bridge switch A will never ever block a port. All of its ports will be considered forwarding or what Cisco likes to call a designated port, one port per link will be considered a forwarding port and switch A became the root. So congratulations switch A, all your ports

00:16:27

will be forwarding. Now all the other switches in the network will find the best way to get to that root bridge, the best way to get to the core of the network. They all look at their links. Now notice right in the middle here I have a link cost of 19 we'll talk about the cost in a moment but 19 happens to be the cost for a fast Ethernet 100 megabit per second link. So the BPDU's traveled through all these links, they know how fast they are, so they added them up, switch C flew around and said, well, it's 19 to reach the root bridge by going up or I can go this way. It's 19 plus I saw my BPDU fly across here. That's 38 to reach the root bridge. So this will be my root port. Same thing

00:17:12

for switch B, they both designate their own root port. The best way to get to the root. Now that's a tip for you. If you're ever doing some show commands on a switch and you see that a switch has a root port, don't be fooled. That is not a root bridge. If a switch has a root port it is, it can't be the root bridge because it's going out that port to reach the root bridge. I've

00:17:36

gotten confused myself many times in doing show spanning tree commands real quick and I see, oh, root port this must be the root but it's not. So we've now found the best way to get to the root we can kind of assume what's gonna happen here right, you're eyeing that bottom link right now and going, uh, that one's not looking so good because both of them found their own little root bridge here, or the root port so looking at this link here's what happens. This side sees that it's redundant

00:18:07

and so does this side but this side marks it as a designated port, what you might be thinking why, whoa, why did that happen? I thought that was gonna be blocked. A designated port is a forwarding port. But notice what I have after the comma, one per link. This

00:18:27

is a link, there due to spanning tree standard, the way they have it there is always one designated port per link. This side blocks. This becomes the blocking port. That's the final type. Where the, ha, notice I put where the tree. Fell, so by one side of the connection disabling its link both sides are down. But

00:18:50

the pain about spanning tree is if your sitting on this switch right here doing show commands, it'll be like, oh, yeah, oh, yeah, this port right here, that one's totally fine, it's forwarding traffic, life is good, green light on the switch. You're gonna

00:19:02

be thinking, man, I thought I understood spanning tree, I thought that one would be the blocked. Well, the truth is it is, it is, but only one side blocks the link. Now as a side note, why do think this guy did it? Why did switch C block his link and not switch B? Any guesses? That's because switch C probably forgot it has the higher MAC address. The higher MAC addresses are not

00:19:26

only used for electing the root bridge or the lower ones but also used to determine who will end up blocking the link. When it's trying to figure out the best link, best switch to block its link, it's gonna say the one that has the higher MAC address. So the worst effect is going to end its connection.

00:19:45

So I'd like to wrap things up in this spanning tree video by talking about how spanning tree finds the best path. Now you saw in that previous graphic that spanning tree will look for the lowest cost link and that's you can see step two, step one, figure out who the root is. Step two, find the lowest cost path

00:20:03

to the root. Now you can see a list of link bandwidths and STP costs over here to the right hand side. Believe it or not, that is ratified list because the previous STP standard maxed out at 1 gig, mean that was the end of the cost. You couldn't go any lower than a 1 gig link. So they revised it. And now you can see they're gonna have to revise it again probably when we get to maybe 1000 gig because the 100 gig will probably be a cost of 1. Once we reach a 1000 gig will extend beyond what normal standard spanning tree can do. Now you don't need to commit all

00:20:38

these values to memory by any means, but I would keep in mind that 100 meg link is the cost of 19. 10 meg is the cost of 100. So when it's comparing, if you have these switch ports that are uplinked, if it's looking and trying to find the best one to get to a location and this is a 10 and maybe you got your root up here, a 10 meg and this is a 100 meg link, it can tell the difference, it can look and say au this is 19 and this is 100. So if this is 19 a cost of 38 is by far better to get to the root going that direction than to use the 10 meg link. This one will end up getting blocked. What

00:21:16

we didn't talk about on our little example was what if the costs were tied, meaning what if we had a scenario like this underneath step three where the one up top got elected the root. We've got 100 meg links everywhere, so we've got cost of 19 going for every switch and this one's looking and saying, well, I've got two paths where if I go to reach the root out either one it's gonna be a cost of 38. Well, that case it's gonna use the lower bridge ID unequal cost path. The bridge ID is that combination of the

00:21:49

priority plus the MAC address. Remember the two fields in that packet that I was showing you before. Priority plus the MAC address. That is known as the bridge ID. So it's gonna look and say, okay, do you have the lower bridge ID or do you? This one says I do.

00:22:04

I do. You know if that happens to have the lower MAC address or priority and it's gonna say, well, then you are my preferred path to get there, this will end up being the blocked link. Now if all else fails, meaning it can't find a tie between the lower port costs, you can't find a lower bridge ID, then you probably have a scenario like our Friday night party where you have two switches connected with two crossover cables just like so. So

00:22:30

in that case it's gonna use the lower port, it's gonna look here and say, okay, well, this a lower port, maybe port fast Ethernet 0/1, this is 0/2 so you were the lower port, I will choose this one and end up blocking that. all right. Well, that's where we'll stop climbing our spanning tree

00:22:48

for now. To hit the high points: We talked about spanning tree dropping trees around the world, meaning it is the feature in any managed switch, any mainline upper end switch that can block the redundant links and keep loops from happening. We looked at the original 802.1D spanning tree. It is an industry standard, not just a Cisco thing. And then I would say we can color half

00:23:14

of this bullet right here. We understand a little bit about oh, I colored the whole thing. Well, you get the idea. We understand a little bit about the BPDU's, the boomerangs that detect the loops in the network. We understand how the elections work based

00:23:27

on the priority and MAC address in the BPDU. And we started getting into some of the other STP details. That's where part two is gonna pick up. So we'll end right there and then pick up with a very large example of spanning tree as we begin part two. I hope this has been informative for you, and I'd like to thank you for viewing.

STP: Foundation Per-VLAN Spanning Tree Concepts, Part 2

STP: Rapid Spanning Tree Concepts and Configuration

EtherChannel: Aggregating Redundant Links

L3 Switching: InterVLAN Routing Extraordinaire

L3 Switching: Understanding CEF Optimization

Redundancy in the Campus: HSRP, VRRP, and GLBP Part 1

Redundancy in the Campus: HSRP, VRRP, and GLBP Part 2

Campus Security: Basic Port Security and 802.1x

Campus Security: VLAN and Spoofing Attacks

Campus Security: STP Attacks and Other Security Considerations

Campus VoIP: Overview, Considerations, and AutoQoS

Wireless LAN: Foundation Concepts and Design Part 1

Wireless LAN: Foundation Concepts and Design Part 2

Wireless LAN: Frequencies and 802.11 Standards

Wireless LAN: Understanding the Hardware

The Switches Domain: Additional Life-Saving Technology

Monitoring: Your Pulse on the Network

Campus Security: VACLs

Please help us improve by sharing your feedback on training courses and videos. For customer service questions, please contact our support team. The views expressed in comments reflect those of the author and not of CBT Nuggets. We reserve the right to remove comments that do not adhere to our community standards.

comments powered by Disqus
Intermediate 11 hrs 24 videos

COURSE RATING

Basic Plan Features


Speed Control
Included in this course
Play videos at a faster or slower pace.

Bookmarks
Included in this course
Pick up where you left off watching a video.

Notes
Included in this course
Jot down information to refer back to at a later time.

Closed Captions
Included in this course
Follow what the trainers are saying with ease.

NuggetLab
Files/materials that supplement the video training

Premium Plan Features


Practice Exams
These practice tests help you review your knowledge and prepare you for exams.

Virtual Lab
Use a virtual environment to reinforce what you are learning and get hands-on experience.

Offline Training
Included in this course
Our mobile apps offer the ability to download videos and train anytime, anywhere offline.

Accountability Coaching
Included in this course
Develop and maintain a study plan with assistance from coaches.
Jeremy Cioara
Nugget trainer since 2003