Live data from Hacker News

Rapid DHCP: Or, how do Macs get on the network so fast?

cafbit.com

51–60 of 191 posts

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#51

Earlier quoted context omitted.

How is this the DHCP server's fault? DHCP is designed to reassign unused leases to new clients if the subnet is all leased out.

How can a lease be "unused" if it hasn't expired and the client that requested it never released it? Are you saying that the DHCP server pings (ICMP or ARP) each address and re-leases the ones that don't get a response?

Are you saying that the DHCP server pings (ICMP or ARP) each address and re-leases the ones that don't get a response?

The DHCP will ping an address before leasing it, and if it gets a response then it will not lease that address.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#52
post #15

> This network recognition technique allows the Mac to very rapidly discover if it is connected to a known network. If the network is recognized (and presumably if the Mac knows that the DHCP lease is still active), it immediately and presumptuously configures its IP interface with the address it knows is good for this network. Ok, seriously? That isn't a bug in an implementation somewhere, but in fact a feature that…

Am I the only one who finds that if you get a room full of people sitting around with Macs at least one person gets their IP address stolen by someone else?

In 4 or 5 years of using OS X laptops in multiple locations (eg: private office, large corporate office with shared wifi, more hotels and airports and coffee shops than I can remember) I can't ever recall having this happen to me.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#53
post #32

Earlier quoted context omitted.

Not security. You usually rely upon security for network layers 1-4 as being actual security. Adding additional controls can be useful in slowing down would-be attackers, or "casual" intruders, but they are not "real" security measures.

The lower level networking protocols do rely on some levels of peer trust, but carefully controlling that trust has come a long way in the last decade. If I'm correct in assuming by "actual security" you mean "physical security" you're making some pretty broad and faulty statements (even about layer 1). There are many networking devices and techniques for hardening hostile networks at layer 2. Layer 3 is IP; to say l…

Sorry, I double-posted accidentally and it looks like I deleted the wrong one. I meant that layers 1-4 should not be relied upon to provide your application security. You are right that there are cool advances that can be worthwhile to slow down attackers, but I think that in most circumstances, you will want to make your guarantees higher up the stack*

*I am not a security expert

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#54
post #19

Earlier quoted context omitted.

Huh, interesting. I have my Mac set up to require a password coming out of sleep. 90% of the time, by the time I've typed my password and hit enter, not only am I reconnected to my wifi network, but even Adium has had time to reconnect me to GTalk and finish fetching online contacts. It's amazing. When I'm in Linux I can't do anything with the network for a good 15 seconds after unlocking my screen.

I don't usually have a password requirement, so I have that much longer to notice it. But even when I did have a setup like yours, it doesn't take me that long to type brandy6 and hit enter. I'd still ending noticing a wait.

Huh, I wonder if there are just differences in the wifi chipsets and/or between the router(s) you and I have used that make the wait longer or shorter. Weird.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#55

Earlier quoted context omitted.

How is this the DHCP server's fault? DHCP is designed to reassign unused leases to new clients if the subnet is all leased out.

How can a lease be "unused" if it hasn't expired and the client that requested it never released it? Are you saying that the DHCP server pings (ICMP or ARP) each address and re-leases the ones that don't get a response?

Well actually the result of "running out" of addresses is undefined and up to the individual hardware manufacturer, so theoretically they could do whatever they want. A high-traffic WAP might want to simply boot the oldest lease if they can't assign more than a certain number of addresses.

Keep in mind if aa client wants an IP, it is supposed to do DHCP discovery every time it connects to the network, even if it's lease isn't up. See http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Prot...

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#56
So, as far as I understand, the issue pointed out here is that the Mac is sending ARP requests with a cached source IP address (which therefore could be already in use).

I wonder why it does that, as you can also send ARP probes originating from a source IP address 0.0.0.0 (and only having the MAC address set). I just tried it on linux:

arping -D -c 1 -I wlan0 172.22.36.1

The computer with 172.22.36.1 will happily send me back its MAC address.

So, is Apple doing something else here? Maybe relying on the router to not poison its cache and not reply at all if the IP is already taken.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#57
post #20
post #18

Earlier quoted context omitted.

Why would that be the case? Assuming it only does this if it knows its previous DHCP lease hasn't run out, it's very likely (unless the DHCP server has been rebooted or has otherwise lost its lease table) that no other device is using that IP. And even if it screws this up, it looks like it does a proper DHCP request about a second after the interface comes up, so the problem will be fixed quickly. Do you have any ev…

By the time the problem is "fixed" the other computer on the network has already detected that its IP address is in conflict by ARP, telling the user what happened (interrupting them) and has shifted to a new IP address (losing all of its active connections in the process). (and yes: some routers hold on to only a certain number of inactive leases, and routers actually do get rebooted in home, office, and hotel envir…

I ask again: do you have any evidence that this is a problem in practice? I feel like this is something we would have heard about before, via some outraged blog post followed by Apple discussion board postings that get deleted by Apple.

How often do computers send out ARP requests to check on the uniqueness of their IP address? If it's less often than once per second or so (and I really hope it is), I could see how you could get away with having two devices with the same IP for a second here or there with no one the wiser.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#58
post #15

> This network recognition technique allows the Mac to very rapidly discover if it is connected to a known network. If the network is recognized (and presumably if the Mac knows that the DHCP lease is still active), it immediately and presumptuously configures its IP interface with the address it knows is good for this network. Ok, seriously? That isn't a bug in an implementation somewhere, but in fact a feature that…

The DHCP stack in iOS does some profiling that should reliably detect whether it is, in fact, on the network that it expects. The most significant of which is the verification of the DHCP server's Ethernet address as correlated to IP.

If you are on a known network, your DHCP lease is still active, and network equipment is working as expected, all of these assumptions are safe. The most common failure scenario is where the DHCP server has lost its DHCP lease table. For many consumer routers, this will occur when the router is rebooted. If you have to reboot your router frequently, you should replace it. Even if you do encounter a failure mode, the error will clear a second or two later when a new address is negotiated via DHCP and the subsequent ARP update.

This is very clearly a trade-off. Devices like the iPhone and iPad are switched on and off very frequently. The difference between 10s to network ready and 0.3s to network ready is more than significant; it's monumental. This is especially true for devices whose use-pattern will involve frequent on-off usage.

If you're uncomfortable with this trade off, you should stay away from Apple devices. Personally, I'll take the 10s.

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#59

The mac implementation is good for 99% of the times, since it is really fast, but the 1% of the times that it steals an ip adress it is really a pain in the ass. I don't mind to wait a few seconds to get a connection in the stardard way.

...but the 1% of the times that it steals an ip adress...

Could someone explain how we're imagining this might happen? If my Dell Precision laptop is using the contended IP Address, then why didn't its interface's mac address get returned by the ARP who-has request for that IP?

Re: Rapid DHCP: Or, how do Macs get on the network so fast?

#60
post #2

I've sat in many a meeting where the Macs "steal" all of the DHCP connections and I'm stuck watching the speaker instead of following TweetDeck.

I'd like to understand this better. I don't understand what you mean by "steal DHCP connections." Do you mean they use up all of the available DHCP leases? Have you verified this assertion?

I've never observed the behavior you're talking about, and frankly, I suspect that you're just attributing some network failure to a Mac user that just happens to be present.

Post reply on HN