Multicast to unicast

Hello everyone :slight_smile:
I'm posting here because I have a problem with my OpenWrt configuration.
I cannot find an option to activate multicast to unicast for wifi in my Xiaomi routeur 3G.

I have a multicast stream that's coming in my wan interface. I have enabled IGMP snooping on the router (and on my switch). But I would like the router to change this mutlicast stream in unicast for my wifi.

I have read IPTV / UDP multicast in the documentation, and udpxy doesn't do what I want :
I want the routeur to change multicast to unicast when a wifi client asks for a multicast stream. Using udpxy doesn't resolve my problem because with udpxy the clients have to ask for http://ip_of_the_routeur:8080//udp/ip_of_the_mutlicast_stream:port instead of rtp://ip_of_the_mutlicast_stream:port

I checked in /sys/class/net/br-lan/lower_wlanX/brport that the file multicast_to_unicast = 1 to activate this function but it doesn't work :
when a wifi client asks for a multicast stream, if I check in wireshark, the client recive the stream in multicast (the destination adresse of the packet are multicast adresses instead of the ip of the client), and this slows down the wifi for everybody (du tu multicast properties)

Is there a way to fix my problem and to activate multicast_to_unicast for wifi ?

PS : the wifi is in the lan interface wich is a bridged interface with lan ports

thanks a lot

The stream is going to a wired node then?
If the node is wireless then it doesn't matter.

Consider not relaying/bridging your wired to wifi.

the stream is asked by a wireless wifi client.

I thought there could be a solution to activate unicast_to_multicast
I don't think that unbridging wifi and wired lan interface would solve the problem : the goal is to allow wifi clients to ask for multicast without destroying wifi speed.

Do you have other ideas ?
Thanks for the reply

What you are asking for is physically impossible even if the software implemented these features.

If the destination is a WiFi client you may as well broadcast it. Multicast, unicast, broadcast, it makes no difference - it's a packet in the WiFi channel in all cases.

1 Like

I searched for this because I know this option exists on cisco hardware :
https://documentation.meraki.com/MR/Other_Topics/Multicast-Unicast_Conversion

And I hoped this option existed in OpenWrt when seeing the option multicast_to_unicast. Then I don't understand what's this option for.

Set option multicast_to_unicast 1 on the LAN interface, e.g. using uci set network.lan.multicast_to_unicast=1; uci commit network; reboot and test again.

Iirc wireless isolation must be enbled as well for this feature to work, the above commands will take care of it.

1 Like

I tried to add this option in lan but it didn't work... I tried with and without wifi isolation.

isn't this option supposed to go on wlan ?

Maybe this option is driver dependant ?

ok I found my error :
OpenWrt doesn't change the destination adresse of the multicasts packets for wifi clients : when you listen with Wireshark on wifi clients while reciving the multicast source on those clients, the destination adresse of the multicast UDP packets is still a multicast adresse (between 224.0.0.0 and 239.255.255.255) whereas I was expecting that OpenWrt would change this destination adresse to the IP of the client asking for multicast
But this client is in fact the only one receiving those packets

I tried with an other laptop connected on the same wifi access point to listen with Wireshark while another wifi client was receiving the multicast stream and the laptop that didn't asked for multicast didn't recivied it.

All in all, the default configuration of OpenWrt is working for multicast_to_unicast for wifi clients (it's just not working the way I thought it would be). This behavior seems to have been implemented a long time ago :
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/generic/backport-4.9/021-bridge-multicast-to-unicast.patch;hb=9b14c7d3d1fb7666a9d75373b87fb8c8179ef21c

Thanks for the help (and sorry for my english)

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.