1
00:00:00,000 --> 00:00:02,370
In this lesson, we're going to discuss loops,

2
00:00:02,370 --> 00:00:05,550
specifically switching loops and routing loops.

3
00:00:05,550 --> 00:00:07,290
First, we have switching loops.

4
00:00:07,290 --> 00:00:09,720
Switching loops or bridging loops are going to occur

5
00:00:09,720 --> 00:00:11,250
whenever there's more than one path

6
00:00:11,250 --> 00:00:13,590
between a source and destination device.

7
00:00:13,590 --> 00:00:15,030
As broadcast packets are sent

8
00:00:15,030 --> 00:00:17,400
for switching through every single switch port

9
00:00:17,400 --> 00:00:19,050
flooding can really occur quickly

10
00:00:19,050 --> 00:00:20,670
when broadcast messages are sent

11
00:00:20,670 --> 00:00:22,830
and then repeated back through another switchboard

12
00:00:22,830 --> 00:00:24,420
in this looped architecture.

13
00:00:24,420 --> 00:00:26,940
This will create a broadcast storm for you.

14
00:00:26,940 --> 00:00:28,260
Since our modern networks are built

15
00:00:28,260 --> 00:00:30,510
with additional load balancing and fault tolerance,

16
00:00:30,510 --> 00:00:32,880
there's usually going to be multiple physical connections

17
00:00:32,880 --> 00:00:34,470
between each part of the network.

18
00:00:34,470 --> 00:00:36,600
And so naturally, we would have loops

19
00:00:36,600 --> 00:00:38,580
and switching loops would become inevitable

20
00:00:38,580 --> 00:00:41,250
if we didn't put some protections in place to prevent them.

21
00:00:41,250 --> 00:00:43,410
So how are you going to prevent them?

22
00:00:43,410 --> 00:00:46,800
Well, to prevent a switching loop, you have to enable STP,

23
00:00:46,800 --> 00:00:48,570
the Spanning Tree Protocol.

24
00:00:48,570 --> 00:00:51,420
Check if STP is enabled and configured on your switch.

25
00:00:51,420 --> 00:00:53,520
You need to use the command show spanning tree

26
00:00:53,520 --> 00:00:54,780
and then hit enter.

27
00:00:54,780 --> 00:00:57,060
For the network+ exam, you do not need to know

28
00:00:57,060 --> 00:00:59,730
how to configure a Spanning Tree Protocol on a switch,

29
00:00:59,730 --> 00:01:01,110
but I'm showing you what it looks like

30
00:01:01,110 --> 00:01:03,270
just for demonstration purposes here.

31
00:01:03,270 --> 00:01:05,700
Now you can see here the information for this switch

32
00:01:05,700 --> 00:01:09,630
in VLAN 0001, which is our default VLAN.

33
00:01:09,630 --> 00:01:11,550
In this example, the Root ID is set

34
00:01:11,550 --> 00:01:14,070
with a priority of 1 and a cost of 2.

35
00:01:14,070 --> 00:01:18,750
The Bridge ID is set with a priority of 61,441.

36
00:01:18,750 --> 00:01:21,030
As we look at the different interfaces on the switch,

37
00:01:21,030 --> 00:01:22,633
you can see there are two ports

38
00:01:22,633 --> 00:01:23,970
that are designated as the root port

39
00:01:23,970 --> 00:01:25,290
that will forward traffic

40
00:01:25,290 --> 00:01:28,530
and all the other ports are set as designated ports.

41
00:01:28,530 --> 00:01:33,530
Eth1/11, 1/12, 1/15 and 1/16 are all in a blocking state.

42
00:01:35,730 --> 00:01:37,080
And this is what prevents a loop

43
00:01:37,080 --> 00:01:39,090
from occurring with this switch.

44
00:01:39,090 --> 00:01:41,730
Now, the bottom line here when it comes to switching loops

