Multipeer Connectivity Is Not a Panacea

I’ve seen two separate postings today talking about Apple’s Multipeer Connectivity framework, introduced in iOS 7. The first was an article on Cult of Mac (linked from iOS Dev Weekly) and the second a Gist from Mattt Thompson. I feel that we collectively need a reality check.

To start, although Multipeer Connectivity-the-framework is new with iOS 7, the technology is not. GameKit included a set of classes implementing peer-to-peer communication starting in iOS 3.0.

The idea of a mesh network comprised of dozens of devices sounds fantastic, but the reality is that an MCSession in iOS 7.x can have at most eight of them.

Throughput is also nothing to get too excited about. It can be quite good if the sender and receiver are both on the same Wi-Fi network, but if we’re to believe the use cases made possible by the technology, then the reality is that we’re probably using ad hoc Wi-Fi (where performance degrades as the number of nodes increases) or Bluetooth (best case 2.1 Mbps). In my experience, with even a few devices, you’re lucky to see 100 KBps.

(Multipeer Connectivity does offer one cool feature: if two devices in the session don’t share an interface type (e.g., one only has Wi-Fi, the other only Bluetooth), communication is still possible: the framework relays messages through a third device that supports, and can reach, both. The problem is that this extra hop has an unsurprisingly large impact on throughput and latency.)

Let’s also remember that none of this stuff works on iOS in the background. The mesh is only active when the app is.

To some degree, I feel like the people writing about this technology haven’t actually tried using it. GameKit P2P had serious problems. Multipeer Connectivity is better in iOS 7, but still fails for seemingly reasonable use if you wander off of Apple’s happy path. I haven’t tried 7.1 to see if it’s any better.

I’ve used the frameworks. I added inter-device sync to a client app with GameKit P2P in 2011. I spoke about Multipeer Connectivity at CocoaConf Columbus in 2013 and the sample code is on GitHub.

Multipeer Connectivity is a cool framework and I agree that it holds a lot of promise, but I fear the hype about wide-area mesh networks enabling new ways to bypass censoring firewalls and avoid governmental eavesdropping is, for now, a fantasy. The framework we have today is meant for games and other apps to communicate with people nearby, and nothing more. There are many new things we can do with it, but let’s avoid the hyperbole.