Explaining and configuring IGMP version 1 on MikroTik RouterOS

IGMP (Internet Group Management Protocol) version 1 is the 1st version used in IGMP which has a function to allow hosts announcing to the router that they want multicast traffic from a specific group such as 239.1.2.3.

IGMP version 1 is a very simple protocol and it uses only 2 messages:

  • Membership report
  • Membership query

[mepr-show rules=”319″ unauth=”message”]

With membership report, the host uses this message when it wants to join a multicast group by sending it to the group address that it wants to receive the multicast stream. Once the multicast-enabled router receives this message, it will start forwarding the multicast traffic out the interface that it has received the IGMP membership report on.

The membership query is sent by the router to the destination 224.0.0.1 which is all hosts multicast group address. This is sent periodically by the router to check whether the hosts are still interested by the multicast traffic. When the router receives a membership report back from a particular host, then its expiry timer will be refreshed. In case he doesn’t hear from the host, then the router will think that he is no longer interested in the multicast traffic and will remove the entry once the timer is 0.

Here below you can see where you can choose which IGPM version you want to use. You can see, we have IGMP1, IGMP2 and IGMP3 (in this book I will speak about IGMP1 and IGMP2 which is the default one on MikroTik routers)

In this chapter, I am going to speak about IGMP version 1.

LAB: Configuring multicast with IGMPv1

In this LAB, I am going to show you how you can configure multicast streaming using a MikroTik router. The IP addresses on the PC’s are set as per the graph, and here is the result on the IP configuration on the Server:

Also here is the IP configuration on the PC running the VLC client:

I have also set the IP addresses on the router interfaces as the following:

That means from the VLC streaming server I can ping all IPs until the VLC client. Let’s try to ping to VLC server all the way to the IP address of the VLC client PC and see the result:

As you can see, we have a successful ping reply.

Excellent!!!! Let’s now start configuring the multicast on the MikroTik router. Remember, we are using only 1 router, so PIM is not important for us but IGMP. However, if you don’t enable PIM along with IGMP, then the multicast will not work even if PIM is not really used – you got me?

So, what should we do now to enable the multicast on the router? Let me show you:

That’s all you need to do on the Router. I have enabled PIM and IGMP on Ether1 and Ether2, selected IGMPv1 (by default MikroTik Router IGMPv2).

Let’s see the result on the Router:

We can see that everything is perfect on the router. Believe it or not, this is the only thing you need to do on the MikroTik Router for now and the multicast traffic would work on it.

Now we need to go to the VLC Streaming server and do the settings there. However, we have to remember that we need to use a destination multicast address, so we have to choose one. I will choose the address: 239.1.2.3. That means that the VLC Streaming Server will send the multicast traffic on 239.1.2.3 group, and the VLC client will receive it from this address – got it?

Now as the VLC streaming server is going to stream to 239.1.2.3, does he know that he should send this traffic to the Router? Think of it. He is going to send it to 239.1.2.3 which is a multicast address, while the server which is a windows machine has a gateway of 192.168.1.1 which is a Unicast address. That means the VLC server will never know how to send the multicast traffic to the router unless we tell him. How can we tell him this? Well, we need to add a route on the Windows PC machine (if you are using MAC or Linux or any other operating system, there is a way to add a route on them).

Before I add the route, let’s see the routing entries that we have on the PC acting as the VLC server (I will use the command “route print” on the command prompt):

As you can see, the PC doesn’t know anything about the address 239.1.2.3, so that means even if our configuration on the MikroTik router is done correctly, the Multicast streaming will not work.

To solve the problem, I will add a route saying to the PC that everything going to 239.1.2.3 have to go to the gateway which is 192.168.1.1. This way I am sure that the multicast traffic will be flowing to the MikroTik router who in turn will hear the IGMP from the 2nd PC asking for the traffic and he can forward it to them.

Let me add the route on the VLC Server PC:

Here is the command. I am saying here for the PC that I want to add a route that everything going to 239.1.2.3 to be forwarded to 192.168.1.1

Up to now everything is perfect. Now we need to start working with VLC software to make it from one side as a server and from the other side as a client. You can use any multicast software that you want, but in this book I am going to use VLC which is a freeware software and it works perfectly (you can download VLC from the following URL: https://www.videolan.org/vlc/)

Now I am at the server side, and I have a video of one of my online courses. I want this video to be streamed from the server to the client.

Let’s open VLC on the server side and start the work.

From Media, I opened Stream and from there I have to say which video I want to stream it in the network.

You click on Add and you select the video that you want to stream it. In my case, I have selected one of my recorded videos where I teach about Load Balancing on MikroTik.

Here it will show you about the file that will be streamed. All you need to do is to click on next.

Then you need to configure the destination setup as you can see on the picture above. I have chosen UDP, but you can choose something else like RTP for example. You need to click on Add then Next.

In this level, you need to put the address for the multicast and the port that the destination (receiver) will listen to. As agreed beginning of this LAB, I will use the address 239.1.2.3, and I will keep the port as it is 1234.

In this step, you can choose the transcoding option that you want. I have left on the same profile and I have checked Activate Transcoding.

In this last step, all you need to do is to stay Steam and we are done.

That’s everything you need to do on the server side.

Let’s go to the client side and see what we need to do and check if the multicast streaming is being received correctly.

I opened VLC on the 2nd PC acting as a multicast receiver, and then clicked on “Open Network Stream”

On the network, you have to write the multicast address with the port number (remember we chose UDP on the server). So the URL should be as following:

Udp://@239.1.2.3:1234 – then all you need to do is to click on Play.

Here you can see the video is running and working on the receiver side.

Let’s see the traffic on the router now.

You can see that the traffic is flowing on the interfaces of the MikroTik router, Ether1 is receiving the traffic from the VLC server to its Ether1 interface, and it is sending the streaming via Ether2 interface. Wow… That’s really working.

On IGMPv1, in case the receiver doesn’t want to receive the multicast traffic anymore (by closing the VLC player), then it doesn’t report this to the router. Which means that the router will keep sending the multicast traffic from its interface until the timer expires. Why the timer expires? Because the host will not send anymore a membership report to the router. This is a very bad thing that we have in IGMPv1 because the multicast traffic will keep flowing for couple of seconds/minutes even if the host doesn’t want that traffic anymore.

Let me show you this right away. The multicast traffic is still flowing now. I will close the VLC player on the host PC acting as a VLC client and will check if the router is notified about this.

After the VLC player has been closed on the host, you can check the IGMP Groups and you see that the multicast traffic will keep sending on Ether2 on the multicast address 239.1.2.3 and the timeout is 255 seconds. That means that the router will have to wait 255 seconds (which is more than 4 min) before it removes this entry from its IGMP Group table, and believe it or not the multicast stream will keep flowing on Ehter2. Is that something nice? Of course not. We want once we close the VLC player that the multicast traffic stops flowing to that host. Unfortunately, on IGMPv1 that’s not possible.

Now the 255 seconds have finished, let’s check if the entry is being removed from the IGMP Group table:

Indeed, I don’t see it anymore in the entries.

That’s all what I wanted to explain about IGMPv1, in the upcoming chapter I will speak about IGMPv2 which is the default version used on MikroTik and which has enhancement features compared to IGMPv1. See you in the upcoming chapter.

[/mepr-show]

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Please Login to Reply or add a comment!

About