Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to obtain an IP-address immediately

Reply
Thread Tools Display Modes

How to obtain an IP-address immediately

 
 
Johann Höchtl
Guest
Posts: n/a

 
      07-13-2007, 07:15 PM
Hello everybody,

first I am sorry, that this is going to be one of those "In Windows it
works, but not on Linux"

I use Kubuntu with kernel 2.6.15-28-386 on a Laptop. Sometimes I am
connected wired, sometimes wireless.

On Windows the OS detects whenever i attach a wired connection an will
obtain an IP-Adress _immediately_. Good.

In Ubuntu it takes some time ... sometimes it's fasters, sometimes
slower. Seems to be some dhcp-renew mechanism. Whatever.

In fact it should _detect_ when a cable get's attached. Is this known
behaviour, some poor hardware integration in whatever shell script or
should i upgrade my Kubunu and it will automagically work?


Regards,


Johann
 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      07-18-2007, 02:42 PM
On Jul 13, 3:15 pm, Johann Höchtl <jane...@none.none> wrote:
> Hello everybody,
>
> first I am sorry, that this is going to be one of those "In Windows it
> works, but not on Linux"
>
> I use Kubuntu with kernel 2.6.15-28-386 on a Laptop. Sometimes I am
> connected wired, sometimes wireless.
>
> On Windows the OS detects whenever i attach a wired connection an will
> obtain an IP-Adress _immediately_. Good.
>
> In Ubuntu it takes some time ... sometimes it's fasters, sometimes
> slower. Seems to be some dhcp-renew mechanism. Whatever.
>
> In fact it should _detect_ when a cable get's attached. Is this known
> behaviour, some poor hardware integration in whatever shell script or
> should i upgrade my Kubunu and it will automagically work?


In this case, I believe that it is Windows that is broken, and not
Linux.

In my experience, Windows violates the DHCP protocol requirements by
using the last assigned IP address on restart, rather than querying
for a DHCP renewal of the address. In this way, Windows can access the
network faster because it doesn't have to wait for the completion of
DHCP address negotiations.

The problem is that (IIRC) this procedure is a violation (or at least
a violent bending) of the DHCP protocol. Basically, once the client
disconnects, or when the lease expires, the DHCP server can reassign
the IP address as it sees fit, and it is only when the DHCP Renew
request is sent that the (previously disconnected and reconnected)
client will find out that the address is no longer available.

Windows DHCP client presumes that it will always be connected to the
same network, and that the DHCP server won't normally reassign the IP
address. Linux DHCP client(s), on the other hand, follow the DHCP
protocol, and immediately request a Renewal on startup. Of course,
this takes a bit of time to complete, so Linux DHCP looks slower than
Windows DHCP.

Of course, you can break Linux DHCP so that it works the same way as
Windows DHCP does. All you need to do is change the code and recompile
(or get someone else to do that for you).

HTH
--
Lew





 
Reply With Quote
 
Johann Höchtl
Guest
Posts: n/a

 
      07-18-2007, 06:43 PM
Lew Pitcher wrote:
> On Jul 13, 3:15 pm, Johann Höchtl <jane...@none.none> wrote:
>> Hello everybody,
>>

>
> In my experience, Windows violates the DHCP protocol requirements by
> using the last assigned IP address on restart, rather than querying
> for a DHCP renewal of the address. In this way, Windows can access the
> network faster because it doesn't have to wait for the completion of
> DHCP address negotiations.
>
>
> Windows DHCP client presumes that it will always be connected to the
> same network, and that the DHCP server won't normally reassign the IP
> address. Linux DHCP client(s), on the other hand, follow the DHCP
> protocol, and immediately request a Renewal on startup. Of course,
> this takes a bit of time to complete, so Linux DHCP looks slower than
> Windows DHCP.
>

Thank you very much for your in depth explainations. However I
experience this behaviour while the laptop is running.

I am on Wlan, no wired connection.
I disable wlan, i attach a wired cable.

Then i have to wait three minutes or so until i get a new IP Adress.
It's the same the other way round: I disconnect wired, enable wlan:
takes some time until i get an ip adress.

There is no network mananger running, plain vanilla kubuntu. I find this
anoying and wonder if other experience the same behaviour.
>
> HTH
> --
> Lew
>

 
Reply With Quote
 
John Thompson
Guest
Posts: n/a

 
      07-19-2007, 02:08 PM
On 2007-07-18, Lew Pitcher <(E-Mail Removed)> wrote:

