14

Am streaming UDP over wifi (5ghz) - approx 1.5k/packet... trying to stream to ~10 devices simultaneously, with extremely low latency..

As I understand Wifi, it can never true multicast, as each device holds a '1:1" relationship with the AP, and then receives the same packet... then the next device connects and gets the same packet.

  1. there are multiple types of router/APs - "3x3" and "4x4", some with MIMO, etc. what should I use as criterion for choice of AP?

  2. can I TRULY multicast over wifi to iOS devices? Is my theory correct?

  3. is there a way to multicast instead of treating each packet/client as a unicast?

9
  • Wi-Fi can multicast, but you are limited to the lowest available speed on the WAP.
    – Ron Maupin
    Commented Nov 11, 2016 at 3:02
  • so when a UDP packet is 'multicast' on an AP, do ALL connected devices receive that UDP packet AT THE SAME EXACT INSTANT (ie., does it get propogated 1x and received by all devices)? Or does it actually get 'hand delivered' to each individual device? I know well how it works on hardwire LANs - but i've gotten conflicting data about WIFI multicast... Commented Nov 11, 2016 at 3:09
  • "Real" multicast is a form of broadcast at layer-2, and Wi-Fi can do that (send to a multicast group instead of individual unicast MAC addresses), but you are limited to the lowest available speed on the WAP. Your "fake" multicast is an attempt to get around that limitation.
    – Ron Maupin
    Commented Nov 11, 2016 at 3:11
  • so...if i turn off all lower speed formats in my network (ie., disable 2.4ghz, only run at say 5ghz, 40mhz with only the fastest streaming possible), this will speed up the entire process? Commented Nov 11, 2016 at 3:16
  • 1
    You mean that things like DHCP, etc. are not going to be used? That really isn't right; hosts need to connect to the WAP, and even multicast needs IGMP for hosts to join a multicast group. Wi-Fi is not a one-way protocol, and the protocol requires that all the devices pause and yield.
    – Ron Maupin
    Commented Nov 11, 2016 at 3:27

2 Answers 2

12

Lets test this out then. If we send multicast packets to multiple devices connected to a WiFi access point at a constant rate, then the access point should report the same amount of traffic.

To run this test, I'm sending packets from a wired PC to an an android tablet and a raspberry pi. Don't have any iOS devices. The network testing tool iperf can easily be used to send and receive these packets with the following settings:

Server (Devices on WiFI): iperf -s -u -B 230.5.5.82

Client (Wired PC): iperf -u -c 230.5.5.82 -t 60 -b 1M

With these settings we're sending multicast packets at 1Mbps for a minute. Running this test and looking at the wireless traffic on the access point shows it is consistently about 1Mbps so it must be doing true multicast. The other notable thing from the results is that the packet loss is really bad at well over 50%. This is likely because multicast packets are getting sent at the lowest possible speed so lets force the access point to only run in the fastest speed. I'm using a WRT54GL running dd-wrt where the setting is called "Transmission Fixed Rate". Running the same tests again after setting this to the fastest speed gives a much more acceptable packet loss of less than 5%.

To actually answer the questions:

  1. Get the fastest access point that allows you to fix the transmission rate and that supports multicast. There are definitely access points that do automatically convert multicast packets to unicast. For the speed issue, it isn't enough to just use a wide 5GHz channel since there are a number of different speeds that clients can actually communicate at.

  2. Can't imagine things would work differently on iOS devices since the main determining factor would be the access point.

  3. See 1 as it depends on the access point.

Edit: After testing things out more and on some ac APs, it turns out the important thing for mulitcast is being able to set the available rates. Multicast still uses g speeds so the available physical rates are 6, 9, 12, 18, 24, 36, 48 and 54Mbps. Most APs are going to default to the slower speeds so being able to disable them to force it to use the higher rates will give a huge speed up. Being able to set this is probably the most important criterion for a multicast AP. As an example, in modern versions of DD-WRT, this can be set using the "wl rateset" command on the command line. It sure is well hidden and most firmware doesn't allow this to be set.

2
  • 1
    Seems like you're multicasting at IP level. Are you sure your Wifi hardware is not sending a copy of each packet to each individual client? Do you have radiotap capture?
    – ogurets
    Commented Apr 16, 2017 at 18:06
  • I'm reasonably sure after adding enough devices that the AP wouldn't be able to reach the speeds it is getting if it were duplicating packets. I've found capturing packets in Wireshark and looking at the bit in the destination field that indicates multicast/broadcast or unicast is a reliable indication of what the AP is really doing.
    – Twiske
    Commented Apr 17, 2017 at 14:18
15

As I understand Wifi, it can never true multicast, as each device holds a '1:1" relationship with the AP, and then receives the same packet... then the next device connects and gets the same packet.

Your understanding is flawed. Multicast does exist, but like most management traffic on a wireless network it must run at the lowest supported base/basic/required data rate. By default this is typically the lowest data rate supported by the AP.

The reason why is that anything that is broadcast or multicast from the AP to surrounding clients must be sent at a speed that all clients must support and can receive reliably.

What you are referring to is a technique that many access points can employ, which is a multicast-to-unicast conversion. Because the radio medium is a shared medium, a multicast frame sent at the lowest data rate can take 300X or more "airtime" than a unicast frame sent at the highest data rate. This is often far more efficient than sending multicast as multicast traffic.

In your example situation on a default configuration AP (802.11n or newer), it could take less time to deliver 10 unicast frames to each of 10 devices (i.e. 100 frames total) at the highest possible speed than it would to deliver even one multicast frame.

Two other considerations for multicast on 802.11 that are often reasons to use multicast-to-unicast conversion are that multicast frames are never acknowledged whereas unicast frames are acknowledged and retransmitted by the AP if there is no ack (not to be confused with TCP acks, this is a L2 mechanism and part of the process for finding optimal data rates between AP and client).

Second, if any client device in the BSS is using power save mode, multicast frames are only sent periodically (based on configured DTIM and beacon intervals) to ensure that multicast frames are again received by all clients. With multicast-to-unicast conversion, frames go to clients immediately if they aren't using power save mode and only delayed to clients that are in power save mode.

there are multiple types of router/APs - "3x3" and "4x4", some with MIMO, etc. what should I use as criterion for choice of AP?

First, you would want an access point that meets or exceeds the capabilities of your client device. By this, I mean that if your clients are 802.11n 2x2 capable devices, then you want at least an 802.11n 2x2 AP. 802.11ac will give you some advantages even with all 802.11n clients and more spatial streams never hurts as the extra streams are in other ways utilized.

Second, you would want an access point where you would have configuration options to disable/enable multicast-to-unicast conversion, select specific supported/required data rates for the ESS, and preferrably to be able to configure the DTIM and beacon intervals.

can I TRULY multicast over wifi to iOS devices? Is my theory correct?

Respectively, yes and no. You can do it, however unless you really know what you are doing, or just to keep things simple, you may get a more "real time" experience utilizing a mulicast-to-unicast feature. Failure to get the below correct for your situation can actually reduce the experience on the client devices.

For good performance you would need to adjust the required data rate upward as far as possible while maintaining a reliable signal based on your environment and distance of the client devices from the AP.

Since iOS devices do certainly use power save mode, you may then want to further tweak the DTIM and beacon intervals to reduce the delay introduced by power save mode. Keep in mind that these settings can also decrease the efficiency of your airtime utilization (i.e. lowering beacon intervals means more beacons, etc) creating more problems than it resolves.

is there a way to multicast instead of treating each packet/client as a unicast?

As I already covered, yes. As long as your AP either doesn't have a multicast-to-unicast feature in the first place or has an option to let you disable it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.