45
00:01:41,730 --> 00:01:43,620
is that if you suspect a switching loop

46
00:01:43,620 --> 00:01:46,410
it's likely an issue with how you configure your STP,

47
00:01:46,410 --> 00:01:47,790
and you need to escalate this work

48
00:01:47,790 --> 00:01:50,040
to a network administrator or network engineer

49
00:01:50,040 --> 00:01:52,980
to troubleshoot it, reconfigure it, and repair it.

50
00:01:52,980 --> 00:01:55,140
Next, let's talk about routing loops.

51
00:01:55,140 --> 00:01:57,150
A routing loop is formed when an error occurs

52
00:01:57,150 --> 00:01:59,370
in the operation of your routing algorithm,

53
00:01:59,370 --> 00:02:00,900
and this creates a circular route

54
00:02:00,900 --> 00:02:03,000
amongst a group of network devices.

55
00:02:03,000 --> 00:02:05,550
Routing loops are caused by incorrect configurations

56
00:02:05,550 --> 00:02:08,370
of your routing protocols where data packets get sent

57
00:02:08,370 --> 00:02:10,259
between different hosts of different networks,

58
00:02:10,259 --> 00:02:12,090
and they get caught in this endless loop

59
00:02:12,090 --> 00:02:14,730
traveling in a circle between the different network routers

60
00:02:14,730 --> 00:02:16,500
with incorrect route entries.

61
00:02:16,500 --> 00:02:18,840
Remember, we want multiple physical connections

62
00:02:18,840 --> 00:02:21,570
between our routers because this gives us higher redundancy

63
00:02:21,570 --> 00:02:22,890
and fault tolerance.

64
00:02:22,890 --> 00:02:25,500
So our routing protocols have methods in place

65
00:02:25,500 --> 00:02:27,840
to protect us from physical loops causing issues,

66
00:02:27,840 --> 00:02:29,130
things like weighted connections

67
00:02:29,130 --> 00:02:31,740
based on hops with the speed of those connections.

68
00:02:31,740 --> 00:02:34,320
For example, distance vector routing protocols

69
00:02:34,320 --> 00:02:37,770
use a Time To Live or TTL in the data gram header

70
00:02:37,770 --> 00:02:39,060
of the IP packets,

71
00:02:39,060 --> 00:02:41,280
and this will help us avoid routing loops.

72
00:02:41,280 --> 00:02:43,860
So if a packet reaches the Time To Live of 0,

73
00:02:43,860 --> 00:02:45,210
it's going to be dropped by the router

74
00:02:45,210 --> 00:02:46,560
and it's not going to be forwarded.

75
00:02:46,560 --> 00:02:48,810
And that effectively ends your routing loop.

76
00:02:48,810 --> 00:02:50,640
Routing loops, unlike switching loops

77
00:02:50,640 --> 00:02:53,250
are not caused by physical circular connections,

78
00:02:53,250 --> 00:02:56,430
but instead by the logical layer three circular connections

79
00:02:56,430 --> 00:02:58,620
that can exist within your routing tables.

80
00:02:58,620 --> 00:03:00,450
Now another method to prevent routing loops

81
00:03:00,450 --> 00:03:02,160
is known as split-horizon.

82
00:03:02,160 --> 00:03:03,870
If you configure split-horizon,

83
00:03:03,870 --> 00:03:06,060
you're going to ensure that you have this router configuration

84
00:03:06,060 --> 00:03:07,830
that stops a route from being advertised

85
00:03:07,830 --> 00:03:09,870
back in the direction that it came from.

86
00:03:09,870 --> 00:03:11,790
This split-horizon mechanism ensures

87
00:03:11,790 --> 00:03:13,920
that a router cannot send back alert route

88
00:03:13,920 --> 00:03:16,080
to the same router that it learned it from.

89
00:03:16,080 --> 00:03:18,750
To set up split-horizon on a Cisco router, for example,

