1
00:00:00,000 --> 00:00:03,000
Now to improve Spanning Tree performance

2
00:00:03,000 --> 00:00:08,000
we want to make these ports point-to-point Spanning Tree ports

3
00:00:08,000 --> 00:00:12,000
point-to-point Spanning Tree ports converge a lot quicker

4
00:00:12,000 --> 00:00:14,000
when using Rapid Spanning Tree.

5
00:00:14,000 --> 00:00:18,000
At the moment on our switches such as switch 3

6
00:00:18,000 --> 00:00:24,000
we can see that the ports are shared ports

7
00:00:24,000 --> 00:00:27,000
they're going to take a lot longer to converge

8
00:00:27,000 --> 00:00:36,000
So intrange gigabit 0/0 - 1 spanning-tree link-type point-to-point

9
00:00:36,000 --> 00:00:41,000
This will allow Spanning Tree to converge a lot quicker

10
00:00:41,000 --> 00:00:44,000
notice the ports are now point-to-points links.

11
00:00:44,000 --> 00:00:49,000
That’s typically determined by the speed and duplex

12
00:00:49,000 --> 00:00:56,000
at the moment these switches in a lab are set to auto-negotiates speed and duplex

13
00:00:56,000 --> 00:01:00,000
you might want to hard code some of those options

14
00:01:00,000 --> 00:01:03,000
if a port is set to full duplex

15
00:01:03,000 --> 00:01:07,000
It will become a point-to-point port in Spanning Tree

16
00:01:07,000 --> 00:01:15,000
as you can see here forVLAN 10, gigabit 0/0 and 0/1 are point-to-point links

17
00:01:15,000 --> 00:01:19,000
but gigabit 0/2 is a shared link.

18
00:01:19,000 --> 00:01:22,000
sh int g0/2

19
00:01:22,000 --> 00:01:27,000
shows me that we're using auto duplex, auto speed negotiation.

20
00:01:27,000 --> 00:01:34,000
In a physical network, we may want to hardcode speed and duplex

21
00:01:34,000 --> 00:01:42,000
or when it negotiates to use full duplex, the port will become a point-to-point link.

22
00:01:42,000 --> 00:01:45,000
But here in GNS3 it's not negotiating that.

23
00:01:45,000 --> 00:01:54,000
So I want to manually set the port type to point-to-point in Spanning Tree.

24
00:01:54,000 --> 00:01:56,000
So let’s do the same in all switches.

25
00:01:56,000 --> 00:02:02,000
So switch 4 sh spanning-tree vlan 20 as an example

26
00:02:02,000 --> 00:02:04,000
you can see the port are shared

27
00:02:04,000 --> 00:02:10,000
so int range g0/0 - 1

28
00:02:10,000 --> 00:02:15,000
on the uplinks tpanning-tree link-type point-to-point

29
00:02:15,000 --> 00:02:20,000
sh spanning-tree vlan 20

30
00:02:20,000 --> 00:02:23,000
notice those ports are now point-to-point

31
00:02:23,000 --> 00:02:26,000
and let’s do it on the core switches as well.

32
00:02:26,000 --> 00:02:31,000
So at the moment sh spanning-tree vlan 1

33
00:02:31,000 --> 00:02:36,000
all my ports have a type of shared including the link aggregation.

34
00:02:36,000 --> 00:02:49,000
So int range g0/0 - 3 spanning-tree link-type point-to-point

35
00:02:49,000 --> 00:02:53,000
sh spanning-tree vlan 1 as an example

36
00:02:53,000 --> 00:02:59,000
ports are still showing as shared on some of the ports

37
00:02:59,000 --> 00:03:04,000
gigabit 1/0 is the link to the host that’s OK.

38
00:03:04,000 --> 00:03:06,000
Port channel is showing up as shared

39
00:03:06,000 --> 00:03:08,000
so I'll go into the port channel

40
00:03:08,000 --> 00:03:16,000
and let's configure that as a Spanning Tree point-to-point link.

41
00:03:16,000 --> 00:03:18,000
sh spanning-tree vlan 1

42
00:03:18,000 --> 00:03:23,000
all ports are now point-to-point on the core.

43
00:03:23,000 --> 00:03:25,000
So these links all point-to-point

44
00:03:25,000 --> 00:03:27,000
we'll do the same on switch 2.

