70 comments

[ 2.7 ms ] story [ 114 ms ] thread
Did he file a bug report?
It doesn't seem like a bug, it seems like a trade off. In order to work over wifi it needs to flick between channels, reducing the uptime on the current channel you are using.
Except my phone will get itself in a state where that latency stays high, and bandwidth drops for a long time. Only solution is to turn wifi off/on. That definitely seems like a bug.

I'm fine with lower throughput while discovery is going on, but when nothing's changed on the network I've been on for days, and my phone can't use wifi anymore, that's a bug.

Very interesting and detailed post

Since upgrading to Yosemite, I've effectively had to stop using Airdrop, as it is now completely unreliable.

The sooner this is sorted, the better.

I was curious as to how Apple implemented AirDrop discovery (particularly the Contacts Only feature) because their documentation is helpful, but vague[1]. I spent a night reverse engineering it, and this is the process:

1. Alice opens the AirDrop sheet.

2. Alice begins advertising her short "proximity"[2] hashes over BTLE.

3. Bob, continually scanning in the background, sees Alice and her hashes.

4. If Bob either a) has the "Everyone" setting enabled, or b) has a match to one of Alice's proximity hashes in his contacts, Bob connects to Alice over AWDL.

6. Bob starts a HTTP server.

7. Bob advertises a Bonjour service for his HTTP server.

8. Alice sends a discovery request.

9. If the request is valid, Bob sends a discovery response (including device model, name and icon).

Also to note, the author, Mario Ciabarra is the (co?)-founder of Rock Your Phone, the alternative to Cydia until the two merged in 2010[3].

[1] https://www.apple.com/privacy/docs/iOS_Security_Guide_Oct_20... (Page 23)

[2] Each device hashes every phone number and email in its address book with SHA256 after normalizing them. These hashes are referred to as full hashes. The "proximity" hashes are the first two bytes of the long hash. The full hashes are not broadcasted, but they are verified later over AWDL.

[3] http://www.tuaw.com/2010/09/11/alliance-of-the-jailbreakers-...

Very interesting. How did you go about reverse engineering it? Would you mind sharing?
Sure! It's a combination of static and dynamic analysis. I have a jailbroken phone, which allows me to access any file on the filesystem and decrypt any App Store binaries[1]. The first step is to find in which binaries the functionality lives. I know from searching that AirDrop lives in Sharing.framework[2], which has a supporting daemon, sharingd. Then, I open the binaries in a disassembler like IDA Pro[3] or Hopper[4] to determine how they work. Running class-dump is also helpful[5]. If I need to inspect a process like sharingd at runtime, I use Cycript[6], which gives me an Objective-C REPL into the process, or LLDB[7].

[1] https://github.com/stefanesser/dumpdecrypted

[2] https://github.com/JaviSoto/iOS8-Runtime-Headers/tree/master...

[3] https://www.hex-rays.com/products/ida/

[4] http://www.hopperapp.com/

[5] http://stevenygard.com/projects/class-dump/

[6] http://www.cycript.org/

[7] http://iphonedevwiki.net/index.php/Debugserver

Oh crap, I didn't know IDA was free for non-commercial use. I thought it was like Photoshop: prohibitively expensive for most users, so everyone pirates it. I'm going to have to give that a shot.
An old version is free, and lacking the decompiler. It's a good tool, but it's really not IDA Pro.
IDA is not the expensive part, the Hex-Rays decompiler is. A single license can cost up to $2000 :(
The free version is also Windows-only
At least in previous releases, you could disable AirDrop on OS X:

defaults write com.apple.NetworkBrowser DisableAirDrop -boolean YES

I don't have any Bluetooth-LE hardware to confirm whether this affects the newer-style AirDrop reported as the problem.

I had this same issue on my 5S and a majority of my friends with that particular model seems to be experiencing that as well.

In any case, after browsing the apple support forums, I decided to try a few of the workarounds there and the only one which worked was by setting my 2.4ghz interface to b/g(legacy)-only mode.

It was an acceptable fix since all my other devices were on the 5ghz and I don't really have any other option(7.1.2 was great for me, shouldn't have upgraded).

On a related note, I believe there is also a hardware problem on the iPhone 6 plus' 4G LTE radio for ATT. Same network, but my old nokia 1020 had a much faster network connection. This is annecdotal, but there are reports in other forums also.
What is the impact on Yosemite if I don't actively use AirDrop. Does it still cause WiFi issues? I'm not clear on the severity of the issue.
The amount of usage doesn't seem to matter in my testing. I didn't share anything (and I also set the discoverable setting to 'no one'), and I see a big difference in the throughput: 38 Mbps (awdl0 interface up) vs ~80 Mbps (awdl0 interface down). Yikes. This was a TCP test using iperf, between the laptop and another machine on the lan.

Turning off bluetooth didn't help, so it looks like it's easy to be affected by the performance hit.

