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