[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] DHCP end of lease time
From: |
Frédéric Grandjean |
Subject: |
Re: [lwip-users] DHCP end of lease time |
Date: |
Thu, 21 Apr 2016 05:19:54 +0000 |
Hi,
I have been using an old Linksys WRT54G with DD-WRT as a router with DHCP
server and a very short DHCP lease time (a few minutes!), for testing of course.
Between 2 DHCP leases, I change the base address of the DHCP server.
In these conditions, the client IP is changing. Might not be like this in real
world, but I need to have an extremely reliable application!
I have implemented a small discovery protocol, by the way. It works in UDP, is
bind to any IP address and "simply" answer with an identification string.
As I said, this seems to "resist" to a change of IP by DHCP end of lease time.
For the open connections (TCP) , sure they will be broken. But this is fine, as
long as the server (the TCP PCB listener) answers to the new request at the new
address.
Finally, I cannot change the application to work with fixed IP address; our
device might installed at any place, by any kind of user, without any IT
knowledge; it has to be plug and play!
Thank you
Frédéric
-----Original Message-----
From: lwip-users [mailto:address@hidden On Behalf Of Sergio R. Caprile
Sent: mercredi 20 avril 2016 18:25
To: address@hidden
Subject: Re: [lwip-users] DHCP end of lease time
AFAIK, you will renew your lease, not get a new address.
Your address can't be taken as you are using it.
The server will assign a new address if you'be been out and your lease expired
and the address was reused and assigned to someone else while you were out.
Let's assume you do have a new address.
All other machines will need to know that, since you said you have servers. How
did they find you in the first place ? (*) You can configure a DNS to talk to
the DHCP server and resolve that, but you can also configure the DHCP server to
assign a fixed address to your machine, and so always the same address.
If you don't:
name resolution results in local caches will cause those machines to
fail on trying to reach you until those caches expire.
you must have a DNS server because you don't have an invariable address.
(*) However, you can write a discovery protocol and provide
your clients a tool to find you...
Besides that, UDP will probably happily survive; however, if you fill your
bindings with the other end address, you'll need to unbind and rebind as when
your application session is done.
Open TCP connections will surely fail, so you will need to shut them off.
I don't think there is something that requires you to restart your servers, as
long as you are not storing your former IP somewhere; the problem, if I'm not
missing something, is with open connections.
Do yourself a favor and just request the admin to add this:
host MyHostName {
hardware ethernet <my MAC>;
fixed-address <my IP>;
}
Where <my IP> must be out of the dynamic pool (well, assuming they run Linux
and dhcpd...)
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users