[Sharing/Help] UDP Send/Receive for multiple unknown computers

realshafer's icon

Hi, I've attached a patch that I've been working on. The goal is to connect four computers via WLAN for synced control. The computers themselves often change, as does the router. I built a patch that does the following:

- Determines each computer's IP address
- Sends the IP address to all the other computers
- Allows any computer to send information to the others

I have been having problems with the patch, though. The two computers I have at home always connect. However, in the wild, with unknown computers, often only two or three computers will connect with each other. Other times, all four will correctly connect. Is there some problem in my logic here? Also, I could accomplish a similar feat simply with net.maxhole without all this setup. Is there any advantage to using UDP to send messages across the network? (I was told this at one time, but now I'm doubting it). The messages are time and tempo related and therefore should have high priority. My experience with net.maxhole is that messages often get dropped.

Thanks for any help developing this idea!

5476.UDPIPCollect.maxpat
Max Patch
Rodrigo's icon

This would be suuuuper useful!

I'm working on a piece that requires a similar kind of setup (multiple computers on a network). It would be great to do it 'automatically'.

Vjacobs's icon

Some things that pop into my mind (since it is difficult to simulate your circumstances and hardware)

- in the case some don't connect, are you able to ping them through regular network tools, to check that they are addressable also out of Max? It might be a firewall or other network issue. I recognize your problem as well and most of the time it's something external, out of your patch. Your network has to be stable and transparent before Max can use it..
- you are trying to combine a high priority messaging system with hardware that often changes. The router/AP (you would actually just need a switch here) does play a role in the stability of all this, as do the software settings of your computers. Ask yourself if there is no other way? I've done performances where 20+ laptops speak wireless to a central control system over UDP, and the only way to achieve this was to always use the same hardware (good and reliable AP) and settings on all the computers. I must say that, once up and running, UDP worked very stable for me.
- I'm not entirely sure about it, but the reason net.maxhole gives you strange results might be that not all switches/routers handle multicast traffic (what it internally uses) in the same way so I wouldn't use it to build your system upon.

Rodrigo's icon

@Vjacobs
What was the good/reliable hardware/switch that you used?

realshafer's icon

Thanks Vjacobs for the encouragement. I'll look into those "regular network tools" that you mentioned. I'm also interested in the reliable hardware you used.

Vjacobs's icon

For wireless UDP traffic I always use a 5GHz wireless Access Point from Ubiquiti (for instance http://www.ubnt.com/airmax#nanostationm ).

If you can use the 5GHz band (ie. having adapters in your computer that support 5GHz), I would recommend it. I had a lot of problems and stability issues when using 2.4GHz since that band is overcrowded. With 5gig you can find channels that nobody else uses.
Of course it's not always possible to do this, but the above mentioned products do all bands so a choice is possible. You can build a stable performance on both bands anyway, you just have to be a bit aware of what you're doing and which blocking factors are present...

(beware: we are talking IP traffic here - Xbee/Zigbee/... traffic is something else)

Hope this helps...

Rodrigo's icon

Never even seen that brand before. For my purposes I'm planning on going wired with the network as I want tight/synchronous events to happen on different machines.

Vjacobs's icon

hehe, I can assure you however that it's the most stable wireless hardware I ever worked with.

For wired: I do most of my things with Cisco consumer but managed gigabit switches (ie. http://www.cisco.com/cisco/web/solutions/small_business/products/routers_switches/200_series_switches/index.html-tab-Models ) and Intel adapters in the computers.
But to be honest, things work mostly quite well directly out of the box with most of the brands.

Rodrigo's icon

What kind of latency do you get off the 5ghz wireless? (sub 20ms?)
And is it consistent?

Wetterberg's icon

Wow, great timing :)

We're doing a big networking stress test tomorrow, if all goes according to plan. We just ran a sync test (unloaded) yesterday, and it was unbelievably tight, just using an ad-hoc wifi network between two macbooks, much to my surprise, so we're testing to see how far we can push it (gig on sunday, classic last-minute dev. rush)