> In my experience, Windows violates the DHCP protocol requirements by
> using the last assigned IP address on restart, rather than querying
> for a DHCP renewal of the address. In this way, Windows can access the
> network faster because it doesn't have to wait for the completion of
> DHCP address negotiations.
>
> The problem is that (IIRC) this procedure is a violation (or at least
> a violent bending) of the DHCP protocol. Basically, once the client
> disconnects, or when the lease expires, the DHCP server can reassign
> the IP address as it sees fit, and it is only when the DHCP Renew
> request is sent that the (previously disconnected and reconnected)
> client will find out that the address is no longer available.
>
> Windows DHCP client presumes that it will always be connected to the
> same network, and that the DHCP server won't normally reassign the IP
> address. Linux DHCP client(s), on the other hand, follow the DHCP
> protocol, and immediately request a Renewal on startup. Of course,
> this takes a bit of time to complete, so Linux DHCP looks slower than
> Windows DHCP.


You can (at least in *nix) configure your dhcp server to always assign
the same IP address to a given MAC address. This should speed up the
dhcp negotiation a little anyway.

--

John ((E-Mail Removed))
 
Reply With Quote
 
John Thompson
Guest
Posts: n/a

 
      07-19-2007, 02:10 PM
On 2007-07-18, Johann Höchtl <(E-Mail Removed)> wrote:

> I am on Wlan, no wired connection.
> I disable wlan, i attach a wired cable.
>
> Then i have to wait three minutes or so until i get a new IP Adress.
> It's the same the other way round: I disconnect wired, enable wlan:
> takes some time until i get an ip adress.
>
> There is no network mananger running, plain vanilla kubuntu. I find this
> anoying and wonder if other experience the same behaviour.


What are you running as a dhcp server?

--

John ((E-Mail Removed))
 
Reply With Quote
 
Johann Höchtl
Guest
Posts: n/a

 
      07-19-2007, 05:21 PM
John Thompson wrote:
> On 2007-07-18, Johann Höchtl <(E-Mail Removed)> wrote:
>
>> I am on Wlan, no wired connection.
>> I disable wlan, i attach a wired cable.
>>
>> Then i have to wait three minutes or so until i get a new IP Adress.
>> It's the same the other way round: I disconnect wired, enable wlan:
>> takes some time until i get an ip adress.
>>
>> There is no network mananger running, plain vanilla kubuntu. I find this
>> anoying and wonder if other experience the same behaviour.

>
> What are you running as a dhcp server?
>


Belkin N1 wireless router --- so it's a hardware device. I do not think
it's the dhcp's problem.

When i do manually ifdown eth0 .... ifup eth0 i get immediatelly an
IP-Adress. Only when i connect a cable and do nothing it takes a while.
 
Reply With Quote
 
Stefan Monnier
Guest
Posts: n/a

 
      07-19-2007, 06:01 PM
> Belkin N1 wireless router --- so it's a hardware device.

Well, it's a computer like any other (tho smaller and slower than your main
one, www.openwrt.org says that it's an ixp425 @ 400MHz (i.e. Intel XScale
processor, using the ARM instruction set) with 32MB of RAM). It appears to
run a Linux-2.6.10 kernel, IIUC.

> When i do manually ifdown eth0 .... ifup eth0 i get immediatelly an
> IP-Adress. Only when i connect a cable and do nothing it takes a while.


What service do you use to automatically react to cable connect/disconnect?
I use ifplugd (on Debian) and don't see any such problem.


Stefan
 
Reply With Quote
 
Johann Höchtl
Guest
Posts: n/a

 
      07-22-2007, 02:43 PM
Stefan Monnier wrote:
>
>> When i do manually ifdown eth0 .... ifup eth0 i get immediatelly an
>> IP-Adress. Only when i connect a cable and do nothing it takes a while.

>
> What service do you use to automatically react to cable connect/disconnect?
> I use ifplugd (on Debian) and don't see any such problem.
>
>
> Stefan


Ah ok, so i have to install something additionally in order to get an IP
immediately on a connect event. If this is the case, then it is due to
my misconception to believe that this is sthg. so ordinary that it
should work out of the box.

apt-cache search ifplugd is positive on kubuntu so i guess this will
solve my "problem". Thank you.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I know the IP address was moved to another host immediately ? John Shi Linux Networking 1 02-20-2009 02:05 PM
Cannot obtain IP address even after being authenticated & connecte Shailesh Wireless Networks 1 07-10-2008 09:55 PM
Cannot Obtain An IP Address Dean S. Lautermilch Wireless Internet 5 12-17-2005 04:39 PM
MN-510 adapter won't obtain IP address Alan Maier Broadband Hardware 1 01-06-2005 10:53 PM
Cannot obtain IP-address with one of my cards patrick Wireless Internet 1 11-04-2003 05:40 PM



1 2 3 4 5 6 7 8 9 10 11