Thursday, October 27, 2016

Spanning Tree Protocol Port States

                   A Spanning Tree is going to be a Logical, Loop Free Topology and, i say it’s a “Logical Loop Free Topology”, because physically like the Topology, we see on Picture.
                   Physically it’s looks like we have a Loop, it’s looks like we got the path between Switches A and B, where packets could Circulate Endlessly but, with Spanning Tree Protocol we going to logically make one of the ports, on one of those Switches Block Traffic. We gonna prevent traffic from flowing in and out of one of those ports, that’s what Spanning Tree Protocol can do for us. It can give us a Logical Loop Free Topology, which is gonna give us Redundancy. Well avoiding the ugly side of facts that come with Layer 2 Topological Loop like we discussed, a Spanning Tree has a Root Bridge, and we want to be able to administrative influences, which Bridge, which Switch becomes the Root Bridge.
                 If we just plug several Switches together without configuring Spanning Tree Protocol. Spanning Tree Protocol will automatically elect the Root bridge, however The Bridge, The Switch that’s the elected is the Root Bridge, it might not be the Optimal Switch, and order to influence the Root Bridge, we need too able to look at the topology like this, and on paper to determine.
   Ø  Who is the Root Bridge in this Topology?
   Ø  Which Ports Are Forwarding?
   Ø  Which Ports Are Blocking?
                   The first question that we ask, who is the Root Bridge. In a Spanning Tree Topology, we have One Root Bridge, and Switch that has the Lowest Bridge ID.
                   The Bridge ID is made up of a Switch Priority, which is something that we can administratively set as well as a Mac-Address, and on Cisco Catalyst Switches the default Switch Priority, that we have is 32768, we could make that value lower to influence that Switch to become the Root Bridge.
                   What if we interconnect bunch of Switches, and we do not set the Switch Priority to something other than the default. Well the Mac-addresses, is the different Switches acts the Tie Breaker, the Switch with the Lowest Mac-Address become the Root Bridge, if we do not go in, and influence the Switch Priority.
Let’s take a look at the Topology on Picture.
                  We got a couple of switches, and the Priority Value of these switches are the default values 32768, that means we gonna use the Switches Mac-Addresses as the Tie-Breaker. The Question we need to ask is
   Ø  Who is the Root Bridge?
                             They have an Equal Priorities that means we look to see who has the lowest mac-address. Let’s look at the first 3 Hexadecimal digits in each Mac-Address. On Switch A, the First 3 digits are 001, and Switch B the first 3 digits are 000Oh! That’s less than 001” that’s tell us, that Switch B, because the Priority is equal. The Switch B is going to be Elected as the Root Bridge.
                       We now know, which Switch is going to be the Base of our Spanning Tree. However, we do not yet know
   Ø  Which port are going to be Blocking
   Ø   And Which Port are going to be Forwarding
 To determined that, we need to understand the different ports states that Spanning tree has.

                          First up is a Root Port “A Root Port is a Port on a Non-Root Bridge, Root Bridge does not have any Root Ports. It’s the Port on a Non-Root bridge that is closest to the Root Bridge in terms of Cost”.
                   Well we know that, Switch B is not going to have any Root Port because it’s the Root Bridge, that means Switch A going to have Root Port. It’s only gonna have One (1).  
                  It’s the Port, that is Closest in Terms of Cost, and when we talk about Cost, we can look at the Interface Speeds, even though both interfaces that we see on Switch A are Fastethernet Interfaces. It doesn’t necessarily mean that they configured to run at Fastethernet Speeds. 
                 Notice that Fastethernet 1/0/1, up of the top of Switch A. It is running 100Mbps, however, Fastethernet 1/0/2 at the bottom of Switch A. It’s configured to run at 10Mbps, in you see from table on Picture.
                 That an “Interface Speed or Ports Speed” of 10Mbps, has an associated Spanning Tree Protocol Port Cost of 100. The Cost for a 100Mbps Port is 19. In order for Switch A, to get back to the Root Bridge, if it goes out of fastethernet 1/0/1, it’s gonna have a Cost of 19 to get there. If it goes out of Fastetherent 1/0/2, that’s gonna be Cost of 100 because that Port Speed is 10Mbps.
                The Cost is lower, if we go out of Fastetherent 1/0/1. Therefore, we can label our Root Port on Switch A as Fastethernet 1/0/1.
                The next Port State is a “Designated Port” and we have a Designated Port on every Network Segment. We got 2 segments on Picture “Top One and Bottom One”, and on each Segment, we going to have One Designated Port, and “It’s the Port, that is Closest to the Root in Terms of Cost” and since both of these Segments touch the Root Bridge. This is going to be easy in this Topology because we are not gonna get Closer to the Root, that actually being on the Root. This means that both Ports on our Root Bridge are “Designated Ports Gigabit 0/9 and Gigabit 0/10”.
               The Next Type of Port, we have is a “Non-Designated Port or a Blocking Port”. By the way we could have a Port, that was “Administratively Shutdown”. It would “be Disabled” and if it were “Administratively Shutdown”, Spanning Tree Protocol would not Administratively bring at Backup, if it were needed it’s just going to be Shutdown. We assuming that in this Topology, we truly do have Backup Path. We were assuming that, none of these Ports are Shutdown, that means that any Remaining Ports, that we not already identified as a “Root Port or as a Designated Port”, any another Remaining Ports, we gonna be “Non-Designated Ports”, another words that’s gonna be “Blocking Ports”, and that means the Bottom Port on “Switch A Fastethernet 1/0/2”, that’s a “Blocking Port”.

