Sie sind auf Seite 1von 9

==================== SPANNING TREE ==================== - Spanning tree is a straightforward concept..

it has only one purpose: to preve nt loops happening at Layer 2. - what confuses people the most is when you have multiple switches (more than 5 switches in your environment). - You have to analyze spanning tree to be able to fix it.. - Again Spanning tre has only one job: to prevent loops at layer 2.. - If we have a pair of switches with a link connecting them.. And a braodcast fr ame arrives, it will forward out of all ports apart from the port that the frame was received on. - There is no mechanism within the layer 2 frame itself to prevent loops (which can be counted down).. It has no aging mechanism within the frame.. - A layer 3 packet has a Time-to-live (TTL). And every port that an IP packet tr ansverses, it will count it down and when the TTL reaches 0, the packet is disca rded. - The Layer 2 switch forwards based on Layer 2 information and it will keep loop ing the frames till someone takes out the link or the switch 'blows up' - The spanning tree selects one of the ports in the loop and blocks it.. of cour se topologies can get more complex as we go.. - A loop is defined by the fact that we can trace our path through our network a nd arrive at the original starting point without retracing our original step. - If spanning tree blocks one port, we've broken the loop. The concept is very e asy but it is understanding where to look when it breaks, that is the issue and that's where experience come in. - We can be shown what to look for and where to look.. but experience always com es in.. we will learn that as time goes by.. - Spanning tree is enabled by default on all Cisco Switches.. (99.99999% of the time).. But it is also good to verify. # show spanning-tree (command to verify spanning tree)..You will see if spanning tree is enabled or not... it doesn't show us if spanning tree is operating corr ectly as we want it to.. # # # # # line console 0 logging synchronous exec-timeout 0 0 exit no ip domain lookup

# conf t # logging console 4 (My console will only log messages of severity 4, 3, 2, 1 an

d 0) + Spanning tree will pick a port to block.. which port will it block? We need mo re information. - (When switchches are cabled up with redundant paths), Spanning tree will start to sends out Layer 2 frames called BPDUs (Bridge Protocol Data Unit).. BPDUs ar e sent out every 2 seconds and the time range is between 1 and 10seconds but we generally leave them alone. - These BPDUs contain certain bits of information about the switch itself and th is information is used to elect a particular device on our network called a ROOT BRIDGE (it is very important). - The ROOT BRIDGE plays a very important role in our network and the role it pla ys is a REFERENCE POINT. - Swich 2 has to know which port to block in reference to what? - The ROOT BRIDGE will advertise its position downstream.. and other switches wi ll calculate how far their ports are from the root bridge. - The election of the root bridge happens before anything else. - So what is inside the BPDUs that is used to determine the ROOT BRIDGE? The 3 m ost inportant information that it contains are: ~ RID: ROOT ID (who this switch believes to be the RID) - MAC ADDRESS: DEFAULT P RIORITY. ~ BID: The advertising switch. - MAC ADDRESS: DEFAULT PRIORITY ~ COST: associated with the bandwidth of the interface. The cost is incremented only inbound.. it is never added as an outbound value.. You pay to get in, you d ont pay to get out. And the cost is carried forward to the downstream bridge. Cost value is cummulative. > > > > 10Mbps = 100 100Mbps = 19 1Gbps = 4 10Gbps = 2

- Every switch will first advertise itself to be the root bridge but then the va lues will be compared as other BPDUs are received.. when a switch sees a vale lo wer than itself, it stops advertising itself as the ROOT BRIDGE and starts to ad vertise the new value that just won. - What used to happen in the old days is that spanning tree will elect the ROOT BRIDGE as the device with the lowest MAC-ADRESS. Switch 2 and Swithc 3 will then stop sending out BPDUs claiming to be the root bridge... THe problem with this is that we can end up electing the oldest slowest switch in our network as the R OOT BRIDGE.. - So we need another value that we can customize before comparing the MAC-ADDRES SES. - There's no requirement for traffic to always go past the ROOT BRIDGE except th

e ROOT BRIDGE is on (not necessarily) the path. Although it is advisable for th e root bridge to be central to the network. - There is a value that we can manually set for the election.. and that value is called the "Default priority". The "Default Priority" is a 16bit number from 065536 (2 exp 16). - Out of the box, all spanning tree's default priority is 32768. - The key to understanding spanning tree is knowing that "the lowest value alway s win". 1. When the switches exchange BPDUs with each other, they will first of all comp are the default priority. Who has the lowest default priority? 2. After this, which switch has the lowest MAC address.. this then becomes the r oot bridge.

- It can take anything up to 5 to 20seconds to determine the root bridge dependi ng on how large your network is. It will take a while for a switch at the end of the network to determine who the root bridge is. - When the switches are determining which port to block, there will be no traffi c flowing in our network as this will cause a loop in our network. - The ROOT BRIDGE can change.. if another switch comes online with a lower defau lt priority than our current ROOT BRIDGE, an election will take place and it wil l become the root bridge. - The ROOT BRIDGE advertises down stream, Switch 2 will not only receive the BPD U but it will also forward it. Now switch 3 will receive the ROOT BRIDGE BPDU ad vertisement from two of its ports and it will know that it has to block one port .

- What switch, which port, which VLAN.