Ouch, I just ran iperf on mine (rMBP wifi to LAN server). I get ~30 Mbits/sec with awdl0 down, and ~9 Mbits/sec with the interface up. This explains why I've been having some problems streaming movies over wifi for a while now, probably since upgrading to Yosemite.
Airdrop uses Bluethooth for discovery (and may be even transfer?). Why does the author say it uses Wifi for discovery?
Yes it does in Yosemite, not sure why you've been down voted .
In a related but different issue, my iPhone 4S has not been able to connect to wifi since I upgraded to 8.0. 8.1 didn't fix it. It notified me of some patch today; I hope it works.

I tried a few different tricks I found by Googling, like "Reset Network Settings", but they didn't work. It's weird, after upgrading to 8.1, I had Wifi for a short period, then the next time I came back to my phone it was back to being completely gone. As in the Settings app won't even let me turn it on.

Pretty frustrating.

In my experience, the wifi icon being greyed out can often mean the hardware on your device is no longer functioning. There are plenty of cases of this, seemed to happen most to 4S phones on upgrade from ios6 to 7 but also to iphone 5 as well. Not generally fixable despite people trying crazy things like blowing hair dryer down the headphone socket etc.
I'm definitely hoping that's not the case... I did have this "no wifi" experience happen once before with this phone on, I think, iOS 6, and I did the "Reset Network Settings" trick and it worked again.

EDIT: After installing iOS 8.1.1, I have wifi back... for now. :)

EDIT 2: Gone again after a reboot, which I did because wifi died. I believe it may have actually crashed my cable modem/router before I rebooted it.

The har dryer + fridge trick actually worked for me, but 3 days later the problem came back again. I thought the OP would be about that issue since it is more similar of the WiFi being fried for real.
Bonjour over Wifi is used for more than Airdrop - its also used for virtualized CoreMIDI endpoints, and Audio too .. maybe there's something to be said about paring down the Bonjour refresh interval or something, but then we'd all be complaining about how long it takes to connect our studio gear to the fancy set of iPads whose soul purpose is to rock and roll ..
I loved the homonym misuse of soul for sole, soul actually fits better for the metaphor.
Yeah when are they going to fix these issues? Everything was great until iOS 8 & Yosemite. My Mac with Yosemite can no longer use Airplay and my Airport Express no longer shows up as a supported Apple device in Airport Utility (despite the wifi still working)
IMHO everything was not "great" since Mavericks came about. My wifi (2012 MBP) started having issues connecting on wake, which were fixed and unfixed with each patch released. Now Yosemite will reconnect on wake, but DNS resolution will be broken, so when that happens i have to go in TCP/IP settings, make any change and "Apply" to get back to a working state.

It's 2014 and these were solved problems, I really don't know why they couldn't leave it well alone.

I've been experiencing the wake issues on 10.9, as well. Bouncing wifi seems to fix it, but it's very annoying. It seems to be when I close lid on one network and open it on a different network that it gets confused what to do.
I gotta say that this is annoying. I currently work for a place where we're all Macs and iOS. Many, many devices all over the place, all broadcasting for AirDrop and AirPlay. We're a school, they are useful features. Everything connects to a mesh wifi network. Neighbouring APs are of course on different channels.

It's like we're the perfect environment to experience this problem on a massive scale. We've tested and replicated OP's test results. So now we have a choice between good wifi and AirDrop/AirPlay? This sucks.

I work for a university, and am a student at the same university. WiFi in lecture halls has been complete garbage since 10.10.1 hit. Students love their Macbooks, and in a room with 30+ of them, our wifi connection drops at least every minute.
I have been suffering some really bizarre WiFi issues on my rMBP since upgrading to 10.10. I'll suddenly get latencies of a second or more. Switching WiFi networks or even turning WiFi off and back on again will solve the problem for a short period of time.

I just tested this fix to do sudo ifconfig awdl0 down and my ping times are consistently low.

ditto here
Ditto here too. I've been getting driven crazy by this with my rMBP for a while now. I'm sooooo glad to have just seen this article on HN!
> Switching WiFi networks or even turning WiFi off and back on again will solve the problem for a short period of time.

This is exactly the problem I'm having both with my 10.10 MBP and my iPhones/iPads running iOS8. Glad to hear bringing down awdl0 fixes it, I'm going to try it as well, but it seems there's no solution for non-jailbroken iOS devices yet :(