45
00:03:27,000 --> 00:03:37,000
So int range g0/0 - 3 spanning-tree link-type point-to-point

46
00:03:37,000 --> 00:03:41,000
int port channel 1

47
00:03:41,000 --> 00:03:46,000
make it point-to-point sh spanning-tree vlan 1

48
00:03:46,000 --> 00:03:53,000
all ports are point-to-point this port is still shared

49
00:03:53,000 --> 00:03:56,000
so I could make that a point-to-point link

50
00:03:56,000 --> 00:03:59,000
but for the moment I’m going to leave that as it is

51
00:03:59,000 --> 00:04:03,000
because we can enable PortFast on these links

52
00:04:03,000 --> 00:04:08,000
to increase the throughput of Spanning Tree convergence on those ports.

53
00:04:08,000 --> 00:04:16,000
So sh spanning-tree vlan 10 and vlan 20

54
00:04:16,000 --> 00:04:18,000
now, let’s test some of the convergence

55
00:04:18,000 --> 00:04:23,000
I’m going to send a continues ping from PC 1

56
00:04:23,000 --> 00:04:26,000
so router 1 pretending to be our PC to the core switch

57
00:04:26,000 --> 00:04:29,000
and let see how good the convergence is

58
00:04:29,000 --> 00:04:38,000
so on router 1 ping 10.1.10.1 ping succeeds

59
00:04:38,000 --> 00:04:41,000
but I can repeat the ping let say 10,000 times

60
00:04:41,000 --> 00:04:46,000
before I press enter on switch 3

61
00:04:46,000 --> 00:04:53,000
so this switch here sh spanning-tree vlan 10

62
00:04:53,000 --> 00:04:57,000
we can see that the root port is gigabit 0/0

63
00:04:57,000 --> 00:05:00,000
this port is an alternate port

64
00:05:00,000 --> 00:05:06,000
so we'll stop the ping, conf t int g0/0 shut it

65
00:05:06,000 --> 00:05:10,000
notice we’ve lost the ping losing a few pings here

66
00:05:10,000 --> 00:05:13,000
so the convergence is taking a while

67
00:05:13,000 --> 00:05:21,000
one of the pings we can do to speed up convergence is change this port

68
00:05:21,000 --> 00:05:23,000
notice the state is learning

69
00:05:23,000 --> 00:05:26,000
gigabit 0/1 has gone forwarding already

70
00:05:26,000 --> 00:05:30,000
but notice this port is still learning.

71
00:05:30,000 --> 00:05:34,000
Because it’s a shared port it’s gonna take longer to converge

72
00:05:34,000 --> 00:05:37,000
so it took a while for that port to converge

73
00:05:37,000 --> 00:05:40,000
it could take like 30 seconds for it to converge

74
00:05:40,000 --> 00:05:45,000
so point-to point links converge very quickly.

75
00:05:45,000 --> 00:05:48,000
As an example, when I shut this port down

76
00:05:48,000 --> 00:05:53,000
this port very quickly went to the forwarding state

77
00:05:53,000 --> 00:05:56,000
if I no shut that port again

78
00:05:56,000 --> 00:06:01,000
sh spanning-tree vlan 10

79
00:06:01,000 --> 00:06:04,000
you can see that port is already forwarding

80
00:06:04,000 --> 00:06:06,000
so very quickly this port went to forwarding

81
00:06:06,000 --> 00:06:08,000
and this port went to blocking

82
00:06:08,000 --> 00:06:14,000
but the problem is the port to the host is blocking because this is a shared port.

83
00:06:14,000 --> 00:06:19,000
So shared ports goes through the normal Spanning Tree timers

84
00:06:19,000 --> 00:06:22,000
of blocking, listening, learning forwarding

85
00:06:22,000 --> 00:06:25,000
so it's gonna take it a while for the port to start forwarding.

86
00:06:25,000 --> 00:06:31,000
Notice we're learning now and then after a period of time its starts forwarding.

87
00:06:31,000 --> 00:06:36,000
So if you don’t have a switch connected to this port

88
00:06:36,000 --> 00:06:40,000
you can improve the convergence of that port

89
00:06:40,000 --> 00:06:45,000
by making it a Spanning Tree Portfast port

90
00:06:45,000 --> 00:06:48,000
so I could specify Portfast here

