For UDP broadcast gurus: Problems achieving high-bandwidth audio UDP broadcast over WiFi (802.11N and 802.11G)

Nick picture Nick · Nov 15, 2009 · Viewed 9.1k times · Source

I'm attempting to send multichannel audio over WiFi from one server to multiple client computers using UDP broadcast on a private network.

I'm using software called Pure Data, with a UDP broadcast tool called netsend~ and netreceive~. The code is here: http://www.remu.fr/sound-delta/netsend~/

To cut a long story short, I'm able to achieve sending 9 channels to one client computer in a point-to-point network, but when I try to do broadcast to 2 clients (haven't yet tried more), I get no sound. I can compress the audio and send 4 channels compressed (about 10% size of uncompressed) over UDP broadcast to 2 clients successfully. Or I can send 1 channel over UDP broadcast to 2 clients, with some glitches.

The WiFi router is a Linksys WRT300N. All computers are running Windows XP. The IP addresses are 192.168.1.x, with subnet mask 255.255.255.0 and the subnet broadcast address: 192.168.1.255.

I'm curious - what happens to UDP broadcast packets in the router? If I have a subnet mask of 255.255.255.0, then does the router make 254 packets for every packet sent ot the broadcast address?

My WiFi bandwidth is at least 100Mbps, but I can't seem to send audio of more than around 10Mbps over UDP broadcast to multiple clients.

What's stopping me from sending audio up to the bandwidth limit of the WiFi?

any suggestions for socket code modifications, network setups, router setups, subnet modifications... all very much appreciated!

thanks Nick

Answer

Simon picture Simon · Dec 3, 2010

Your problem is caused by the access point's rate control algorithm. With unicast the access point tracks what data rate every particular receiver can reliably receive at, and sends about that rate. With multicast the access point does not know which receivers are interested in the data, so simple access points send the data at the slowest possible rate (1Mb/s). Better implemented access points may send the data at the rate that the slowest connected client is using, and the best access points use IGMP snooping to see who's receiving each IP multicast stream, and they will choose the slowest rate out of the receivers for that stream.

The simplest solution is to not use multicast when you have a small number of WiFi receivers.