Talking in the Vernacular—Something About Multicast

I. Introduction

Multicast is a knowledge point that computer network operation and maintenance personnel can never get around. For beginners like me, the concept of multicast is often only a little understanding. It is easy to lose the book, but I really want to make it clear. There are difficulties.
Most of the knowledge points related to Baidu multicast are not so easy to understand, so I want to combine my understanding and give him a "literal translation" in my own language to facilitate my future review.
The talk is relatively general, and some concepts are not involved. If you need to understand, please read the information yourself. Our goal is to write an introduction to multicast that monkeys can understand. It is not the most accurate, but the most intuitive.

Second, the thing about multicast

(1) What's the matter with multicast

1. Why do we need multicast?

Multicast essentially transmits UDP packets. There are two common transmission forms for UDP packets.
One is unicast
or point-to-point transmission, which is very clear. You can send it from one network device to another.
Another one of my own is broadcasting
, that is, point-to-many. I gave it. Within a certain range, anyone can receive it. This certain range is usually considered to be non-transvlan (the reason why it is usually thought that there is also a router However, in fact, the difference in function between routers and switches has been a bit blurred. It can only be said that the focus is different), which means that if it is not across the vlan, as long as it can be seen, broadcast information Can pass.
And the problems that exist are also obvious.
The problem with unicast
is that it can only be one-to-one. If many devices want this data, each device needs to ask the sender of the data, and give it a separate copy. Therefore, ten people want to send the data. Those who have to send ten, this is obviously very redundant.
The problem of
broadcasting Broadcasting can realize one-to-many transmission. Anyway, I sent it once, and the data was circulated everywhere in the LAN. Whoever wants to collect it by himself is fine, but this problem is also obvious. The data can't cross the vlan. What about the data? You can only wander around in this yard, you can't get out of the gate of the yard.
Therefore , in order to solve the drawbacks of both, it came into being multicast, and multicast two most important feature is that goes far and as long as a pass . We will talk about these characteristics of multicast in detail later.

2. Several characteristics of multicast that I am concerned about

The so-called multicast, he is not alone in the fight, he is not a person, he is a team, each perform their duties, in charge of part of the content, so as to achieve multicast data forwarding. In this team, there are a few Titans, and the main player is naturally the igmp protocol and the pim protocol. Who are they? Don't worry, we will introduce them later when appropriate.
Below, I first introduce the most important features of multicast in my opinion.

(1) Entry and exit mechanism