91
00:06:48,000 --> 00:06:54,000
notice we're warned that this should only be enabled on ports

92
00:06:54,000 --> 00:06:56,000
where we don’t have switches connected

93
00:06:56,000 --> 00:06:59,000
so we shouldn’t have hubs or switches or other devices

94
00:06:59,000 --> 00:07:03,000
that can cause loops in the network on these ports.

95
00:07:03,000 --> 00:07:06,000
So our pings are continuing.

96
00:07:06,000 --> 00:07:09,000
sh spanning-tree vlan 10

97
00:07:09,000 --> 00:07:13,000
shows me that the port is a shared port

98
00:07:13,000 --> 00:07:16,000
but now when I go into gigabit 0/0

99
00:07:16,000 --> 00:07:21,000
and shut the port down, ports gone down now

100
00:07:21,000 --> 00:07:31,000
notice gigabit 0/1 is already forwarding it's taking a while

101
00:07:31,000 --> 00:07:34,000
because I put, its look like I put the command on the wrong port

102
00:07:34,000 --> 00:07:37,000
so let’s have a look again at the config.

103
00:07:37,000 --> 00:07:44,000
I incorrectly configured Portfast on gigabit 0/0

104
00:07:44,000 --> 00:07:46,000
so let’s fix that problem

105
00:07:46,000 --> 00:07:52,000
so int g0/0 no spanning-tree portfast edge

106
00:07:52,000 --> 00:07:57,000
do sh run in g0/0 no shut the port now

107
00:07:57,000 --> 00:07:59,000
and then let’s go on to gigabit 0/2

108
00:07:59,000 --> 00:08:03,000
and type spanning-tree portfast

109
00:08:03,000 --> 00:08:05,000
And let see if I did this right now

110
00:08:05,000 --> 00:08:07,000
so do sh int gigabit 0/2

111
00:08:07,000 --> 00:08:12,000
this port is now a Portfast port or what’s called an edge port, which is correct.

112
00:08:12,000 --> 00:08:18,000
do sh run g0/0 that shouldn’t be a Portfast port

113
00:08:18,000 --> 00:08:22,000
and it’s not and neither should gigabit 0/1 so that looks better.

114
00:08:22,000 --> 00:08:26,000
do sh spanning tree vlan 10

115
00:08:26,000 --> 00:08:30,000
notice the difference this is now a shared edge port, that looks a lot better.

116
00:08:30,000 --> 00:08:35,000
Let’s do the ping again at the moment gigabit 0/0 is the root port

117
00:08:35,000 --> 00:08:39,000
so int g0/0 shut the port down

118
00:08:39,000 --> 00:08:42,000
let’s see if we lose as many pings

119
00:08:42,000 --> 00:08:45,000
and as you’ve notice there we only lost a single ping.

120
00:08:45,000 --> 00:08:51,000
So I'll break that ping, we lost 1 ping

121
00:08:51,000 --> 00:08:54,000
we lost this last when I broke the ping

122
00:08:54,000 --> 00:08:57,000
but we only lost this single ping when the interface went down.

123
00:08:57,000 --> 00:08:59,000
So that’s a lot better than we had previously

124
00:08:59,000 --> 00:09:05,000
so do sh spanning-tree vlan 10

125
00:09:05,000 --> 00:09:11,000
notice gigabit 1/0 is the root port I'll send a 100 pings now

126
00:09:11,000 --> 00:09:17,000
and let's no shut the interface, let's make that a thousand

127
00:09:17,000 --> 00:09:25,000
sh spanning-tree vlan 10 what you’ll notice once again

128
00:09:25,000 --> 00:09:27,000
I dropped the single ping over there

129
00:09:27,000 --> 00:09:33,000
and it immediately revert it to port 1 being the root port.

130
00:09:33,000 --> 00:09:38,000
So what’s the moral of the story? These links need to be point-to-point links

131
00:09:38,000 --> 00:09:42,000
this link needs to be a Portfast port

132
00:09:42,000 --> 00:09:51,000
in other words, an edge port compares that to switch 4 on switch 4 this is a shared port.

133
00:09:51,000 --> 00:09:54,000
So it's gonna take longer for this to converge.

134
00:09:54,000 --> 00:10:03,000
On this switch we want to go into gigabit 0/2 and type spanning-tree portfast