Conclusion: - This gives us our “Loop Free Topology”. We not going to have a “Layer2 Topological Loop” because Production Traffic is not going to be flowing “Into or Out” of a Fastethernet 1/0/2 on Switch A.

              If You Like the Post. Don’t forget 
       to “Subscribe/Share/Comment”. Thank You.
Read More

Tuesday, October 25, 2016

inTroDucTion To Spanning Tree Protocol

In mid-1980’s, there is something called “Ethernet Bridges”.
                “A Bridge made Layer 2 forwarding decisions in Software, as supposed to Hardware as a Switch does". Bridges operates slower than Switches. They don’t have ASIC, they don’t have those Application Specific Integrated Circuit. Circuitry that’s dedicated to making these Layer2 forwarding decisions but the basic theory of operation of a bridge is the same as a Switch. A bridge like a Switch can take a look at the “Destination Mac-Address” on a “Ethernet Frame”, and make a forwarding decision, based on the Destination Mac-Address and that Bridge can learn, what Mac-Addresses reside of a different bridge ports and, like you see in Picture.            
                   We could have redundant links between these Ethernet Bridges, and today we do the same thing with Ethernet Switches, and by Redundant Links, means we could lose any of these 3 different links that you see, and there would still be a path from any Bridge to any other Bridge, but there is an issue with this design what we have on Picture is a “Layer 2 Topological Loop”, and with a “Layer 2 Topological Loop”, we could have some really ugly side effects, if all of these links were simultaneously forwarding traffic.
      For Example, we can have Ethernet frame that just endlessly circulated around and around to this topology, so there is argument that Redundancy is good thing, but a Layer2 Loop is a bad thing but
Ø  in end of mid 1980’s, Radia Perlman working at Digital Equipment Corporation develops Spanning Tree Protocol or STP
Ø  and a variant of that original STP implementation was made by the Standard
Ø   The IEEE, The Institute of Electrical and Electronics Engineers, and the 1990 they developed the Standard of IEEE 802.1D
                And as we get to our discussion of Spanning Tree Protocol, you gonna notice that we use the term “Bridge” a lot off, and the reason is “Radia Perlman” she worked with “Ethernet Bridges”. So the terminology sort of stuck, but just keep in mind when we use the term “Bridge” for example, we gonna be talking about a Root Bridge, realize that Bridge in today’s modern networks is going to be an “Ethernet Switch” but we still might use the term “Bridge” to referred to that Switch.
              A Layer 2 topological loop could cause us some issues, let’s take a look at some of those issues, if we do not have Spanning Tree Protocol running in our Networks.
             Let’s ask the question? Why would a Layer2 Topological Loop be bad for Layer2 but not bad for Layer3?
To illustrate, I have got couple of Layer 3 devices, couple of Routers on the Picture, and in the “Header” of Layer3 Packet, there is a “Field” called the “TTL” or the “Time-To-Live” Field.
                                “Every time a packet is routed by a router, it goes through a Router or HOP, that TTL value gets decremented, or it’s gets reduced by ONE (1)”, and if it reaches 0, it’s gonna be dropped, it’s not gonna be forwarded anymore. To illustrate let’s imagine that. This packet begins with the “Time-To-Live” value of 2.
