Re: how to adjust the number of DHCP require packets



On 09/14/2011 07:41 PM, Dan Williams wrote:
On Wed, 2011-09-14 at 10:46 +0800, cute walker wrote:
Hello.
I have a problem and need your help .
On my laptop it runs Ubuntu 10.04 , gnome 2.30.2 and NM 0.8 . I have
enjoying them for more than one year. But nowadays I have a problem.
My laptop can not access the campus' wifi network for most time I try.
After communication with the network administrator, we find the
problem happens in the process of IP obtainment via DHCP. By capturing
packets using wireshark, we find that the DHCP server is slow and my
laptop  need 4 or more DHCP require packets before it can get a DHCP
offer packet. But, after 3 DHCP require packets, my laptop will stop
trying and deassociates the link on layer 2( IEEE802.11) .

Of course, the network administrator has his work to speed up the DHCP
server. But before he does, I still can not access the network.

Now my idea is to adjust the number of DHCP require packets while
tring to access, namely, setting it bigger enough to get the DHCP
offer packet. ( In fact , we find the Windows keep sending DHCP
require packets  for many times, so Windows do not suffer this problem
). But I don't know how to do that.

So, can anyone of you give me a simple way to adjust the parameter?
The actual number of packets sent is determined by dhclient itself; it
uses a randomized backoff algorithm to ensure it doesn't flood the DHCP
server with requests.  The entire process is bounded by a 45-second
timer, because if your DHCP server really doesn't respond within 45
seconds, there's something really really wrong with the network or the
DHCP server, and that should be fixed.  Bumping this timeout to 60
seconds or so has been discussed before and maybe we'll do that.  But in
any case, there is one dhclient variable that you could change, and
that's the 'initial-interval'.  Setting this to 1 makes dhclient
immediately emit the second request, instead of waiting a random period
of time.  The theory is that if you have 100 machines that all turn on
at the same time (computer lab) and all 100 machines immediately emit
DHCP requests, that's effectively a DDoS against the DHCP server.  You
can modify this behavior by adding the line:

initial-interval 1;

I'm not sure this will help.
As I understand it the server just answers after more than 45 seconds (whew, that's really slow as I can tell)
so sending more requests don't speed that up. But you could try.
You can also try to set the 'timeout' variable by adding the line:

timeout 150;

From dhclient.conf man page:
"The timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the time that it decides that it's not going to be able to contact a server.
 By default, this timeout is sixty seconds."

to /etc/dhcp/dhclient.conf.

I've been thinking that NM doesn't use /etc/dhcp/dhclient.conf and creates its own /var/run/nm-dhclient-iface.conf which gets overwritten each time NM runs dhclient
so there's no way how to pass some options to NM started dhclient.
I'll be glad if you could educate me in this.

Thanks,
Jiri Popelka


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]