Joining and exiting mean whether I want to join this activity. Of course, this activity is to send and receive data in the form of multicast . Note that it is to send and receive data. As long as you join this activity, you are a member of this activity, that is, you are a member of the member group. I emphasize this means that it is like playing a game of Werewolf. No matter what identity you play behind, you are first of all A player.
Plan focuses
So, as long as you participate in this event multicast, you are multicast member, whether you are a data sender or recipient of the data, in other words, you are in this event, you can be both sender of data, it can be The data receiver, that is, when you send data, you are the multicast source (the multicast source is the device that sends the multicast data, more intuitively, it is the IP of that device, pay attention, must be distinguished The multicast source is not a multicast group. The multicast group corresponds to the multicast address, which is the destination IP when you send multicast data. When you receive data, you are the receiver.
Make this clear, let's continue, then how do you participate in and withdraw from this event? Of course, there must be an active manager. Only members cannot play. The manager here is the multicast router, that is, the switching and routing equipment that participates in the multicast activity. More precisely, the so-called multicast router . One of the characteristics is that it runs the igmp protocol, that is, the Internet Group Management Protocol is called the Internet Group Management Protocol (Internet Group Management Protocol). Seriously, I emphasize that an important feature of the multicast router is that it runs the igmp protocol. It may be a switch! One of his roles is to manage everyone's participation and exit activities through the igmp protocol.
The role of the igmp protocol mentioned here is just one role, responsible for joining and exiting .
The igmp protocol is an agreement on the device side and the switch router. It is equivalent to that when everyone supports and agrees to the management agreement of the housekeeper, then everyone will follow this regulation. Of course, the regulations are mutual, if Only the manager agrees, but the members disagree. Of course, it is useless. For management, it is naturally managed nearby.
In order to manage everyone's entry and exit, he thought of many methods and constantly improved his working methods and styles. Therefore, there are three versions of igmp v1, v2, and v3. The v in front of the number is naturally version. The meaning of the version.
But no matter which version it is, there is a common feature, that is, among the many managers in this activity, that is, the multicast router, the most difficult butler (ie IGMP querier) needs to be selected, and he needs to do the most The important job is to constantly ask the terminal equipment a question, "Are you participating in this activity", and repeatedly confirm, he will ask every device directly connected to many multicast routers in the network (this time, it needs to be emphasized. , Multicast is an activity based on the premise that the network is unobstructed. The unobstructed network means that it can be reached ). It's really a responsible and heartbreaking job. There are a few key words here. Let me remind you to take the initiative, continuously, inquire, and directly connect to the device . Then, each terminal device will continuously reply to the nearest multicast router. In addition to the differences, I will only mention the differences that I think are important.
igmp v1 : When everyone agrees with the v1 version of the igmp protocol, the butler still keeps asking, that is, IGMP query messages (Query Message), and then each terminal device keeps replying "I want to participate". This is the IGMP membership report Message (Membership Report Message), note, only reply to the message I want to participate in. After the multicast router receives the message, it knows that someone is going to participate in this event. If within the specified time, the multicast router does not receive this participation. Information, he thinks this member has withdrawn from this activity.
igmp v2: Compared with the v1 version, the mechanism for selecting a butler is different, but I don’t care. I think the most important difference is that the v2 version of the protocol adds a message for the member to opt-out, that is, it is no longer passed by the multicast router. The message is confiscated at the specified time to judge, but the member will take the initiative to say, "I want to quit" the message, that is, the Leave Group message, and send it to the multicast router.
igmp v3 : Compared with v1 and v2, the access mechanism is of course enhanced and changed, but I think the biggest difference between the v3 version and the previous two versions is that the multicast source is added (emphasized earlier) What is a multicast source) content, that is, after everyone agrees to the v3 version of the protocol, as an active member, I can specify which member I want or not, which member, and which multicast address to send data to me.
So far, I have roughly introduced the multicast in and out mechanism. The reason why I have spent such a long time talking about this is because the in and out of multicast members is a difficult point.

(2) "Go far" and "only pass one copy" mechanism

