Let's talk about how multicast routing works.
Now, multicast routing is when you send traffic
to a Class D IP address, known as the multicast group.
Now, our goal here is for us only to send traffic out once
and then have all of the devices who want
to get that information.
And anybody who doesn't want to get it doesn't get it.
Now, there are two primary ways of doing this.
The first is known as IGMP
or the Internet Group Management Protocol.
The second is PIM or Protocol Independent Multicast.
We'll cover both of those in detail in this lesson.
Now, IGMP or the Internet Group Management Protocol,
is used by clients
and routers so that the routers know which interfaces have
multicast receivers on them.
This allows a client to join a multicast group
and then be able to receive messages
that they wanted to get
through this multicast group.
Now, there are three variants of IGMP.
The first one was IGMP version one,
and then it was improved to version two and version three.
Now, in version one,
clients could request joining the group
and every 60 seconds,
their router would go back and say,
Do you still want to be here?
And you could see how that causes a lot
of unnecessary traffic.
In version two, clients had the ability
to send leave messages to exit the group
when they want it.
Essentially, now the router's just going to assume you want
to be there until you told it
that you didn't want to be there.
Finally, in version three,
the client could request a multicast
from only a specific server and then choose,
Did I want to get my messages from one server
and not from server two?
That was allowed.
It would also allow
for source specific multicast,
which is what this server request was called.
Now this allowed us to have multiple video streams
to a single multicast stream.
Now, almost like you'd have
with cable TV where you could
dial into the channel you wanted,
that's kind of what we were doing here digitally
using the IGMP protocol.
So how did IGMP work?
Well, let's look at this diagram.
If I have a server that wants to send out traffic,
it's going to send it to the router
and the IP address of the multicast group.
In this case, 239.2.1.3.
Right now, the router is not sending it anywhere
because nobody's requested that information.
But if PC2 sends a request message to router one,
now router one is going to remember that PC2
wants to be a part of this multicast group.
Anything it gets as part of this multicast group
will now be sent over to PC2 as well,
and only going to go to PC2
because remember, PC1 and PC3
didn't ask to be a part of this group.
So hopefully you can see the benefits of this now.
In this example here, we have PC1
and PC3 that wanted to be in there
and they could join the group as well,
and then the server can send it out to all three people
with only one copy of the message being sent in.
That's the benefit of this.
The second thing we want to look at is PIM
or the Protocol Independent Multicast.
PIM is going to allow multicast traffic to be routed
between multicast enabled routers.
Multicast routing forms this multicast distribution tree,
and it really works between all these different routers
together because IGMP was more about clients
and servers together
where PIM is much more focused on
the routing part of this.
Now, there are two different modes in PIM.
There's a PIM-DM,
which is the dense mode,
or PIM-SM or sparse mode.
In dense mode, we're going to use a periodic flood
and prune behavior to form an optimal distribution tree
across these routers.
And this can actually cause a negative performance
impact on your network.
And because of this, in modern networks,
we really don't use it.
Instead, we tend to use sparse mode.
With PM-SM or sparse mode,
this is going to use a shared distribution tree initially,
and then it's going to over time, find the best tree.
Now when we start out,
that shared distribution tree is not optimal,
but over time,
we're going to learn where the best tree is
and then start switching over
to the shortest path tree or SPT
once it determines what that actually is.
Now, I know that's a lot of words,
so let's take a look at some pictures
to hopefully understand how this works a little better.
Here you can see PIM-DM or dense mode.
Now what happens in dense mode is to begin with,
it has this flooding procedure where all of the routers,
every router in this entire network,
is getting all of the information.
Now, as you can see, that's a lot of traffic,
but we do already have the optimal way of getting there from
that multicast source to the multicast destination
because it comes all of it at once with that big flood.
So in this case, it would be going down
the left side of that pyramid.
Now, as we go through,
it's going to then prune off all the non-optimal routes,
which in this case is all the routers off to the right.
It sends out this prune message saying,
"Hey, I don't need this traffic.
I'm not part of the optical route.
Get me out of here."
And that way they can go ahead
and drop those from the route.
Now, after sending all these pruning messages,
we now have the optimal path between the source router
and the last hop router, giving us
the quickest and easiest path.
Now, this is the idea of flood and prune,
and this happens every three minutes trying
to find a more optimal route, which again,
can cause a really big performance hit to your network
because we're flooding it every three minutes,
and this is why we don't really use it much anymore.
Instead, we use sparse mode.
Now, sparse mode or PIM-SM
is going to use a shared distribution tree.
Essentially, when the server sends out the first message,
the router's going to send it over any way it can
to get it from the first router down to the last hop.
In this case, it's going to be sending it
to this rendezvous point first
and then down to the last router hop.
Now, this isn't the optimal path,
but it is a path,
and that's okay and it works.
And so this information is going to start to flow.
As you can see, there are four
of the six routers that got the information.
Two of them weren't even bothered to get the information,
and so they saved all that resources
because they weren't being flooded.
Now, over time,
we figured out this was a suboptimal path
and instead it would be a lot quicker
to go down the left hand side of the diagram.
So we're going to start switching over to that,
getting rid of all these unused branches
and then going to the shortest path tree, SPT.
And that now gives us the optimal tree in this shared
distribution tree just like we had before in dense mode.
Now you can see how this uses a lot less resources than
dense mode did,
but it did take us a little bit more time
to find that optimal way.
That's the trade off here.
Do you want to get optimal right from the start,
but flood your network?
Or can you wait for optimal
and use a lot less resources?
In most modern networks,
we choose PIM-SM or sparse mode
because it works better on our networks
and uses less resources upfront,
and eventually gets that optimal distribution
that we're looking for.