Here's the weird thing, my devices (both i and MBP) are fine on the work network, so I wonder why they're good there but not at home? I have a decent router (LinkSys E4200) that worked fine pre-iOS8 and 10.10. I have fiddled with the settings on the 2.4 Ghz and 5 Ghz to no avail (though admittedly I haven't tried everything).

Does anyone have any idea why my devices work fine on our work network and not at home? I'd hate to think I need a new router, I know it's not real gear, but it's served it's purpose just fine until this. I know my company at work doesn't allow Bonjour, is there a way to disallow it on my home router too?

Unrelated: Don't factory reset your router. The software to set it up requires you to downgrade to 10.7 or something. It'd be nice if linksys would update their software, or at least remove the version cap.
I didn't have to use any special software to set up my Linksys E4200, either when it was new or this year.

You can always use the web interface to set it up, it's just 'easier' for non-technical consumers to use the software.

The difference between your work and home wifi networks might be multicast settings. Another idea is that at work there's a number of wifi APs on a number of channels, so your devices don't have to switch channels to do the awdl0 broadcast/receive.
I've been experiencing this problem a lot at my university, I'll be trying this out.
Ever since I upgraded to iOS 8.1, I've seen random wifi drops where wifi just disappears completely and I've got to go back into Settings to reactivate wifi.

As you can imagine, it's exceedingly annoying when trying to watch a video.

(comment deleted)
(comment deleted)
Neat. This is very helpful. Hopefully it actually fixes the WiFi performance issues. I created an Alfred workflow for myself based on the terminal commands listed in the article to quickly enable/disable WiFried on Yosemite. It basically runs the terminal command after authenticating upon entering a keyword to trigger. Quick and easy, just like the iOS tweak.

Edit: Here's a link to the Alfred workflows to disable/enable AirDrop if you're interested. https://dl.dropboxusercontent.com/u/534072/WiFried.zip

I'm surprised this issue wasn't caught at Apple. You would think they must have a huge network of Macs and iPhones--surely someone should have noticed the poor WiFi performance.
I tested on my 802.11ac network with an iPhone 6 and couldn't replicate using the steps provided. A speed test sustained 193Mb/s. Maybe 802.11ac networks don't have the same problem? I would think Apple are running 802.11ac on campus.
Perhaps 802.11ac, since it uses 5GHz, is less congested and thus has less problems?
I have noticed since iOS8 on an iPad3 and my 2012 MBP (non-retina) that Safari is insanely slow to resolve sites. It gets to about 15% of the progress bar and will just sit there.

Has anyone else noticed this?

Yes, I noticed this as well. Sometimes it also loads the page, but without images.
Hurray! Glad it wasn't just me going insane!
Safari is borderline unusable for me on 10.9 and 10.10. It will literally take 30 seconds to load facebook.com. If I open Chrome or Firefox and try it, it loads instantly.

I've tried different DNS servers to no avail. I don't use Safari that often so I never bothered digging deeper.

Thanks! My wife is going mad trying to use it on the iPad. I am glad it isn't just me.
Happens to me as well on a rMBP. There's also significant lag opening new tabs.

I've had wifi issues on my phone since upgrading, where the iPhone will switch to LTE even though there's wifi available, from a network it remembers. Rebooting the phone will cause it to reconnect, so I'm trying this airdrop disable tip to see if it helps my connection problems.

I disabled AirDrop using the "defaults write" command, and now Safari loads things instantly! Holy crap!
great article! Hope Apple takes the hint for this call to action.
Must be a real problem since its got an icon.
I thought one of the benefits of the Apple ecosystem was that they controlled both the software and the hardware, so they should be able to catch these things...
Seems Apple's quality control has really been screwing up the last few releases. I haven't updated to iOS 8 or OSX 10.10, and the way things are going I'm not going to any time soon.

If they keep this up, I'm switching back to Android and Linux.

I second this. I'm part of Appleseed because I figured my use cases of my Macbook for development might bring out some less noticeable bugs.

In the latest pre-release before 10.10.1 came out, the iCloud settings broke so that you could only access the system settings by agreeing to the iCloud EULA, or clicking very quickly and hoping you could press the back button before the dialog reappeared. Very obvious, easy to reproduce bug.

Even after sending in multiple reports via Feedback assistant, it's still a live bug in 10.10.1 production. I get it, bugs happen, but the lack of QA and use of feedback assistant is really mindblowing to me.

Anyone have some light to shed on what's up?

I totally agree. I still get weird graphical changes when I open an app group (corners contract and expand). This has been the case for every iOS 8 version update and continues through 2 restores.
Given how many circa 2012 and later Apple laptops I've had to deal with that no longer worker due to ventilation/ GPU issues, I think they're quality control went way downhill a while ago.
All of the problems I've experienced with iOS 8 have gone away in the subsequent patches, with one exception: turning the screen off occasionally activates Siri, which immediately gets deactivated since the screen turns off. The only thing that happens is the phone goes "ding-ding" like when Siri is turned on, even when the phone has the silent switch enabled.

Quite annoying when I'm at a quiet client site and my phone makes that noise.

--edit: I should say all of the problems except the fact that the wifi is so unbearably slow and unreliable that I often resort to LTE when I need to get something done. Wifi sucks on iOS8.

I see many comments criticizing Apple's QA and wondering how this defect was not discovered prior to release. The bulk of the comments seem to adopt a tone of disbelief. I find that hard to believe.

It would be illuminating to know more details about how development and testing worked for the Yosemite project. Was this a late change? Were there systematic blind spots in the test environments and test processes that made defects like this difficult to discover internally? Are we even sure that this issue was not identified internally? Etc.