...

Monday, April 5, 2010

CCNA 39

In this article, we'll connect a crossover cable between S2 and S3 to create some redundancy. The topology now looks like this:

To see information about spanning-tree, type:
show spanning-tree

On some devices, you might have to type:
show spanning-tree br

The output would be similar to this:
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     cc02.05b4.0000
             Cost        19
             Port        15 (FastEthernet0/14)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     cc04.05b4.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13     128.14   128    19 BLK    19 32768 cc03.05b4.0000 128.16
FastEthernet0/14     128.15   128    19 FWD     0 32768 cc02.05b4.0000 128.16
FastEthernet0/15     128.16   128    19 FWD    19 32768 cc04.05b4.0000 128.16
You will see both the Bridge ID and the Root ID. The Root ID shows information about the root bridge. Bridge ID on the other hand, shows information about the bridge you're on.

Port information can also be seen at the bottom. Right now all switches are at default, so the MAC address will break the tie. Currently, the switch with the lowest MAC address will be the root bridge.

The first sign that this switch is not the root bridge is that the root ID and the bridge ID are different. The second sign that the switch is not the root bridge is that not all ports are FWD.

The bridge is out of F0/14. If we look at our topology, we'll know that the root bridge is S2. This is inefficient because for R2 to reach R1, it'll have to go through 3 switches. To fix this, we'll need to turn S1 into the root bridge. Use the command:
spanning-tree vlan 1 root primary

When this is done, you would see something like this:
S1(config)#spanning-tree vlan 1 root primary
 VLAN 1 bridge priority set to 8192
 VLAN 1 bridge max aging time unchanged at 20
 VLAN 1 bridge hello time unchanged at 2
 VLAN 1 bridge forward delay unchanged at 15
Right now, if we check the spanning-tree summary again, we'll see this:
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc04.05b4.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192
             Address     cc04.05b4.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13     128.14   128    19 FWD     0  8192 cc04.05b4.0000 128.14
FastEthernet0/14     128.15   128    19 FWD     0  8192 cc04.05b4.0000 128.15
FastEthernet0/15     128.16   128    19 FWD     0  8192 cc04.05b4.0000 128.16
Notice that now the root ID is the same as the bridge ID, and all ports are forwarding. This means that S1 is now the root bridge. In this case, the F0/15 of both S2 and S3 would be forwarding. F0/13 on the other hand would be forwarding on the better bridge (S2) and blocked on the lower bridge (S3).

You can manually set the priority of spanning-tree. To do this, type:
spanning-tree vlan 1 priority 32768

Notice that you can only set in increments of 4096. This is because in PVST, the last 12 of 16 bits of the priority field is actually the VLAN number. Now we can test if spanning-tree is working correctly. At the same time, we can see how long it takes for spanning-tree to actually failover.

To do this, go to S1 and type:
ping

Next, type in the IP of S3 (192.169.1.12) and make it ping a million times (or any other large numbers). Once it begins pinging, go to S3 and shut down F0/1. Your ping will stop going through on S1.

At this point, F0/13 on S2 would be out of the blocking state and in the LIS then the LRN state. Finally, the MAX AGE would have to time out before the port goes into forwarding!
Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet0/13     128.14   128    19 LRN    19 32768 cc03.05b4.0000 128.14
FastEthernet0/15     128.16   128    19 FWD     0  8192 cc04.05b4.0000 128.14
With my timeout set to 1 second, the ping output looked like this:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.............
..................................!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This indicates a total of 48 seconds out outage before the pings came back!

Now go back onto S3 and turn the link back on. The network goes down again! This time, S15 on S3 would be in the LIS then LRN state before it would start forwarding again. This is the downtime:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.....
........................!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This took a whole 30 seconds! In the next article, I'm going to touch on the different states, what they do, and the enhancements to spanning-tree.

No comments :

Post a Comment

<