I have finished talking about the operating mechanism of participating in and withdrawing from this event. Now I should talk about how to solve the unicast and broadcast problems that have just been thrown out in multicast. Multicast cannot go out, but unicast goes out. It can only be passed on one by one.
In (1), you should have noticed that in multicast, there are multicast routers (described earlier), so the problem becomes the following two problems:
a) How in multiple multicast routers Transmit a copy of multicast data, pay attention, it is passed between the multicast router and the multicast router ;
b) In the multicast router, how to turn one copy into multiple copies of data, to the desired members, pay attention to this step It is to transfer data between the multicast router and the members connected to the multicast router ;
to achieve these two points, you should think about how a certain multicast router knows its needs between the multicast routers. There is no need to send the data of a certain multicast group to the next multicast router. Between the multicast router and the members, the multicast router needs to send the data of which multicast groups to which members.
With this question, we found this very very important thing, the multicast routing table , each line of the multicast forwarding table, roughly in this form (S, G), the content S, It is the multicast source, that is, the ip of the member that sent the multicast data, and G is the multicast group, which is the multicast address.
Here we specifically emphasize the concepts of multicast source, multicast group, and multicast address. We can understand that in the management scope of so many multicast routers, there are a lot of terminal devices, and each of them has an identity that distinguishes them. When the device participates in an activity and becomes the sender of data, the device’s ip is the multicast source. In so many devices, many activities can be carried out at the same time, not just one activity, but each For activities, we divide him into a group, which we call a multicast group. The biggest difference between a group and a group is the difference in the multicast address. In my understanding, the multicast address is actually an identifier. It is a different multicast group. Still don't understand? for example.
Just like a kindergarten, the kindergarten teacher is a multicast router, the administrator, in the scope of their management, there are many children, each child has his own ID card, when they participate in a specific activity, they are participating in the activity The members of, so many members need to be divided into several groups, this is the multicast group, each group must have its own name or logo, such as banana group, apple group, this is the multicast address, each group, its own development Discussion. The content of the discussion is multicast data. When a child speaks and others are listening, the child’s ID is the multicast source. Of course, each child can join multiple groups.
After clarifying this relationship, you can understand the (S, G) of the multicast routing table. When S is used as the data sender and the destination multicast address is G multicast data, when entering a certain multicast router, it will be compared with the multicast forwarding table of this multicast router to see if it is There is such a line (S, G), if not, discard it, if there is, let this piece of data enter the multicast router, then let this piece of data enter.
After entering the multicast router, where do I go next? This will introduce a new thing, called the multicast forwarding table . The multicast forwarding table is the result of the joint selection of all the multicast routers passing through from the multicast sender to the multicast receiver. It cannot be determined by one of them alone. Therefore, the prerequisite for generating the multicast forwarding table is that the multicast path is unblocked. The only criterion for the generation of this multicast forwarding table is the shortest path. From the sender to the receiver, there is a tangled network extending in all directions, just like a city. From this point to that point, there can be many ways, but the shortest way must be found. The so-called shortest is to pass The number of multicast routers is the least.
After introducing the multicast routing table and multicast forwarding table, interested comrades should already have a few doubts:
How is the multicast routing table generated? How is this (S, G) generated? It’s not someone who chooses, and configures them one by one, right?
In the multicast forwarding table, how does he know how to take the shortest path?
With these doubts, it's time to throw out the heavyweights and start a new line.
The function of the PIM protocol (protocal independent multicast)
is to generate the multicast routing table and the multicast forwarding table in the multicast router.
First of all, it is required to enable the PIM protocol in all possible multicast routers during the transmission of multicast data. Although I don't want to talk about theory, I still need to clarify a few concepts before introducing this.
DR , I think, can be simply understood as a multicast router, of course there are differences.
SPT (shortest path tree), as the name implies, is the shortest path from the multicast source to the data receiver, or from the multicast source to the RP.
RP (Rendezvous point), the convergence point, this point is like a data transceiver center, and is also the identity of the big housekeeper we mentioned in IGMP. At this point, we configure the multicast address of the multicast group. There is one and only one of all multicast routers, but there can be multiple spare wheels, which can be manually configured or automatically elected. I will not introduce the automatic election mechanism. It can be understood that the multicast source sends data to this point, and then forwards the data to the desired recipient at this point. RP is not something that must be configured. It is only needed in PIM-SM mode (explained later). If RP is configured, you need to find two shortest paths. With this point as the middle point, there are two directions, one is The shortest path in the direction of the multicast source, that is, the SPT just mentioned, is the shortest path in the direction of the recipient of the multicast data, that is, the RPT.
RPT , similar to SPT, if RP is configured, it involves this concept, the shortest path from the aggregation point to the multicast receiver.
In the introduction just now, the word PIM-SM has already appeared. These are the two modes of PIM, mainly to make a simple distinction.
PIM-DM, In this mode, a shortest path from the multicast source to the multicast receiver is directly generated. Multicast data is sent directly from the multicast source to the receiver. It is suitable for situations where the scale is relatively small and the network is relatively concentrated.
In PIM-SM , in this mode, a data transceiver center RP appears, and two paths are generated, first from the multicast source to the RP, and then from the RP to the receiver. This mode is called sparse mode, which is suitable for large scale and complex network topology, because if the network is complex, if a path is directly generated, the path will be very complicated, and there are many paths, there is an RP, Will be much clearer.
The above theory has said so much, the following is about to focus on .
a) In the actual process, the establishment of multicast status and the sending and receiving of multicast data are two processes. First, the multicast state is established, and then the multicast data can be sent and received.
b) The establishment of the multicast state is the process of multicast registration. In this process, it is the IGMP mechanism just mentioned. It is necessary to distinguish between upstream and downstream contents.
For the data sender, his registration information content is itself What multicast address will you send data to? Your own address, the source address, will go downstream (that is, to the multicast receiver). If there is an RP, go to the RP. If there is no RP, you will go all the way to the receiver. under. If it is PIM-DM, only the downstream content.
For the data receiving end, his registration information is, what multicast source I want to receive, what multicast address is the multicast data, and send it upstream (that is, to the RP), all the way, the passing multicast router, Both will add (S, G) to their own multicast routing table. If it is PIM-SM, use RP as the intermediate point to distinguish upstream and downstream. Focus on the important points , this upstream registration information is very important, and it will play a heavy role in the content that will be introduced soon.
The multicast routing table and forwarding table are formed in this upstream and downstream.

