How to obtain an IP-address immediately - Networking

This is a discussion on How to obtain an IP-address immediately - Networking ; 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 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to obtain an IP-address immediately

  1. How to obtain an IP-address immediately

    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

  2. Re: How to obtain an IP-address immediately

    On Jul 13, 3:15 pm, Johann Höchtl 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






  3. Re: How to obtain an IP-address immediately

    Lew Pitcher wrote:
    > On Jul 13, 3:15 pm, Johann Höchtl 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
    >


  4. Re: How to obtain an IP-address immediately

    On 2007-07-18, Lew Pitcher 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 (john@os2.dhs.org)

  5. Re: How to obtain an IP-address immediately

    On 2007-07-18, Johann Höchtl 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 (john@os2.dhs.org)

  6. Re: How to obtain an IP-address immediately

    John Thompson wrote:
    > On 2007-07-18, Johann Höchtl 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.

  7. Re: How to obtain an IP-address immediately

    > 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

  8. Re: How to obtain an IP-address immediately

    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 to Thread