90
00:03:18,750 --> 00:03:22,020
you're simply going to enter the command ip split-horizon

91
00:03:22,020 --> 00:03:24,120
and hit enter at the command line interface.

92
00:03:24,120 --> 00:03:26,820
If you believe split-horizon has been disabled by accident,

93
00:03:26,820 --> 00:03:29,790
you can look to see if the no ip split-horizon command

94
00:03:29,790 --> 00:03:31,380
was previously issued.

95
00:03:31,380 --> 00:03:33,690
Now, route poisoning is another method we can use

96
00:03:33,690 --> 00:03:36,180
to avoid routing loops inside of our networks.

97
00:03:36,180 --> 00:03:37,050
If a router detects

98
00:03:37,050 --> 00:03:39,000
that one of its connected routes has failed,

99
00:03:39,000 --> 00:03:40,740
the router's going to poison that route

100
00:03:40,740 --> 00:03:43,680
by increasing its metric to an infinitely high number.

101
00:03:43,680 --> 00:03:45,960
This happens automatically inside your routers.

102
00:03:45,960 --> 00:03:47,490
So that really isn't something you have to do

103
00:03:47,490 --> 00:03:50,130
or configure, it'll just happen for you.

104
00:03:50,130 --> 00:03:52,320
Finally, we have hold-down timers.

105
00:03:52,320 --> 00:03:54,600
Hold-down timers are used to prevent bad routes

106
00:03:54,600 --> 00:03:57,540
from being restored and passed to other routers by accident.

107
00:03:57,540 --> 00:03:58,950
Now, hold down-timers are used

108
00:03:58,950 --> 00:04:01,620
with distant vector routing protocols like RIP.

109
00:04:01,620 --> 00:04:03,990
The router's going to be configured, so it will not advertise

110
00:04:03,990 --> 00:04:07,080
or accept any routes that are in a hold-down state.

111
00:04:07,080 --> 00:04:10,230
This occurs for a set period known as the hold-down period.

112
00:04:10,230 --> 00:04:13,740
By default, the hold-down timer is set at 180 seconds

113
00:04:13,740 --> 00:04:15,690
or three minutes when you're using RIP

114
00:04:15,690 --> 00:04:17,070
as your routing protocol,

115
00:04:17,070 --> 00:04:18,360
and it should be configured that way

116
00:04:18,360 --> 00:04:20,220
automatically by your router.

117
00:04:20,220 --> 00:04:23,040
As I said, most of the routing loop issues can be solved

118
00:04:23,040 --> 00:04:25,140
by simply using the right routing protocols,

119
00:04:25,140 --> 00:04:26,970
ensuring they're configured properly.

120
00:04:26,970 --> 00:04:29,340
If you're adding a bunch of static routes into your router,

121
00:04:29,340 --> 00:04:30,540
be really careful

122
00:04:30,540 --> 00:04:33,300
because this is how most routing loops are going to be created.

123
00:04:33,300 --> 00:04:34,980
Remember, statically created routes

124
00:04:34,980 --> 00:04:36,960
are given a metric of 1 by default,

125
00:04:36,960 --> 00:04:40,200
making it extremely highly trusted by the router.

126
00:04:40,200 --> 00:04:42,150
The only type of route that the router will trust

127
00:04:42,150 --> 00:04:43,950
more than your statically assigned route

128
00:04:43,950 --> 00:04:45,840
is a directly connected route.

129
00:04:45,840 --> 00:04:47,910
Any routes that it learns through OSPF

130
00:04:47,910 --> 00:04:50,970
or RIP or BGP or EIGRP,

131
00:04:50,970 --> 00:04:53,370
any other routing protocol will not overwrite

132
00:04:53,370 --> 00:04:55,050
that static route that you created.

133
00:04:55,050 --> 00:04:56,670
So you have to be careful with static routes

134
00:04:56,670 --> 00:04:58,920
in order to prevent a potential routing loop.

