Now to improve Spanning Tree performance
we want to make these ports point-to-point Spanning Tree ports
point-to-point Spanning Tree ports converge a lot quicker
when using Rapid Spanning Tree.
At the moment on our switches such as switch 3
we can see that the ports are shared ports
they're going to take a lot longer to converge
So intrange gigabit 0/0 - 1 spanning-tree link-type point-to-point
This will allow Spanning Tree to converge a lot quicker
notice the ports are now point-to-points links.
That’s typically determined by the speed and duplex
at the moment these switches in a lab are set to auto-negotiates speed and duplex
you might want to hard code some of those options
if a port is set to full duplex
It will become a point-to-point port in Spanning Tree
as you can see here forVLAN 10, gigabit 0/0 and 0/1 are point-to-point links
but gigabit 0/2 is a shared link.
sh int g0/2
shows me that we're using auto duplex, auto speed negotiation.
In a physical network, we may want to hardcode speed and duplex
or when it negotiates to use full duplex, the port will become a point-to-point link.
But here in GNS3 it's not negotiating that.
So I want to manually set the port type to point-to-point in Spanning Tree.
So let’s do the same in all switches.
So switch 4 sh spanning-tree vlan 20 as an example
you can see the port are shared
so int range g0/0 - 1
on the uplinks tpanning-tree link-type point-to-point
sh spanning-tree vlan 20
notice those ports are now point-to-point
and let’s do it on the core switches as well.
So at the moment sh spanning-tree vlan 1
all my ports have a type of shared including the link aggregation.
So int range g0/0 - 3 spanning-tree link-type point-to-point
sh spanning-tree vlan 1 as an example
ports are still showing as shared on some of the ports
gigabit 1/0 is the link to the host that’s OK.
Port channel is showing up as shared
so I'll go into the port channel
and let's configure that as a Spanning Tree point-to-point link.
sh spanning-tree vlan 1
all ports are now point-to-point on the core.
So these links all point-to-point
we'll do the same on switch 2.
So int range g0/0 - 3 spanning-tree link-type point-to-point
int port channel 1
make it point-to-point sh spanning-tree vlan 1
all ports are point-to-point this port is still shared
so I could make that a point-to-point link
but for the moment I’m going to leave that as it is
because we can enable PortFast on these links
to increase the throughput of Spanning Tree convergence on those ports.
So sh spanning-tree vlan 10 and vlan 20
now, let’s test some of the convergence
I’m going to send a continues ping from PC 1
so router 1 pretending to be our PC to the core switch
and let see how good the convergence is
so on router 1 ping 10.1.10.1 ping succeeds
but I can repeat the ping let say 10,000 times
before I press enter on switch 3
so this switch here sh spanning-tree vlan 10
we can see that the root port is gigabit 0/0
this port is an alternate port
so we'll stop the ping, conf t int g0/0 shut it
notice we’ve lost the ping losing a few pings here
so the convergence is taking a while
one of the pings we can do to speed up convergence is change this port
notice the state is learning
gigabit 0/1 has gone forwarding already
but notice this port is still learning.
Because it’s a shared port it’s gonna take longer to converge
so it took a while for that port to converge
it could take like 30 seconds for it to converge
so point-to point links converge very quickly.
As an example, when I shut this port down
this port very quickly went to the forwarding state
if I no shut that port again
sh spanning-tree vlan 10
you can see that port is already forwarding
so very quickly this port went to forwarding
and this port went to blocking
but the problem is the port to the host is blocking because this is a shared port.
So shared ports goes through the normal Spanning Tree timers
of blocking, listening, learning forwarding
so it's gonna take it a while for the port to start forwarding.
Notice we're learning now and then after a period of time its starts forwarding.
So if you don’t have a switch connected to this port
you can improve the convergence of that port
by making it a Spanning Tree Portfast port
so I could specify Portfast here
notice we're warned that this should only be enabled on ports
where we don’t have switches connected
so we shouldn’t have hubs or switches or other devices
that can cause loops in the network on these ports.
So our pings are continuing.
sh spanning-tree vlan 10
shows me that the port is a shared port
but now when I go into gigabit 0/0
and shut the port down, ports gone down now
notice gigabit 0/1 is already forwarding it's taking a while
because I put, its look like I put the command on the wrong port
so let’s have a look again at the config.
I incorrectly configured Portfast on gigabit 0/0
so let’s fix that problem
so int g0/0 no spanning-tree portfast edge
do sh run in g0/0 no shut the port now
and then let’s go on to gigabit 0/2
and type spanning-tree portfast
And let see if I did this right now
so do sh int gigabit 0/2
this port is now a Portfast port or what’s called an edge port, which is correct.
do sh run g0/0 that shouldn’t be a Portfast port
and it’s not and neither should gigabit 0/1 so that looks better.
do sh spanning tree vlan 10
notice the difference this is now a shared edge port, that looks a lot better.
Let’s do the ping again at the moment gigabit 0/0 is the root port
so int g0/0 shut the port down
let’s see if we lose as many pings
and as you’ve notice there we only lost a single ping.
So I'll break that ping, we lost 1 ping
we lost this last when I broke the ping
but we only lost this single ping when the interface went down.
So that’s a lot better than we had previously
so do sh spanning-tree vlan 10
notice gigabit 1/0 is the root port I'll send a 100 pings now
and let's no shut the interface, let's make that a thousand
sh spanning-tree vlan 10 what you’ll notice once again
I dropped the single ping over there
and it immediately revert it to port 1 being the root port.
So what’s the moral of the story? These links need to be point-to-point links
this link needs to be a Portfast port
in other words, an edge port compares that to switch 4 on switch 4 this is a shared port.
So it's gonna take longer for this to converge.
On this switch we want to go into gigabit 0/2 and type spanning-tree portfast
and now when we type sh spanning-tree vlan 20
notice it's a shared edge port and we can do something similar now
on router 2, I'll ping 10.1.20.1 and repeat that thousand times again.
Go into gigabit 0/0 start the ping
and I'll shut the port down notice we lost 1 ping.
So do sh spanning tree vlan 20 in this example
forwarding port is now this port
it’s the root port, this port is the edge port
let’s do the ping again I'll no shut gigabit 0/0, now gigabit 0/0 is the root port
and it’s already forwarding.
The convergence is a lot better than we had previously
we didn’t even lose a ping in this example.
So let’s do that process again.
Do a ping shut the port down, we’ve lost a ping but only 1
I'll no shut the port, just too quick I'll shut it down again, do a ping again.
Port to shut no shut it
sh spanning-tree vlan
do sh spanning tree vlan 10 or 20 in this example
gigabit 0/0 is the root port gigabit 0/1 is the alternate port
gigabit 0/2 is a shared edge port.
So once again, to optimize Spanning Tree
make all ports point-to-point links between your switches
make your ports to your edge devices Spanning Tree Portsfast
or edge ports as it's called in the industry.
So Cisco term is Portfast other vendors will call these edge ports
and we could do the same on these 2 ports here.
So the last thing we need to do is on switch 1 go into gigabit 1/0
and type spanning-tree portfast
and then do the same on switch 2 int g1/0 spanning-tree portfast
sh spanning-tree vlan 1 gigabit 1/0 is an edge port on switch 2
sh spanning-tree vlan 1 on switch 1 notice this is an edge port here.
So we’ve optimized Spanning Tree
by making all of these ports point-to-point links in Spanning Tree.
These ports are edge ports and these 2 ports are bonded in a link aggregation or Etherchannel.
So once again, on switch 1 sh spanning-tree vlan 1
notice this is a port channel and it's point-to-point link.
Spanning Tree has been optimized, now that we’ve optimized layer 2
we need to look at layer 3 functionality
and specifically the default gateways of devices in the topology.
We also need to think about routing
how we're going to route from these devices into the Internet
so we'll cover that in subsequent videos.