(3) ASM and SSM modes

I spent a lot of time talking about the contents of the first two parts, so it's time to talk about this part. In fact, this part of the content is the first issue you should consider when configuring multicast.
The ASM mode is the arbitrary source mode, that is, the multicast source is not specified, that is, when registering the information, the registration information of the data receiving end is written like this (*, G), that is, any multicast source, anyone can send it. I only care which multicast address is the data. In this mode, you must configure the PIM-SM mode and configure the RP.
SSM mode is the designated source mode. Once the source is designated, PIM-DM can be enabled or PIM-SM can be used, but there is no need to configure RP. PIM-SM is similar to PIM-DM without RP configuration. However, in this mode, the terminal device must specify the multicast source. At this time, the registration information of the data receiving end is written as (S, G), where S is specific to the IP of the multicast source.
Here, it should also be noted that the multicast addresses used in the ASM and SSM modes are in different network segments.

Multicast address range use
224.0.1.0~231.255.255.255 Available ASM multicast addresses
233.0.0.0~238.255.255.255 Available ASM multicast addresses
232.0.0.0~232.255.255.255 Available SSM multicast addresses

When contacting an unfamiliar multicast group, you can roughly judge its multicast mode based on the range of its multicast address.

(2) What's going on with Layer 2 multicast

Under the Layer 2 switch, multicast is broadcast by default. You can use igmp-snooping for some restrictions, or sorting. Note that in addition to whether there is igmp-snooping and other configurations, multicast can be forwarded by default, but some restrictions are added after the configuration is added.

(3) How to configure multicast

1. Select the multicast mode and determine the multicast address

According to the network conditions, decide to use ASM mode or SSM mode. And choose the multicast address correctly.

2. Select PIM mode

If it is ASM mode, you can only choose PIM-SM mode, if it is SSM, you can choose.

3. Determine the multicast source and multicast receivers, and plan a rough route

After determining, determine the multicast source address, and determine the switch router device that may be routed.

4. Configure the selected switching routing device as a multicast router

Determine the switch router equipment that may be routed. The port or vlan connected with the device terminal should enable the igmp protocol. If it is in SSM mode, it must be igmp v3. The specific mode of PIM is enabled between the routers that may pass. If it is PIM-SM in ASM mode, RP needs to be configured.

5. Multicast receiver side configuration (in SSM mode)

If it is in SSM mode, the multicast receiver needs to specify the multicast source, which can be configured under windows or linux systems, and configured in a configuration item of the operating system.
Attention ! ! If it is in SSM mode, it is necessary, it is necessary, to use the 232 network segment multicast, and must, must configure the designated source, if the designated source is not configured, the multicast routing table will not be generated in the switch!

Three, write at the end

The concept of multicast may be written more amateurishly. The article is mainly based on the author's personal understanding. I hope it will be helpful to beginners like me. The most important thing is that this is my personal study notes. It is not true.

Guess you like

Origin blog.csdn.net/baidu_31788709/article/details/108098211