When it goes to the Next Router, or HOP, it’s gonna be reduced to a TTL of 1.
               And when it goes into the Next Router, it’s gonna be reduced to a TTL of 0.
                And it’s no longer gonna be forwarded, it’s a very different story with a Layer2 Switch because “Ethernet Frame” do not have TTL value, and since there is no TTL field.
if we have a frame
That starts to go in loop like this.
                    It can Circulate Endlessly because there is nothing to cause to Time Out on the network. This can cause something called a “Broadcast Strom”.
                From one thing and devices attached to a network that is experiencing a broadcast Strom, they can slow down and hang, because their NIC or Network Interface Cards are having to take time to examine each of these broadcast frames that coming. It can even lock up the mouse pointer, we not able to move the mouse around the screen.
That’s one reason that Layer2 Topological loop can be a very Negative thing. Let’s now take a deeper look at some of these Symptoms, which can result from a Layer2 topological loop.
Beginning with the Symptoms, which can cause the Switches Mac-Address Tables to become corrupted, where they have inaccurate information about where there is Mac-Address on the network lives.
Consider the example on Picture.
                   We got Switch A and Switch B, and let’s say that PC A is sending out a frame on this “Top Ethernet” segment.

                     And the frame on a common network segment is going to go, in this case to both Switch A and Switch B.
                      Both Switch A and Switch B will learn that the all AAAA.AAAA.AAAA’s Mac-Address. The Mac-Addresses, that we pretended belongs to PC A. The all AAAA.AAAA.AAAA’s Mac-Address lives on their Top Port, It lives on their Gigabit 1/0/1 Port  and that gets added to their Mac-Address Table also known as the CAM Table.
                               But here what we start to have an issue.
Each of these Switches is going to forward that frame.
                 Out of bottom segment and each switch is going to see the frame sent by the other switch, and PC B sees the same frame twice.
it’s now received a Duplicate frame.
                      And when Switch A and B see this frame on the bottom Segment, arriving from the other Switch, suddenly they see that here this frame appearing on the bottom port that’s looks like a, it came from the all AAAA.AAAA.AAAA’s Mac-Address and they think, Well we need to update our Mac-Address Table, and they will delete the entry.
                    Saying that “all AAAA.AAAA.AAAA’s Mac-Address lives on their gigabit 1/0/1 Port”, and they will  add an entry, saying “NO! that mac-address lives on the gigabit 1/0/2 port”. This means that our switches now have an incorrect information in the Mac-Address Table. The Mac-Address table another words has been corrupted on each of these Switches, and also we mentioned PC B received Duplicate frames, that’s one side effect having a Layer2 Topological Loop, and not having “Spanning Tree Protocol” to protect this from the loop.

Another issue we could have a “Broadcast Strom”, remember what Broadcast frame looks like that were, we have a Destination Mac-Address of all “FFFF.FFFF.FFFF” in Hexadecimal notation.
             We have all FFFF.FFFF.FFFF’s Mac-Address, and that Mac-Address is not going to be burned into some devices or Network Interface Card, and therefore that mac-address is not gonna be learned by a Switch.
 What does the Switch do? when it receives a frame, where the Destination Mac-Address is Unknown?
 “It’s not been learned by the Switches Mac-Address Table. Well it gonna flood that frame out of all over the Switchport’s, other than the port on which that frame was received”.

And in this example, PCA is sending out a broadcast frame
On that Top Segment.
Well, Switches A and B, they flood that out down to the Bottom Segment.
For PC B gets a couple of copies of that frames.
And the frame from Switch A goes into the Switch B.
And frame flooded out of the Switch B goes into the bottom Port of Switch A.
And Switches A and B, they flood those frames up to the Top Segment.
And now PC A getting a Duplicate copying of that Broadcast Frame, and this just to repeat itself. The Broadcast traffic continue to circulate around the networks.

     We have a Broadcast Storm. PC’s A and B, their being flooded with this Broadcast Traffic. These PC’s, there having the interrupt their normal operation to take a look at these frames coming in, and that’s preventing them from doing their normal duties. This can also dramatically increase the Processor Utilization.

Conclusion: -  Broadcast Storm can bring a network to its knees, but the good news is Spanning Tree Protocol can come to the rescue, and we gonna see how that works in our Next Topic.

             If You Like the Post. Don’t forget 
    to “Subscribe/Share/Comment”. Thank You.
Read More

Friday, October 21, 2016