135
00:10:03,000 --> 00:10:11,000
and now when we type sh spanning-tree vlan 20

136
00:10:11,000 --> 00:10:15,000
notice it's a shared edge port and we can do something similar now

137
00:10:15,000 --> 00:10:26,000
on router 2, I'll ping 10.1.20.1 and repeat that thousand times again.

138
00:10:26,000 --> 00:10:32,000
Go into gigabit 0/0 start the ping

139
00:10:32,000 --> 00:10:38,000
and I'll shut the port down notice we lost 1 ping.

140
00:10:38,000 --> 00:10:46,000
So do sh spanning tree  vlan 20 in this example

141
00:10:46,000 --> 00:10:48,000
forwarding port is now this port

142
00:10:48,000 --> 00:10:52,000
it’s the root port, this port is the edge port

143
00:10:52,000 --> 00:11:01,000
let’s do the ping again I'll no shut gigabit 0/0, now gigabit 0/0 is the root port

144
00:11:01,000 --> 00:11:03,000
and it’s already forwarding.

145
00:11:03,000 --> 00:11:10,000
The convergence is a lot better than we had previously

146
00:11:10,000 --> 00:11:13,000
we didn’t even lose a ping in this example.

147
00:11:13,000 --> 00:11:15,000
So let’s do that process again.

148
00:11:15,000 --> 00:11:22,000
Do a ping shut the port down, we’ve lost a ping but only 1

149
00:11:22,000 --> 00:11:33,000
I'll no shut the port, just too quick I'll shut it down again, do a ping again.

150
00:11:33,000 --> 00:11:36,000
Port to shut no shut it

151
00:11:36,000 --> 00:11:39,000
sh spanning-tree vlan

152
00:11:39,000 --> 00:11:48,000
do sh spanning tree vlan 10 or 20 in this example

153
00:11:48,000 --> 00:11:52,000
gigabit 0/0 is the root port gigabit 0/1 is the alternate port

154
00:11:52,000 --> 00:11:55,000
gigabit 0/2 is a shared edge port.

155
00:11:55,000 --> 00:11:59,000
So once again, to optimize Spanning Tree

156
00:11:59,000 --> 00:12:04,000
make all ports point-to-point links between your switches

157
00:12:04,000 --> 00:12:09,000
make your ports to your edge devices Spanning Tree Portsfast

158
00:12:09,000 --> 00:12:12,000
or edge ports as it's called in the industry.

159
00:12:12,000 --> 00:12:17,000
So Cisco term is Portfast other vendors will call these edge ports

160
00:12:17,000 --> 00:12:20,000
and we could do the same on these 2 ports here.

161
00:12:20,000 --> 00:12:29,000
So the last thing we need to do is on switch 1 go into gigabit 1/0

162
00:12:29,000 --> 00:12:34,000
and type spanning-tree portfast

163
00:12:34,000 --> 00:12:46,000
and then do the same on switch 2 int g1/0 spanning-tree portfast

164
00:12:46,000 --> 00:12:54,000
sh spanning-tree vlan 1 gigabit 1/0 is an edge port on switch 2

165
00:12:54,000 --> 00:13:03,000
sh spanning-tree vlan 1 on switch 1 notice this is an edge port here.

166
00:13:03,000 --> 00:13:07,000
So we’ve optimized Spanning Tree

167
00:13:07,000 --> 00:13:14,000
by making all of these ports point-to-point links in Spanning Tree.

168
00:13:14,000 --> 00:13:23,000
These ports are edge ports and these 2 ports are bonded in a link aggregation or Etherchannel.

169
00:13:23,000 --> 00:13:28,000
So once again, on switch 1 sh spanning-tree vlan 1

170
00:13:28,000 --> 00:13:33,000
notice this is a port channel and it's point-to-point link.

171
00:13:33,000 --> 00:13:38,000
Spanning Tree has been optimized, now that we’ve optimized layer 2

172
00:13:38,000 --> 00:13:41,000
we need to look at layer 3 functionality

173
00:13:41,000 --> 00:13:45,000
and specifically the default gateways of devices in the topology.

174
00:13:45,000 --> 00:13:47,000
We also need to think about routing

175
00:13:47,000 --> 00:13:51,000
how we're going to route from these devices into the Internet

176
00:13:51,000 --> 00:13:56,000
so we'll cover that in subsequent videos.
