12 ms·
Rapid DHCP: Or, how do Macs get on the network so fast? (2011)
- aeontech 9y agoPretty neat! Previously discussed here: https://news.ycombinator.com/item?id=2755461 https://news.ycombinator.com/item?id=2755461
- ams6110 9y agoCould have been titled: How do Apple devices wreak havoc on home networks. When my kid comes home with his iPhone there is a better than even chance that my home network will go out to lunch. Router reboot time. Never happens with Windows or Android devices coming and going.
- ryanlol 9y agoBuy a new router?
- kalleboo 9y agoIf it's "router reboot time" something is seriously messed up with your network. If that's an exaggeration and the iPhone is just booting other random stuff off the network, have you tried just increasing the DHCP lease time? On a home network that just sees the same devices day in and out you could safely set it to several days long.
- ams6110 9y agoStandard Netgear wifi router with standard config. As I said, it's fine except when Apple devices come onto the network.
- csydas 9y agoI'd suggest that it warrants more investigation than just writing it off as Apple trashes networks. Hybrid Apple/Windows households have been common for the larger part of 2 decades now and certainly others do not experience the same issues guaranteed. So rather, the title would be Apple devices cause issues on your home network. Or more accurately, something on your home network works in an unintended fashion when your son's iPhone connects.
- ams6110 9y agoIt's not just his iPhone. It's iPads, any Apple device that has been "away" for a while and then comes back. TFA describes how Apple is taking shortcuts in the DHCP negotiation. I blame them for assuming that the previous IP address assigned to the device will still be available.
- csydas 9y agoWell, while this may be the case, I'm not quite sure how Apple device assuming same IP as before somehow triggers the disconnect from the rest. It may be part of the steps required to reproduce, but hundreds of other consumer routers with standard configuration handle such a scenario without booting the rest of the attached clients, which is why I woudl rephrase it as unexpected behavior from the router. And Apple isn't taking a shortcut or a hack here, it's a known scheme: http://www.ietf.org/rfc/rfc4436.txt http://www.ietf.org/rfc/rfc4436.txt It's not so much doing anything special as crafting a special call to the network it tries to connect to. It's more of a shortcut to know if the Mac should go to the DHCP phase rather than cheating its way on to the network.
- subway 9y agoOdds are high that GP's router is configured to give out addresses sequentially, with a fairly short lease and the wireless ap is configured to disallow communication between wireless hosts. I'm thinking the odds they'll change the configuration vs yell about apple devices aren't so high.
- zlynx 9y agoStill weird. My Netgear R7000 doesn't have a problem with Apple devices. It used to have an open root exploit (patched), but it never had an Apple problem. :-)
- wtallis 9y agoReally, if your router's uptime isn't measured in months, you're doing it wrong. Probably by running the software it came with, instead of replacing it with an actually-maintained Linux distribution like OpenWRT or LEDE. There are really very few routers out there anymore that have so little memory they can't be robust and run modern software. Flaky hardware is quite a bit more rare than some users seem to think. The problem is mostly that the hardware vendors have very little incentive to continue polishing the software after the device is shipping, because by the time you get fed up with the consequences of their crap software there will be a new model to sell you. They love that "buy a new router" is such a common troubleshooting step.
- iiilllililiiiiI 9y agoIf you have a linux device on the network you could have that be the dhcp server and control lease times there, dhcp and dns on a linux machine(even an old laptop) are way better than all but the top tier netgear routers. If your windows machine is always on you could even run it in a vm. https://askubuntu.com/questions/248355/can-i-run-a-dhcp-server-on-an-ubuntu-vm-under-vmware-and-serve-the-host https://askubuntu.com/questions/248355/can-i-run-a-dhcp-serv... Hope that helps. You'll still be behind the NAT of the netgear router but you'll have better control over QoS. Here's how you can do it on a debian box https://wiki.debian.org/DHCP_Server https://wiki.debian.org/DHCP_Server
- tristanj 9y agoThis is a known issue on iOS 8.0-8.1. Lookup 'WiFried'.
- 9935c101ab17a66 9y agoThis is very interesting! I just replied to another commentator mentioning issues apple had with 10.10.1 - 10.10.4 when they updated some aspect of the network stack. both the macOS and iOS issues were apparently caused by the same change. More info here: https://www.macrumors.com/2015/05/26/apple-discoveryd-replaced-with-mdnsresponder/ https://www.macrumors.com/2015/05/26/apple-discoveryd-replac...
- mdekkers 9y agoMy SO unfortunately has 2 ipones, an ipad and a MBP. There is a confluence of DHCP activity from all these devices that is guaranteed to take my network down.
- pilif 9y agoDHCP activity from 4 devices will not slow your network, much less take it down. A DHCP negotiation to get an IP address takes 4 UDP packets, all of them usually below 500 bytes in size. Not even when you have set the lease time to the theoretical minimum of 1s, this traffic will be at all significant in your network.
- mdekkers 9y agoIt will kill my fiber to the home network box that my telco installed, and provides DHCP. It isn't a load issue, it is a "the DHCP server died" issue
- 9935c101ab17a66 9y ago"It" won't. Bugs in DHCP / your router/modem/telco's software will.
- brokenmachine 9y agoI would be talking to my telco in this instance.
- kalleboo 9y agoOur home network has 6+ Apple devices and a pile of other stuff (Smart TVs, DVRs, game consoles, media converters, etc) and it has zero problems whatsoever. Our router is some generic thing by NEC that I bought off the shelf at a big-box retailer because it had the biggest numbers on the box.
- acdha 9y agoUnless your DHCP server is an old Commodore 64, that's not the right diagnosis. The ISC DHCP server was rock solid with negligible CPU load with many thousands of clients even 10-15 years ago. If your network is really having problems, either dig deeper if you want to learn more about networking or buy something like a Google WiFi device if you just want something known to handle much greater loads without issue.
- matthewmacleod 9y agoLet’s be clear: this is an issue with your home network. If it’s not able to cope with a known and documented by RFC scheme for detecting network reattachment, then it’s broken. Unfortunately, most domestic networking equipment is in my experience awful.
- lathiat 9y agoInteresting nugget of information here: > Thanks to Steinar H. Gunderson for pointing out in the comments that the DHCP server on my test network was incorrectly configured. Since I was using a mostly "out of the box" dhcpd configuration from Ubunbtu Linux, it wasn't set up to be authoritative by default, so it wasn't promptly sending NAKs in response to the Galaxy Tab's requests for an old IP address. After fixing the problem on the DHCP server, the Galaxy Tab's DHCP handshake happens quite a bit faster (although still 85 times slower than the Mac). Set authoritative on your dhcpd.conf! I checked, fortunately mine is set :)
- taurath 9y agoAn instruction like that is why I don't use Linux as a desktop!
- deleted 9y ago[deleted]
- Nition 9y agoI'm a bit disappointed that you're downvoted to grey right now because editing obscure config files and entering esoteric terminal commands is exactly why Linux is so difficult for the average user, and it's never going to improve if those who're already comfortable with it ignore the problem.
- RubyPinch 9y agoThat's all fine and dandy for the desktop case. But its a dhcp server, network admins would be expected to touch config files, and the interface for a DHCP server really can't be much worse than the GUI version that microsoft supplies! but digressions, to say "this is why I won't use a linux desktop" in response to a server-specific use-case, is at best antagonistic!
- gogopuppygogo 9y agoPfsense does a great job offering a GUI for how configuring DHCP should work.
- PhasmaFelis 9y agoMy 5-year-old MBP doesn't seem to connect faster than anything else.
- deleted 9y ago[deleted]
- johngalt 9y agoRapid driving: how ignoring red lights makes the iCar so fast.
- mdekkers 9y agoAs I was reading, I was mentally composing a convoluted reply. Yours said the same thing, much better, and bonus coffee over my screen! well done :)
- wtfwtfw 9y ago> bonus coffee over my screen Why did you pour coffee on your screen? That's really quite strange behaviour.
- mdekkers 9y agoHN isn't in the mood for levity today....
- Piccollo 9y agomaybe he was laughing too hard and spit out the coffee that was in the person's mouth
- mdekkers 9y agoThat is indeed what happened. Unfortunately, HN has become so fucking dour, and mindless downvoting is quickly replacing interesting discourse. This is no longer a place for some occasional lighthearted discourse.
- 9935c101ab17a66 9y agoOh god, a snide, inane comment from someone who both hates Apple and has an apparent affinity for Ayn Rand.
- rkangel 9y agoExcept that this isn't ignoring red lights, it's taking a government approved shortcut that no-one else has done the research to know about (to extend your metaphor). This approach is standards approved: http://www.ietf.org/rfc/rfc4436.txt http://www.ietf.org/rfc/rfc4436.txt
- cordite 9y agoThey also end up with other host names in the terminal from time to time.
- brazzledazzle 9y agoThat's why I configure my hostname permanently. Using scutil if memory serves.
- panic 9y agoThe hostname has to do with multicast DNS / "Bonjour", not DHCP or IP address assignment.
- kalleboo 9y agoI remember this feature used to cause a lot of problems with random IP conflicts, but I haven't had an IP conflict like that in years, so it seems they've made it a lot more robust. Or are routers/DHCP servers just less broken these days (I guess since Apple's market share has forced them to)?
- 9935c101ab17a66 9y agoI think Apple "updated" the network stack with 10.10 (maybe 10.10.1) and then had so many issues with IP conflicts with the new implementation that they actually backtracked and reverted to the original. The memory is hazy but if you're interested I can do a little digging and see if I can find some other info.
- iagovar 9y agoIt does. I had to deal with it many times working at helpdesk.
- 3pt14159 9y agoIt still happens. I run Ubuntu on a MBP (dual boot) and some networks are fucking great. No problems whatsoever. Others I get booted off more frequently the more people enter the cafe. I dug into the problem a while back and figured out it was this shitty behaviour by Apple that Ubuntu hadn't fixed.
- djrogers 9y agoIt’s not a Mac hardware behavior, it’s in macOS - the fact that you’re seeing bad things in Ubuntu has nothing to do with Apple here.
- xsmasher 9y agoCirca 2014: https://www.net.princeton.edu/apple-ios/ipad-iphoneos32-stops-renewing-lease-keeps-using-IP-address.html https://www.net.princeton.edu/apple-ios/ipad-iphoneos32-stop...
- epistasis 9y agoThis is an article from 2011, 6 years ago. Has there been any progress on implementing RFC 4436 on Linux in general or Android specifically in the interim? http://www.ietf.org/rfc/rfc4436.txt http://www.ietf.org/rfc/rfc4436.txt
- bobsam 9y agoNo, but it is still quite fast. On chromeOS network bring up is extremely fast. We are talking 1-3 seconds from cold boot to your emails have been synchronized. My Ubuntu is almost as fast, if we subtract the 4 seconds the ugly bios screen adds. No idea about Android, but did you read the end of the article?
- rektide 9y agoMy NetworkManager still takes multiple seconds to connect to wifi, and that's definitely the same pathetic DHCP behavior. wpa_supplicant is super fast. Modern Ubuntu (17.04) is still stuck in this ancient, lethargic world.
- tbrock 9y agoIt's better but definitely not "extremely fast". The mac from 6 years ago does it in 300ms which is still 3-10x faster than what you suggest is the norm for your setup. The difference between 300ms and 3 seconds is the tipping point for being annoyed when you cannot connect to the first page you visit.
- bobsam 9y agoYou misunderstood my numbers :) Search "chromebook boot time" on YouTube. Checkout the comparisons between a $200 chromebook from 2013 and a $2000 MBP...
- feld 9y agoChromeOS is not a real OS. It's an embedded appliance/cloud OS as a gateway to the web and Google services. Anyone can make a machine boot fast if it has nothing to load.
- colanderman 9y agoThis is nice, but kind of useless when waking up from deeper sleep states, which prevent the password dialog from receiving keystrokes for a good five seconds anyway (despite teasing a blinking cursor).
- smcl 9y agoThat blinking cursor is especially sneaky. When they just loaded up what is effectively a screenshot while everything loaded, that could've been forgiven (better than a blank screen I suppose). But animating it so that it LOOKS like it's working ...
- hibbelig 9y agoThank you both. I've been mystified by this behavior for years. How do I tell when it becomes responsive ? Without trying to type of course.
- ceejayoz 9y agoMan, I thought that was just something buggy on mine. That's standard behavior?!?!
- the_duke 9y agoNeeds a (2011) in the title.
- VeejayRampay 9y agoHonestly, my Lenovo using Ubuntu gets on the network just as fast as my Mac used to, it's impressive coming back to Linux after 5 years.
- mappu 9y agoPrevious comments are interesting: https://news.ycombinator.com/item?id=2755461 https://news.ycombinator.com/item?id=2755461
- tiku 9y agoI'm more worried about the network problems i have with my mac, it disconnects sometimes out of the blue, if i reconnect or enable/disable vpn it works again, very weird behaviour.
- paule89 9y agoCan someone please port this to the linux kernel, or at least archlinux / ubuntu????
- mschuster91 9y agoThe joke is, Macbooks are dead slow on WPA2-Enterprise networks once you go with certificate-based logins. At home, I'm in the network often enough faster than 1s - at work, up to two minutes sometimes. I guess that modern macbooks keep the connection alive on the PHY level while asleep... they do have that "backup/sync while you sleep" feature, so quite possible that the chip handling this feature only speaks "normal" WPA2, keeps the connection alive and then after resuming the OS only has to re-check the IP address and does not have to do the full PHY handshake first...
- djrogers 9y agoIf you’re seeing 2 minute connection times that’s on your network - probably the RADIUS server, not macOS. There are tons of places using macs with WPA2 and certs that don’t have any connection lag - including my employer and many of my customers.
- Gys 9y agoDoes anybody know if there is a setting to disable this ?
- sethammons 9y ago> I assume the Mac would know to begin the DHCP discovery phase, instead of sending blind requests for a former IP address... I wonder if that is my problem. Often, my Mac won't connect to my mobile hotspot. I open the lid, it starts attempting to connect to the hotspot and just sits. Connecting. Forever. I can turn off WiFi, turn off the hotspot, and sometimes even reboot both my phone and my laptop and still be unable to connect. I recently figured out that if this not-connecting happens, I can disable wifi, disable hotspot, turn on WiFi and select my not-on hotspot to connect to. A couple of seconds later, it fails and asks to run network diagnostics. I cancel, disable wifi, turn back on the hotspot, turn back on wifi and, presto, it connects. I figured there was some caching going on and that I am effectively invalidating the cache. Maybe this is what the op is talking about here.
- djrogers 9y agoIt sounds more like your hotspot is janky - if a Mac doesn’t get a DHCP response it will still connect to the wifi network using and autoconf address. There is no dhcp related scenario that causes it to not connect to the network at all.
- ksk 9y agoInterestingly, we use Cisco's Meraki APs at work. The WiFi is pretty solid most of the time, but macs are the only machines that suffer occasional dropouts and then DHCP stops working till you cycle the n/w adapter. (though iphones never seem to have this issue).
- f4rker 9y agowaiting an extra 3 or 4 seconds for your wifi to come up means very little. there are 28,800 seconds in an 8 hr work day.
- oxplot 9y agoIt depends on the router too. My arch Linux connects almost instantly to my Ubiquiti WiFi AP on wake from sleep, but takes seconds to connect to my phone AP.