-: The last topic we need to talk about 2 2
in this routing section is how multicast routing works. 3 3
Now, multicast routing is when you send traffic 4 4
to a class D IP address, known as the multicast group. 5 5
Now, our goal here is for us only to send traffic out once 6 6
and then have all of the devices 7 7
who want to get that information, 8 8
and anybody who doesn't want to get it, doesn't get it. 9 9
Now, there are two primary ways of doing this. 10 10
The first is known as IGMP, 11 11
or the Internet Group Management Protocol. 12 12
The second is PIM, or Protocol Independent Multicast. 13 13
We'll cover both of those in detail in this lesson. 14 14
Now, IGMP, or the Internet Group Management Protocol, 15 15
is used by clients and routers 16 16
so that the routers know which interfaces 17 17
have multicast receivers on them. 18 18
This allows a client to join a multicast group 19 19
and then be able to receive messages that they wanted to get 20 20
through this multicast group. 21 21
Now, there are three variants of IGMP. 22 22
The first one was IGMPv1. 23 23
And then it was improved to version two and version three. 24 24
Now in version one, 25 25
clients could request joining the group 26 26
and every 60 seconds, their router would go back and say, 27 27
do you still want to be here? Do you still want to be here? 28 28
Do you still want to be here? 29 29
And you could see how that causes 30 30
a lot of unnecessary traffic. 31 31
In version two, clients had the ability 32 32
to send leave messages to exit the group when they wanted. 33 33
Essentially now, the router's just going to assume 34 34
you want to be there until you told it 35 35
that you didn't want to be there. 36 36
Finally, in version three, 37 37
the client could request a multicast 38 38
from only a specific server and then choose, 39 39
did I want to get my messages from one server 40 40
and not from server two? 41 41
That was allowed. 42 42
It would also allow for source specific multicast, 43 43
which is what this server request was called. 44 44
Now, this allowed us to have multiple video streams 45 45
to a single multicast stream. 46 46
Now, almost like you'd have with cable TV, 47 47
where you could dial into the channel you wanted, 48 48
that's kind of what we were doing here digitally, 49 49
using the IGMP protocol. 50 50
So how did IGMP work? 51 51
Well, let's look at this diagram. 52 52
If I have a server that wants to send out traffic, 53 53
it's going to send it to the router 54 54
and the IP address of the multicast group. 55 55
In this case, 239.2.1.3. 56 56
Right now, the router is not sending it anywhere, 57 57
'cause nobody's requested that information. 58 58
But if PC2 sends a request message to router one, 59 59
now router one is going to remember that PC2 60 60
wants to be a part of this multicast group, 61 61
and anything it gets as part of this multicast group 62 62
will now be sent over to PC2 as well. 63 63
And only going to go to PC2, 64 64
because remember, PC1 and PC3 65 65
didn't ask to be a part of this group. 66 66
So hopefully you can see the benefits of this now. 67 67
In this example here, 68 68
we have PC1 and PC3 that wanted to be in there 69 69
and they could join the group as well. 70 70
And then the server can send it out to all three people 71 71
with only one copy of the message being sent in. 72 72
That's the benefit of this. 73 73
The second thing we want to look at is PIM, 74 74
or the Protocol Independent Multicast. 75 75
PIM is going to allow multicast traffic to be routed 76 76
between multicast enabled routers. 77 77
Multicast routing forms this multicast distribution tree, 78 78
and it really works between all these different routers 79 79
together because IGMP 80 80
was more about clients and servers together, 81 81
where PIM is much more focused on the routing part of this. 82 82
Now, there are two different modes in PIM. 83 83
There's a PIM-DM, which is the Dense Mode, 84 84
or PIM-SM or Sparse Mode. 85 85
In Dense Mode, we're going to use a periodic flood and prune 86 86
behavior to form an optimal distribution tree 87 87
across these routers. 88 88
And this can actually cause a negative performance impact 89 89
on your network, and because of this, in modern networks, 90 90
we really don't use it. 91 91
Instead, we tend to use Sparse Mode. 92 92
With PIM-SM, or Sparse Mode, 93 93
this is going to use a shared distribution tree initially, 94 94
and then it's going to, over time, find the best tree. 95 95
Now, when we start out, 96 96
that shared distribution tree is not optimal, but over time, 97 97
we're going to learn where the best tree is, 98 98
and then start switching over to the Shortest Path Tree, 99 99
or SPT, once it determines what that actually is. 100 100
Now, I know that's a lot of words. 101 101
So let's take a look at some pictures 102 102
to hopefully understand how this works a little better. 103 103
Here you can see PIM-DM or Dense Mode. 104 104
Now, what happens in Dense Mode is, 105 105
to begin with, it has this flooding procedure 106 106
where all of the routers, 107 107
every router in this entire network, 108 108
is getting all of the information. 109 109
Now, as you can see, that's a lot of traffic, 110 110
but we do already have the optimal way of getting there 111 111
from that multicast source to the multicast destination, 112 112
because it comes all at once with that big flood. 113 113
So in this case, it would be going down the left side 114 114
of that pyramid. 115 115
Now, as we go through, 116 116
it's going to then prune off all the non-optimal routes, 117 117
which in this case is all the routers off to the right. 118 118
It sends out this prune message saying, 119 119
hey, I don't need this traffic. 120 120
I'm not part of the optical route. Get me out of here. 121 121
And that way, 122 122
they can go ahead and drop those from the route. 123 123
Now, after sending all these pruning messages, 124 124
we now have the optimal path 125 125
between the source router and the last hop router, 126 126
giving us the quickest and easiest path. 127 127
Now, this is the idea of flood and prune. 128 128
And this happens every three minutes, 129 129
trying to find a more optimal route, 130 130
which again, can cause a really big performance hit 131 131
to your network, because we're flooding it 132 132
every three minutes. 133 133
And this is why we don't really use it much anymore. 134 134
Instead we use Sparse Mode. 135 135
Now Sparse Mode, or PIM-SM, 136 136
is going to use a shared distribution tree. 137 137
Essentially, when the server sends out the first message, 138 138
the router's going to send it over any way it can 139 139
to get it from the first router down to the last hop. 140 140
In this case, it's going to be sending it 141 141
to this rendezvous point first, 142 142
and then down to last router hop. 143 143
Now, this isn't the optimal path, 144 144
but it is a path and that's okay and it works. 145 145
And so this information is going to start to flow. 146 146
As you can see, 147 147
there are four of the six routers that got the information. 148 148
Two of them weren't even bothered to get the information, 149 149
and so they saved all that resources, 150 150
because they weren't being flooded. 151 151
Now, over time, we figured out this was a sub optimal path, 152 152
and instead, it would be a lot quicker 153 153
to go down the left-hand side of the diagram. 154 154
So, we're going to start switching over to that, 155 155
getting rid of all these unused branches 156 156
and then going to the Shortest Path Tree, the SPT, 157 157
and that now gives us the optimal tree 158 158
in this shared distribution tree, 159 159
just like we had before in Dense Mode. 160 160
Now you can see how this uses a lot less resources 161 161
than Dense Mode did, 162 162
but it did take us a little bit more time 163 163
to find that optimal way. 164 164
That's the trade off here. 165 165
Do you want to get optimal right from the start, 166 166
but flood your network? 167 167
Or can you wait for optimal 168 168
and use a lot less resources? 169 169
In most modern networks, 170 170
we choose PIM-SM, or Sparse Mode, 171 171
because it works better on our networks 172 172
and uses less resources upfront, 173 173
and eventually gets that optimal distribution 174 174
that we're looking for.