Layer3 EtherChannel Configuration

                      Now in our last topic, we configured a “Layer2 Etherchannel”, and that might be very appropriate, If we had end to end Vlan’s in the Enterprise, another words, we got Vlan’s in Building 1, Vlan’s in Building 2 and Vlan’s in Building 3, and all the same. They are being shared between all those buildings, and we have Trunks interconnecting our buildings and case like that.
                   We might want to use “Layer2 Ether-channel’s”, however if we have a “Local Vlans” deployment, we might have Vlan’s within building 1, and the different set of Vlan’s within building 2, and different set of Vlan’s within building 3, and to get between buildings. Instead of sending traffic over a “Layer 2 Trunk”, we “Route between Buildings”. We need to leave a building not over a Trunk but over a “Routed Port”. We can do that with a Layer3 Etherchannel.
        “A Layer 3 Etherchannel is a connection made up of, a group of bundle ports, which we put into a logical interface, and those ports on that logical interface, they routed ports, instead of switchports

Let’s take a look? How to set it up
Ø  SW2(config)#interface range fastethernet 0/1-2
Ø  SW2(config-if-range)#speed auto
Ø  SW2(config-if-range)#duplex auto
Ø  SW2(config-if-range)#mdix auto
ü  Reason we doing that is we wanna make sure that, we can use MDI-X, which were requires the “Speed and Duplex” to be set to “Auto”. MDI-X is gonna let me use Straight-Through Cables to interconnect these switches.

Now let’s convert these “Switchport” into the “Routed Port
Ø  SW2(config-if-range)#no switchport
ü  Now fastethernet 0/1 and 0/2, they are now Routed Ports, we can could go in, and assign those “individual IP Addresses”. However instead, we want to bundle them together into the “Logical Etherchannel”.

Let’s use that Channel-group command again to create Virtual-Interface
Ø  SW2(config-if-range)#channel-group 1 mode on
ü  1:- locally significant number
ü  ON: - This way, we are not sending PAGP frames, we are not sending LACP frames, we just saying these this port to be a channel.

Let’s go into that Channel now.
Ø  SW2(config)#interface port-channel 1
Ø  SW2(config-if)#no switchport
ü  To make sure that, this Virtual interface is also viewed as a Routed interface, not a Switch interface

Now assign an IP Address, because this is a Routed Port.
Ø  SW2(config-if)#ip address

Once we set up, we want to confirm that we really are exchanging a Route information via OSPF, to do that, we want to create a loopback interface.
  Ø  SW2(config)#interface loopback 0
     Ø  SW2(config-if)#ip address

Now setup some Routing, let’s use OSPF. First we have to enable the IP Routing, which is disabled by default.
  Ø  SW2(config)#ip routing
  Ø  SW2(config)#router ospf 1
ü  1:- Process ID, locally significant
  Ø  SW2(config-router)#network area 0
ü  Route for all networks, shortcut way

Done with Configuration on SW2.Let’s go over SW3 and give a similar Configuration
  Ø  SW3(config)#interface range fastethernet 0/1-2
  Ø  SW3(config-if-range)#speed auto
  Ø  SW3(config-if-range)#duplex auto
  Ø  SW3(config-if-range)#mdix auto
  Ø  SW3(config-if-range)#no switchport
  Ø  SW3(config-if-range)#channel-group 1 mode on
ü  Remember the other side is ON, it’s not gonna be sending or responding to PAGP or LACP frames, and as result the channel will be formed.

  Ø  SW3(config)#interface port-channel 1
  Ø  SW3(config-if)#no switchport
  Ø  SW3(config-if)#ip address

  Ø  SW3(config)#interface loopback 0
  Ø  SW3(config-if)#ip address

Routing Configuration:-
  Ø  SW3(config)#ip routing
  Ø  SW3(config)#router ospf 1
  Ø  SW3(config-router)#network area 0
ü  Everybody belong to Area 0

 These switches now acting as Layer3 or Multilayer Switches. They are doing routing.

Verification & Troubleshooting: -
  Ø  SW3#show ip interface brief
ü  Make sure that, we have a newly created Virtual Interface

Now let’s make sure that, OSPF Neighborship formed over the Etherchannel
  Ø  SW3#show ip ospf neighbor

Now verify, have we learned any Network Information via OSFP over that Routed link
  Ø  SW#show ip route

Now go to SW2 and use same command
  Ø  SW2#show ip route

Conclusion: - That’s the look, creating a Layer3 Etherchannel for times, we want to have some extra bandwidth on a Routed Link interconnecting a couple of Multilayer Switches.

          If You Like the Post. Don’t forget 
    to “Subscribe/Share/Comment”. Thank You.
Read More